Pythonを使用してAzure 2.0.0rc2でタグを作成しようとしています。create tags Python Azure SDKの使い方は?
def __update_tags(self):
username = '[email protected]'
password = '[email protected]'
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'
誰もがこの問題を解決するためのアイデアを持っているの 私が使用したコードを以下に示します。
私はこの方法を試してみましたが、azure.mgmt.resource.resourcesから '紺碧2.0.0rc2にはResourceManagementClientConfiguration をインポート'は使用できません。一度確認してください。 –
@ramkumarどういう意味ですか?私は私の側から** azure.mgmt.resource.resources import ResourceManagementClientConfiguration **が確実に動作することを確認できます。私の返信で更新をチェックしてください。 – forester123