在使用 @azure/arm-monitor sdk 创建 MonitorClient对象时候,遇见错误 ManagedIdentityCredential authentication failed.(status code 500)
CredentialUnavailableError: ERROR: AADSTS500011: The resource principal name https://management.azure.com was not found in tenant name ##############. 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.
在初始化 MonitorClient 对象时,添加 credentialScopes 参数:
credentialScopes: ['https://management.chinacloudapi.cn/.default']
即可解决问题。
MonitorClient(TokenCredential, string, MonitorClientOptionalParams) : https://learn.microsoft.com/en-us/javascript/api/@azure/arm-monitor/monitorclient?view=azure-node-latest#@azure-arm-monitor-monitorclient-constructor
MonitorClient Optional Params credentialScopes : https://learn.microsoft.com/en-us/javascript/api/%40azure/arm-monitor/monitorclientoptionalparams?view=azure-node-latest#@azure-arm-monitor-monitorclientoptionalparams-credentialscopes
问题描述 在App Service上放置一个JS页面并引用msal.min.js,目的是获取AAD用户名并展示。 问题解答 示例代码 Azure Service
spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type=AZURE_CHINA