Goal if this template is to be executed with a managed application deployment from Azure Marketplace.
- Subscription should be allow-listed to use a hidden VM image
- Customer should not be forced to opt in manually
- Template should deploy a single (tiny) VM within the template, which automagically registers the subscription to enlist in the plan
- Post VM deployment, a deploymentScript should delete the VM (and NIC and Disk) again
- To do that, deploymentScript needs Contributor role assignement on managed resource group