vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[json] VS Code suggests another property when a property's casing is not correct.

Open wenwu449 opened this issue 11 years ago • 3 comments

The error in following JSON against schema is: "resources\properties\osProfile\computername" should be "computerName".

But VS Code shows two errors here:

  1. on "Microsoft.Compute/virtualMachines", error message is: Value is not an accepted Value. Valid values: ["Microsoft.Network/publicIPAddresses"]
  2. on “properties", error message is: Missing property "publicIpAllocationMethod"

It would be good if the error can be on the "computename" or at lease on "osProfile" about missing required property "computerName", ("computerName" is a required property according to schema)

JSON example:

{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [
{ "apiVersion": "2015-06-15", "type": "Microsoft.Compute/virtualMachines", "name": "a", "location": "West US", "properties": { "hardwareProfile": { "vmSize": "Small" }, "osProfile": { "computername": "a", "adminUsername": "a", "adminPassword": "a" }, "storageProfile": { "imageReference": { "publisher": "a", "offer": "a", "sku": "a", "version": "latest" }, "osDisk": { "name": "osdisk", "vhd": { "uri": "[concat('http://', 'b','.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" } }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" } ] }, "diagnosticsProfile": { "bootDiagnostics": { "enabled": "true", "storageUri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net')]" } } } } ] }

wenwu449 avatar Dec 01 '15 19:12 wenwu449

fix delivered

aeschli avatar Dec 03 '15 20:12 aeschli

@aeschli @wenwu449 Can this fix be targeted at a milestone? I'm trying to understand when this would be released, as it is a major roadblock for authoring Azure Resource Manager (ARM) JSON Templates.

screen shot 2015-12-13 at 7 31 57 am

pcgeek86 avatar Dec 13 '15 14:12 pcgeek86

Sorry, the milestone was missing. Fix already got delivered a while ago

aeschli avatar Dec 14 '15 09:12 aeschli