<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kazeem</title>
    <description>The latest articles on DEV Community by Kazeem (@kazz).</description>
    <link>https://dev.to/kazz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1039623%2F10b680f1-b0be-4110-abf7-73ec328b87ac.jpeg</url>
      <title>DEV Community: Kazeem</title>
      <link>https://dev.to/kazz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kazz"/>
    <language>en</language>
    <item>
      <title>4 Ways to Create Virtual Machine in Microsoft Azure</title>
      <dc:creator>Kazeem</dc:creator>
      <pubDate>Sat, 13 May 2023 12:45:34 +0000</pubDate>
      <link>https://dev.to/kazz/4-ways-to-create-virtual-machine-in-microsoft-azure-boj</link>
      <guid>https://dev.to/kazz/4-ways-to-create-virtual-machine-in-microsoft-azure-boj</guid>
      <description>&lt;p&gt;A virtual machine is an important element of most successful businesses using cloud resources.&lt;/p&gt;

&lt;p&gt;Think of a virtual machine as a personal computer with your desired specifications to run different tasks for you. For instance, you need a PC with at least 32GB RAM and over 1TB storage among other specifications. But due to limited financial capabilities, you are unable to purchase the PC. This is one of the ways a virtual machine comes in. &lt;/p&gt;

&lt;p&gt;In this article, I will show you five (5) different ways to create virtual machine in Microsoft Azure.&lt;/p&gt;

&lt;p&gt;Microsoft Azure is one of the foremost cloud services provider with high credibility. Before you access the Azure portal, you need to sign up for an account - a free tier account is also available with enough resources to get started including a $200 credit.&lt;/p&gt;

&lt;p&gt;Now to the real business. How can you create a virtual machine in Microsoft Azure?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Using the Azure Portal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Access the Azure Portal by visiting &lt;a href="https://portal.azure.com" rel="noopener noreferrer"&gt;https://portal.azure.com&lt;/a&gt;. Input Virtual Machine in the search bar.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhliqkqgf2vnyzsddud5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhliqkqgf2vnyzsddud5n.png" alt="Azure Portal Search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the search results, click "create" on the Virtual Machine icon&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f8m424va19n5e4pt6u0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f8m424va19n5e4pt6u0.png" alt="Azure Popular Resources"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select your subscription. If you do not have an active subscription, create one or a free trial subscription from Microsoft.&lt;/p&gt;

&lt;p&gt;After selecting your subscription, select the resource group this virtual machine should belong to or create a new resource group&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth6ee5nx5nz43gj1vhj4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth6ee5nx5nz43gj1vhj4.png" alt="Creating Virtual Machine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give your virtual machine a name - like a computer name. Select an OS (image) for your VM.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssjq5uez9jo2rdd58sbb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssjq5uez9jo2rdd58sbb.png" alt="Virtual Machine details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting your image and check other information, click on "review + create" to create your virtual machine.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jmvpnrb3mtt3hlvvzos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jmvpnrb3mtt3hlvvzos.png" alt="Available image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deployment will take a moment. After deployment completes, you have successfully created a virtual machine and can go to the resource.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fins8tityh9kq9dmwcvmb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fins8tityh9kq9dmwcvmb.png" alt="VM Deployed with azure quickstart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2: Using Custom Template from Azure Quickstart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creating a virtual machine by deploying using a custom template is a fast and easy method that does not require a user to do too much.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Select "Deploy custom template"&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F337xy0fhl0qo5py3xc7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F337xy0fhl0qo5py3xc7v.png" alt="Azure Quickstart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next page, provide your virtual machine details including an admin username and password.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fref86gun7j9t5iistoqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fref86gun7j9t5iistoqi.png" alt="Azure Virtual Machine Custom Template"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on "Review + create" and watch the magic! &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0rg1w70dis4thusiwem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0rg1w70dis4thusiwem.png" alt="Create Virtual Machine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 3: Using Azure Cloud Shell&lt;/strong&gt;&lt;br&gt;
Azure Cloud Shell provides us with a simple way to create resource group and virtual machines using simple shell commands.&lt;/p&gt;

&lt;p&gt;Open up the cloud shell terminal by clicking on the icon on the azure portal.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodxmlyqfkdhyxozcljof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodxmlyqfkdhyxozcljof.png" alt="Azure Cloud Shell"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select PowerShell in the presented tab.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi7o3jchhbdu0syvlt0qv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi7o3jchhbdu0syvlt0qv.png" alt="Cloud Shell"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ensure you are in the right directory. In the image below, we are in the "/home/seidu" directory.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0fjpjn9ggd4qzv413l0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0fjpjn9ggd4qzv413l0.png" alt="PowerShell Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before crating a virtual machine, there must be a resource group. The following commands should be run in this form: &lt;em&gt;&lt;strong&gt;New-AzResourceGroup -Name "Your Resource Group Name" -Location "Your resource location".&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New-AzResourceGroup -Name "myresourcegroup" -Location "EAST US"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flroj9hneh98yjf2phewr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flroj9hneh98yjf2phewr.png" alt="Create resource group"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successfully creating a resource group, we will go ahead to create our virtual machine using this command: &lt;br&gt;
&lt;em&gt;&lt;strong&gt;New-AzVM -ResourceGroupName "Resource group name" -Name "vm name" -Location "EAST US"&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New-AzVM -ResourceGroupName "myresourcegroup" -Name MyVm -Location "EAST US"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj3nlhy2ey49mvkznb7ow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj3nlhy2ey49mvkznb7ow.png" alt="VM PowerShell command"&gt;&lt;/a&gt;&lt;br&gt;
You will be prompted to provide a username and password for the virtual machine. Virtual machine will then be created and details displayed as in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7p2m46yhpqos8wdh83y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7p2m46yhpqos8wdh83y.png" alt="VM Created"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 4: Using Azure Cli&lt;/strong&gt;&lt;br&gt;
The microsoft azure CLI command is similar to using the power shell commands. &lt;/p&gt;

&lt;p&gt;To access the CLI, click on the "BASH" terminal in the cloud shell window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqohlw6xwevwshiqa35s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqohlw6xwevwshiqa35s.png" alt="Azure CLI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a resource group, run:&lt;br&gt;
&lt;strong&gt;&lt;em&gt;az group create --name "resource group name" --location "Resource Location"&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az group create --name mytestgroup --location EastUS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a7fgazfgz1kz73x5a34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9a7fgazfgz1kz73x5a34.png" alt="Resoure Group Azure CLI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a virtual machine in our resource group, we run:&lt;br&gt;
az vm create \&lt;br&gt;
--resource-group "resource group name" \&lt;br&gt;
--name "vm machine name" \&lt;br&gt;
--image "os image" \&lt;br&gt;
--generate-ssh-keys&lt;/p&gt;

&lt;p&gt;Exmple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az vm create \
--resource-group myRgGroup \
--name myVmMachine \
--image UbuntuLTS \
--generate-ssh-keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tvk4rk6aluau8u24j3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tvk4rk6aluau8u24j3e.png" alt="VM CLI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
Virtual machines are essential for today's businesses as it helps to scale in/out up/down depending on the needs. Microsoft Azure has done so well in this regards by providing developers with all they need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Important Notice:&lt;/em&gt;&lt;/strong&gt; Remember to delete any resource you create which is not in use in order not to incur unwanted expenses.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
