0

I have an application registered both in Application Insights and Azure Active Directory. So, I can send requests to the application

https://management.azure.com/subscriptions/<subId>/resourceGroups/<resGroupId>/providers/Microsoft.Insights/components/myApp/providers/microsoft.insights/metrics?api-version=2018-01-01&metricnames=traces/count&interval=PT1H

to retrieve some Application Insights metrics. But I also need to know the identifier (IP or hostname) of the machine where my application is deployed. Application Insights Analytics queries provide such functionality (there is cloud_RoleInstance column in schema corresponding to the hostname of application's machine).

But I have to use classic Azure REST API (with access_token and without Application Insights Access Key). Can I do that? Or if I cannot could you please provide some proof links that Microsoft prohibits such requests?

Thank you in advance.

grey_wind
  • 11
  • 2

1 Answers1

0

Yes you can do that. You can call all REST APIs using Azure API format as well.

Refer to the below link for more information:

https://dev.applicationinsights.io/documentation/Overview/URL-formats

You can use the below API to get the cloud_RoleInstance:

https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/microsoft.insights/components/{component_name}/query?api-version=2018-04-20&query=requests | project cloud_RoleInstance

You can also use the API explorer to get the same information:

https://dev.applicationinsights.io/apiexplorer/query?appId=DEMO_APP&apiKey=DEMO_KEY&query=requests%20%7C%20project%20cloud_RoleInstance

Here is another way to find out the IP address of your Azure Web App:

How can I determine the IP address of an Azure hosted WebApp

AmanGarg-MSFT
  • 1,123
  • 6
  • 10