Hero Banner

Microsoft AppSource and Azure Marketplace

Learn how to grow your business by publishing your cloud solution on Microsoft AppSource and Azure Marketplace

Reply
Level 2 Contributor

Azure partner resource tagging via User-Agent header

Onboarding to Azure Marketplace requires implementation of resource tagging with a partner product GUID. There's a detailed article that describes the implementation options in details https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution

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.

The GUID is registered in the partner portal.

What do I miss? 

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.

1 ACCEPTED SOLUTION
Level 2 Contributor

Thanks to this answer https://stackoverflow.com/a/60460004/755362 we know the root cause.

Passing a partner guid via User-Agent header doesn't leave any traces in ARM tempaltes, thereby it's not possible to validate if tagging works querying resources by name (Get-AzResourceGroupDeployment).

We got a confirmation from MSFT that our partner guid is being tracked via User-Agent header, and the result is only visible in the partner portal (not in Azure portal).

View solution in original post

2 REPLIES 2
Level 2 Contributor

Thanks to this answer https://stackoverflow.com/a/60460004/755362 we know the root cause.

Passing a partner guid via User-Agent header doesn't leave any traces in ARM tempaltes, thereby it's not possible to validate if tagging works querying resources by name (Get-AzResourceGroupDeployment).

We got a confirmation from MSFT that our partner guid is being tracked via User-Agent header, and the result is only visible in the partner portal (not in Azure portal).

View solution in original post

Microsoft

@cameronpercycan you help with this?