Detect system-assigned managed identities in AzureCredentialHelper#15885
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15885Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15885" |
There was a problem hiding this comment.
Pull request overview
Restores managed-identity support in AzureCredentialHelper for Azure App Service deployments by detecting system-assigned managed identity signals and selecting a managed-identity credential path instead of falling back to development credentials.
Changes:
- Detects
IDENTITY_ENDPOINT(in addition toAZURE_CLIENT_ID) to decide when to useManagedIdentityCredential. - Adds an inline comment clarifying why
IDENTITY_ENDPOINTis checked.
60f26ad to
05cce1c
Compare
|
Copilot pointed out that the code doesn't seem to be working for user-assigned managed identities either so I made the suggested adjustments (with some minor tweaks) to account for this too. |
…Helper When system-assigned managed identities are enabled the IDENTITY_ENDPOINT and IDENTITY_HEADER environment variables are defined. It should be enough to detect the endpoint variable for this purpose. AZURE_CLIENT_ID is still used by user-managed identities. Reference: https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Chttp#rest-endpoint-reference
05cce1c to
7918d6b
Compare
eerhardt
left a comment
There was a problem hiding this comment.
LGTM
@christothes - let me know if you think we shouldn't do this.
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
…Helper (#15885) When system-assigned managed identities are enabled the IDENTITY_ENDPOINT and IDENTITY_HEADER environment variables are defined. It should be enough to detect the endpoint variable for this purpose. AZURE_CLIENT_ID is still used by user-managed identities. Reference: https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Chttp#rest-endpoint-reference
Description
This should restore support for system-assigned managed identities.
When system-assigned managed identities are enabled the
IDENTITY_ENDPOINTandIDENTITY_HEADERenvironment variables are defined. It should be enough to detect the endpoint variable for this purpose.AZURE_CLIENT_IDis still used by user-managed identities.Reference:
https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Chttp#rest-endpoint-reference
Fixes #15879
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: