我正在尝试使用 Python 在 Azure 2.0.0rc2 中创建标签。以下是我使用的代码:
def __update_tags(self):
username = 'user@xyz.com'
password = 'user@1234'
subscription_id = '478-ytehn-47ds5-784aa-4758a'
credentials = UserPassCredentials(username=username, password=password)
resource_client = ResourceManagementClient(credentials=credentials)
tag_operations = TagOperations(client=resource_client)
tag_operations.create_or_update_value(tag_name='key_1', tag_value='val_1')
在运行此代码时,我收到如下错误:
if self.client.credentials.subscription_id is not None:
AttributeError: 'UserPassCredentials' object has no attribute 'subscription_id'
任何人都有解决这个问题的想法。