-
Notifications
You must be signed in to change notification settings - Fork 207
Closed
Labels
Description
Bug description
I am an Azure costumer. I can't use MSAL to generate an access token for the scope of my app reg using my managed identity.
I have this setup:
- I deployed an Azure function app that is validating access token of an Application registration. It checks that the Client has the correct role.
- I have a compute instance that is assigned a Managed identity. I want to send a HTTP request to my azure function with an access token generated for my Managed Identity.
It might be related to #58
To Reproduce
- Create an app reg with a custom role
- Create a managed identity
- Assign the custom role to the managed identity
- Create a compute instance and assigned it the managed identity
- In the compute instance run:
from azure.identity import ManagedIdentityCredential
cred = ManagedIdentityCredential(client_id="<managed-identity-client-id>")
token = cred.get_token("api://<app-reg-client-id>/.default")
The code will run indefinitely
Expected behavior
After running token = cred.get_token("api://<app-reg-client-id>/.default")
the token should be generated
What you see instead
Code is still running and no token is generated.
The MSAL Python version you are using
1.21.0