-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
Managed Identitycustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.Workflow: More information is needed from author to address the issue.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamno-recent-activityThere has been no recent activity on this issue.There has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
- Package Name: azure-identity
- Package Version: 1.12.0
- Operating System: Ubuntu/ AzML
- Python Version: 3.8
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.
I also asked the MSAL
team, they only have a draft PR.
For a production environment, I would need an upstream solution.
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.
Metadata
Metadata
Assignees
Labels
Managed Identitycustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.Workflow: More information is needed from author to address the issue.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamno-recent-activityThere has been no recent activity on this issue.There has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that