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

Support for AzureChinaCloud #74

Closed
octavia213 opened this issue Jun 27, 2022 · 4 comments
Closed

Support for AzureChinaCloud #74

octavia213 opened this issue Jun 27, 2022 · 4 comments
Labels
need-to-triage Requires investigation

Comments

@octavia213
Copy link

Hi, I am currently trying to get this action to work with an AKS instance in AzureChinaCloud. This action fails with "ExpiredServicePrincipal", although I am able to login via AZ CLI and fetch the aks credentials with "az aks get-credentials", so I wonder if this ExpiredServicePrincipal error is actually because I didn't specify using AzureChinaCloud in this action, and it couldn't find my subscription or service principal in the global cloud.

with:
creds: ***
cluster-name: [cluster_group_name]
resource-group: [resource_group_name]
Error: ExpiredServicePrincipal

@octavia213 octavia213 added the need-to-triage Requires investigation label Jun 27, 2022
@OliverMKing
Copy link
Collaborator

Are you using the Azure/login action to authenticate? Azure/login takes a environment parameter that you should pass AzureChinaCloud into.

@octavia213
Copy link
Author

Hi Oliver,
There is a login action that successfully runs before reaching the aks-set-context step, as follows:

- uses: azure/login@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}
    environment: AzureChinaCloud
- uses: azure/aks-set-context@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}
    cluster-name: ${{ env.CLUSTER_NAME }}
    resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}

Maybe the credentials from azure/login didn't carry over to azure/aks-set-context, or the service principal itself doesn't have enough privilege for this action?

@OliverMKing
Copy link
Collaborator

You should upgrade to v3 or v2 of aks-set-context. V1 used a completely different login strategy.

@octavia213
Copy link
Author

It ran successfully after upgrading to v3; thank you Oliver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-to-triage Requires investigation
Projects
None yet
Development

No branches or pull requests

2 participants