Azure – Certification 70-532-Part 6 – Create a Virtual Machine with Azure Power Shell

Hello Friends,

Hope you all are doing good !!!
Let’s continuing with our posts on Azure Exam 70-532: Developing Microsoft Azure Solutions.
In our last blog, we have discussed about Microsoft service Command Line Interface.In that blog we have discussed how to manage and execute powershell command by browser without configuring the local environment.Today we will discuss, how to configure local environment to support Azure PowerShell script and will go through a example, where we will create a new Azure Virtual Machine using Azure Power Shell from local environment.
If we have not configured the Azure PowerShell yet, Let’s go through the following steps an configure it before proceeding with our example.

  1. To proceed with the Azure PowerShell configuration, let’s have a little information from the this link.From this link we found, that we can download a MSI file and click on it to install the Azure PowerShell. So please download the Azure-Cmdlets-6.11.0.23555-x64.msi and click on it to continue with the installation, as shown in the following figure.

    Download MSI File For Azure PoserShell
    Figure 1: Azure Certification 70-532 – Download MSI File For Azure PoserShell

  2. Allow to proceed with the installation, as in following figure.

    Allow to proceed with installation
    Figure 2: Azure Certification 70-532 – Allow to proced with Installation

  3. Once the Azure PowerShell installation done, we will lunch Window Powershell and try to connect to our azure account by selecting Always run ,if there is no security issue, as in following figure.

    Connect to our Azure Account
    Figure 3: Azure Certification 70-532 – Connect ot our Azure Accoun

  4. Once every thing went well, it will ask us to provide our azure subscription credentials to connect to our Azure account and once, we are authenticated, we are all set to go with our example, as in following figure.

    Provideing the credeitial
    Figure 4: Azure Certification 70-532 – Provide credential

Note :
After November 2018, there will be no new features or cmdlets added to the AzureRM module. AzureRM will continue to be supported and receive bug fixes. New features will be provided in the Az module, which will reach 1.0 at the same time. Az has a backwards compatibility mode with AzureRM, and is designed to be easy to switch to. To learn more about this new module and how to upgrade, see:

If you have deployments that use the classic deployment model that cannot be converted, you can install the Service Management version of Azure PowerShell. For more information, see Install the Azure PowerShell Service Management module.

Now We are ready with our local configuration to execute any powershell script against our Azure Account.as we discussed earlier, today we will move and try to create a new Virtual Machine server using a powershell script.We know that a virtual machine can not be created alone.It has many dependencies like , Resource Group, Stoage Account, Network configuration,IP configuration etc.So before creating the VM , we need to make sure that, all the prerequisites must be in place.
I have downloaded a powershell script created by Mike Pfeiffer and did a little modification.In this powershell script Mike has taken care of all the required prerequisites.
So lets start with the example and execute the following powershell script by providing required parameters.

As Shown in the following figure, We need to provide the required parameters and it will craete all required resources in before hand and then it will proceed to create a new ManasTestVM, as shown in the following figure.

Executing Powershell Script to create new VM
Figure 5: Azure Certification 70-532 – Executing Powershell Script to create new VM

When executing the script file, you might face the following script not digitally signed issue, as shown in the following figure.In that case, we can set “Set-ExecutionPolicy” to unrestricted if it is safe, as shown in the following figure.

Set Execution policy to Unrestricted
Figure 6: Azure Certification 70-532 – Set Execution policy to Unrestricted

Once we have done with the above configuration, we can re execute execute the script and it will ask you the User Name and Password for the new VM and we need to provide the new username and password, as shown in the following figure.

 Asking VM creadentials
Figure 7: Azure Certification 70-532 – Asking VM creadentials

After Some time, we can see our new VM is ready with all configurations, as shown in the following figure.

 VM Created
Figure 8: Azure Certification 70-532 -VM Creatation task is done

 VM Created successfully
Figure 9: Azure Certification 70-532 -VM Creatation successfully done

Thanks for reading 🙂

Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.

Stay tuned on Knowledge-Junction, will come up with more such articles.

More Posts On Exam 70-532: Developing Microsoft Azure Solutions :

Azure – Certification 70-532-Part 1-Create New Azure Virtual Machine

Azure – Certification 70-532-Part 2 – Managing Azure Virtual Machine Disks

Azure – Certification 70-532-Part 3 – Create An Azure Storage Account.

Azure – Certification 70-532-Part 4- Configuring Shared Storage Using Azure File Service

Azure – Certification 70-532-Part 5 – Working with Azure CLI

Azure – Certification 70-532-Part 7 – Deploying a Web App to Azure Virtual Machine with Web Deploy method

Azure – Certification 70-532-Part 8 – Remote debugging on an Azure VM

Azure – Certification 70-532-Part 9 – Azure Automation State Configuration

Azure – Certification 70-532-Part 10 – Configure Azure PowerShell Desired State Configuration (DSC) Through Azure Portal

Advertisements

Comments

5 comments on “Azure – Certification 70-532-Part 6 – Create a Virtual Machine with Azure Power Shell”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.