microsoft / vscode-azurearmtools

Azure Resource Manager Tools for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools
MIT License
135 stars 81 forks source link

Template is recognized and reports no problems until Select ParameterFile. #782

Closed Falconwmua closed 4 years ago

Falconwmua commented 4 years ago

Does this occur consistently? Yes Repro steps:

  1. Open template file
  2. Wait for VSCode to recognize it as a Azure Resource Manager Template
    • ARM Template Outline populates, file type and icon change
  3. Go to Parameters section of template, right click to "Select/Create Parameter File..."
  4. VSCode returns notification or error below instead of prompting for parameter file.

Action: azurerm-vscode-tools.selectParameterFile Error type: Error Error Message: "c:\repos\allspice\aspice-armt-partner-env-platformfabric\PlatformFabric.json" does not appear to be an Azure Resource Manager deployment template file.

Version: 0.10.0 OS: win32 OS Release: 10.0.18363 Product: Visual Studio Code Product Version: 1.46.0 Language: en

Call Stack ``` Object. extension.bundle.js:1:596601 fulfilled extension.bundle.js:1:593686 ```
StephenWeatherford commented 4 years ago

@Falconwmua Thanks for taking the time to report this issue! Could you check to see if your template file is saved as UTF-8 with BOM? And if so, consider resaving without the BOM (F1 -> Change File Encoding)? There was a known issue with that which will be fixed in the next release (see https://github.com/microsoft/vscode-azurearmtools/issues/721).

If you need it saved with the BOM, I believe you can change it back after setting up the parameter file association.

Falconwmua commented 4 years ago

That fixed it. I thought I searched but guess not well enough. Was there a related issue with some of the other tooling (CLI/PowerShell) with regards to the UTF-8 with BOM? An engineer brought this up a while back but we couldn't reproduce it and he had upgraded and changed all the files that had the problem.

StephenWeatherford commented 4 years ago

I just deployed one with no problems.