bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Bicep Decompile leaves single quotes on Valid Property Names

Open dciborow opened this issue 3 years ago • 0 comments

Bicep version Bicep CLI version 0.9.1 (a2950a16df)

Describe the bug After running az bicep decompile, property names which are valid are wrapped in single quotes. Particularly, _artifactsLocation and _artifactsLocationSasToken

image

To Reproduce Convert the following file from ARM to Bicep.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
                "description": "Deployment Location"
            }
        },
        "_artifactsLocation": {
            "type": "string",
            "defaultValue": "[deployment().properties.templateLink.uri]",
            "metadata": {
                "description": "The base URI where artifacts required by this template are located including a trailing '/'"
            }
        },
        "_artifactsLocationSasToken": {
            "type": "secureString",
            "defaultValue": "",
            "metadata": {
                "description": "The sasToken required to access _artifactsLocation."
            }
        }
    },
    "resources": []
}

Additional context It may be that these variables are prefixed with "_", but these two are very commonly used. Conversion from ARM to Bicep should not leave issues in the bicep file which can be auto-fixed in the IDE, as they should be fixed for the user during conversion.

dciborow avatar Aug 12 '22 19:08 dciborow