Azure Resources libraries for python
Overview
Deploy, monitor, and manage resources in groups with Azure Resource Manager.
Management API
Use the management API to create resource groups and deploy resources from templates.
pip install azure-mgmt-resource
pip install azure-identity
Example
Create a new resource group in the Azure Eastern US region.
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource import ResourceManagementClient
import os
LOCATION = 'eastus'
GROUP_NAME ='sample_resource_group'
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = ResourceManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
client.resource_groups.create_or_update(GROUP_NAME, {'location': LOCATION})
Samples
Manage Azure resources and resource groups
View the complete list of Azure Resource Manager samples.
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.
Azure SDK for Python