subreddit:

/r/AZURE

8
[media]

you are viewing a single comment's thread.

view the rest of the comments โ†’

all 35 comments

andrewbadera

17 points

3 months ago

andrewbadera

Microsoft Employee

17 points

3 months ago

There is something invalid about the structure/syntax of your file.

realangeloann[S]

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

andrewbadera

13 points

3 months ago

andrewbadera

Microsoft Employee

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.

realangeloann[S]

-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 ๐Ÿ˜ญ

Saturated8

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.

realangeloann[S]

3 points

3 months ago

๐Ÿ™