Skip to content

Add a dedicate appId registration for mooncake #802

Open

Description

@peombwa

As a continuation of #425, we should consider adding a special appId registration for mooncake since globally registered apps don't replicate to China cloud. This effort will build upon the existing model used by GE - microsoftgraph/microsoft-graph-explorer-v4#955.

The current workaround is registering your own appId in mooncake and using it with Connect-MgGraph - Connect-MgGraph -ClientId $appId -Environment China.
AB#10522

Activity

  1. leapyear1969 commented on Jan 24, 2022

    @leapyear1969

    hello there, may i know if there's any updates on this issue? my org in China has encountered this problem.

    the workaround seems not working, with below error:

    Connect-MgGraph -ClientId $appId -Environment China -Scopes "User.Read.All","Group.ReadWrite.All" -TenantId $tenantId

    AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '$appId'.

    However, i tried to use below commands, another error occured:

    Connect-MgGraph -ClientId $clientId -Environment China -TenantId $tenantId -CertificateThumbprint $thumbprint

    image
    image

  2. maisarissi commented on Jan 28, 2022

    @maisarissi

    Hi leapyear1969 (@leapyear1969) .
    Cloud you please call the command with -Debug and share the output?

    Connect-MgGraph -Environment China -AppId $CN_App_Id -TenantId $CN_Tenant_Id -CertificateThumbprint $Cert_Thumbprint -Debug
  3. Icybiubiubiu commented on Jan 29, 2022

    @Icybiubiubiu

    image

    image

    Does this mean self-signed cert cannot be used here?

  4. leapyear1969 commented on Jan 29, 2022

    @leapyear1969

    hello Maísa Rissi (@maisarissi)

    please check the error message:
    image

  5. leapyear1969 commented on Jan 29, 2022

    @leapyear1969

    hello Icy (@Icybiubiubiu) , i saw that you regesiterd you own app, and it works, how did you do that? i tried both Self-signed certificate and CA certificate,no luck for me.

  6. georgend commented on Jan 31, 2022

    @georgend
    Contributor

    Icy (@Icybiubiubiu) Is the certificate installed in your machine?

    Can you execute with the certificate in memory:-

    Connect-MgGraph -Environment China -AppId $CN_App_Id -TenantId $CN_Tenant_Id -Certificate $CertificateObject -Debug
    
  7. Icybiubiubiu commented on Feb 9, 2022

    @Icybiubiubiu

    George (@georgend)
    Thanks for reminder.
    issue was resolved by installing cert on the client.

  8. leapyear1969 commented on Feb 9, 2022

    @leapyear1969

    i still cannot connect to MSGraph via powershell SDK, even i installed the cert on my PC as trusted cert.

    Connect-MgGraph -Environment China -AppId $CN_App_Id -TenantId $CN_Tenant_Id -Certificate $CertificateObject -Debug

    image

  9. georgend commented on Feb 9, 2022

    @georgend
    Contributor

    leapyear1969 (@leapyear1969) have you uploaded the certificate to your mooncake (Azure Active Directory App Registration)?

  10. leapyear1969 commented on Feb 10, 2022

    @leapyear1969

    leapyear1969 (@leapyear1969) have you uploaded the certificate to your mooncake (Azure Active Directory App Registration)?

    George (@georgend) yes,i did upload it to the AAD app registartion.
    image

  11. peombwa commented on May 10, 2022

    @peombwa
    MemberAuthor

    leapyear1969 (@leapyear1969), the certificate needs to be installed in your user's trusted store on the machine you are running the script from. You can use Get-ChildItem Cert:\CurrentUser\My\$CertThumbprint to verify if the certificate is indeed installed in the user store. See https://docs.microsoft.com/en-us/powershell/microsoftgraph/app-only?context=graph%2Fapi%2F1.0&view=graph-powershell-beta&tabs=azure-portal#certificate for more details.

    Alternatively, you can -Certificate example shown in https://github.com/microsoftgraph/msgraph-sdk-powershell#usage.

    I'm able to use app-only with a certificate thumbprint in China cloud without any issue.

  12. leapyear1969 commented on May 11, 2022

    @leapyear1969

    leapyear1969 (@leapyear1969), the certificate needs to be installed in your user's trusted store on the machine you are running the script from. You can use Get-ChildItem Cert:\CurrentUser\My\$CertThumbprint to verify if the certificate is indeed installed in the user store. See https://docs.microsoft.com/en-us/powershell/microsoftgraph/app-only?context=graph%2Fapi%2F1.0&view=graph-powershell-beta&tabs=azure-portal#certificate for more details.

    Alternatively, you can -Certificate example shown in https://github.com/microsoftgraph/msgraph-sdk-powershell#usage.

    I'm able to use app-only with a certificate thumbprint in China cloud without any issue.

    Thanks so much Peter, it works for me after adding the cert to my local machine, i can check it via below command:

    Get-ChildItem Cert:\CurrentUser\My\$CertThumbprint
    
  13. Marcoevich commented on Jul 3, 2025

    @Marcoevich

    Hi Gents,

    It's been a while since this issue got any attention. Are there still plans to integrate this into 21Vianet tenants?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions