Azure Functions GET /metadata/instance Cancelled Calls

220 views Asked by At

We are running a number of Azure Functions on a Linux Consumption Plan instance using v4 functions written in C#. Code is deployed using GitHub Actions and all use Microsoft.Azure.Functions.Worker.Sdk Version 1.14.1.

One of the functions uses a CosmosDB Change Trigger to activate, and another is using a Timer Trigger set to execute very five minutes.

Our Application Insights for the functions is showing GET: {ipAddress}/metadata/instance calls every five minutes, each with an average duration of 1.1 minutes, and always resulting in a Cancelled state.

Where and why are these calls being made, and what can be done to avoid this? It seems like this would be adding unnecessary overhead load to the service?

1

There are 1 answers

3
Matias Quaranta On BEST ANSWER

This call is made by the Azure Cosmos DB SDK to capture Azure VM metadata information. Reference: https://learn.microsoft.com/azure/virtual-machines/instance-metadata-service?tabs=windows

This call is made during client initialization and the failure is not critical for the Cosmos DB client. The purpose is, for cases where you have issues and telemetry is emitted, it adds information such as, where is the location of the Azure VM and helps to identify cases where you have multiple client instances.

The important part here is, this should happen only during client initialization. The CosmosDBTrigger creates the client once and reuses it, if you are seeing it every 5 minutes, this means that either: