編輯

共用方式為


適用於 Python 的 Azure 資源庫Azure Resources libraries for Python

概觀Overview

在資源群組中管理 Azure 資源。Manage Azure resources in resource groups.

PackagePackage 說明Description
azure.mgmt.resource.featuresazure.mgmt.resource.features Azure 功能控制項 (AFEC) 提供一種機制,讓資源提供者可控制要向使用者曝光的功能。Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users.
azure.mgmt.resource.linksazure.mgmt.resource.links 可將 Azure 資源連結在一起來構成邏輯關聯性。Azure resources can be linked together to form logical relationships. 您可以在屬於不同資源群組的資源之間建立連結。You can establish links between resources belonging to different resource groups.
azure.mgmt.resource.locksazure.mgmt.resource.locks 可以鎖定 Azure 資源來防止貴組織中的其他使用者刪除或修改資源。Azure resources can be locked to prevent other users in your organization from deleting or modifying resources.
azure.mgmt.resource.managedapplicationsazure.mgmt.resource.managedapplications Azure 受控應用程式 (設備)。ARM managed applications (appliances).
azure.mgmt.resource.policyazure.mgmt.resource.policy 若要管理和控制資源的存取權,您可以定義自訂的原則,並在範圍內將它們加以指派。To manage and control access to your resources, you can define customized policies and assign them at a scope.
azure.mgmt.resource.resourcesazure.mgmt.resource.resources 提供使用資源與資源群組的作業。Provides operations for working with resources and resource groups.
azure.mgmt.resource.subscriptionsazure.mgmt.resource.subscriptions 所有資源群組和資源都在訂用帳戶內。All resource groups and resources exist within subscriptions. 這些作業可讓您取得訂用帳戶和租用戶的相關資訊。These operation enable you get information about your subscriptions and tenants.

安裝程式庫Install the libraries

pip install azure-mgmt-resource

範例Example

下列範例說明如何建立資源群組。The following is an example of how to create a resource group.

from azure.mgmt.resource import ResourceManagementClient
client = ResourceManagementClient(credentials, subscription_id)
client.resource_groups.create(RESOURCE_GROUP_NAME, {'location':'eastus'})

深入探索可在應用程式中使用的 Python 程式碼範例Explore more sample Python code you can use in your apps.