【发布时间】:2020-05-29 09:37:19
【问题描述】:
我使用 Microsoft.Azure.Management 来管理我的租户的虚拟机,使用 clientId、clientSecret 和tenantId。 如果另一个租户想让我访问管理他的虚拟机,是否可以使用这种方式连接到他的虚拟机,只更改tenantId?
是否可以使用 Microsoft 授权授予对虚拟机的访问权限?又会是怎样的流程?
或者哪种方式最适合我的需求?
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Authentication;
//...
var creds = new AzureCredentialsFactory().FromServicePrincipal(clientId, clientSecret, tenantId, AzureEnvironment.AzureGlobalCloud);
IAzure azure = Azure.Authenticate(creds).WithDefaultSubscription();
var machines = azure.VirtualMachines.List().ToList();
【问题讨论】:
标签: c# azure azure-management-api