Skip to content

Commit d38c4d6

Browse files
Merge pull request #276600 from davidsmatlak/ds-updates-managedapps-bicep-deploy-20240529
Updates Managed Apps deploy bicep definition
2 parents 22ea308 + 229044b commit d38c4d6

File tree

4 files changed

+75
-88
lines changed

4 files changed

+75
-88
lines changed

articles/azure-resource-manager/managed-applications/deploy-bicep-definition.md

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use Bicep to deploy an Azure Managed Application definition
33
description: Describes how to use Bicep to deploy an Azure Managed Application definition from your service catalog.
44
ms.topic: quickstart
55
ms.custom: devx-track-azurepowershell, devx-track-bicep, devx-track-azurecli
6-
ms.date: 05/12/2023
6+
ms.date: 05/29/2024
77
---
88

99
# Quickstart: Use Bicep to deploy an Azure Managed Application definition
@@ -20,10 +20,10 @@ To deploy a managed application definition from your service catalog, do the fol
2020

2121
To complete the tasks in this article, you need the following items:
2222

23-
- Completed the quickstart to [use Bicep to create and publish](publish-bicep-definition.md) a managed application definition in your service catalog.
23+
- Deployed a definition with [Quickstart: Use Bicep to create and publish an Azure Managed Application definition](publish-bicep-definition.md).
2424
- An Azure account with an active subscription. If you don't have an account, [create a free account](https://azure.microsoft.com/free/) before you begin.
2525
- [Visual Studio Code](https://code.visualstudio.com/) with the latest [Azure Resource Manager Tools extension](https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools). For Bicep files, install the [Bicep extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-bicep).
26-
- Install the latest version of [Azure PowerShell](/powershell/azure/install-az-ps) or [Azure CLI](/cli/azure/install-azure-cli).
26+
- The latest version of [Azure PowerShell](/powershell/azure/install-az-ps) or [Azure CLI](/cli/azure/install-azure-cli).
2727

2828
## Get managed application definition
2929

@@ -39,18 +39,18 @@ Connect-AzAccount
3939

4040
The command opens your default browser and prompts you to sign in to Azure. For more information, go to [Sign in with Azure PowerShell](/powershell/azure/authenticate-azureps).
4141

42-
From Azure PowerShell, get your managed application's definition. In this example, use the resource group name _bicepDefinitionRG_ that was created when you deployed the managed application definition.
42+
From Azure PowerShell, get your managed application's definition. In this example, use the resource group name _bicepDefinitionGroup_ that was created when you deployed the managed application definition.
4343

4444
```azurepowershell
45-
Get-AzManagedApplicationDefinition -ResourceGroupName bicepDefinitionRG
45+
Get-AzManagedApplicationDefinition -ResourceGroupName bicepDefinitionGroup
4646
```
4747

4848
`Get-AzManagedApplicationDefinition` lists all the available definitions in the specified resource group, like _sampleBicepManagedApplication_.
4949

5050
The following command parses the output to show only the definition name and resource group name. You use the names when you deploy the managed application.
5151

5252
```azurepowershell
53-
Get-AzManagedApplicationDefinition -ResourceGroupName bicepDefinitionRG | Select-Object -Property Name, ResourceGroupName
53+
Get-AzManagedApplicationDefinition -ResourceGroupName bicepDefinitionGroup | Select-Object -Property Name, ResourceGroupName
5454
```
5555

5656
# [Azure CLI](#tab/azure-cli)
@@ -65,18 +65,18 @@ az login
6565

6666
The command opens your default browser and prompts you to sign in to Azure. For more information, go to [Sign in with Azure CLI](/cli/azure/authenticate-azure-cli).
6767

68-
From Azure CLI, get your managed application's definition. In this example, use the resource group name _bicepDefinitionRG_ that was created when you deployed the managed application definition.
68+
From Azure CLI, get your managed application's definition. In this example, use the resource group name _bicepDefinitionGroup_ that was created when you deployed the managed application definition.
6969

7070
```azurecli
71-
az managedapp definition list --resource-group bicepDefinitionRG
71+
az managedapp definition list --resource-group bicepDefinitionGroup
7272
```
7373

7474
The command lists all the available definitions in the specified resource group, like _sampleBicepManagedApplication_.
7575

7676
The following command parses the output to show only the definition name and resource group name. You use the names when you deploy the managed application.
7777

7878
```azurecli
79-
az managedapp definition list --resource-group bicepDefinitionRG --query "[].{Name:name, ResourcGroup:resourceGroup}"
79+
az managedapp definition list --resource-group bicepDefinitionGroup --query "[].{Name:name, ResourcGroup:resourceGroup}"
8080
```
8181

8282
---
@@ -157,49 +157,29 @@ For more information about the resource type, go to [Microsoft.Solutions/applica
157157

158158
## Create the parameter file
159159

160-
Open Visual Studio Code and create a parameter file named _deployServiceCatalog.parameters.json_. Copy and paste the following code into the file and save it.
161-
162-
```json
163-
{
164-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
165-
"contentVersion": "1.0.0.0",
166-
"parameters": {
167-
"definitionName": {
168-
"value": "sampleBicepManagedApplication"
169-
},
170-
"definitionRG": {
171-
"value": "bicepDefinitionRG"
172-
},
173-
"managedAppName": {
174-
"value": "sampleBicepManagedApp"
175-
},
176-
"mrgName": {
177-
"value": "<placeholder for managed resource group name>"
178-
},
179-
"appServicePlanName": {
180-
"value": "demoAppServicePlan"
181-
},
182-
"appServiceNamePrefix": {
183-
"value": "demoApp"
184-
},
185-
"storageAccountNamePrefix": {
186-
"value": "demostg1234"
187-
},
188-
"storageAccountType": {
189-
"value": "Standard_LRS"
190-
}
191-
}
192-
}
160+
Open Visual Studio Code and create a parameter file named _deployServiceCatalog-parameters.bicepparam_. Copy and paste the following code into the file and save it.
161+
162+
```bicep
163+
using './deployServiceCatalog.bicep'
164+
165+
param definitionName = 'sampleBicepManagedApplication'
166+
param definitionRG = 'bicepDefinitionGroup'
167+
param managedAppName = 'sampleBicepManagedApp'
168+
param mrgName = 'placeholder for managed resource group name'
169+
param appServicePlanName = 'demoAppServicePlan'
170+
param appServiceNamePrefix = 'demoApp'
171+
param storageAccountNamePrefix = 'demostg1234'
172+
param storageAccountType = 'Standard_LRS'
193173
```
194174

195175
You need to provide several parameters to deploy the managed application:
196176

197177
| Parameter | Value |
198178
| ---- | ---- |
199179
| `definitionName` | Name of the service catalog definition. This example uses _sampleBicepManagedApplication_. |
200-
| `definitionRG` | Resource group name where the definition is stored. This example uses _bicepDefinitionRG_.
180+
| `definitionRG` | Resource group name where the definition is stored. This example uses _bicepDefinitionGroup_.
201181
| `managedAppName` | Name for the deployed managed application. This example uses _sampleBicepManagedApp_.
202-
| `mrgName` | Unique name for the managed resource group that contains the application's deployed resources. The resource group is created when you deploy the managed application. To create a managed resource group name, you can run the commands that follow this parameter list. |
182+
| `mrgName` | Unique name for the managed resource group that contains the application's deployed resources. The resource group is created when you deploy the managed application. To create a managed resource group name, run the commands that follow this parameter list and use the `$mrgname` value to replace the placeholder in the parameters file. |
203183
| `appServicePlanName` | Create a plan name. Maximum of 40 alphanumeric characters and hyphens. For example, _demoAppServicePlan_. App Service plan names must be unique within a resource group in your subscription. |
204184
| `appServiceNamePrefix` | Create a prefix for the plan name. Maximum of 47 alphanumeric characters or hyphens. For example, _demoApp_. During deployment, the prefix is concatenated with a unique string to create a name that's globally unique across Azure. |
205185
| `storageAccountNamePrefix` | Use only lowercase letters and numbers and a maximum of 11 characters. For example, _demostg1234_. During deployment, the prefix is concatenated with a unique string to create a name globally unique across Azure. |
@@ -236,23 +216,30 @@ Use Azure PowerShell or Azure CLI to create a resource group and deploy the mana
236216
# [PowerShell](#tab/azure-powershell)
237217

238218
```azurepowershell
239-
New-AzResourceGroup -Name bicepAppRG -Location westus3
219+
New-AzResourceGroup -Name bicepApplicationGroup -Location westus
220+
221+
$deployparms = @{
222+
ResourceGroupName = "bicepApplicationGroup"
223+
TemplateFile = "deployServiceCatalog.bicep"
224+
TemplateParameterFile = "deployServiceCatalog-parameters.bicepparam"
225+
Name = "deployServiceCatalogApp"
226+
}
240227
241-
New-AzResourceGroupDeployment `
242-
-ResourceGroupName bicepAppRG `
243-
-TemplateFile deployServiceCatalog.bicep `
244-
-TemplateParameterFile deployServiceCatalog.parameters.json
228+
New-AzResourceGroupDeployment @deployparms
245229
```
246230

231+
The `$deployparms` variable uses PowerShell [splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) to improve readability for the parameter values.
232+
247233
# [Azure CLI](#tab/azure-cli)
248234

249235
```azurecli
250-
az group create --name bicepAppRG --location westus3
236+
az group create --name bicepApplicationGroup --location westus
251237
252238
az deployment group create \
253-
--resource-group bicepAppRG \
239+
--resource-group bicepApplicationGroup \
254240
--template-file deployServiceCatalog.bicep \
255-
--parameters @deployServiceCatalog.parameters.json
241+
--parameters deployServiceCatalog-parameters.bicepparam \
242+
--name deployServiceCatalogApp
256243
```
257244

258245
---
@@ -272,27 +259,27 @@ After the deployment is finished, you can check your managed application's statu
272259
Run the following command to check the managed application's status.
273260

274261
```azurepowershell
275-
Get-AzManagedApplication -Name sampleBicepManagedApp -ResourceGroupName bicepAppRG
262+
Get-AzManagedApplication -Name sampleBicepManagedApp -ResourceGroupName bicepApplicationGroup
276263
```
277264

278265
Expand the properties to make it easier to read the `Properties` information.
279266

280267
```azurepowershell
281-
Get-AzManagedApplication -Name sampleBicepManagedApp -ResourceGroupName bicepAppRG | Select-Object -ExpandProperty Properties
268+
Get-AzManagedApplication -Name sampleBicepManagedApp -ResourceGroupName bicepApplicationGroup | Select-Object -ExpandProperty Properties
282269
```
283270

284271
# [Azure CLI](#tab/azure-cli)
285272

286273
Run the following command to check the managed application's status.
287274

288275
```azurecli
289-
az managedapp show --name sampleBicepManagedApp --resource-group bicepAppRG
276+
az managedapp show --name sampleBicepManagedApp --resource-group bicepApplicationGroup
290277
```
291278

292279
The following command parses the data about the managed application to show only the application's name and provisioning state.
293280

294281
```azurecli
295-
az managedapp show --name sampleBicepManagedApp --resource-group bicepAppRG --query "{Name:name, provisioningState:provisioningState}"
282+
az managedapp show --name sampleBicepManagedApp --resource-group bicepApplicationGroup --query "{Name:name, provisioningState:provisioningState}"
296283
```
297284

298285
---
@@ -359,29 +346,29 @@ To review the managed resource group's deny assignments, use the Azure portal or
359346

360347
## Clean up resources
361348

362-
When you're finished with the managed application, you can delete the resource groups and that removes all the resources you created. For example, you created the resource groups _bicepAppRG_ and a managed resource group with the prefix _mrg-bicepManagedApplication_.
349+
When you're finished with the managed application, you can delete the resource groups and that removes all the resources you created. For example, you created the resource groups _bicepApplicationGroup_ and a managed resource group with the prefix _mrg-bicepManagedApplication_.
363350

364-
When you delete the _bicepAppRG_ resource group, the managed application, managed resource group, and all the Azure resources are deleted.
351+
When you delete the _bicepApplicationGroup_ resource group, the managed application, managed resource group, and all the Azure resources are deleted.
365352

366353
# [PowerShell](#tab/azure-powershell)
367354

368355
The command prompts you to confirm that you want to remove the resource group.
369356

370357
```azurepowershell
371-
Remove-AzResourceGroup -Name bicepAppRG
358+
Remove-AzResourceGroup -Name bicepApplicationGroup
372359
```
373360

374361
# [Azure CLI](#tab/azure-cli)
375362

376363
The command prompts for confirmation, and then returns you to command prompt while resources are being deleted.
377364

378365
```azurecli
379-
az group delete --resource-group bicepAppRG --no-wait
366+
az group delete --resource-group bicepApplicationGroup --no-wait
380367
```
381368

382369
---
383370

384-
If you want to delete the managed application definition, delete the resource groups you created named _packageStorageRG_ and _bicepDefinitionRG_.
371+
If you want to delete the managed application definition, delete the resource groups you created named _packageStorageGroup_ and _bicepDefinitionGroup_.
385372

386373
## Next steps
387374

articles/azure-resource-manager/managed-applications/publish-bicep-definition.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use Bicep to create and publish an Azure Managed Application definition
33
description: Describes how to use Bicep to create and publish an Azure Managed Application definition in your service catalog.
44
ms.topic: quickstart
55
ms.custom: devx-track-azurecli, devx-track-azurepowershell, devx-track-bicep
6-
ms.date: 05/24/2024
6+
ms.date: 05/29/2024
77
---
88

99
# Quickstart: Use Bicep to create and publish an Azure Managed Application definition
@@ -379,12 +379,12 @@ The command opens your default browser and prompts you to sign in to Azure. For
379379
After you connect, run the following commands.
380380

381381
```azurepowershell
382-
New-AzResourceGroup -Name packageStorageGroup -Location westus3
382+
New-AzResourceGroup -Name packageStorageGroup -Location westus
383383
384384
$pkgstorageparms = @{
385385
ResourceGroupName = "packageStorageGroup"
386386
Name = "<pkgstorageaccountname>"
387-
Location = "westus3"
387+
Location = "westus"
388388
SkuName = "Standard_LRS"
389389
Kind = "StorageV2"
390390
MinimumTlsVersion = "TLS1_2"
@@ -435,12 +435,12 @@ The command opens your default browser and prompts you to sign in to Azure. For
435435
After you connect, run the following commands.
436436

437437
```azurecli
438-
az group create --name packageStorageGroup --location westus3
438+
az group create --name packageStorageGroup --location westus
439439
440440
az storage account create \
441441
--name <pkgstorageaccountname> \
442442
--resource-group packageStorageGroup \
443-
--location westus3 \
443+
--location westus \
444444
--sku Standard_LRS \
445445
--kind StorageV2 \
446446
--min-tls-version TLS1_2 \
@@ -619,7 +619,7 @@ Create a resource group named _bicepDefinitionGroup_ and deploy the managed appl
619619
# [PowerShell](#tab/azure-powershell)
620620

621621
```azurepowershell
622-
New-AzResourceGroup -Name bicepDefinitionGroup -Location westus3
622+
New-AzResourceGroup -Name bicepDefinitionGroup -Location westus
623623
624624
$deployparms = @{
625625
ResourceGroupName = "bicepDefinitionGroup"
@@ -634,7 +634,7 @@ New-AzResourceGroupDeployment @deployparms
634634
# [Azure CLI](#tab/azure-cli)
635635

636636
```azurecli
637-
az group create --name bicepDefinitionGroup --location westus3
637+
az group create --name bicepDefinitionGroup --location westus
638638
639639
az deployment group create \
640640
--resource-group bicepDefinitionGroup \

articles/azure-resource-manager/managed-applications/publish-service-catalog-app.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create and publish Azure Managed Application in service catalog
33
description: Describes how to create and publish an Azure Managed Application in your service catalog using Azure PowerShell, Azure CLI, or Azure portal.
44
ms.topic: quickstart
55
ms.custom: subject-armqs, devx-track-azurecli, devx-track-azurepowershell, subject-rbac-steps, mode-api, mode-arm, devx-track-arm-template, engagement-fy23
6-
ms.date: 05/24/2024
6+
ms.date: 05/29/2024
77
---
88

99
# Quickstart: Create and publish an Azure Managed Application definition
@@ -275,12 +275,12 @@ Connect-AzAccount
275275
The command opens your default browser and prompts you to sign in to Azure. For more information, go to [Sign in with Azure PowerShell](/powershell/azure/authenticate-azureps).
276276

277277
```azurepowershell
278-
New-AzResourceGroup -Name packageStorageGroup -Location westus3
278+
New-AzResourceGroup -Name packageStorageGroup -Location westus
279279
280280
$pkgstorageparms = @{
281281
ResourceGroupName = "packageStorageGroup"
282282
Name = "<pkgstorageaccountname>"
283-
Location = "westus3"
283+
Location = "westus"
284284
SkuName = "Standard_LRS"
285285
Kind = "StorageV2"
286286
MinimumTlsVersion = "TLS1_2"
@@ -323,12 +323,12 @@ az login
323323
The command opens your default browser and prompts you to sign in to Azure. For more information, go to [Sign in with Azure CLI](/cli/azure/authenticate-azure-cli).
324324

325325
```azurecli
326-
az group create --name packageStorageGroup --location westus3
326+
az group create --name packageStorageGroup --location westus
327327
328328
az storage account create \
329329
--name <pkgstorageaccountname> \
330330
--resource-group packageStorageGroup \
331-
--location westus3 \
331+
--location westus \
332332
--sku Standard_LRS \
333333
--kind StorageV2 \
334334
--min-tls-version TLS1_2 \
@@ -485,7 +485,7 @@ In the portal, the group ID and role ID are configured when you publish the mana
485485
Create a resource group for your managed application definition.
486486

487487
```azurepowershell
488-
New-AzResourceGroup -Name appDefinitionGroup -Location westus3
488+
New-AzResourceGroup -Name appDefinitionGroup -Location westus
489489
```
490490

491491
The `blob` command creates a variable to store the URL for the package _.zip_ file. That variable is used in the command that creates the managed application definition.
@@ -495,7 +495,7 @@ $blob = Get-AzStorageBlob -Container appcontainer -Blob app.zip -Context $pkgsto
495495
496496
$publishparms = @{
497497
Name = "sampleManagedApplication"
498-
Location = "westus3"
498+
Location = "westus"
499499
ResourceGroupName = "appDefinitionGroup"
500500
LockLevel = "ReadOnly"
501501
DisplayName = "Sample managed application"
@@ -523,7 +523,7 @@ Some of the parameters used in the preceding example are:
523523
Create a resource group for your managed application definition.
524524

525525
```azurecli
526-
az group create --name appDefinitionGroup --location westus3
526+
az group create --name appDefinitionGroup --location westus
527527
```
528528

529529
The `blob` command creates a variable to store the URL for the package _.zip_ file. That variable is used in the command that creates the managed application definition.
@@ -537,7 +537,7 @@ blob=$(az storage blob url \
537537
538538
az managedapp definition create \
539539
--name "sampleManagedApplication" \
540-
--location "westus3" \
540+
--location "westus" \
541541
--resource-group appDefinitionGroup \
542542
--lock-level ReadOnly \
543543
--display-name "Sample managed application" \

0 commit comments

Comments
 (0)