从具有系统分配的标识(不是用户分配的托管标识)的 VM 中。
我可以通过 az cli 通过键入进行身份验证,az login -identity
并且可以基于对 VM 服务主体的 RoleAssignments 执行操作。
但是,当我尝试使用 pwsh 执行相同操作时:
Connect-AzAccount -Identity
出现错误:
WARNING: Unable to acquire token for tenant 'organizations' with error 'ManagedIdentityCredential authentication unavailable. No Managed Identity endpoint found.'
Connect-AzAccount: ManagedIdentityCredential authentication unavailable. No Managed Identity endpoint found.
但是,如果我Connect-AzAccount -Identity
在它似乎工作后立即运行第二次:
PS /root> Connect-AzAccount -Identity
Account SubscriptionName TenantId Environment
------- ---------------- -------- -----------
MSI@XXXXX <subscriptionName> <tenantId> AzureCloud
我可以做些什么来避免显示此警告吗?