I'm trying to implement partner tagging of Azure resources by adding a partner product GUID to the User-Agent header when creating resources via the Resource Manager API, but it doesn't have any visible effect. I checked the ARM template of a "tagged" resource, but the GUID is not there. Verification method described in the article also gives negative results.
Does it work for anyone?
Here's the Powershell code based on the above guide that reproduces the issue:
Install-Module -Name Az -AllowClobber -Scope CurrentUser # installs Azure Powerhsell module
$partnerID = "pid-3fd1a53d-3ef0-4111-8a66-211ed6470935" # Product GUID
$VMLocalAdminUser = "partneridtest" # test VM username
$VMLocalAdminSecurePassword = ConvertTo-SecureString "Pa$$word123" -AsPlainText -Force # test VM password
$resourceGroupName=[guid]::NewGuid().ToString() # randomly generated resource group name
Import-Module -Name Az # import Azure Powerhsell module
[Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent($partnerID) # add user-agent for partner tracking
Connect-AzAccount # login to Azure
New-AzResourceGroup -Name $resourceGroupName -Location eastus # create a resource group
Write-Host Resource group name $resourceGroupName
$vmParams = @{
ResourceGroupName = $resourceGroupName
Name = 'PartnerIdTest1'
Location = 'eastus'
ImageName = 'Win2016Datacenter'
PublicIpAddressName = 'partnerIdTestPublicIp'
Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword)
OpenPorts = 3389
}
$newVM1 = New-AzVM @vmParams # create a test VM (should be tagged with the partner product guid)
Get-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -Name $partnerID # fails with Get-AzResourceGroupDeployment : Deployment 'pid-3fd1a53d-3ef0-4111-8a66-211ed6470935' could not be found.
Note: the GUID above is random - not a real one. It should be replaced with a registered partner GUID.