I had deployed my application in the Azure Linux environment.
I followed the official python example: https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=python
import os
import requests
identity_endpoint = os.environ["IDENTITY_ENDPOINT"]
identity_header = os.environ["IDENTITY_HEADER"]
def get_bearer_token(resource_uri):
token_auth_uri = f"{identity_endpoint}?resource={resource_uri}&api-version=2019-08-01"
head_msi = {'X-IDENTITY-HEADER':identity_header}
resp = requests.get(token_auth_uri, headers=head_msi)
access_token = resp.json()['access_token']
return access_token
Why I am getting KeyError: 'IDENTITY_ENDPOINT' error? Any configuration I need to do extra?


