You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/management/manage-resource-groups-python.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ Learn how to use Python with [Azure Resource Manager](overview.md) to manage you
21
21
* azure-mgmt-resource
22
22
* azure-mgmt-storage
23
23
24
+
If you have older versions of these packages already installed in your virtual environment, you may need to update them with `pip install --upgrade {package-name}`
25
+
24
26
* The examples in this article use CLI-based authentication (`AzureCliCredential`). Depending on your environment, you may need to run `az login` first to authenticate.
25
27
26
28
* An environment variable with your Azure subscription ID. To get your Azure subscription ID, use:
@@ -112,7 +114,7 @@ for rg in rg_list:
112
114
print(rg.name)
113
115
```
114
116
115
-
To get one resource group, provide the name of the resource group.
117
+
To get one resource group, use [ResourceManagementClient.resource_groups.get](/python/api/azure-mgmt-resource/azure.mgmt.resource.resources.v2022_09_01.operations.resourcegroupsoperations#azure-mgmt-resource-resources-v2022-09-01-operations-resourcegroupsoperations-get) and provide the name of the resource group.
116
118
117
119
```python
118
120
import os
@@ -150,9 +152,11 @@ For more information about how Azure Resource Manager orders the deletion of res
150
152
151
153
## Deploy resources
152
154
153
-
You can deploy Azure resources by using Python classes or by deploying an Azure Resource Manager (ARM) template.
155
+
You can deploy Azure resources by using Python classes or by deploying an Azure Resource Manager template (ARM template).
156
+
157
+
### Deploy resources by using Python classes
154
158
155
-
The following example creates a storage account. The name you provide for the storage account must be unique across Azure.
159
+
The following example creates a storage account by using [StorageManagementClient.storage_accounts.begin_create](/python/api/azure-mgmt-storage/azure.mgmt.storage.v2022_09_01.operations.storageaccountsoperations#azure-mgmt-storage-v2022-09-01-operations-storageaccountsoperations-begin-create). The name for the storage account must be unique across Azure.
To deploy an ARM template, use [ResourceManagementClient.deployments.begin_create_or_update](/python/api/azure-mgmt-resource/azure.mgmt.resource.resources.v2022_09_01.operations.deploymentsoperations#azure-mgmt-resource-resources-v2022-09-01-operations-deploymentsoperations-begin-create-or-update).
187
+
### Deploy resources by using an ARM template
188
+
189
+
To deploy an ARM template, use [ResourceManagementClient.deployments.begin_create_or_update](/python/api/azure-mgmt-resource/azure.mgmt.resource.resources.v2022_09_01.operations.deploymentsoperations#azure-mgmt-resource-resources-v2022-09-01-operations-deploymentsoperations-begin-create-or-update). The following example requires a local template named `storage.json`.
0 commit comments