Share via

Az customization scripts not running

Soumyadip Chatterjee 41 Reputation points
2022-03-06T21:09:48.803+00:00

Hi Team,
Not able to execute the below scipts from Cloudshell as follows :-

az vm create --resource-group "TutorialResources" --name "TutorialResources-win-cli" --image "win2016datacenter" --public-ip-sku Standard --admin-username "windowsusr"

Thus please assist me so that I can configure the same through Powershell .

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,861 Reputation points Microsoft Employee Moderator
    2022-03-07T01:21:32.587+00:00

    Hello, @Soumyadip Chatterjee !

    Using the Azure CLI, you'll need to create the resource group before you create the VM or else you'll get a ResourceGroupNotFound error. Here is your script with an added line to create a resource group:

    az group create --name kobullocMyResourceGroup --location eastus  
      
    az vm create --resource-group kobullocMyResourceGroup --name kobullocMyVM --image Win2019Datacenter --public-ip-sku Standard --admin-username azureuser  
    

    For additional information, you can check out the documentation on creating a VM using Azure CLI:
    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/quick-create-cli

    180473-image.png

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.