擅长:python、mysql、java
<p>根据文档(<a href="http://azure-sdk-for-python.readthedocs.org/en/latest/resourcemanagement.html" rel="nofollow">Resource Management</a>和<a href="http://azure-sdk-for-python.readthedocs.org/en/latest/resourcemanagementauthentication.html" rel="nofollow">Resource Management Authentication</a>),正如@forester123所说,将代码总结如下。在</p>
<pre><code>from azure.common.credentials import UserPassCredentials
from azure.mgmt.resource.resources import ResourceManagementClient, ResourceManagementClientConfiguration
username = 'user@xyz.com'
password = 'user@1234'
subscription_id = '478-ytehn-47ds5-784aa-4758a'
credentials = UserPassCredentials(username, password)
resource_client = ResourceManagementClient(
ResourceManagementClientConfiguration(
credentials,
subscription_id
)
)
</code></pre>