Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This script deploys a managed application definition from the service catalog.
To run this sample, install the latest version of the Azure CLI. To start, run az login to create a connection with Azure.
Samples for the Azure CLI are written for the bash shell. To run this sample in Windows PowerShell or Command Prompt, you may need to change
elements of the script.
If you don't have an Azure subscription, create a trial account before you begin.
Sample script
#!/bin/bash
# Create resource group
az group create --name applicationGroup --location chinaeast
# Get ID of managed application definition
appid=$(az managedapp definition show --name ManagedStorage --resource-group appDefinitionGroup --query id --output tsv)
# Get subscription ID
subid=$(az account show --query id --output tsv)
# Construct the ID of the managed resource group
managedGroupId=/subscriptions/$subid/resourceGroups/infrastructureGroup
# Create the managed application
az managedapp create \
--name storageApp \
--location "chinaeast" \
--kind "Servicecatalog" \
--resource-group applicationGroup \
--managedapp-definition-id $appid \
--managed-rg-id $managedGroupId \
--parameters "{\"storageAccountNamePrefix\": {\"value\": \"demostorage\"}, \"storageAccountType\": {\"value\": \"Standard_LRS\"}}"
Script explanation
This script uses the following command to deploy the managed application. Each command in the table links to command-specific documentation.
| Command | Notes |
|---|---|
| az managedapp create | Create a managed application. Provide the definition ID and parameters for the template. |
Next steps
- For an introduction to managed applications, see Azure Managed Application overview.
- For more information on the Azure CLI, see Azure CLI documentation.