1

Azure Diagnostics Extension uses DeploymentId to store performance counter and other data in the storage tables. However, when a VM is deployed thru Azure Resource Manager, finding out what this DeploymentId is, is not apparent.

How does one find this DeploymentId? What API do I query? I need to do this programmatically and I do not have access to the VM itself, can only to call the API.

Igorek
  • 15,716
  • 3
  • 54
  • 92
  • look in to `resourceId` function https://azure.microsoft.com/en-gb/documentation/articles/resource-group-template-functions/ – Milen Nov 17 '15 at 09:28
  • Unfortunately, resourceId is a different entity all together. DeploymentId is a Guid. In "Classic" API world, it would get assigned to a deployment and exposed thru the API. Everything would be "hanging off" a deployment. In ARM world, I can't find it anywhere – Igorek Nov 17 '15 at 16:11
  • 1
    Yes that's correct but you can use this with `reference` function to get to the property you need. Here's an example that I used and tested: `"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('Microsoft.Insights/components', concat(parameters('baseUriName'), '-MyAppName'))).InstrumentationKey]"` to get `.InstrumentationKey` property of AppInsights added within my ARM template – Milen Nov 18 '15 at 08:34
  • I see. And do you know how to do this thru an outside application using the Resource Manager API after deployment? – Igorek Nov 18 '15 at 14:30
  • Go to resources.azure.com and select the item you're interested in (web site for example), then select the category (lets say config/connectionstring) you'll see url to make get requests to the api (You have to add auth headers) in order to receive the data required – Milen Nov 18 '15 at 14:38
  • Rest API https://msdn.microsoft.com/en-GB/library/azure/dn790568.aspx – Milen Nov 18 '15 at 16:28
  • I combed thru that API everywhere. Found the InstrumentaitonKey in AppInsights. Unfortunately, DeploymentId is not to be found. InstrumentationKey is not DeploymentId – Igorek Nov 20 '15 at 06:30
  • Hi, do you have any specific requirement for the programmatic way to call the API? E.g. Azure PowerShell command, C# Azure management library – juvchan Nov 25 '15 at 00:16
  • My requirement is to read data from diagnostic storage, and WADPerformanceCountersTable and I need deployment id for that – Igorek Nov 25 '15 at 00:35

1 Answers1

0

There is no possibility to get the deploymentId of ARM VM via REST api:

https://social.technet.microsoft.com/Forums/exchange/en-US/a228bb05-3a3f-488c-bd29-c2ea17ffc728/rest-api-to-get-vm-deployment-id-and-instance-id

UNdedss
  • 168
  • 1
  • 8