user6264
user6264

Reputation: 185

How to add base image to formula in devtest lab using ARM template?

I am trying to create a formula in DevTest lab using ARM. This formula needs base image. I am using customimageid property in as shown below in ARM template.

 "customImageId": "[concat('/customimages/', variables('imageName'))]"

I can create a formula but unable to attach base image to the formula.

Any help can be appriciated. Thank you.

Upvotes: 0

Views: 214

Answers (1)

KrishnaG
KrishnaG

Reputation: 3484

As per this Azure document, customImageId property accepts string value of the custom image identifier of the virtual machine. So I suggest you to give a try by having customImageId something like shown below.

"customImageId": "[resourceId(variables('resourceType'), parameters('existingLabName'), parameters('imageName'))]"

Note: consider above customImageId if you have below resourceType variable in your variables section

"resourceType": "Microsoft.DevTestLab/labs/customimages"

and consider above customImageId if you have below existingLabName and imageName parameters in your parameters section

"existingLabName": {
    "type": "string",
    "metadata": {
        "description": "Name of an existing lab where the custom image will be created."
    }
},
"imageName": {
    "type": "string",
    "metadata": {
        "description": "Name of the custom image being created or updated."
    }
}

Upvotes: 0

Related Questions