-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update AzureDevOps.yml #5249
Update AzureDevOps.yml #5249
Conversation
Replacing usage of PAT with Entra ID service principal via federated identity
run: | ||
# The resource ID for Azure DevOps is always 499b84ac-1321-427f-aa17-267ca6975798 | ||
# https://learn.microsoft.com/azure/devops/integrate/get-started/authentication/service-principal-managed-identity | ||
echo "ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the resource id be part of you secrets?
Or can the action below use the azure login to carry out the task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, but resource id is a public information so there isn't any real need hiding it.
run: | ||
# The resource ID for Azure DevOps is always 499b84ac-1321-427f-aa17-267ca6975798 | ||
# https://learn.microsoft.com/azure/devops/integrate/get-started/authentication/service-principal-managed-identity | ||
echo "ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
echo "ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV | |
echo "ADO_TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV |
- uses: pavelhorak/github-actions-issue-to-work-item@main | ||
env: | ||
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}" | ||
ado_token: "${{ env.ado_token }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
ado_token: "${{ env.ado_token }}" | |
ado_token: "${{ env.ADO_TOKEN }}" |
Replacing usage of PAT with Entra ID service principal via federated identity