Azure 运行 作为跨订阅的帐户
Azure Run as account across subscriptions
我在我的一个订阅中创建了一个 Azure 运行 作为帐户。在我的 PS 运行 书中,如何使用此 运行 作为帐户访问其他订阅中的资源。
run as account
本质上是您的 Azure 广告租户中的服务主体。当它在订阅下创建时,它会自动在订阅下分配一个 Contributor
角色。
如果你想让它访问其他订阅中的资源,只需导航到门户中的特定订阅 -> Access control (IAM)
-> Add
-> Add role assignment
->添加服务主体(run as account
的显示名称)作为您想要的角色(例如贡献者)。看到这个 link. Note: Make sure your user account which used to login portal is an Owner
role of the subscription, otherwise you will not have the permission to do that. For more details about azure RBAC, you could refer to this link.
然后在 runbook 中,您可以使用 Set-AzureRmContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
设置要使用的订阅,更多详细信息请参阅此 link。
我在我的一个订阅中创建了一个 Azure 运行 作为帐户。在我的 PS 运行 书中,如何使用此 运行 作为帐户访问其他订阅中的资源。
run as account
本质上是您的 Azure 广告租户中的服务主体。当它在订阅下创建时,它会自动在订阅下分配一个 Contributor
角色。
如果你想让它访问其他订阅中的资源,只需导航到门户中的特定订阅 -> Access control (IAM)
-> Add
-> Add role assignment
->添加服务主体(run as account
的显示名称)作为您想要的角色(例如贡献者)。看到这个 link. Note: Make sure your user account which used to login portal is an Owner
role of the subscription, otherwise you will not have the permission to do that. For more details about azure RBAC, you could refer to this link.
然后在 runbook 中,您可以使用 Set-AzureRmContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
设置要使用的订阅,更多详细信息请参阅此 link。