0

When I issue the following command in the Azure Cloud shell:

az group deployment create --resource-group OurResourceGroup --template-file @WebSiteSQLDatabase.json --parameters @WebSiteSQLDatabase.parameters.json

I receive the following error message:

[Errno 36] File name too long: '{\r\n  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#...

The message continues on and outputs the entire template as if that were the filename that was too long. This is clearly a Python error...I have verified that the file is in the right location, and tried several different locations.

I have also tried executing from a URL:

Azure:~$ az group deployment create --resource-group OurResourceGroup --template-uri https://xxxx.file.core.windows.net/cs-xxxx-xxxx/templates/WebSiteSQLDatabase.json

but it returns this message:

HTTP Error 400: The value for one of the HTTP headers is not in the correct format.

Any suggestions would be appreciated.

Chris B. Behrens
  • 6,255
  • 8
  • 45
  • 71

1 Answers1

0

I doubt you need @ in front of the file name. The second error is due to the fact that Azure File is not exposed with HTTP url, you should use blob storage, not file share

error in the template: sql server name cannot contain -
also, it appears that there is some bug in Azure Cli that prevents this from working (doing the same in PS works).

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • Without the @ sign, I get this: malformed node or string: <_ast.Name object at 0x7f364ea86358>. I get the same error if I attempt to use it from blob storage: az group deployment create --resource-group OurResourceGroup --template-uri https://xxx9.blob.core.windows.net/templates/WebSiteSQLDatabase.json. – Chris B. Behrens Aug 01 '18 at 18:54
  • I should also add that this template and parameters file DOES validate correctly. – Chris B. Behrens Aug 01 '18 at 18:55
  • blob has to be publicly available. show the template. – 4c74356b41 Aug 01 '18 at 20:08
  • well, looks like a azure cli bug, nothing we can do about it. deployment works in powershell, doesnt in cli >> obviously bug. you can file a report here: https://github.com/Azure/azure-cli – 4c74356b41 Aug 01 '18 at 20:22
  • I'm getting the same error in Powershell, the malformed node or string one. – Chris B. Behrens Aug 01 '18 at 20:26
  • 1
    ah, that explains. your error is - sql server name cannot contain `-` change that and it will work. or at least you will get another error – 4c74356b41 Aug 01 '18 at 20:31
  • That ultimately was the issue - but the direct answer to my question is that the Bash interface is broken - I am now able to get this to deploy in PS but not in Bash. If you can post that as an answer, I'll mark it as accepted. – Chris B. Behrens Aug 01 '18 at 23:50
  • not exactly sure what you mean by that, but here you go – 4c74356b41 Aug 02 '18 at 05:31