{
    "id": "0c058fc3-a343-4bf1-9444-d0175f6baab9",
    "name": "Deploy Simple Virtual Machines",
    "slug": "deploy-simple-virtual-machines",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "1a20bc1a-9d44-4503-95f2-3de135097a2e",
            "0fafa2f2-99f0-42eb-98ff-a5f046da20e1"
        ],
        "pta_sdn": "142",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-08-18T20:44:37.741962Z",
    "modified": "2023-10-03T18:58:29.170628Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
    "learning_areas": [
        {
            "id": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
            "name": "Cloud",
            "slug": "cloud"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": true,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "# Provision Virtual Machines\n\n**Objective** : Provision Virtual Machines",
    "description_html": "<h1>Provision Virtual Machines</h1>\n<p><strong>Objective</strong> : Provision Virtual Machines</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-04-07T18:00:00Z",
    "solutions": "# Solution\n\n## Create a virtual machine using Azure Portal, Azure CLI and Azure PowerShell\n\n\n**Step 1:** Start the lab, agree after reading terms and conditions and check the credential/URL provided on the page.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/1.png)\n\n\n**Step 2:** Open the Login URL link in incognito (Right click on the URL and select Open link in incognito Window option).\n\nThe URL will take you to the Azure Portal login page. Use the provided username and password to login into it.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/2_1.png)\n\nEnter password \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/2_2.png)\n\n**Step 3:** An empty resource group  will be visible. Click on Create option to create aVirtual Network, Storage Account and virtual machine\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/3.png)\n\n**Step 4:** Create a Virtual Machine as shown below\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/4.png)\n\nSelect Size as shown below\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/5.png)\n\nEnter the administrative details and Click on **Review and Create** \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/7.png)\n\nAfter successful Validation Click **Create** \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/6.png)\n\nNavigate to your Resource for more details. Click on **Connect** option, select **Bastion**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/8.png)\n\n**Step 5:** Select **Create Azure Bastion using Defaults**. It uses default Subnet to create Bastion and connect to the Virtual Machine. It may take a few minutes\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/9.png)\n\nEnter username and Password and Click **Connect**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/10.png)\n\nOnce connected, Open powershell and enter the command given below to verify Azure agent Related Windows Services\n\n````\nGet-Service | ? {$_.Name -like \"*Azure*\"} | Select Name\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/27.png)\n\n**Step 6:** Deploy a Virtual Machine using **Azure CLI**. Install Azure CLI using the **Appendix A** below\n\n**Step 7:** Login to your account using azure command\n\n````\naz login\n````\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/15.png)\n\n````\naz vm create -n <virtual-machine-name> -g <resource-group-name> --image Canonical:UbuntuServer:18.04-LTS:latest -l <location> --authentication-type password --admin-username <administrator-username> --admin-password <password> --vnet-name <virtual-network-name> --subnet <subnet-name> --public-ip-address <public-ip-name>  --public-ip-sku Standard --size Standard_B1s\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/16.png)\n\n\n**Note** Use Virtual network and Subnet Created in Step 4\n\nNavigate to Azure Portal and verify your Virtual Machine. Click on **Connect**. Select **Bastion**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/17.png)\n\nEnter Aministrative Credentials and Click **Connect**\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/18.png)\n\nOnce you access your Virtual Machine, verify the running to azure related linux daemon using the following command\n\n````\nps -aux | grep waagent\n````\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/19.png)\n\n**Step 8:** Delete the Resources. Navigate to your Virtual Machine, Click on **Delete** option in \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/20.png)\n\nNavigate to Public ip. Click on **Delete** option\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/21.png)\n\nNaviagte to Network Security Group. Click on **Delete** option \n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/22.png)\n\n**Step 9:** Deploy Virtual Machine using **Azure Powershell** or **Azure Bash** Terminal\n\nProvide the Credentials for Administrative account using the azure command\n\n````\n$cred =  Get-Credential\n````\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/24.png)\n\nConnect to your Account using the azure command\n\n````\nConnect-AzAccount\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/25.png)\n\nCreate a Virtual Machine using the following command\n\n````\nNew-AzVm -ResourceGroupName <resource-group-name> -Location <location-name> -Credential $cred -Image Win2016Datacenter -Name <virtual-machine-name> -VirtualNetworkName <virtual-Network-Name> -SubnetName <default> -PublicIpAddressName <public-ip-name> -OpenPorts 3389 -Size Standard_B1s\n````\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/26.png)\n\n**Note** Use Virtual network and Subnet Created in Step 4\n\n**Step 10:**  Naviagte to Azure Portal. Delete the resources using **Delete** option (Shown in Step 8)\n\n# Conclusion \n\nIn this way you can Create a virtual machine,storage account and virtual network, configure storage endpoints for Storage Account in the Virtual Network. Verfiy using the virtual Machine\n\n## Appendix A : Install Azure CLI\n\n1.For Windows, the Azure CLI is installed via a MSI, which gives you access to the CLI through the Windows Command Prompt (CMD) or PowerShell.\n\n    2. Download the latest release of Azure CLI from https://aka.ms/installazurecliwindows. An MSI file will be downloaded as shown below\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/12.png)\n\n    3. Open the msi file and It will prepare to install cli on your local machine. Accept the terms and conditions. Click on install\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/13.png)\n\n    4.When the installer asks if it can make changes to your computer, click the \"Yes\" box. After the installation is complete, you will need to close and reopen any active Windows Command Prompt or PowerShell windows to use the Azure CLI.\n\n    5. For the macOS platform, you can install the Azure CLI with Homebrew package Managers which used to manage your CLI installation.\n\n    6.Download homebrew from https://docs.brew.sh/Installation.html\n\n    7.Install brew by using following command in bash\n\n````\nbrew update && brew install azure-cli\n````\n    8.For Ubuntu/Debian platform, Installation can be done with one command given below.\n    \n    This script is downloaded via curl and piped directly to bash to install the CLI.\n\n````\ncurl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash\n````  \n\n    9. You can check if the installation is successful with any azure command.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/14.png)",
    "solutions_html": "<h1>Solution</h1>\n<h2>Create a virtual machine using Azure Portal, Azure CLI and Azure PowerShell</h2>\n<p><strong>Step 1:</strong> Start the lab, agree after reading terms and conditions and check the credential/URL provided on the page.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/1.png\" /></p>\n<p><strong>Step 2:</strong> Open the Login URL link in incognito (Right click on the URL and select Open link in incognito Window option).</p>\n<p>The URL will take you to the Azure Portal login page. Use the provided username and password to login into it.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/2_1.png\" /></p>\n<p>Enter password </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/2_2.png\" /></p>\n<p><strong>Step 3:</strong> An empty resource group  will be visible. Click on Create option to create aVirtual Network, Storage Account and virtual machine</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/3.png\" /></p>\n<p><strong>Step 4:</strong> Create a Virtual Machine as shown below</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/4.png\" /></p>\n<p>Select Size as shown below</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/5.png\" /></p>\n<p>Enter the administrative details and Click on <strong>Review and Create</strong> </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/7.png\" /></p>\n<p>After successful Validation Click <strong>Create</strong> </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/6.png\" /></p>\n<p>Navigate to your Resource for more details. Click on <strong>Connect</strong> option, select <strong>Bastion</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/8.png\" /></p>\n<p><strong>Step 5:</strong> Select <strong>Create Azure Bastion using Defaults</strong>. It uses default Subnet to create Bastion and connect to the Virtual Machine. It may take a few minutes</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/9.png\" /></p>\n<p>Enter username and Password and Click <strong>Connect</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/10.png\" /></p>\n<p>Once connected, Open powershell and enter the command given below to verify Azure agent Related Windows Services</p>\n<pre class=\"codehilite\"><code>Get-Service | ? {$_.Name -like \"*Azure*\"} | Select Name</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/27.png\" /></p>\n<p><strong>Step 6:</strong> Deploy a Virtual Machine using <strong>Azure CLI</strong>. Install Azure CLI using the <strong>Appendix A</strong> below</p>\n<p><strong>Step 7:</strong> Login to your account using azure command</p>\n<p><pre class=\"codehilite\"><code>az login</code></pre>\n<img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/15.png\" /></p>\n<pre class=\"codehilite\"><code>az vm create -n &lt;virtual-machine-name&gt; -g &lt;resource-group-name&gt; --image Canonical:UbuntuServer:18.04-LTS:latest -l &lt;location&gt; --authentication-type password --admin-username &lt;administrator-username&gt; --admin-password &lt;password&gt; --vnet-name &lt;virtual-network-name&gt; --subnet &lt;subnet-name&gt; --public-ip-address &lt;public-ip-name&gt;  --public-ip-sku Standard --size Standard_B1s</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/16.png\" /></p>\n<p><strong>Note</strong> Use Virtual network and Subnet Created in Step 4</p>\n<p>Navigate to Azure Portal and verify your Virtual Machine. Click on <strong>Connect</strong>. Select <strong>Bastion</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/17.png\" /></p>\n<p>Enter Aministrative Credentials and Click <strong>Connect</strong></p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/18.png\" /></p>\n<p>Once you access your Virtual Machine, verify the running to azure related linux daemon using the following command</p>\n<p><pre class=\"codehilite\"><code>ps -aux | grep waagent</code></pre>\n<img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/19.png\" /></p>\n<p><strong>Step 8:</strong> Delete the Resources. Navigate to your Virtual Machine, Click on <strong>Delete</strong> option in </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/20.png\" /></p>\n<p>Navigate to Public ip. Click on <strong>Delete</strong> option</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/21.png\" /></p>\n<p>Naviagte to Network Security Group. Click on <strong>Delete</strong> option </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/22.png\" /></p>\n<p><strong>Step 9:</strong> Deploy Virtual Machine using <strong>Azure Powershell</strong> or <strong>Azure Bash</strong> Terminal</p>\n<p>Provide the Credentials for Administrative account using the azure command</p>\n<p><pre class=\"codehilite\"><code>$cred =  Get-Credential</code></pre>\n<img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/24.png\" /></p>\n<p>Connect to your Account using the azure command</p>\n<pre class=\"codehilite\"><code>Connect-AzAccount</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/25.png\" /></p>\n<p>Create a Virtual Machine using the following command</p>\n<pre class=\"codehilite\"><code>New-AzVm -ResourceGroupName &lt;resource-group-name&gt; -Location &lt;location-name&gt; -Credential $cred -Image Win2016Datacenter -Name &lt;virtual-machine-name&gt; -VirtualNetworkName &lt;virtual-Network-Name&gt; -SubnetName &lt;default&gt; -PublicIpAddressName &lt;public-ip-name&gt; -OpenPorts 3389 -Size Standard_B1s</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/26.png\" /></p>\n<p><strong>Note</strong> Use Virtual network and Subnet Created in Step 4</p>\n<p><strong>Step 10:</strong>  Naviagte to Azure Portal. Delete the resources using <strong>Delete</strong> option (Shown in Step 8)</p>\n<h1>Conclusion</h1>\n<p>In this way you can Create a virtual machine,storage account and virtual network, configure storage endpoints for Storage Account in the Virtual Network. Verfiy using the virtual Machine</p>\n<h2>Appendix A : Install Azure CLI</h2>\n<p>1.For Windows, the Azure CLI is installed via a MSI, which gives you access to the CLI through the Windows Command Prompt (CMD) or PowerShell.</p>\n<pre class=\"codehilite\"><code>2. Download the latest release of Azure CLI from https://aka.ms/installazurecliwindows. An MSI file will be downloaded as shown below</code></pre>\n\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/12.png\" /></p>\n<pre class=\"codehilite\"><code>3. Open the msi file and It will prepare to install cli on your local machine. Accept the terms and conditions. Click on install</code></pre>\n\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/13.png\" /></p>\n<pre class=\"codehilite\"><code>4.When the installer asks if it can make changes to your computer, click the &quot;Yes&quot; box. After the installation is complete, you will need to close and reopen any active Windows Command Prompt or PowerShell windows to use the Azure CLI.\n\n5. For the macOS platform, you can install the Azure CLI with Homebrew package Managers which used to manage your CLI installation.\n\n6.Download homebrew from https://docs.brew.sh/Installation.html\n\n7.Install brew by using following command in bash</code></pre>\n\n\n<p><pre class=\"codehilite\"><code>brew update &amp;&amp; brew install azure-cli</code></pre>\n    8.For Ubuntu/Debian platform, Installation can be done with one command given below.</p>\n<pre class=\"codehilite\"><code>This script is downloaded via curl and piped directly to bash to install the CLI.</code></pre>\n\n\n<pre class=\"codehilite\"><code>curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash</code></pre>\n\n<pre class=\"codehilite\"><code>9. You can check if the installation is successful with any azure command.</code></pre>\n\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/deploy-simple-virtual-machines/14.png\" /></p>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "web",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}