none
issues with "az group deployment create" RRS feed

  • Question

  • I downloaded azuredeploy0801.json and azuredeploy0801.parameters.json to my azure account

    from Microsoftlearning github 

    Here is the file structure: 

    842c589-aa91-4f53-9b95-36b50e43@Azure:~$ ls
    azuredeploy0401.json           azuredeploy0801.json             clouddrive      packer
    azuredeploy04.parameters.json  azuredeploy0801.parameters.json  cloud-init.txt  packer_1.3.1_linux_amd64.zip

    why did I get the following error message?

    a842c589-aa91-4f53-9b95-36b50e43@Azure:~$ az group deployment create --resource-group az3000801-LabRG --template-file azuredeploy0801.json --parameters @azuredeploy0801.parameters.json
    Failed to parse azuredeploy0801.json with exception:
        Expecting value: line 7 column 1 (char 6)

    Thanks!

    Thursday, September 5, 2019 3:43 AM

All replies

  • Hi Erik,

    With below templates which were downloaded from here, tried to create a deployment with in the Cloud Shell (Bash version) in the Azure portal. Uploaded the below templates with in the Cloud shell in the azure portal and ran the command and the deployment did work and resources where deployed in the respective resource group , except the NRMS-Rule-103 (security Rule). 

    az group deployment create --resource-group myresourcegroup --template-file azuredeploy0801.json --parameters azuredeploy0801.parameters.json

    azuredeploy0801

    {
    	"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    	"contentVersion": "1.0.0.0",
    	"parameters": {
    		"virtualNetworkName": {
    			"type": "string",
    			"defaultValue": "az3000801-vnet",
    			"metadata": {
    				"description": "This is the name of the Virtual Network"
    			}
    		},
    		"networkInterfaceName": {
    			"type": "string",
    			"defaultValue": "az3000801-nic",
    			"metadata": {
    				"description": "This is the prefix name of the Network interfaces"
    			}
    		},
    		"vmNamePrefix": {
    			"type": "string",
    			"defaultValue": "az3000801-vm",
    			"metadata": {
    				"description": "Prefix to use for VM names"
    			}
    		},
    		"adminUsername": {
    			"type": "string",
    			"metadata": {
    				"description": "Admin username"
    			}
    		},
    		"adminPassword": {
    			"type": "securestring",
    			"metadata": {
    				"description": "Admin password"
    			}
    		},
    		"imagePublisher": {
    			"type": "string",
    			"defaultValue": "MicrosoftWindowsServer",
    			"metadata": {
    				"description": "Image Publisher"
    			}
    		},
    		"imageOffer": {
    			"type": "string",
    			"defaultValue": "WindowsServer",
    			"metadata": {
    				"description": "Image Offer"
    			}
    		},
    		"imageSKU": {
    			"type": "string",
    			"defaultValue": "2016-Datacenter",
    			"metadata": {
    				"description": "Image SKU"
    			}
    		},
    		"vmSize": {
    			"type": "string",
    			"defaultValue": "Standard_DS1_v2",
    			"metadata": {
    				"description": "This is the VM size"
    			}
    		},
    		"modulesUrl": {
    			"type": "string",
    			"metadata": {
    				"description": "URL for the DSC configuration module"
    			}
    		},
    		"configurationFunction": {
    			"type": "string",
    			"defaultValue": "ContosoWebsite.ps1\\ContosoWebsite",
    			"metadata": {
    				"description": "DSC configuration function to call"
    			}
    		}
    	},
    	"variables": {
    		"availabilitySetName": "az3000801-avset",
    		"subnet0Name": "web",
    		"subnet1Name": "app",
    		"subnet2Name": "database",
    		"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',parameters('virtualNetworkName'))]",
    		"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables ('subnet0Name'))]",
    		"numberOfInstances": 2,
    		"networkSecurityGroupName": "az3000801-web-nsg",
    		"vmExtensionName": "dscExtension"
    	},
    	"resources": [
    		{
    			"type": "Microsoft.Compute/availabilitySets",
    			"name": "[variables('availabilitySetName')]",
    			"apiVersion": "2018-06-01",
    			"location": "[resourceGroup().location]",
    			"sku": {
    				"name": "Aligned"
    			},
    			"properties": {
    				"platformFaultDomainCount": "2",
    				"platformUpdateDomainCount": "5"
    			}
    		},
    		{
    			"apiVersion": "2018-08-01",
    			"type": "Microsoft.Network/virtualNetworks",
    			"name": "[parameters('virtualNetworkName')]",
    			"location": "[resourceGroup().location]",
    			"properties": {
    				"addressSpace": {
    					"addressPrefixes": [
    						"10.0.0.0/22"
    					]
    				},
    				"subnets": [
    					{
    						"name": "[variables('subnet0Name')]",
    						"properties": {
    							"addressPrefix": "10.0.0.0/24"
    						}
    					},
    					{
    						"name": "[variables('subnet1Name')]",
    						"properties": {
    							"addressPrefix": "10.0.1.0/24"
    						}
    					},
    					{
    						"name": "[variables('subnet2Name')]",
    						"properties": {
    							"addressPrefix": "10.0.2.0/24"
    						}
    					}
    				]
    			}
    		},
    		{
    			"apiVersion": "2018-08-01",
    			"type": "Microsoft.Network/networkInterfaces",
    			"name": "[concat(parameters('networkInterfaceName'), copyindex())]",
    			"location": "[resourceGroup().location]",
    			"copy": {
    				"name": "nicLoop",
    				"count": "[variables('numberOfInstances')]"
    			},
    			"dependsOn": [
    				"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
    			],
    			"properties": {
    				"ipConfigurations": [
    					{
    						"name": "ipconfig1",
    						"properties": {
    							"privateIPAllocationMethod": "Dynamic",
    							"subnet": {
    								"id": "[variables('subnetRef')]"
    							}
    						}
    					}
    				],
    				"networkSecurityGroup": {
    					"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
    				}
    			}
    		},
    		{
    			"apiVersion": "2018-06-01",
    			"type": "Microsoft.Compute/virtualMachines",
    			"name": "[concat(parameters('vmNamePrefix'), copyindex())]",
    			"copy": {
    				"name": "virtualMachineLoop",
    				"count": "[variables('numberOfInstances')]"
    			},
    			"location": "[resourceGroup().location]",
    			"dependsOn": [
    				"[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'), copyindex())]",
    				"[concat('Microsoft.Compute/availabilitySets/', variables('availabilitySetName'))]"
    			],
    			"properties": {
    				"availabilitySet": {
    					"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('availabilitySetName'))]"
    				},
    				"hardwareProfile": {
    					"vmSize": "[parameters('vmSize')]"
    				},
    				"osProfile": {
    					"computerName": "[concat(parameters('vmNamePrefix'), copyIndex())]",
    					"adminUsername": "[parameters('adminUsername')]",
    					"adminPassword": "[parameters('adminPassword')]"
    				},
    				"storageProfile": {
    					"imageReference": {
    						"publisher": "[parameters('imagePublisher')]",
    						"offer": "[parameters('imageOffer')]",
    						"sku": "[parameters('imageSKU')]",
    						"version": "latest"
    					},
    					"osDisk": {
    						"createOption": "FromImage"
    					}
    				},
    				"networkProfile": {
    					"networkInterfaces": [
    						{
    							"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('networkInterfaceName'),copyindex()))]"
    						}
    					]
    				}
    			}
    		},
    		{
    			"name": "[variables('networkSecurityGroupName')]",
    			"type": "Microsoft.Network/networkSecurityGroups",
    			"apiVersion": "2018-08-01",
    			"location": "[resourceGroup().location]",
    			"comments": "Network Security Group (NSG) for Primary NIC",
    			"properties": {
    				"securityRules": [
    					{
    						"name": "custom-allow-rdp",
    						"properties": {
    							"priority": 1000,
    							"sourceAddressPrefix": "*",
    							"protocol": "Tcp",
    							"destinationPortRange": "3389",
    							"access": "Allow",
    							"direction": "Inbound",
    							"sourcePortRange": "*",
    							"destinationAddressPrefix": "*"
    						}
    					},
    					{
    						"name": "custom-allow-http",
    						"properties": {
    							"priority": 1100,
    							"sourceAddressPrefix": "*",
    							"protocol": "Tcp",
    							"destinationPortRange": "80",
    							"access": "Allow",
    							"direction": "Inbound",
    							"sourcePortRange": "*",
    							"destinationAddressPrefix": "*"
    						}
    					}
    				]
    			}
    		},
    		{
    			"type": "Microsoft.Compute/virtualMachines/extensions",
    			"name": "[concat(parameters('vmNamePrefix'), copyindex(), '/', variables('vmExtensionName'))]",
    			"copy": {
    				"name": "virtualMachineExtensionLoop",
    				"count": "[variables('numberOfInstances')]"
    			},
    			"apiVersion": "2018-06-01",
    			"location": "[resourceGroup().location]",
    			"dependsOn": [
    				"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNamePrefix'), copyindex())]"
    			],
    			"properties": {
    				"publisher": "Microsoft.Powershell",
    				"type": "DSC",
    				"typeHandlerVersion": "2.76",
    				"autoUpgradeMinorVersion": true,
    				"settings": {
    					"ModulesUrl": "[parameters('modulesUrl')]",
    					"ConfigurationFunction": "[parameters('configurationFunction')]",
    					"Properties": {
    						"MachineName": "[concat(parameters('vmNamePrefix'), copyindex())]"
    					}
    				},
    				"protectedSettings": null
    			}
    		}
    	]
    }

    azuredeploy0801.parameters

    {
    	"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    	"contentVersion": "1.0.0.0",
    	"parameters": {
    		"adminUsername": {
    			"value": "Student"
    		},
    		"adminPassword": {
    			"value": "Pa55w.rd1234"
    		},
    		"modulesUrl": {
    			"value": "https://github.com/Azure/azure-quickstart-templates/raw/master/dsc-extension-iis-server-windows-vm/ContosoWebsite.ps1.zip"
    		},
    		"configurationFunction": {
    			"value": "ContosoWebsite.ps1\\ContosoWebsite"
    		}
    	}
    }

    Hope this information helps, however if you are still seeing the issue please feel free to revert back. Thanks 


    Wednesday, September 11, 2019 4:51 PM
    Owner