The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Virtual Machines!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Deploying a Custome Managed Image With An ARM Template - however the linked subscription 'subscriptions' was not found. RRS feed

  • Question

  • I am currently tring to deploy VM's using an ARM template and a custom VM image captured using the instruction found here. If I run the script as below it fails to deploy the VM's with the following error

    'The client has permission to perform action 'Microsoft.Resources/subscriptions/<subscriptionID>/VMImages/Microsoft.Compute/read' on scope '/subscriptions/<subscriptionID>/resourcegroups/Dev-rg/providers/Microsoft.Compute/virtualMachines/DEPTESTCL1', however the linked subscription 'subscriptions' was not found. "'

    If I hard code the subscription Id the deployment completes and the VM's are created. I have full permission to the Azure subscription (Owner) and there are no restrictions in place. What am I doing wrong?

    I do not want to hard code the subscription ID a this template will be stored in Github

    The issue seems to be here

    "storageProfile": {
              "osDisk": {
                "name": "[concat(variables('vmNamePrefix'), copyIndex(1), '-osdisk')]",
                "createOption": "FromImage",
                "managedDisk": {
                  "storageAccountType": "[parameters('osDiskType')]"
                }
              },
              "imageReference": {
                "id": "[concat('/subscriptions/', variables('subscriptionId'), '/resourceGroups/VMImages/providers/Microsoft.Compute/images', variables('operatingSystemValues')[parameters('operatingSystem')].imageValue)]"
              }
            },


    Monday, December 2, 2019 6:49 PM

All replies

  • HI SuperCoach91,

    Since it works well when you hardcode the subscription id, Can you check if the variable "subscriptionId" is computed for proper value(subscription id) from the inputs provided by the user.

    I think the variable "subscriptionId" has the vaule "subscriptions" instead of the actual subscription id

    Try this out and let me know


    Wednesday, December 4, 2019 5:29 AM
  • HI SuperCoach91,

    is there any update

    Thursday, December 5, 2019 8:53 AM
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

    Thanks.
    Wednesday, December 11, 2019 4:46 AM