Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure Python SDK_Python_Azure_Azure Sdk Python - Fatal编程技术网

Azure Python SDK

Azure Python SDK,python,azure,azure-sdk-python,Python,Azure,Azure Sdk Python,我正在尝试使用Python SDK获取Azure租户中的订阅列表 我想使用这个类: 以及列表方法 文档中说“您不应该直接实例化这个类,而应该创建一个客户机实例来为您创建它并将其作为属性附加。” 这是什么意思 这就是我所拥有的: client = SubscriptionClient(credentials) test = SubscriptionClient.SubscriptionsOperations(client) 我明白了: AttributeError: type object '

我正在尝试使用Python SDK获取Azure租户中的订阅列表

我想使用这个类:

以及
列表
方法

文档中说“您不应该直接实例化这个类,而应该创建一个客户机实例来为您创建它并将其作为属性附加。”

这是什么意思

这就是我所拥有的:

client = SubscriptionClient(credentials)

test = SubscriptionClient.SubscriptionsOperations(client)
我明白了:

AttributeError: type object 'SubscriptionClient' has no attribute 'SubscriptionsOperations'
谢谢

米克

我让它工作了:

client = SubscriptionClient(credentials) # correct
print (client.subscriptions)
这给了我
azure.mgmt.subscription.operations.subscriptions\u operations.subscriptionoperations
,当我使用它时,它会起作用

这就是他们所说的:

您不应直接实例化此类,而应创建一个客户端实例,该实例将为您创建类并将其作为属性附加