Skip to content

fix(credential): fix credential issue on CN tenant #105

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

Merged
merged 3 commits into from
May 19, 2025

Conversation

z30yserr
Copy link
Contributor

@z30yserr z30yserr commented May 19, 2025

Fix credential issue on CN azure context

This PR solves authentication issue on a chinese tenant. Following this issue.

As of now, when you try to use octodns on a CN context you will end up with this error :

octo-sync --config-file=public-file.yaml
ERROR: AADSTS500011: The resource principal named https://management.azure.com was not found in the tenant named

octo-sync --config-file=private-file.yaml
azure.core.exceptions.ClientAuthenticationError: Authentication failed: AADSTS500011: The resource principal named https://management.azure.com was not found in the tenant named

even though on both files, the following settings have been applied :

authority: https://login.partner.microsoftonline.cn
base_url: https://management.chinacloudapi.cn

After the fix, both synchronization are working properly.

2025-05-19T09:20:40  [264762031934928] DEBUG msal.token_cache event={
    "client_id": "REDACTED",
    "data": {
        "claims": null,
        "scope": [
            "https://management.chinacloudapi.cn/.default"
        ]
    },
    "environment": "login.partner.microsoftonline.cn",
    "grant_type": "client_credentials",
    "params": null,
    "response": {
        "access_token": "********",
        "expires_in": 3599,
        "ext_expires_in": 3599,
        "token_type": "Bearer"
    },
    "scope": [
        "https://management.chinacloudapi.cn/.default"
    ],
    "token_endpoint": "https://login.partner.microsoftonline.cn/REDACTED/oauth2/v2.0/token"
}
2025-05-19T09:20:40  [264762031934928] INFO  azure.identity._internal.get_token_mixin ClientSecretCredential.get_token_info succeeded

@z30yserr z30yserr changed the title fix(credential): fix credntial issue on CN tenant fix(credential): fix credential issue on CN tenant May 19, 2025
Copy link
Contributor

@ross ross left a comment

Choose a reason for hiding this comment

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

Tested locally with my personal azure setup. Thanks.

@ross
Copy link
Contributor

ross commented May 19, 2025

/cc Fixes #102

@ross ross merged commit 96f29f5 into octodns:main May 19, 2025
7 checks passed
@ross ross mentioned this pull request May 19, 2025
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