-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override User-Agent for Azure partner customer attribution #2157
Comments
I thought this was already implemented in #483. Sorry if this is some other issue. If I do this:
Then I can see the following in the debug logs:
|
Thanks @joakimhellum-in ! I hadn't seen that. It's actually appending AZURE_HTTP_USER_AGENT rather than overriding it, which may or may not work for customer attribution but I'll try it at some point and make a PR if it doesn't. |
Would it be possible to re-open this to add user_agent as a new argument in the AzureRM provider block? This would work well where you have multiple AzureRM provider blocks and aliases, given that the generated GUID should represent the combination of an offer and distribution channel. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Description
When a Microsoft partner deploys resources into a customer's subscription, Microsoft likes to know which partner is responsible for the deployments. (Among other reasons, this helps with tracking when partners are driving increased Azure adoption.)
The way to do this seems to be to set a
User-Agent
likepid-7d85a862-78c1-4ea3-bfda-67fada6e3bb9
when making request to the ARM API:https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution#tag-a-deployment-with-the-resource-manager-apis
For example, the
az
cli allows the user to set an environment variable likeexport AZURE_HTTP_USER_AGENT='pid-eb7927c8-dd66-43e1-b0cf-c346a422063'
which is then used for all HTTP calls.New or Affected Resource(s)
N/A
Potential Terraform Configuration
For consistency with the
az
cli, one option would be to read an environment variableAZURE_HTTP_USER_AGENT
.It might be cleaner to define a
user_agent
parameter in theazurerm
provider instead.If not specified, the current
User-Agent
behaviour would be used.The text was updated successfully, but these errors were encountered: