適用於 Python 的 Azure 資源庫Azure Resources libraries for python
概觀Overview
使用 Azure Resource Manager 部署、監視和管理群組中的資源。Deploy, monitor, and manage resources in groups with Azure Resource Manager.
管理 APIManagement API
使用管理 API 來透過範本建立資源群組及部署資源。Use the management API to create resource groups and deploy resources from templates.
pip install azure-mgmt-resource
範例Example
在 Azure 的美國東部區域建立新的資源群組。Create a new resource group in the Azure Eastern US region.
from azure.mgmt.resource import ResourceManagementClient
LOCATION = 'eastus'
GROUP_NAME ='sample_resource_group'
resource_client = ResourceManagementClient(credentials, subscription_id)
resource_client.resource_groups.create_or_update(GROUP_NAME, {'location': LOCATION})
範例Samples
管理 Azure 資源和資源群組Manage Azure resources and resource groups
檢視 Azure Resource Manager 範例的完整清單。View the complete list of Azure Resource Manager samples.