Containers (1 / 61): You have just deployed several Azure resources within the DemoResourceGroup resource group and you want to capture the template that Azure Resource Manager used for the deployment for future use. How can you accomplish this efficiently?
Answer:
The az deployment group export command is used to export the template that was used for a specific deployment. This command allows you to capture the exact template used by Azure Resource Manager for that particular deployment.
Using the Azure portal to manually copy the JSON of the deployment template also is valid way to do it, but is a manual process and inefficient.
az group export --name DemoResourceGroup and Export-AzResourceGroup -Name DemoResourceGroup export the resource group (which may include many deployments), not a specific deployment template.