Python中的Login-AzurermAccount

时间:2018-07-02 09:35:48

标签: python azure

我不是Windows用户,因此我试图摆脱使用Powershell的麻烦。

如果必须为每个订阅创建服务原则,我发现很难找到一种方法来管理不同订阅中的天蓝色资源。

似乎每个python身份验证都需要设置服务原理,但是powershell命令允许我根据我的租户权限访问多个订阅。

是否存在与Login-AzurermAccount -Credential $Cred -TenantID $TenantID -SubscriptionID $SubscriptionID等效的python 不创建服务原则?

1 个答案:

答案 0 :(得分:0)

以下是医生在讨论这个问题:
https://docs.microsoft.com/en-us/python/azure/python-sdk-azure-authenticate?view=azure-python#mgmt-auth-legacy

from azure.common.credentials import UserPassCredentials

credentials = UserPassCredentials(
    'user@domain.com',
    'my_smart_password'
)