Skip to content
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

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Update AzureDevOps.yml #5249

merged 1 commit into from
Sep 5, 2024

Conversation

pavelhorak
Copy link
Member

Replacing usage of PAT with Entra ID service principal via federated identity

Replacing usage of PAT with Entra ID service principal via federated identity
@pavelhorak pavelhorak requested a review from nohwnd September 3, 2024 10:03
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
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
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 }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
ado_token: "${{ env.ado_token }}"
ado_token: "${{ env.ADO_TOKEN }}"

@nohwnd nohwnd merged commit c056ac5 into main Sep 5, 2024
2 checks passed
@nohwnd nohwnd deleted the pavelhorak-patch-1 branch September 5, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants