My current Setup:
My DevOps guy has created a User Managed Identity and have added it to the Access policy of Azure key Vault.
I have Created a function app testing-01
and assigned the User-ManagedIdentity to it under platform settings.
I am using Python 3.6 as runtime language.
This is my helper method that i use to check if i am able to access the secrets from key vault. and i am returning its response.
def cred_checker():
credential = ManagedIdentityCredential()
# credential = ManagedIdentityCredential(client_id='client_id
vault_name= "myvault"
client = SecretClient(vault_url=f"https://{vault_name}.vault.azure.net/", credential=credential)
username = client.get_secret(name="username")
password= client.get_secret(name="password")
return f"AKV client created successfully {client} .<br> name: {username},<br> pass: {password} "
I am able to create the client with no error. But when i try to fetch secret from it, I am getting this ClientAuthenticationError :
Exception while executing function: Functions.HttpTriggerFunc <--- Result: Failure Exception: ClientAuthenticationError: Unexpected response '{'statusCode': 400, 'message': 'Unable to load requested managed identity.', 'correlationId': '92daf146-fed2-4a75-8359-9r955939815e'}'