Python용 Azure 리소스 라이브러리

개요

Azure Resource Manager를 사용하여 그룹에서 리소스를 배포, 모니터링 및 관리합니다.

관리 API

관리 API를 사용하여 리소스 그룹을 만들고, 템플릿에서 리소스를 배포합니다.

pip install azure-mgmt-resource
pip install azure-identity

예제

Azure Eastern US 지역에 새 리소스 그룹을 만듭니다.

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})

샘플

Azure 리소스 및 리소스 그룹 관리

Azure Resource Manager 샘플의 전체 목록을 봅니다.