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

Cannot create Storage Container in National Cloud (China) #16861

Closed
3 tasks
TruongNguyen888 opened this issue Aug 11, 2021 · 9 comments
Closed
3 tasks

Cannot create Storage Container in National Cloud (China) #16861

TruongNguyen888 opened this issue Aug 11, 2021 · 9 comments
Assignees
Labels
Azure.Identity bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.

Comments

@TruongNguyen888
Copy link

  • Package Name && Version:
    "@azure/arm-storage": "^16.1.0",
    "@azure/identity": "^1.5.0",
  • Operating system:
  • nodejs
    • version: v10.15.3
  • browser
    • name/version: Firefox
  • typescript
    • version: 4.2.3

Describe the bug
I am using the arm-storage package to create a new container in storage account via code. It works well for the azure global environment. Now i deployed my server into the china cloud and now it doesnt work any more.

To Reproduce
Here is the sample code to get the client in the china login:

const servicePrincipaleCred = new ClientSecretCredential(
    process.env.ARM_TENANT_ID,
    process.env.ARM_CLIENT_ID,
    process.env.ARM_CLIENT_SECRET,
    {
      authorityHost: process.env.NATIONALCLOUD?.toUpperCase() === 'GLOBAL' ? AzureAuthorityHosts.AzurePublicCloud : AzureAuthorityHosts.AzureChina
    }
  )

  const client = new StorageManagementClient(servicePrincipaleCred as any, process.env.ARM_SUBSCRIPTION_ID);

This works well.

Here is the code for creating the storage account:

client.blobContainers.create(
                            process.env.SA_RESOURCEGROUPNAME as string,
                            process.env.SA_ACCOUNTNAME as string,
                            newContainerName.toLowerCase(),
                            blobContainer
                        )

But now occurs this error:

Error: invalid_resource(status code 400). More details: AADSTS500011: The resource principal named https://management.azure.com was not found in the tenant named xxxx-xxxx-xxxx-xxxx-xxxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: xxxx-xxxx-xxxx-xxxx-xxxxCorrelation ID: xxxx-xxxx-xxxx-xxxx-xxxxTimestamp: 2021-07-30 16:30:44Z

So the problem is, i dont know where i can set up the Azure Resource Manager for China
("https://management.chinacloudapi.cn")

Can you help me maybe?
I hope this is the right place to question.

Greetings Truong Nguyen.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 11, 2021
@ramya-rao-a ramya-rao-a added Azure.Identity Client This issue points to a problem in the data-plane of the library. labels Aug 11, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 11, 2021
@ramya-rao-a
Copy link
Contributor

Thanks for reporting @TruongNguyen888

Can you try passing the baseUri in the options when creating the client? I have updated your code to take this option below

const client = new StorageManagementClient(servicePrincipaleCred as any, process.env.ARM_SUBSCRIPTION_ID, {
   baseUri: "https://management.chinacloudapi.cn"
});

@ramya-rao-a
Copy link
Contributor

@sadasant Am guessing this is going to be the same problem as #15945?

@sadasant
Copy link
Contributor

@ramya-rao-a if it’s the same problem as #15945, setting the baseUri won’t help until we merge and release something similar to this PR: Azure/ms-rest-js#457

@TruongNguyen888
Copy link
Author

@ramya-rao-a Thank you for your reply. I tried your suggestion but the same error occurs again

@ramya-rao-a
Copy link
Contributor

Thanks for the confirmation @TruongNguyen888
Can you try the workaround mentioned in #15945 (comment) while we work on the solution for this issue?

@nickzhums
Copy link
Contributor

@TruongNguyen888 thank you for the feedback. We as the product team are very interested in learning about your experience using the JavaScript SDK. Would you be interested in a quick 20-30 min call to talk about your thoughts? The time can be flexible, thanks!

@sadasant sadasant added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Aug 21, 2021
@ramya-rao-a
Copy link
Contributor

Hello @TruongNguyen888

The issue was in the package @azure/ms-rest-js which is a dependency of the @azure/arm-storage package you are using.
We have released a new version for @azure/ms-rest-js that should fix this issue.

Please ensure you have the latest version of this package and let us know if this is still a problem

@ramya-rao-a ramya-rao-a added issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Aug 23, 2021
@ghost
Copy link

ghost commented Aug 23, 2021

Hi @TruongNguyen888. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ramya-rao-a ramya-rao-a added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 23, 2021
@ramya-rao-a ramya-rao-a added this to the [2021] September milestone Aug 23, 2021
@ghost
Copy link

ghost commented Aug 30, 2021

Hi @TruongNguyen888, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Aug 30, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.
Projects
None yet
Development

No branches or pull requests

4 participants