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/managed-applications/deploy-service-catalog-quickstart.md
+157-8Lines changed: 157 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
2
title: Deploy a service catalog managed application
3
-
description: Describes how to deploy a service catalog's managed application for an Azure Managed Application.
3
+
description: Describes how to deploy a service catalog's managed application for an Azure Managed Application using Azure PowerShell, Azure CLI, or Azure portal.
4
4
author: davidsmatlak
5
5
ms.author: davidsmatlak
6
6
ms.topic: quickstart
7
-
ms.date: 03/14/2023
7
+
ms.date: 03/16/2023
8
8
---
9
9
10
10
# Quickstart: Deploy a service catalog managed application
You use the `$definitionid` variable's value when you deploy the managed application.
57
57
58
+
# [Azure CLI](#tab/azure-cli)
59
+
60
+
To get the managed application's definition with Azure CLI, run the following commands.
61
+
62
+
In Visual Studio Code, open a new Bash terminal session and sign in to your Azure subscription. If you have Git installed, select Git Bash.
63
+
64
+
```azurecli
65
+
az login
66
+
```
67
+
68
+
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).
69
+
70
+
From Azure CLI, get your managed application's definition. In this example, use the resource group name _appDefinitionGroup_ that was created when you deployed the managed application definition.
71
+
72
+
```azurecli
73
+
az managedapp definition list --resource-group appDefinitionGroup
74
+
```
75
+
76
+
The command lists all the available definitions in the specified resource group, like _sampleManagedApplication_.
77
+
78
+
Create a variable for the managed application definition's resource ID.
79
+
80
+
```azurecli
81
+
definitionid=$(az managedapp definition show --resource-group appDefinitionGroup --name sampleManagedApplication --query id --output tsv)
82
+
```
83
+
84
+
You use the `$definitionid` variable's value when you deploy the managed application.
85
+
58
86
# [Portal](#tab/azure-portal)
59
87
60
88
To get the managed application's definition from the Azure portal, use the following steps.
@@ -72,7 +100,7 @@ To get the managed application's definition from the Azure portal, use the follo
72
100
73
101
1. Select **Sample managed application** and then select **Create**.
74
102
75
-
The portal displays the managed application definitions that you created with the quickstart articles to publish an application definition.
103
+
The portal displays the managed application definitions that you published with the quickstart articles.
76
104
77
105
:::image type="content" source="./media/deploy-service-catalog-quickstart/select-service-catalog-managed-application.png" alt-text="Screenshot that shows managed application definitions that you can deploy.":::
The `$mrgprefix` and `$mrgtimestamp` variables are concatenated to create a resource group name like _rg-sampleManagedApplication-20230310100148_ that's stored in the `$mrgname` variable. You use the `$mrgname` variable's value when you deploy the managed application.
130
+
The `$mrgprefix` and `$mrgtimestamp` variables are concatenated to create a managed resource group name like _rg-sampleManagedApplication-20230310100148_ that's stored in the `$mrgname` variable. The name's format `rg-{definitionName}-{dateTime}` is the same format as the portal's default value. You use the `$mrgname` variable's value when you deploy the managed application.
103
131
104
132
You need to provide several parameters to the deployment command for the managed application. You can use a JSON formatted string or create a JSON file. In this example, we use a JSON formatted string. The PowerShell escape character for the quote marks is the backtick (`` ` ``) character. The backtick is also used for line continuation so that commands can use multiple lines.
105
133
@@ -125,6 +153,52 @@ The parameters to create the managed resources:
125
153
-`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. Although you're creating a prefix, the control checks for existing names in Azure and might post a validation message that the name already exists. If so, choose a different prefix.
126
154
-`storageAccountType`: The default is Standard_LRS. The other options are Premium_LRS, Standard_LRS, and Standard_GRS.
127
155
156
+
# [Azure CLI](#tab/azure-cli)
157
+
158
+
Create a resource group for the managed application that's used during the deployment.
159
+
160
+
```azurecli
161
+
az group create --name applicationGroup --location westus3
162
+
```
163
+
164
+
You also need to create a name and path for the managed application resource group. The resource group is created when you deploy the managed application.
165
+
166
+
Run the following commands to create the managed resource group's path.
167
+
168
+
```azurecli
169
+
mrgprefix='rg-sampleManagedApplication-'
170
+
mrgtimestamp=$(date +%Y%m%d%H%M%S)
171
+
mrgname="${mrgprefix}${mrgtimestamp}"
172
+
subid=$(az account list --query [].id --output tsv)
The `mrgprefix` and `mrgtimestamp` variables are concatenated to create a managed resource group name like _rg-sampleManagedApplication-20230310100148_ that's stored in the `mrgname` variable. The name's format:`rg-{definitionName}-{dateTime}` is the same format as the portal's default value. The `mrgname` and `subid` variable's are concatenated to create the `mrgpath` variable value that creates the managed resource group during the deployment.
177
+
178
+
You need to provide several parameters to the deployment command for the managed application. You can use a JSON formatted string or create a JSON file. In this example, we use a JSON formatted string. The PowerShell escape character for the quote marks is the backslash (`\`) character. The backslash is also used for line continuation so that commands can use multiple lines.
For readability, the completed JSON string uses the backtick for line continuation. The values are stored in the `params` variable that's used in the deployment command. The parameters in the JSON string are required to deploy the managed resources.
-`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.
198
+
-`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.
199
+
-`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. Although you're creating a prefix, the control checks for existing names in Azure and might post a validation message that the name already exists. If so, choose a different prefix.
200
+
-`storageAccountType`: The default is Standard_LRS. The other options are Premium_LRS, Standard_LRS, and Standard_GRS.
201
+
128
202
# [Portal](#tab/azure-portal)
129
203
130
204
1. Provide values for the **Basics** tab and select **Next: Web App settings**.
@@ -157,7 +231,7 @@ The parameters to create the managed resources:
157
231
158
232
# [PowerShell](#tab/azure-powershell)
159
233
160
-
Run the following command to deploy the managed application from your Azure PowerShell session.
234
+
Run the following command to deploy the managed application.
161
235
162
236
```azurepowershell
163
237
New-AzManagedApplication `
@@ -175,10 +249,35 @@ The parameters used in the deployment command:
175
249
-`Name`: Specify a name for the managed application. For this example, use _demoManagedApplication_.
176
250
-`ResourceGroupName`: Name of the resource group you created for the managed application.
177
251
-`Location`: Specify the region to deploy the resources. For this example, use _westus3_.
178
-
-`ManagedResourceGroupName`: Uses the `$mrgname`parameters value. The managed resource group is created when the managed application is deployed.
252
+
-`ManagedResourceGroupName`: Uses the `$mrgname`variable's value. The managed resource group is created when the managed application is deployed.
179
253
-`ManagedApplicationDefinitionId`: Uses the `$definitionid` variable's value for the managed application definition's resource ID.
180
254
-`Kind`: Specifies that type of managed application. This example uses _ServiceCatalog_.
181
-
-`Parameter`: Uses the `$parms` variable's value in the JSON formatted string.
255
+
-`Parameter`: Uses the `$params` variable's value in the JSON formatted string.
256
+
257
+
# [Azure CLI](#tab/azure-cli)
258
+
259
+
Run the following command to deploy the managed application.
260
+
261
+
```azurecli
262
+
az managedapp create \
263
+
--name demoManagedApplication \
264
+
--resource-group applicationGroup \
265
+
--location westus3 \
266
+
--managed-rg-id $mrgpath \
267
+
--managedapp-definition-id $definitionid \
268
+
--kind ServiceCatalog \
269
+
--parameters "$params"
270
+
```
271
+
272
+
The parameters used in the deployment command:
273
+
274
+
-`name`: Specify a name for the managed application. For this example, use _demoManagedApplication_.
275
+
-`resource-group`: Name of the resource group you created for the managed application.
276
+
-`location`: Specify the region to deploy the resources. For this example, use _westus3_.
277
+
-`managed-rg-id`: Uses the `$mrgpath` variable's value. The managed resource group is created when the managed application is deployed.
278
+
-`managedapp-definition-id`: Uses the `$definitionid` variable's value for the managed application definition's resource ID.
279
+
-`kind`: Specifies that type of managed application. This example uses _ServiceCatalog_.
280
+
-`parameters`: Uses the `$params` variable's value in the JSON formatted string.
182
281
183
282
# [Portal](#tab/azure-portal)
184
283
@@ -198,7 +297,7 @@ After the deployment is finished, you can check your managed application's statu
198
297
199
298
# [PowerShell](#tab/azure-powershell)
200
299
201
-
Run the following commands to check the managed application's status.
300
+
Run the following command to check the managed application's status.
Run the following command to check the managed application's status.
315
+
316
+
```azurecli
317
+
az managedapp list --resource-group applicationGroup
318
+
```
319
+
320
+
The following command parses the data about the managed application to show only the application's name and provisioning state.
321
+
322
+
```azurecli
323
+
az managedapp list --resource-group applicationGroup --query "[].{Name:name, provisioningState:provisioningState}"
324
+
```
325
+
213
326
# [Portal](#tab/azure-portal)
214
327
215
328
Go to the resource group named **applicationGroup** and select **Overview**. The resource group contains your managed application named _demoManagedApplication_.
@@ -252,6 +365,34 @@ You can also list the deny assignments for the managed resource group.
252
365
Get-AzDenyAssignment -ResourceGroupName $mrgname
253
366
```
254
367
368
+
# [Azure CLI](#tab/azure-cli)
369
+
370
+
To display the managed resource group's resources, run the following command. You created the `$mrgname` variable when you created the parameters.
371
+
372
+
```azurecli
373
+
az resource list --resource-group $mrgname
374
+
```
375
+
376
+
Run the following command to list only the name, type, and provisioning state for the managed resources.
377
+
378
+
```azurecli
379
+
az resource list --resource-group $mrgname --query "[].{Name:name, Type:type, provisioningState:provisioningState}"
380
+
```
381
+
382
+
Run the following command to list the role assignment for the group that was used in the managed application's definition.
383
+
384
+
```azurecli
385
+
az role assignment list --resource-group $mrgname
386
+
```
387
+
388
+
The following command parses the data for the group's role assignment.
389
+
390
+
```azurecli
391
+
az role assignment list --resource-group $mrgname --role Owner --query "[].{ResourceGroup:resourceGroup, GroupName:principalName, RoleDefinition:roleDefinitionId, Role:roleDefinitionName}"
392
+
```
393
+
394
+
To review the managed resource group's deny assignments, use the Azure portal or Azure PowerShell commands.
395
+
255
396
# [Portal](#tab/azure-portal)
256
397
257
398
Go to the managed resource group with the name prefix **rg-sampleManagedApplication** and select **Overview** to display the resources that were deployed. The resource group contains an App Service, App Service plan, and storage account.
@@ -283,6 +424,14 @@ The command prompts you to confirm that you want to remove the resource group.
283
424
Remove-AzResourceGroup -Name applicationGroup
284
425
```
285
426
427
+
# [Azure CLI](#tab/azure-cli)
428
+
429
+
The command prompts for confirmation, and then returns you to command prompt while resources are being deleted.
430
+
431
+
```azurecli
432
+
az group delete --resource-group applicationGroup --no-wait
433
+
```
434
+
286
435
# [Portal](#tab/azure-portal)
287
436
288
437
1. From Azure portal **Home**, in the search field, enter _resource groups_.
0 commit comments