AzureDeploy icon indicating copy to clipboard operation
AzureDeploy copied to clipboard

No HTTP resource was found that matches the request URI

Open Layanshafaamri opened this issue 6 years ago • 10 comments

Hi, I am trying to deploy the template. It does not work. It shows this error:

"Template deployment returned the following errors: 16:06:55 - 4:06:49 PM - Resource Microsoft.Resources/resourceGroups 'lsh' failed with message '{ 16:06:55 - "message": "No HTTP resource was found that matches the request URI 'https://management.azure.com/subscriptions/fcebdb0c-44cf-4d89-8248-e9acdbafd358/resourcegroups/lsh4/providers/Microsoft.Resources/resourceGroups/lsh?api-version=2018-05-01'."

Any idea what is wrong?

Layanshafaamri avatar Aug 26 '18 13:08 Layanshafaamri

looking at the URI you need to target the subscription to make this work and you are targeting the resource group

4c74356b41 avatar Aug 26 '18 14:08 4c74356b41

How can i do that? i just copied the template from GitHub and deployed it. Here is the link 👍 https://github.com/krnese/AzureDeploy/blob/master/ARM/deployments/rgCreate.json

Layanshafaamri avatar Aug 26 '18 14:08 Layanshafaamri

https://docs.microsoft.com/en-us/azure/azure-resource-manager/create-resource-group-in-template

4c74356b41 avatar Aug 26 '18 14:08 4c74356b41

I just copied the template below to Visual Studio" { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.1", "parameters": { "rgName": { "type": "string" }, "rgLocation": { "type": "string" } }, "variables": {}, "resources": [ { "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2018-05-01", "location": "[parameters('rgLocation')]", "name": "[parameters('rgName')]", "properties": {} } ], "outputs": {} }",

I am still getting the same error.

Layanshafaamri avatar Aug 26 '18 14:08 Layanshafaamri

why would it matter if its visual studio or not? read the article I've linked.

4c74356b41 avatar Aug 26 '18 14:08 4c74356b41

I am trying to give you all the information to sort it out accurately. I have seen the the link you have sent me many times while researching, and i still cannot find what is the reason behind the template failure.

Layanshafaamri avatar Aug 26 '18 14:08 Layanshafaamri

you are using wrong command to deploy the template. thats the reason. read the article carefully.

4c74356b41 avatar Aug 26 '18 14:08 4c74356b41

@Layanshafaamri , You are trying to create resource group within a resource group. This template, it creates a resource group and then creates a storage account in that resource group.

If you want the same template to work, New-AzDeployment -TemplateFile .\rgCreate.json -Location "UK SOuth"

Note: Make sure that Storage account name must be between 3 and 24 characters in length.

sraddhananda avatar Jul 16 '19 15:07 sraddhananda

@sraddhananda

I'm trying to deploy the same template but via an azure pipeline task. That fails because my pipeline task as detailed below tries to deploy to a resource group, the same group that it is actually trying to create.

task: AzureResourceGroupDeployment@2 displayName: 'Azure Deployment:Create Resource Group' inputs: azureSubscription: $(azureSubscription) resourceGroupName: $(resourceGroupName) location: $(location) csmFile: '$(System.DefaultWorkingDirectory)/**/container-resourceGroup-template.json' overrideParameters: '-rgName "$(resourceGroupName)" -rgLocation "$(location)"'

Removing the resourceGroupName: $(resourceGroupName) line from above fails because it is a required clause

I did not find a pipeline task for doing subscription level deployments, is there one?

ArindamRayMukherjee avatar Feb 03 '20 10:02 ArindamRayMukherjee

Silly me, I didn't realize that pipeline tasks create a resource group if they do not find one!

ArindamRayMukherjee avatar Feb 03 '20 10:02 ArindamRayMukherjee