Open ezYakaEagle442 opened 1 year ago
Also the pre-req mentionned in the docs were missing ;
az role assignment create --role contributor --subscription ${SUBSCRIPTION_ID} --assignee-object-id $SPN_OBJECT_ID --assignee-principal-type ServicePrincipal --scope /subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_KV}
az role assignment create --role contributor --subscription ${SUBSCRIPTION_ID} --assignee-object-id $SPN_OBJECT_ID --assignee-principal-type ServicePrincipal --scope /subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_APP}
but fails with
Principals of type Application cannot validly be used in role assignments.
GH Runner fails with
Error: Az CLI Login failed. Please check the credentials and make sure az is installed on the runner. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows
it does even not displays the log message shown in the docs : 'Using OIDC authentication ...'
the permissions were missing :
# required for https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-cli%2Clinux#set-up-azure-login-with-openid-connect-authentication
permissions:
id-token: write
contents: read
I have add them and now the az cli runs correctly in the workflow :
Using OIDC authentication...
Federated token details:
issuer - https://token.actions.githubusercontent.com/
subject claim - repo:ezYakaEagle442/aca-java-petclinic-mic-srv:ref:refs/heads/main
/usr/bin/az cloud set -n azurecloud
Done setting cloud: "azurecloud"
Login successful.
The initial issue is still there : I could create Federated Credentials for GitHub from the portal only, not from CLI
@jiasli for awareness
Adding Service team to look into this.
I hit the same error with CLI 2.45.0 @yonzhan can I have an update on that one please ?
Related command
Describe the bug
To Reproduce
Expected behavior Based on the docs CLI should work
Environment summary From VS Code / WSL :
Additional context
I could sucessfully create Federated Credentials from the Portal using the same values. Note: I use an MS FTE Tenant (named AppInnoLabs) with external subscription