none
Powershell Script for creating a VM using shared Gallery Image RRS feed

All replies

  • Hi, Thanks for reaching out.
    Can you please share the following so that I can help you better:

    1. What errors are you seeing?

    2. Please share the specific step in the doc where you are stuck and not able to proceed.

    3. Are you using Azure cloud shell?

    Tuesday, August 13, 2019 11:37 PM
    Moderator
  • Hi Karishma Tiwari,

    Thanks for the mail,

    1. I am not able to fetch the image id from my shared gallery. 

    2. https://docs.microsoft.com/en-us/azure/virtual-machines/windows/shared-images#create-vms-from-an-image

    3. Yes am using Azure cloud shell.


    Wednesday, August 14, 2019 5:48 AM
  • Thank you for providing the answers. 
    You mentioned that you are not able to fetch the image id to be used in the next step of creating VM from the image : https://docs.microsoft.com/en-us/azure/virtual-machines/windows/shared-images#create-vms-from-an-image 

    Please refer to the the comment on this post, which says, use the following command to get the image versions: : $imageVersions = Get-AzResource -ResourceType Microsoft.Compute/galleries/images/versions

    I want to make sure that I am understanding your issue right. Can you please also confirm if you are trying to create a VM in a different subscription but under the same tenant and receiving the following error: New-AzVm : The image subscription doesn't match the current subscription?

    If that's the case, please refer to the following thread comment on the same
    https://github.com/Azure/azure-powershell/issues/8670#issuecomment-494637394

    Please let me know if you have any questions and we can dig deeper into the issue. Thanks.

    Wednesday, August 14, 2019 8:56 PM
    Moderator
  • Any update on this? 
    Thursday, August 15, 2019 9:42 PM
    Moderator
  • Any update on this? 

    If the proposed answer was useful, please remember to "Up-Vote" and "Mark as Answer" so others in the community can benefit 

    Thursday, August 22, 2019 10:08 PM
    Moderator
  • Hello,

    Any update on the issue?

    If your issue is resolved with the provided suggestion, do click “Mark as Answer” and "Up-Vote" on the post that helped you, so that other forum members can benefit from it.

    Thanks.
    Wednesday, August 28, 2019 11:11 AM
    Moderator
  • Hi 

    Sorry for the delay in reply. 

    No the issue is still there. Can you please provide me the automated script to use a shared gallery image to create a VM.

    Thanks,

    Karthik.T

    Wednesday, September 4, 2019 5:39 AM
  • Hi Karthikeya,

    Looking at Karishma's last post, can you confirm on this part: 

    "Can you please also confirm if you are trying to create a VM in a different subscription but under the same tenant and receiving the following error: New-AzVm : The image subscription doesn't match the current subscription?

    If that's the case, please refer to the following thread comment on the same
     : https://github.com/Azure/azure-powershell/issues/8670#issuecomment-494637394"

    Wednesday, September 4, 2019 5:27 PM
    Moderator