0
votes

I have an Azure template and am attempting to deploy two extra resource groups.

{
  "type": "Microsoft.Resources/resourceGroups",
  "apiVersion": "2019-08-01",
  "location": "eastus",
  "name": "[variables('galleryResourceGroupName')]",
  "properties": {}
},
{
  "type": "Microsoft.Resources/resourceGroups",
  "apiVersion": "2019-08-01",
  "location": "[resourceGroup().location]",
  "name": "[variables('tempResourceGroupName')]",
  "properties": {}
},

When I run this template, the result for these two resources is:

{ "message": "No HTTP resource was found that matches the request URI 'https://management.azure.com/subscriptions/59b4b...9074/resourcegroups/rgMain/providers/Microsoft.Resources/resourceGroups/rgTemp?api-version=2019-08-01'." }

NotFound

The docs say you can deploy a resourceGroup: https://docs.microsoft.com/en-us/azure/templates/microsoft.resources/2019-08-01/resourcegroups

But it is not working... Any ideas why ?

2
How are you deploying this template?Gaurav Mantri
You need to use the complete template, not a part of it. See template. You need to put your groups in the resources.Charles Xu

2 Answers

1
votes

This template is a subscription level template that creates a resource group. In this documentation you can find the ways to deploy this template.

enter image description here

0
votes

From the URI you seem to be targeting another resource group. You can't create a resource group within another resource group. You need to target the subscription instead!