无法为Azure Nodejs SDK指定中国地区

无法为Azure Nodejs SDK指定中国地区,azure,azure-sdk,azure-node-sdk,azure-china,Azure,Azure Sdk,Azure Node Sdk,Azure China,我正在尝试与Azure中国资源公司进行Nodejs互动 但无法找到如何使用nodejs SDK使用Azure China对应用程序进行身份验证 已尝试@azure/arm存储 从@azure/ms rest nodeauth导入*作为msrestnodeuth; 从@azure/arm存储导入{StorageManagementClient、StorageManagementModels、StorageManagementMappers}; const subscriptionId=proces

我正在尝试与Azure中国资源公司进行Nodejs互动

但无法找到如何使用nodejs SDK使用Azure China对应用程序进行身份验证

已尝试@azure/arm存储

从@azure/ms rest nodeauth导入*作为msrestnodeuth; 从@azure/arm存储导入{StorageManagementClient、StorageManagementModels、StorageManagementMappers}; const subscriptionId=process.env[AZURE_SUBSCRIPTION_ID]; msRestNodeAuth.interactiveLogin.thencreds=>{ const client=新的StorageManagementClientcreds,subscriptionId; client.operations.list.thenresult=>{ console.log结果是:; console.logresult; }; }.catcherr=>{ console.error; }; 要连接到Azure中国,您需要指定环境。请参阅下面的代码:

const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const Environment = require("@azure/ms-rest-azure-env").Environment;

const mooncake = Environment.ChinaCloud;

msRestNodeAuth.interactiveLogin({
  environment: mooncake
}).then((creds) => {
  console.log(creds);
}).catch((err) => {
  console.error(err);
});

中国地区Azure产品是单独管理的,您需要专门注册。我投票将此问题作为非主题关闭,因为这是一个订阅注册主题。与编程无关。@DavidMakogon谦虚地说,我不同意。问题是如何使用NodeSDK连接到中国地区的Azure订阅。请看下面我的答案。@GauravMantri-啊-我误解了这个问题。是的,中国和德国产品都使用不同的API端点。