5

I am trying to deploy multiple LogicApps and other resources together from a single ARM Template. When i try to do a Test-AzureRmResourceGroupDeployment with the template that i created it throws this error

Code    : InvalidTemplate
Message : Deployment template validation failed: 'The template resource 'MyLogicApp' at line '159' and column '9' is not valid: The resource identificator
          '/subscriptions/8a506831-cc80-4512-b51b-6ed4cc32b2cd/resourceGroups/arm/providers/Microsoft.Web/' is malformed. Please see https://aka.ms/arm-template-expressions/#reference for usage
          details.. Please see https://aka.ms/arm-template-expressions for usage details.'.

This is the block where the resource is created from my code.

enter image description here

I cannot seem to find any resource regarding this. Please help. Thanks

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
HariHaran
  • 3,642
  • 2
  • 16
  • 33

1 Answers1

3

Somewhere in the template you constructed resourceId poorly:

/subscriptions/8a506831-cc80-4512-b51b-6ed4cc32b2cd/resourceGroups/arm/providers/Microsoft.Web/

it should end with a resource name. hard to tell when you do not provide the template.

In this case one of the parameters passed to the template was empty, hence this error indicating that there is no name for the resource.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • this is fine right `"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/',resourceGroup().location,'/managedApis/servicebus')]",` – HariHaran Sep 10 '18 at 13:09
  • eh, i'm unaware how this particular ID should be constructed, but usually, it should be `subscriptions/GUID/resourceGroups/name/providers/type/name` yours is `subscriptions/GUID/providers/type/random/subtype/name` – 4c74356b41 Sep 10 '18 at 13:17
  • I had seperatetemplates for all logic apps , it isworking fine when deployed. But i have combined it now , i cannot seem to find the error . The construction of this line i provided is same on seperate as well as combined one – HariHaran Sep 10 '18 at 13:27
  • i wont be able to help without the full template. you have an error in the template. – 4c74356b41 Sep 10 '18 at 13:33
  • Here's the template @4c74356b41 https://gist.github.com/hariharan618/887c3360d1318f6d5863e9df578c190b – HariHaran Sep 10 '18 at 13:41
  • i just looked through it and dont get any error. tried deploying it and it did pass validation. not sure are you trying the same version? – 4c74356b41 Sep 10 '18 at 13:54
  • i get the same error while i do `Test-AzureRmResourceGroupDeployment` i am using vscode – HariHaran Sep 10 '18 at 13:57
  • I am getting same error in PowerShell ISE too https://imgur.com/a/SZ6I21G – HariHaran Sep 10 '18 at 14:03
  • 2
    are you passing an empty string to one of the parameters? – 4c74356b41 Sep 10 '18 at 14:04
  • Thanks alot man, it seems some params were empty. Thanks alot – HariHaran Sep 10 '18 at 14:09
  • if you update the answer i can accept it and it will help others in future – HariHaran Sep 10 '18 at 14:15
  • thanks, did that, i'd appreciate an upvote as well ;) – 4c74356b41 Sep 10 '18 at 14:22