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.
Met ons samenwerken op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.
Azure SDK for Python