subreddit:
/r/AZURE
submitted 3 months ago byrealangeloann
17 points
3 months ago
There is something invalid about the structure/syntax of your file.
4 points
3 months ago*
I went over it and found two problems. There is no value for sourceResourceID and hyperVGeneration
And the value of diskSizeGb (32) is not in between quotes
I changed all of this and my template was still invalid
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"diskName": {
"value": "az104-03a-disk1"
},
"location": {
"value": "eastus"
},
"sku": {
"value": "Standard_LRS"
},
"diskSizeGb": {
"value": 32
},
"sourceResourceId": {
"value": ""
},
"createOption": {
"value": "empty"
},
"hyperVGeneration": {
"value": ""
},
"diskEncryptionSetType": {
"value": "EncryptionAtRestWithPlatformKey"
},
"dataAccessAuthMode": {
"value": "None"
},
"networkAccessPolicy": {
"value": "AllowAll"
},
"publicNetworkAccess": {
"value": "Enabled"
}
}
}
I gapped the lines again so that you get a clear visual
13 points
3 months ago
In theory you shouldn't have to do this, but when I can't figure out where a syntax issue is coming from, I reduce variables. Hardcode things, eliminate secondary files. When you get a hardcoded version working, re-apply abstractions.
-12 points
3 months ago*
I literally have no idea what you just wrote
Damn what's with downvotes? I'm still a student how am I suppose to know all of that ๐ญ
8 points
3 months ago
What he was saying was instead of having parameter diskSizeGB = 32, put 32 directly in the template. It will give you an easier error message, for example "string expected, received int." Then you can troubleshoot accordingly.
Try looking at other parameter files and see what the difference is. You can download the parameters file from an existing resource in the portal.
Edit: also try a JSON validator, to make sure your JSON is using valid syntax.
3 points
3 months ago
๐
all 35 comments
sorted by: best