Repository: Azure/bicep

Issue #11683: regression: Deployment: if no parameter file is chosen, should ask for unspecified parameter values but doesn't
Created: 2023-08-30T17:16:20Z
Reported through documentation users: https://github.com/MicrosoftDocs/azure-docs/issues/113981
REPRO:

Deploy the following bicep file:

param p1 int

for "Select a parameter file", select "None"
!) does not ask for a value for p1 and instead deployment just fails:

{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'The value for the template parameter 'p1' at line '1' and column '545' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":1,"linePosition":545,"path":"properties.template.parameters.p1"}}]}}

NOTE: This doesn't repro if you instead specify a parameter file, even if it has no values, e.g.:
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
  }
}

Duplicate issue #12984: Unable to deploy bicep from VS Code w/o parameter file
Created: 2024-01-11T23:32:08Z
Bicep version
Bicep CLI version 0.24.24 (5646341)
Describe the bug
I'm trying to deploy the attached bicep file by right clicking it in VS Code and getting this error.
3:24:42 PM: Preparing for deployment of c:\Users\mjbrown\GitHub\Vector-Search-AI-Assistant-MongoDBvCore\azuredeploynoaoai.bicep
3:24:42 PM: Scope specified in azuredeploynoaoai.bicep -> resourceGroup
3:24:47 PM: No parameter file was provided
3:24:48 PM: Deployment failed for c:\Users\mjbrown\GitHub\Vector-Search-AI-Assistant-MongoDBvCore\azuredeploynoaoai.bicep. Deployment template validation failed: 'The value for the template parameter 'mongoDbUserName' at line '1' and column '1229' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
Status: 400 (Bad Request)
ErrorCode: InvalidTemplate
Content:
{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'The value for the template parameter 'mongoDbUserName' at line '1' and column '1229' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":1,"linePosition":1229,"path":"properties.template.parameters.mongoDbUserName"}}]}}
Headers:
Cache-Control: no-cache
Pragma: no-cache
x-ms-failure-cause: REDACTED
x-ms-ratelimit-remaining-subscription-writes: REDACTED
x-ms-request-id: e6d01872-40fa-464b-a202-8de8e3c2c8f4
x-ms-correlation-request-id: e6d01872-40fa-464b-a202-8de8e3c2c8f4
x-ms-routing-request-id: WESTUS:20240111T232453Z:e6d01872-40fa-464b-a202-8de8e3c2c8f4
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
Date: Thu, 11 Jan 2024 23:24:52 GMT
Content-Type: application/json; charset=utf-8
Expires: -1
Content-Length: 411
To Reproduce
Steps to reproduce the behavior:
Note: I'm attaching an ARM template because GitHub doesn't support uploading bicep files.

Decompile the attached ARM template into Bicep (doesn't matter if this is decompiled or not. I tried this with a handwritten bicep file and got the same error)
Right click the attached bicep file in VS Code.
Let the good times roll.

Additional context
azuredeploynoaoai.json

Closing comment (2024-01-25T17:02:20Z): @puicchan Dupe of #11683, which I guess has fallen to me to fix...