0

I have contributor access. When I try to download an ARM template from azure portal, I get "access denied : 401" error. What could be the reason and how can I fix it? Strangely no one had this issue on google.

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30
Blue Clouds
  • 7,295
  • 4
  • 71
  • 112
  • use developer tools to find out the actual error behind the 401? I doubt anyone would be able to help you based on this vague description – 4c74356b41 Jan 27 '20 at 15:54
  • I second this. The reason for the 401 is generally in the response and usually tells you exactly what permission you don't have. – Brian Hauger Jan 29 '20 at 00:17

1 Answers1

0

You can also use Azure CLI, Azure PowerShell, or REST API to export ARM templates.

Azure CLI:

echo "Enter the Resource Group name:" &&
read resourceGroupName &&
az group export --name $resourceGroupName

The script displays the template on the console. Copy the JSON, and save as a file.

Note: The export template feature doesn't support exporting Azure Data Factory resources.

Azure Powershell:

To export all resources in a resource group, use the Export-AzResourceGroup cmdlet and provide the resource group name.

$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name"

Export-AzResourceGroup -ResourceGroupName $resourceGroupName

It saves the template as a local file. More options here.

REST API:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate?api-version=2019-10-01

Captures the specified resource group as a template. API Reference here.

Bhargavi Annadevara
  • 4,923
  • 2
  • 13
  • 30