I am using Azure Managed Identity feature for my python Azure Functions App and would like to be able to fetch currently assigned Client ID from within the Function App itself. Search through documentation and azure-identity python sources did not give result I would expect. Maybe I could: Query Azure Instance Metadata Service myself to get this ID. (not really happy with this option) Provision it as env variable during ARM deployment stage/ or by hands later on. (seems good and efficient, but not sure what is the best practice here) UPDATE Managed o get it working with ARM template and env variable Deploys FunctionApp with System Identity Provisions System Identity as env variable of this same FunctionApp Idea is to use Microsoft.Resources/deployments subtemplate to update Function App configuration with: { "name": "AZURE_CLIENT_ID", "value": "[reference(resourceId('Microsoft.Web/sites', variables('appName')), '2019-08-01', 'full').identity.principalId]" }, Continue reading...