Hero Banner

Microsoft Partner Network

Where Microsoft's CSP, MSP, SI, and ISV partners seek new opportunities and learn from each other

Reply
Highlighted
Level 3 Contributor

customer usage attribution with CLI or PowerShell

The docs here mention the following lines of code for PowerShell and CLI:

 

[Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent("pid-eb7927c8-dd66-43e1-b0cf-c346a422063")

export AZURE_HTTP_USER_AGENT='pid-eb7927c8-dd66-43e1-b0cf-c346a422063'

 

and I assume if you're running CLI from PowerShell (not a Bash window) then this might help:

$env:AZURE_HTTP_USER_AGENT='pid-eb7927c8-dd66-43e1-b0cf-c346a422063'

 

Once I've set that how do I validate it worked? Let's say I run New-AzStorageAccount in PowerShell or "az storage account create" in CLI. I don't see that it creates any "deployments" so the Get-AzResourceGroupDeployment for that resource group returns nothing. Is there somewhere else it is marked? Or does this literally only work for actual ARM templates and not CLI or PowerShell creation of resources (without an ARM template)?

 

@brian_levenson 

3 REPLIES 3
Microsoft

Re: customer usage attribution with CLI or PowerShell

Hey Greg - my understanding is that it is specifically ARM templates and not CLI or PowerShell. I'll contact a few colleagues to confirm or correct this.

Microsoft

Re: customer usage attribution with CLI or PowerShell

Correction: CLI and PowerShell are supported.

 

Probably need a support case for the error you're encountering.

Level 3 Contributor

Re: customer usage attribution with CLI or PowerShell

An Azure support case or a Partner support case?

No error. I just don’t know how to validate it tagged us since there are no rows returned from Get-AzResourceGroupDeploy unless we use ARM templates.

Thanks so much for the follow up!