Skip to content

Commit 10fc5d5

Browse files
committed
coordinate manage resource groups
1 parent 6d39868 commit 10fc5d5

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

articles/azure-resource-manager/management/manage-resource-groups-cli.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ title: Manage resource groups - Azure CLI
33
description: Use Azure CLI to manage your resource groups through Azure Resource Manager. Shows how to create, list, and delete resource groups.
44
author: mumian
55
ms.topic: conceptual
6-
ms.date: 09/10/2021
7-
ms.author: jgao
6+
ms.date: 03/31/2023
87
ms.custom: devx-track-azurecli
98
---
109

1110
# Manage Azure Resource Groups by using Azure CLI
1211

1312
Learn how to use Azure CLI with [Azure Resource Manager](overview.md) to manage your Azure resource groups. For managing Azure resources, see [Manage Azure resources by using Azure CLI](manage-resources-cli.md).
1413

14+
## Prerequisites
15+
16+
* Azure CLI. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
17+
18+
* After installing, sign in for the first time. For more information, see [How to sign into the Azure CLI](/cli/azure/get-started-with-azure-cli#how-to-sign-into-the-azure-cli).
19+
1520
## What is a resource group
1621

1722
A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to add resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.
@@ -54,18 +59,44 @@ For more information about how Azure Resource Manager orders the deletion of res
5459

5560
You can deploy Azure resources by using Azure CLI, or by deploying an Azure Resource Manager (ARM) template or Bicep file.
5661

62+
### Deploy resources by using Storage operations
63+
5764
The following example creates a storage account. The name you provide for the storage account must be unique across Azure.
5865

5966
```azurecli-interactive
6067
az storage account create --resource-group exampleGroup --name examplestore --location westus --sku Standard_LRS --kind StorageV2
6168
```
6269

70+
### Deploy resources by using an ARM template or Bicep file
71+
6372
To deploy an ARM template or Bicep file, use [az deployment group create](/cli/azure/deployment/group#az-deployment-group-create).
6473

6574
```azurecli-interactive
6675
az deployment group create --resource-group exampleGroup --template-file storage.bicep
6776
```
6877

78+
The following example shows the Bicep file named `storage.bicep` that you're deploying:
79+
80+
```bicep
81+
@minLength(3)
82+
@maxLength(11)
83+
param storagePrefix string
84+
85+
var uniqueStorageName = concat(storagePrefix, uniqueString(resourceGroup().id))
86+
87+
resource uniqueStorage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
88+
name: uniqueStorageName
89+
location: 'eastus'
90+
sku: {
91+
name: 'Standard_LRS'
92+
}
93+
kind: 'StorageV2'
94+
properties: {
95+
supportsHttpsTrafficOnly: true
96+
}
97+
}
98+
```
99+
69100
For more information about deploying an ARM template, see [Deploy resources with Resource Manager templates and Azure CLI](../templates/deploy-cli.md).
70101

71102
For more information about deploying a Bicep file, see [Deploy resources with Bicep and Azure CLI](../bicep/deploy-cli.md).

articles/azure-resource-manager/management/manage-resource-groups-powershell.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ title: Manage resource groups - Azure PowerShell
33
description: Use Azure PowerShell to manage your resource groups through Azure Resource Manager. Shows how to create, list, and delete resource groups.
44
author: mumian
55
ms.topic: conceptual
6-
ms.date: 09/10/2021
7-
ms.author: jgao
6+
ms.date: 03/31/2023
87
ms.custom: devx-track-azurepowershell
98

109
---
1110
# Manage Azure Resource Groups by using Azure PowerShell
1211

1312
Learn how to use Azure PowerShell with [Azure Resource Manager](overview.md) to manage your Azure resource groups. For managing Azure resources, see [Manage Azure resources by using Azure PowerShell](manage-resources-powershell.md).
1413

14+
## Prerequisites
15+
16+
* Azure PowerShell. For more information, see [Install the Azure Az PowerShell module](/powershell/azure/install-az-ps).
17+
18+
* After installing, sign in for the first time. For more information, see [Sign in](/powershell/azure/install-az-ps#sign-in).
19+
1520
## What is a resource group
1621

1722
A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to add resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.
@@ -54,18 +59,44 @@ For more information about how Azure Resource Manager orders the deletion of res
5459

5560
You can deploy Azure resources by using Azure PowerShell, or by deploying an Azure Resource Manager (ARM) template or Bicep file.
5661

62+
### Deploy resources by using Storage operations
63+
5764
The following example creates a storage account. The name you provide for the storage account must be unique across Azure.
5865

5966
```azurepowershell-interactive
6067
New-AzStorageAccount -ResourceGroupName exampleGroup -Name examplestore -Location westus -SkuName "Standard_LRS"
6168
```
6269

70+
### Deploy resources by using an ARM template or Bicep file
71+
6372
To deploy an ARM template or Bicep file, use [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
6473

6574
```azurepowershell-interactive
6675
New-AzResourceGroupDeployment -ResourceGroupName exampleGroup -TemplateFile storage.bicep
6776
```
6877

78+
The following example shows the Bicep file named `storage.bicep` that you're deploying:
79+
80+
```bicep
81+
@minLength(3)
82+
@maxLength(11)
83+
param storagePrefix string
84+
85+
var uniqueStorageName = concat(storagePrefix, uniqueString(resourceGroup().id))
86+
87+
resource uniqueStorage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
88+
name: uniqueStorageName
89+
location: 'eastus'
90+
sku: {
91+
name: 'Standard_LRS'
92+
}
93+
kind: 'StorageV2'
94+
properties: {
95+
supportsHttpsTrafficOnly: true
96+
}
97+
}
98+
```
99+
69100
For more information about deploying an ARM template, see [Deploy resources with ARM templates and Azure PowerShell](../templates/deploy-powershell.md).
70101

71102
For more information about deploying a Bicep file, see [Deploy resources with Bicep and Azure PowerShell](../bicep/deploy-powershell.md).
@@ -86,6 +117,13 @@ To get the locks for a resource group, use [Get-AzResourceLock](/powershell/modu
86117
Get-AzResourceLock -ResourceGroupName exampleGroup
87118
```
88119

120+
To delete a lock, use [Remove-AzResourceLock](/powershell/module/az.resources/remove-azresourcelock).
121+
122+
```azurepowershell-interactive
123+
$lockId = (Get-AzResourceLock -ResourceGroupName exampleGroup).LockId
124+
Remove-AzResourceLock -LockId $lockId
125+
```
126+
89127
For more information, see [Lock resources with Azure Resource Manager](lock-resources.md).
90128

91129
## Tag resource groups

0 commit comments

Comments
 (0)