<?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: Aniket Kumar Sinha</title>
    <description>The latest articles on DEV Community by Aniket Kumar Sinha (@aniketkumarsinha).</description>
    <link>https://dev.to/aniketkumarsinha</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%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg</url>
      <title>DEV Community: Aniket Kumar Sinha</title>
      <link>https://dev.to/aniketkumarsinha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aniketkumarsinha"/>
    <language>en</language>
    <item>
      <title>Deploy Airbyte on AKS</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Thu, 03 Oct 2024 16:57:46 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/deploy-airbyte-on-aks-31co</link>
      <guid>https://dev.to/aniketkumarsinha/deploy-airbyte-on-aks-31co</guid>
      <description>&lt;h2&gt;
  
  
  What is Airbyte?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://airbyte.com/" rel="noopener noreferrer"&gt;Airbyte&lt;/a&gt; is an open-source data movement infrastructure for building extract and load (EL) data pipelines. It is designed for versatility, scalability, and ease-of-use.&lt;/p&gt;

&lt;p&gt;In simple terms, it is a platform to unanimously fetch your data from various platforms and use it for your data analysis purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is AKS?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/products/kubernetes-service/?msockid=34c001cc5dc46a3a36b612385c3c6bc5" rel="noopener noreferrer"&gt;Azure Kubernetes Service (AKS)&lt;/a&gt; is a managed Kubernetes service that you can use to deploy and manage containerized applications. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kubernetes?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kubernetes.io/" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt; is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why to use AKS (K8s) for Airbyte?
&lt;/h2&gt;

&lt;p&gt;To understand this, let's first understand the available options to deploy Airbyte.&lt;/p&gt;

&lt;p&gt;So, as suggested by Airbyte, we can use Virtual machine to run Airbyte locally in VM. It is a fantastic idea for keep the VM running all the time to run Airbyte locally on it. But the issues comes where we have multiple data pipelines with loads and loads on data getting fetched via Airbyte. It can make the VM go out of service. And to make it run all the time with such load, it will incur lot of cost. So, here comes the scaling and cost as an issue.&lt;/p&gt;

&lt;p&gt;Thus comes the better option to deploy it over K8s in Azure using Azure Kubernetes Service for easy scaling!&lt;/p&gt;

&lt;p&gt;Even Airbyte too suggest K8s as the best option to deploy it over. But they don't have enough documents for AKS and thus we are here to understand it better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Helm Charts
&lt;/h2&gt;

&lt;p&gt;A &lt;a href="https://helm.sh/" rel="noopener noreferrer"&gt;Helm Chart&lt;/a&gt; is a collection of templates and settings that describe a set of Kubernetes resources.&lt;/p&gt;

&lt;p&gt;We will use Helm Charts to deploy Airbyte on AKS. Airbyte has predefined Helm charts with some specific general values for Airbyte. You can even alter those values. We will see later in the article, how we can update the helm chart as per our usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's start with the actual work
&lt;/h2&gt;

&lt;p&gt;Assuming that you've already created the AKS using UI or IaC, let's move ahead to connect with it and deploy Airbyte.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to connect with AKS locally
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to Azure in your terminal.&lt;/li&gt;
&lt;li&gt;Set your specific Azure subscription where you have created your AKS cluster.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az account set --subscription &amp;lt;subscription_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Download the credentials to your cluster.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az aks get-credentials --resource-group &amp;lt;aks_rg_name&amp;gt; --name &amp;lt;aks_cluster_name&amp;gt; --overwrite-existing

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using Helm to deploy Airbyte
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;a href="https://helm.sh/docs/intro/install/" rel="noopener noreferrer"&gt;Helm&lt;/a&gt; in your system.&lt;/li&gt;
&lt;li&gt;Run command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm repo add airbyte https://airbytehq.github.io/airbyte/charts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can get all the helm charts present via the &lt;a href="https://artifacthub.io/" rel="noopener noreferrer"&gt;ArtifactHub&lt;/a&gt; platform.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now we will install Airbyte on our AKS cluster.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install airbyte airbyte/airbyte --namespace &amp;lt;namespace_name&amp;gt; --create-namespace --kubeconfig '&amp;lt;path_to_downloaded_cluster_credential_file&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After running the above command, you can check your AKS cluster, in the namespace you can see your deployed Airbyte namespace.&lt;/li&gt;
&lt;/ul&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%2Fo3q9ormlb9t2yvp6avju.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%2Fo3q9ormlb9t2yvp6avju.png" alt="AKS Cluster Namespace Page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To connect with your Airbyte locally, use below command.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl port-forward pod/&amp;lt;airbyte_webapp_pod_name&amp;gt; 8080:8080 --namespace &amp;lt;namespace_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can get the running pod name from AKS cluster --&amp;gt; Workloads --&amp;gt; Pods.&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%2Fdb7pxivc307yrdaghprt.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%2Fdb7pxivc307yrdaghprt.png" alt="Webapp Pod name from Workloads Pods page"&gt;&lt;/a&gt;&lt;br&gt;
** &lt;em&gt;Note that the pod name can be different every time the cluster scales up or down.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How to modify Airbyte pods configuration as per your need?
&lt;/h3&gt;

&lt;p&gt;To modify, you just need to pull helm chart locally and alter the values file and push it again as an update to the cluster. Or you can use your altered Helm chart folder to directly push to your new cluster.&lt;/p&gt;

&lt;p&gt;Steps to follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pull Helm chart locally
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm pull --untar airbyte/airbyte
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Open the unzipped airbyte folder.&lt;/li&gt;
&lt;li&gt;From the list of files and folders, open &lt;strong&gt;&lt;em&gt;values.yaml&lt;/em&gt;&lt;/strong&gt; and update the configurations as per your need.&lt;/li&gt;
&lt;li&gt;Use the local helm chart folder to install Airbyte on AKS.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install airbyte &amp;lt;path_to_local_helm_chart&amp;gt; --namespace &amp;lt;namespace_name&amp;gt; --create-namespace --kubeconfig '&amp;lt;path_to_downloaded_cluster_credential_file&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or say you have airbyte already functional in your AKS, then you can even simply upgrade the values.yaml file present in AKS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm upgrade --install airbyte airbyte/airbyte -f &amp;lt;path_to_values.yaml_file_present_in_local&amp;gt; --namespace &amp;lt;namespace_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You are set to scale Airbyte in AKS!&lt;/p&gt;

</description>
      <category>airbyte</category>
      <category>aks</category>
      <category>kubernetes</category>
      <category>helmchart</category>
    </item>
    <item>
      <title>Integrating Terraform Cloud with GitHub Actions workflow</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Sun, 22 Oct 2023 15:55:26 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/integrating-terraform-cloud-with-github-actions-workflow-jn7</link>
      <guid>https://dev.to/playfulprogramming/integrating-terraform-cloud-with-github-actions-workflow-jn7</guid>
      <description>&lt;h2&gt;
  
  
  What is Terraform Cloud?
&lt;/h2&gt;

&lt;p&gt;Terraform Cloud is a web-based SaaS (Software as a Service) platform provided by HashiCorp, the creators of Terraform. It serves as a central hub for managing and automating infrastructure provisioning using HashiCorp's Infrastructure as Code (IaC) tool, Terraform. Terraform Cloud enhances the deployment workflow by offering features such as remote execution, collaboration, version control integration, and secure state management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should we use Terraform Cloud over Terraform Open Source?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;HashiCorp announced that now Terraform will not be fully open source. &lt;a href="https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license" rel="noopener noreferrer"&gt;Link to article&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Better and secure State management - HashiCorp provides feature of keeping the state file in TFC workspace and also provides an option to lock that state i.e, one cannot write upon the locked state.&lt;/li&gt;
&lt;li&gt;Remote execution.&lt;/li&gt;
&lt;li&gt;TFC has their own agents which works well with Terraform.&lt;/li&gt;
&lt;li&gt;TFC provides HashiCorp's Sentinel policies which can help in integrating Policy-as-Code in our infrastructure.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why integrating TFC with GH Actions workflow?
&lt;/h2&gt;

&lt;p&gt;TFC can handle only Terraform steps/commands ,i.e, terraform init, terraform validate, terraform plan, terraform apply. So, if you are having any other step, or any of your jobs are using some other scripts, then you might need GitHub Action for running those scripts, which will run on either GitHub runners or Self hosted runners.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a new Workspace in &lt;a href="https://app.terraform.io/" rel="noopener noreferrer"&gt;Terraform Cloud&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Choose API-driven workflow.
&lt;img src="https://media2.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%2Fqr2602gh3tze75ysgnps.png" alt="API driven workflow based TFC workspace" width="800" height="434"&gt;
We choose API-driven workflow because we are integrating TFC with GitHub Actions so the API token will be used by GitHub Actions for authentication in TFC workspace. &lt;a href="https://developer.hashicorp.com/terraform/cloud-docs/run/api" rel="noopener noreferrer"&gt;Read more on API-driven workflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Provide the workspace a name.
&lt;img src="https://media2.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%2Fcwj6qjlbmrspxyaxm9pn.png" alt="TFC workspace name" width="800" height="442"&gt;
&lt;/li&gt;
&lt;li&gt;Tap on &lt;strong&gt;Create Workspace&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Create a GitHub repository where you would be adding your TF code and GitHub Actions workflow files. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let's now create the API token in TFC.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the home page of your TFC organization - &lt;a href="https://app.terraform.io/app/ORGANIZATION_NAME/workspaces" rel="noopener noreferrer"&gt;https://app.terraform.io/app/ORGANIZATION_NAME/workspaces&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open Settings.
&lt;img src="https://media2.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%2Fbqe540ymlb7xocy1f2s7.png" alt="Choosing Settings option in TFC" width="277" height="485"&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;API tokens&lt;/strong&gt; section.
&lt;img src="https://media2.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%2Faws62hu0qvo0atdqu0k4.png" alt=" " width="800" height="888"&gt;
There are 3 categories of token which one can generate:

&lt;ul&gt;
&lt;li&gt;User Token - In a TFC organization, many users can be a part. So, this token is generated by a single user.&lt;/li&gt;
&lt;li&gt;Team Token - This token is generated by a team.&lt;/li&gt;
&lt;li&gt;Organization Token - This token is generated for the whole organization. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;All tokens have similar access, it's just that all users or teams should not have access to all tokens.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are creating the User token. 
&lt;img src="https://media2.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%2Fwqo61og9vs06j23dchqg.png" alt=" " width="800" height="164"&gt;
&lt;/li&gt;
&lt;li&gt;Add a description and set the expiration time period of that token, and Generate the token.
&lt;img src="https://media2.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%2Fs859d63pr6w5ytb1kgwy.png" alt=" " width="601" height="337"&gt;
&lt;/li&gt;
&lt;li&gt;Copy and store the generated API token.
&lt;img src="https://media2.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%2Fxcdfb5posesrcns5ksl1.png" alt=" " width="800" height="213"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Now get back to your repository Settings-&amp;gt;Secrets and variables-&amp;gt;Actions. And tap on &lt;strong&gt;New repository secret&lt;/strong&gt; to add the TFC API token as secret in the GitHub repository.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fh093l1mdvsz6y5ti3qnm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fh093l1mdvsz6y5ti3qnm.png" alt=" " width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Add the secret name(prefer adding the same name as you added while creating the token. In the &lt;strong&gt;Secret&lt;/strong&gt; section add the generated token. Click &lt;strong&gt;Add secret&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fqljyazb5uekum7tmdne4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqljyazb5uekum7tmdne4.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Add your SPN details (such as Client ID, Client Secret, Tenant ID) and subscription details in TFC workspace variables.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fhgqmrc1v4yk92k59k5hc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhgqmrc1v4yk92k59k5hc.png" alt=" " width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Now it's time to add some TF code in your GitHub repo along with the Terraform providers block with specific details of your TFC workspace. These details are important for your connection and deployment via TFC.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform {
  required_providers {
    azurerm = {
        source = "hashicorp/azurerm"
    }

    random = {
        source = "hashicorp/random"
    }
  }

  cloud {
    organization = "aniketkumarsinha"

    workspaces {
      name = "tfc-integration-with-gh-actions"
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Time to work on the integrated GitHub Actions workflow creation!
.github/workflows/deploy.yml
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: WORKFLOW

on:
  workflow_dispatch:

jobs:
  terraform:
    name: "Terraform"
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup Terraform
      uses: hashicorp/setup-terraform@v2
      with:
        terraform_version: 1.1.7
        cli_config_credentials_token: ${{ secrets. TF_API_TOKEN }}

    - name: Terraform Init
      id: init
      run: terraform init

    - name: Terraform Validate
      id: validate
      run: terraform validate -no-color

    - name: Terraform Plan
      id: plan
      run: terraform plan -no-color -input=false

    - name: Terraform Apply
      id: apply
      run: terraform apply -auto-approve -input=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We created an integrated workflow file that connects the GitHub actions workflow with the TFC workspace run. When you run this workflow, you can see a simultaneous run over TFC workflow, both the runs are the same, it's just that the real TF code run is running on TFC workspace and a copy/replica is shown up in the GitHub actions workflow run.&lt;/p&gt;

&lt;p&gt;Hola!! Pipeline running successfully ✅&lt;br&gt;
&lt;a href="https://media2.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%2F0wlxe8bl6ub0rekkibgz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0wlxe8bl6ub0rekkibgz.png" alt=" " width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check the TFC workflow run and you can also get that link from the Terraform Plan or Terraform Apply phase:&lt;br&gt;
&lt;a href="https://media2.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%2Fd9ajdsvxew8xzljslyy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fd9ajdsvxew8xzljslyy0.png" alt=" " width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqjy5yywoniwduy1q209b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqjy5yywoniwduy1q209b.png" alt=" " width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have attained Integration Nirvana!&lt;/p&gt;

&lt;p&gt;Checkout this repository: &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/aniketkumarsinha" rel="noopener noreferrer"&gt;
        aniketkumarsinha
      &lt;/a&gt; / &lt;a href="https://github.com/aniketkumarsinha/tfc-integration-gh-action" rel="noopener noreferrer"&gt;
        tfc-integration-gh-action
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Integrating Terraform Cloud with GitHub Actions workflow&lt;/h1&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is Terraform Cloud?&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Terraform Cloud is a web-based SaaS (Software as a Service) platform provided by HashiCorp, the creators of Terraform. It serves as a central hub for managing and automating infrastructure provisioning using HashiCorp's Infrastructure as Code (IaC) tool, Terraform. Terraform Cloud enhances the deployment workflow by offering features such as remote execution, collaboration, version control integration, and secure state management.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why should we use Terraform Cloud over Terraform Open Source?&lt;/h2&gt;
&lt;/div&gt;


&lt;ol&gt;

&lt;li&gt;HashiCorp announced that now Terraform will not be fully open source. &lt;a href="https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license" rel="nofollow noopener noreferrer"&gt;Link to article&lt;/a&gt;
&lt;/li&gt;

&lt;li&gt;Better and secure State management - HashiCorp provides feature of keeping the state file in TFC workspace and also provides an option to lock that state i.e, one cannot write upon the locked state.&lt;/li&gt;

&lt;li&gt;Remote execution.&lt;/li&gt;

&lt;li&gt;TFC has their own agents which works well with Terraform.&lt;/li&gt;

&lt;li&gt;TFC provides HashiCorp's Sentinel policies which can help in integrating…&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/aniketkumarsinha/tfc-integration-gh-action" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Share if your like the blog and follow for more!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__475018"&gt;
    &lt;a href="/aniketkumarsinha" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg" alt="aniketkumarsinha image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Aniket Kumar Sinha&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Cloud Consultant at Rapid Circle | Gold Microsoft Learn Student Ambassador | GDSC Lead'21&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Migration of Terraform State file from Azure Storage Account to Terraform Cloud workspace</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Wed, 23 Aug 2023 18:00:06 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/migration-of-terraform-state-file-from-azure-storage-account-to-terraform-cloud-workspace-3530</link>
      <guid>https://dev.to/playfulprogramming/migration-of-terraform-state-file-from-azure-storage-account-to-terraform-cloud-workspace-3530</guid>
      <description>&lt;h2&gt;
  
  
  What is Terraform State file?
&lt;/h2&gt;

&lt;p&gt;Terraform stores information about your infrastructure in a State file. This state file keeps track of resources created by your configuration and maps them to real-world resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Migration Steps involves:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the latest State file from the Azure storage account, and rename it to &lt;code&gt;terraform.tfstate&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a new directory/folder and create a new &lt;code&gt;main.tf&lt;/code&gt; file with following configurations:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform {
 cloud {
  organization = "YOUR_TFC_ORGANIZATION"

  workspaces {
   name = "WORKSPACE_NAME"
  }
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Copy the downloaded state file into this new directory/folder in which you created the new &lt;code&gt;main.tf&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Make sure that the local version of Terraform match with the Terraform version of your Terraform Cloud workspace. If not install the required version.&lt;/li&gt;
&lt;li&gt;Now run &lt;code&gt;terraform init&lt;/code&gt; command. It will show you something similar:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initializing Terraform Cloud...
Do you wish to proceed?
  As part of migrating to Terraform Cloud, Terraform can optionally copy your
  current workspace state to the configured Terraform Cloud workspace.

  Answer "yes" to copy the latest state snapshot to the configured
  Terraform Cloud workspace.

  Answer "no" to ignore the existing state and just activate the configured
  Terraform Cloud workspace with its existing state, if any.

  Should Terraform migrate your existing state?

  Enter a value: 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Type "yes".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now you can check over your TFC workspace and you should see the migrated state file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;After Migration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go back to your actual directory/folder containing your Terraform infrastructure code.&lt;/li&gt;
&lt;li&gt;Add this same code block to your &lt;code&gt;main.tf&lt;/code&gt; file or &lt;code&gt;providers.tf&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform {
 cloud {
  organization = "YOUR_TFC_ORGANIZATION"

  workspaces {
   name = "WORKSPACE_NAME"
  }
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;terraform init&lt;/code&gt; and &lt;code&gt;terraform plan&lt;/code&gt; commands or initiate a run over Terraform Cloud. You should see that Terraform Plan phase is not showing any changes to be done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You have successfully migrated your TF state file from storage account to TFC workspace.&lt;/p&gt;
&lt;h3&gt;
  
  
  Note:
&lt;/h3&gt;

&lt;p&gt;One TFC workspace can hold only a single state file. If you have multiple environments with multiple state files, you need to create a separate workspace for individual environment's state files respectively and follow the same migration steps.&lt;/p&gt;

&lt;p&gt;Checkout this repository: &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/aniketkumarsinha" rel="noopener noreferrer"&gt;
        aniketkumarsinha
      &lt;/a&gt; / &lt;a href="https://github.com/aniketkumarsinha/migration-of-terraform-state-file-to-terraform-cloud-workspace" rel="noopener noreferrer"&gt;
        migration-of-terraform-state-file-to-terraform-cloud-workspace
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Migration of Terraform State file from Azure Storage Account to Terraform Cloud workspace&lt;/h1&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/7012ee980bb84ae8f39391ece03e5298d6515223fdc5b965c869dddf78c8f0bc/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d79577871665644392d2d2f635f696d616767615f7363616c652c665f6175746f2c666c5f70726f67726573736976652c685f3432302c715f6175746f2c775f313030302f68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f77776575737537356674656d79653378657436772e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/7012ee980bb84ae8f39391ece03e5298d6515223fdc5b965c869dddf78c8f0bc/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d79577871665644392d2d2f635f696d616767615f7363616c652c665f6175746f2c666c5f70726f67726573736976652c685f3432302c715f6175746f2c775f313030302f68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f77776575737537356674656d79653378657436772e706e67" alt="Migration of Terraform State file from Azure Storage Account to Terraform Cloud workspace"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is Terraform State file?&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Terraform stores information about your infrastructure in a State file. This state file keeps track of resources created by your configuration and maps them to real-world resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Migration Steps involves:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the latest State file from the Azure storage account, and rename it to &lt;code&gt;terraform.tfstate&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a new directory/folder and create a new &lt;code&gt;main.tf&lt;/code&gt; file with following configurations:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;terraform {
 cloud {
  organization = "YOUR_TFC_ORGANIZATION"

  workspaces {
   name = "WORKSPACE_NAME"
  }
 }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Copy the downloaded state file into this new directory/folder in which you created the new &lt;code&gt;main.tf&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Make sure that the local version of Terraform match with the Terraform version of your Terraform Cloud workspace. If not install the required version.&lt;/li&gt;
&lt;li&gt;Now run &lt;code&gt;terraform init&lt;/code&gt; command. It will show you something similar:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;Initializing Terraform Cloud
Do you wish&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/aniketkumarsinha/migration-of-terraform-state-file-to-terraform-cloud-workspace" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Share if your like the blog and follow for more!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__475018"&gt;
    &lt;a href="/aniketkumarsinha" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg" alt="aniketkumarsinha image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Aniket Kumar Sinha&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Cloud Consultant at Rapid Circle | Gold Microsoft Learn Student Ambassador | GDSC Lead'21&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>terraform</category>
      <category>terraformcloud</category>
      <category>infrastructureascode</category>
      <category>devops</category>
    </item>
    <item>
      <title>Implementing Policy-as-Code to Terraform workflow using Hashicorp Sentinel</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Tue, 13 Jun 2023 07:45:34 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/implementing-policy-as-code-to-terraform-workflow-using-hashicorp-sentinel-189p</link>
      <guid>https://dev.to/playfulprogramming/implementing-policy-as-code-to-terraform-workflow-using-hashicorp-sentinel-189p</guid>
      <description>&lt;p&gt;In this blog post, I will show you how to implement Policy-as-Code (PaC) to your Terraform workflow using Hashicorp Sentinel. PaC is a way of defining and enforcing policies for your infrastructure as code, which can help you ensure compliance, security and best practices across your organization. Sentinel is a language and framework for writing and applying policies to Terraform and other Hashicorp products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use Policy-as-Code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Policy-as-Code has many benefits for managing your infrastructure as code. Some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It allows you to codify your policies and store them in version control, which makes them easier to track, review and audit.&lt;/li&gt;
&lt;li&gt;It enables you to apply your policies consistently and automatically across your environments, which reduces human errors and increases efficiency.&lt;/li&gt;
&lt;li&gt;It empowers you to enforce your policies at different stages of your workflow, such as plan, apply or destroy, which gives you more control and visibility over your infrastructure changes.&lt;/li&gt;
&lt;li&gt;It supports you to write policies that are flexible and expressive, which can handle complex scenarios and logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to use Sentinel with Terraform?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sentinel integrates seamlessly with Terraform Cloud and Terraform Enterprise, which are platforms for collaborating and automating your Terraform workflows. To use Sentinel with Terraform, you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write your policies in Sentinel language and save them as .sentinel files in your repository.&lt;/li&gt;
&lt;li&gt;Configure your Terraform organization and workspace to enable Sentinel and specify which policies to apply.&lt;/li&gt;
&lt;li&gt;Run your Terraform commands as usual and see how Sentinel evaluates your policies against your configuration and state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sentinel policies can be applied at different levels of granularity, such as organization, workspace or run. You can also use different enforcement modes, such as advisory, soft-mandatory or hard-mandatory, depending on how strict you want your policies to be.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Advisory: Failed policies never interrupt the run, just post a warning.&lt;/li&gt;
&lt;li&gt;Soft-mandatory: lets an organization owner or a user with override privileges proceed with the run in the event of failure. Terraform Cloud logs all overrides.&lt;/li&gt;
&lt;li&gt;Hard-mandatory: requires that the policy passes. If a policy fails, the run stops. You must resolve the failure to proceed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Learn more about Sentinel: &lt;a href="https://youtu.be/Vy8s7AAvU6g" rel="noopener noreferrer"&gt;Introduction to Sentinel, HashiCorp Policy as Code Framework By Armon Dadgar, CTO Hashicorp&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform without Sentinel:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Ftlyth8stff6gxsorhqhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftlyth8stff6gxsorhqhk.png" alt="Terraform without Sentinel" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform with Sentinel:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Ffkx2ms86mjmaaudh5zmd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffkx2ms86mjmaaudh5zmd.png" alt="Terraform with Sentinel" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;We are using a policy to restrict VM size, which basically means that if the VM size mentioned in our infrastructure matches the list VM sizes mentioned in our policy, then the Policy checks will pass and proceed to Apply phase, otherwise it will stop with the error.&lt;/p&gt;

&lt;p&gt;And we are adding this policy directly to Terraform Cloud via UI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;So go to your workspace page in Terraform Cloud - &lt;a href="https://app.terraform.io/app/%7Busername%7D/workspaces" rel="noopener noreferrer"&gt;https://app.terraform.io/app/{username}/workspaces&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Move in to Settings from left pane.
&lt;img src="https://media2.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%2Fqn76di9ommlkh87cly65.png" alt=" " width="415" height="760"&gt;
&lt;/li&gt;
&lt;li&gt;Move to &lt;code&gt;Policies&lt;/code&gt; tab from left pane and tap on 'Create a new policy' button. This will lead to the page where you can add your sentinel policy code.
&lt;img src="https://media2.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%2Fcox8vmy1nmg8n5vh94ls.png" alt=" " width="800" height="345"&gt;
&lt;/li&gt;
&lt;li&gt;Finally Create a new policy

&lt;ul&gt;
&lt;li&gt;Choose &lt;strong&gt;Sentinel&lt;/strong&gt; in &lt;code&gt;Policy framework&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add the policy name.&lt;/li&gt;
&lt;li&gt;Add the description.&lt;/li&gt;
&lt;li&gt;Choose the enforcement level (advisory, soft-mandatory or hard-mandatory)&lt;/li&gt;
&lt;li&gt;Add the Policy Code. We are using this code:
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;For now keep the Policy set as blank because we haven't created any policy set yet.&lt;/li&gt;
&lt;li&gt;And then tap on Create policy button.
&lt;img src="https://media2.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%2Fckofyermqa0zptlgj0r1.png" alt=" " width="800" height="1044"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It's time to create a Policy Set. Policy sets are groups of policies which may be enforced on workspaces. In settings itself, move to &lt;code&gt;Policy Set&lt;/code&gt; from left pane, and click on 'Create a new policy set'.
&lt;img src="https://media2.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%2F97htuz0ig0zld6hacba0.png" alt=" " width="800" height="349"&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;Connect to VCS&lt;/code&gt;, choose 'No VCS Connection', as we not using any GitHub repo for our policy. We can also use any repository containing policies.
&lt;img src="https://media2.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%2Fucyz979s193ojnk62rya.png" alt=" " width="800" height="531"&gt;
&lt;/li&gt;
&lt;li&gt;It will directly lead you to &lt;code&gt;Configure settings&lt;/code&gt; page.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Sentinel&lt;/strong&gt; in &lt;code&gt;Policy framework&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add a name.&lt;/li&gt;
&lt;li&gt;Add description to policy set.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Scope of policy&lt;/code&gt;, choose the scope according to your need. We are restricting the scope to selected workspace.&lt;/li&gt;
&lt;li&gt;Choose the workspace. We are using an already created workspace. To learn how to create a workspace and deploy to Azure using the workspace, check out this blog: &lt;a href="https://dev.to/this-is-learning/deploy-azure-infrastructure-using-terraform-cloud-3j9d"&gt;Deploy Azure Infrastructure using Terraform Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;And tap on to &lt;code&gt;Connect policy set&lt;/code&gt; button to create the policy set.
&lt;img src="https://media2.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%2F78yeftf102a9kajyhcee.png" alt=" " width="800" height="833"&gt;
&lt;/li&gt;
&lt;li&gt;We are done with creation of the policy set.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Move back to policies to add this created policy set to your policy. And tap on Update policy button.
&lt;img src="https://media2.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%2Farj1yaeu8b5hxokhusd9.png" alt=" " width="800" height="325"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, finally we are done with adding our sentinel policy to Terraform Cloud.&lt;/p&gt;

&lt;p&gt;It's time to check the workflow.&lt;br&gt;
So, in our infra, we have used VM with size, "Standard_D1_v2", which is a part of allowed VM sizes, so let's see the workflow outcome.&lt;br&gt;
&lt;a href="https://media2.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%2Fo21oa2xvuyjg84ick766.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fo21oa2xvuyjg84ick766.png" alt=" " width="800" height="395"&gt;&lt;/a&gt;&lt;br&gt;
We can that we have new phase named as 'Sentinel policies passed', and since the infra matches the policy condition it passes and proceeded to Apply phase.&lt;/p&gt;

&lt;p&gt;Let's try with some different VM size.&lt;br&gt;
We are changing the VM size to "Standard_D2_v5" which is not a part of allowed VM sizes, and running the workflow.&lt;br&gt;
&lt;a href="https://media2.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%2Fcl41qcpe9snsznqhax4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcl41qcpe9snsznqhax4u.png" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
We can see that the sentinel policy phase failed and stop the workflow there itself because we applied enforcement mode as hard-mandatory.&lt;/p&gt;

&lt;p&gt;Error message: Resource azurerm_virtual_machine.vm[0] has attribute vm_size with value Standard_D2_v5 that is not in the allowed list: ["Standard_A1" "Standard_A2" "Standard_D1_v2" "Standard_D2_v2"]&lt;br&gt;
&lt;a href="https://media2.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%2F34pei9g22o8dopy9hvrz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F34pei9g22o8dopy9hvrz.png" alt=" " width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's me just give you a small brief that how the policies are working. So, the Plan phase generates the mock files (containing the output of Plan phase) which is used as input to Sentinel policy phase, and then the policy phase checks with the policy and accordingly pass or fail.&lt;br&gt;
&lt;a href="https://media2.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%2Fepj9vmhh8xki94c5qz82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fepj9vmhh8xki94c5qz82.png" alt=" " width="800" height="308"&gt;&lt;/a&gt;&lt;br&gt;
You can even download those mock files to see the results.&lt;/p&gt;

&lt;p&gt;If you want to learn how to use Terraform Cloud to deploy over Azure, checkout this blog:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You can get the whole Policy-as-Code from this repo:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/aniketkumarsinha" rel="noopener noreferrer"&gt;
        aniketkumarsinha
      &lt;/a&gt; / &lt;a href="https://github.com/aniketkumarsinha/terraform-sentinel-policy" rel="noopener noreferrer"&gt;
        terraform-sentinel-policy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This Project uses Terraform Sentinel to apply Policy-as-Code on Terraform Workflow. Get more details:
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Implementing Policy-as-Code to Terraform workflow using Hashicorp Sentinel&lt;/h1&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/015564a955291d5af1c6c54e257a40cb752cdb52e61d95c67a605ca6144cdb3e/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d67584b614a58436f2d2d2f635f696d616767615f7363616c652c665f6175746f2c666c5f70726f67726573736976652c685f3432302c715f6175746f2c775f313030302f68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f6e63396364726c71333031626c353464306771772e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/015564a955291d5af1c6c54e257a40cb752cdb52e61d95c67a605ca6144cdb3e/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d67584b614a58436f2d2d2f635f696d616767615f7363616c652c665f6175746f2c666c5f70726f67726573736976652c685f3432302c715f6175746f2c775f313030302f68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f6e63396364726c71333031626c353464306771772e706e67" alt="Sentinel Cover Image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this project, we are implementing Policy-as-Code (PaC) to our Terraform workflow using Hashicorp Sentinel. PaC is a way of defining and enforcing policies for your infrastructure as code, which can help you ensure compliance, security and best practices across your organization. Sentinel is a language and framework for writing and applying policies to Terraform and other Hashicorp products.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why use Policy-as-Code?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Policy-as-Code has many benefits for managing your infrastructure as code. Some of them are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It allows you to codify your policies and store them in version control, which makes them easier to track, review and audit.&lt;/li&gt;
&lt;li&gt;It enables you to apply your policies consistently and automatically across your environments, which reduces human errors and increases efficiency.&lt;/li&gt;
&lt;li&gt;It empowers you to enforce your policies at different stages of your workflow, such as plan, apply or destroy, which gives you more control…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/aniketkumarsinha/terraform-sentinel-policy" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Share if your like the blog and follow for more!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__475018"&gt;
    &lt;a href="/aniketkumarsinha" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg" alt="aniketkumarsinha image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Aniket Kumar Sinha&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Cloud Consultant at Rapid Circle | Gold Microsoft Learn Student Ambassador | GDSC Lead'21&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>terraform</category>
      <category>devops</category>
      <category>sentinel</category>
      <category>policyascode</category>
    </item>
    <item>
      <title>Deploy Azure Infrastructure using Terraform Cloud</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Sun, 11 Jun 2023 07:21:34 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/deploy-azure-infrastructure-using-terraform-cloud-3j9d</link>
      <guid>https://dev.to/playfulprogramming/deploy-azure-infrastructure-using-terraform-cloud-3j9d</guid>
      <description>&lt;p&gt;&lt;em&gt;Note: You can get the whole code from this repository: &lt;a href="https://github.com/aniketkumarsinha/azure-terraform-infrastructure" rel="noopener noreferrer"&gt;aniketkumarsinha/azure-terraform-infrastructure&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Terraform?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share.&lt;/p&gt;
&lt;h5&gt;
  
  
  Terraform Flow
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;First you have the terraform code.&lt;/li&gt;
&lt;li&gt;Then we have Terraform Plan phase. The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.&lt;/li&gt;
&lt;li&gt;Terraform Apply phase executes the actions proposed in a Terraform plan.&lt;/li&gt;
&lt;li&gt;And everything gets deployed over the CSP, here Azure.
&lt;img src="https://media2.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%2Fodtun8rbj9hgsb9brhuq.png" alt="Terraform Flow" width="800" height="239"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is Terraform Cloud?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://cloud.hashicorp.com/products/terraform" rel="noopener noreferrer"&gt;Terraform Cloud&lt;/a&gt; is a managed service offering by HashiCorp that eliminates the need for unnecessary tooling and documentation for practitioners, teams, and organizations to use Terraform in production. It allows you to provision infrastructure in a remote environment that is optimized for the Terraform workflow.&lt;br&gt;
&lt;a href="https://media2.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%2F7w2ijyuk5x6rrqy99gd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7w2ijyuk5x6rrqy99gd1.png" alt="Terraform Cloud Flow" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this blog, we will be creating Azure Infrastructure using Terraform and will be deploying it over to Azure using Terraform Cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Infrastructure Code&lt;/strong&gt;&lt;br&gt;
We are creating a VM and resources related to it. &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Setting up Terraform Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Terraform Cloud Account - &lt;a href="https://www.hashicorp.com/products/terraform" rel="noopener noreferrer"&gt;Terraform Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a Project in Terraform Cloud:
&lt;img src="https://media2.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%2Fy949ss9lexpd5ridhozu.png" alt=" " width="800" height="348"&gt;
&lt;/li&gt;
&lt;li&gt;Create a Workspace.
&lt;img src="https://media2.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%2Fwdde76gof5yxc8vp1kpw.png" alt=" " width="800" height="336"&gt;

&lt;ul&gt;
&lt;li&gt;Choose Version control workflow
&lt;img src="https://media2.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%2Fn1gp6u6x1mez3kdvbt8n.png" alt=" " width="800" height="665"&gt;
&lt;/li&gt;
&lt;li&gt;Connect to a version control provider
&lt;img src="https://media2.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%2Fa8bat7opbkli0x9t1yrj.png" alt=" " width="800" height="406"&gt;
&lt;/li&gt;
&lt;li&gt;Choose your Azure Infrastructure repository from your repository list. You can check the advance settings if you want to configure the workflow.
&lt;img src="https://media2.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%2Fkd5dop1al2pugnalmqew.png" alt=" " width="800" height="705"&gt;
&lt;/li&gt;
&lt;li&gt;Tap on &lt;strong&gt;Create Workspace&lt;/strong&gt; button to create your workspace in terraform cloud Or Start new run from workspace overview page.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You can directly start your plan phase.
&lt;img src="https://media2.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%2Fht6c0c2krj3o8wzmwgnk.png" alt=" " width="800" height="447"&gt;
&lt;/li&gt;
&lt;li&gt;You can verify in your projects page that your workspace has been created.
&lt;img src="https://media2.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%2Fosfgv461t6slsonxjoo3.png" alt=" " width="800" height="369"&gt;
&lt;/li&gt;
&lt;li&gt;Open your workspace to start new run.
&lt;img src="https://media2.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%2Fu1z112gu2ntqq8nuz5vx.png" alt=" " width="800" height="989"&gt;
&lt;/li&gt;
&lt;li&gt;Choose your run type and start run.
&lt;img src="https://media2.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%2Fq263knx3mxpb9lfj3ith.png" alt=" " width="800" height="439"&gt;
&lt;/li&gt;
&lt;li&gt;Ouch!! Errors!!
We are getting error in provider phase. The reason behind this is that we have authorized our infrastructure to connect and write over our Azure. We will be creating an App provide all the necessary details to our infrastructure.
&lt;img src="https://media2.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%2F0178a4rs54hqgjtjam3o.png" alt=" " width="800" height="363"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Authorizing Terraform Infrastructure to write over Azure&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are creating an App over Azure to authorize using Client Id, Client Secret and Tenant Id. So in your &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt; move into Azure Active Directory, and open &lt;code&gt;App registrations&lt;/code&gt; from left pane, And add a new registration.
&lt;img src="https://media2.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%2F4p1bc3pibj9hfog28oef.png" alt=" " width="800" height="356"&gt;
&lt;/li&gt;
&lt;li&gt;Add your App details and register.
&lt;img src="https://media2.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%2Fdja5n5a5hmppgm3alwsq.png" alt=" " width="800" height="363"&gt;
&lt;/li&gt;
&lt;li&gt;So we have finally created our app.
&lt;img src="https://media2.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%2Fc42vlbil4aviwcvtwqck.png" alt=" " width="800" height="340"&gt;
&lt;/li&gt;
&lt;li&gt;To connect our Infrastructure we need 4 details

&lt;ul&gt;
&lt;li&gt;Client Id&lt;/li&gt;
&lt;li&gt;Client Secret&lt;/li&gt;
&lt;li&gt;Tenant Id&lt;/li&gt;
&lt;li&gt;Subscription Id
We would be getting this one by one.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;Application (client) ID&lt;/code&gt; is Client Id.
&lt;code&gt;Directory (tenant) ID&lt;/code&gt; is Tenant Id.
&lt;img src="https://media2.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%2Fn01jcz1nqjwwn4zjv0nu.png" alt=" " width="800" height="342"&gt;
&lt;/li&gt;

&lt;li&gt;To get the Client Secret, we first need to create the secret.
&lt;img src="https://media2.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%2Fj8zkh7k7zylxbporn2cx.png" alt=" " width="800" height="342"&gt;

&lt;ul&gt;
&lt;li&gt;Add description and expiry of this secret which you're creating.&lt;/li&gt;
&lt;li&gt;Copy this value under Value column, and save it somewhere as we wouldn't be able to access this later. This is our Client secret.
&lt;img src="https://media2.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%2Fyggxgu21wa9o97nf315n.png" alt=" " width="800" height="345"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Search Subscription from search box and open your subscription. Copy your subscription id.
&lt;img src="https://media2.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%2Fl4jmyk0g0p57mwqr518k.png" alt=" " width="800" height="333"&gt;
So now we have all the required values.&lt;/li&gt;

&lt;li&gt;Let's add these values in our Infrastructure.

&lt;ul&gt;
&lt;li&gt;In the provider block add all four details. We would be saving the values in Terraform Cloud variables for security purpose.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "azurerm" {
  features {}

  skip_provider_registration = "true"

  # Connection to Azure
  subscription_id = var.subscription_id
  client_id = var.client_id
  client_secret = var.client_secret
  tenant_id = var.tenant_id
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Add variables in Variables page.
&lt;img src="https://media2.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%2Fgiji6tny99ldozgyp2yb.png" alt=" " width="800" height="816"&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;Key&lt;/code&gt; add the words with var, i.e., var.&lt;code&gt;key&lt;/code&gt;, and in &lt;code&gt;Value&lt;/code&gt; add required Ids' and Secret.
&lt;img src="https://media2.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%2Fjns0v92i8f6phwqqt8c2.png" alt=" " width="800" height="251"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's rerun the workflow!&lt;/p&gt;

&lt;p&gt;Ohhhhh!!!! ERROR AGAIN!!!!&lt;br&gt;
&lt;a href="https://media2.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%2Fpte3o0sq7lmlo9i8vem0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpte3o0sq7lmlo9i8vem0.png" alt=" " width="800" height="1424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But we are still left with some more code :P&lt;br&gt;
We need to add variables.tf file mentioning about these variables.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;And now finally we can get the results from Plan and Apply phase. Let's rerun the pipeline.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wohooo!! Our Plan phase ran successfully:
&lt;img src="https://media2.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%2For808kgvinu7t4hefah4.png" alt=" " width="800" height="776"&gt;
&lt;/li&gt;
&lt;li&gt;Expand Plan phase to check what resources are getting created. And if every configuration is fine then tap on &lt;code&gt;Confirm &amp;amp; Apply&lt;/code&gt; button at the end of phase. So by default the Apply phase does not run automatically, we need manual approval, this is to make sure that someone checks the Plan output and verifies everything and then accordingly approve for Apply or reject.
&lt;img src="https://media2.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%2Fd1i9t9fbo1ggnxa2mxea.png" alt=" " width="800" height="458"&gt;
&lt;/li&gt;
&lt;li&gt;Error again 🫠
&lt;img src="https://media2.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%2Fb359xrmnrnllyu5a813y.png" alt=" " width="800" height="1175"&gt;
&lt;/li&gt;
&lt;li&gt;It seems our Azure app don't have permission to add anything. Let's provide the contributor role to our app.

&lt;ul&gt;
&lt;li&gt;Under Subscription, got to Access Control (IAM) and Add a role there.
&lt;img src="https://media2.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%2Fp31hlbpe9xfj2wwl8g4l.png" alt=" " width="800" height="361"&gt;
&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;Contributor&lt;/code&gt; role under Privileged administrator roles.
&lt;img src="https://media2.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%2Fdt9iw8nusgjp2thbkf9w.png" alt=" " width="800" height="326"&gt;
&lt;/li&gt;
&lt;li&gt;Under Members tab, select our app as member.
&lt;img src="https://media2.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%2F21huwn8l97928mwqcqs8.png" alt=" " width="800" height="364"&gt;
&lt;/li&gt;
&lt;li&gt;And then tap on Review+Assign. So now our App has contributor role and can make changes over Azure subscription.
&lt;img src="https://media2.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%2F2lk9ervpboi0xnof2cjx.png" alt=" " width="800" height="358"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Rerun the pipeline. And wollaahh!!
Everything ran successfully!
&lt;img src="https://media2.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%2F3fdkhg2fmcbwawd2skq9.png" alt=" " width="601" height="426"&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Let's confirm over our Azure Portal too. &lt;br&gt;
Yes we can see all our resources present under our subscription.&lt;br&gt;
&lt;a href="https://media2.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%2Feyp2ult5uid4uerv6tmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Feyp2ult5uid4uerv6tmp.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🤩🤩🤩🤩🤩🤩🤩&lt;/p&gt;

&lt;p&gt;Damn!!!! We learnt so many things today. We first created the Terraform Infrastructure, setup our Terraform Cloud profile and then used it to deploy resources over Azure too. Now you can say you're a pro in Terraform and Terraform Cloud.&lt;/p&gt;

&lt;p&gt;Let me provide you a bonus happiness. So the project which we configured over Terraform Cloud, automatically runs the workflow any branch is merged to the main branch or any new pushes are done to main branch.&lt;/p&gt;

&lt;p&gt;You can get the whole Infrastructure as Code from this repository: &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/aniketkumarsinha" rel="noopener noreferrer"&gt;
        aniketkumarsinha
      &lt;/a&gt; / &lt;a href="https://github.com/aniketkumarsinha/azure-terraform-infrastructure" rel="noopener noreferrer"&gt;
        azure-terraform-infrastructure
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Deploy Azure Infrastructure using Terraform Cloud
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="MD"&gt;
&lt;div&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Deploy Azure Infrastructure using Terraform Cloud&lt;/h1&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6739eedb0e3660a41b84c68a144c233f864577f0db669f2b6e863997e00ea51b/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f633636776e6469683461613433636634393376642e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/6739eedb0e3660a41b84c68a144c233f864577f0db669f2b6e863997e00ea51b/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f633636776e6469683461613433636634393376642e706e67" alt="Cover Image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;Note: Tried of creating this doc as a demo with all process/steps in creating this project
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is Terraform?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://www.terraform.io/" rel="nofollow noopener noreferrer"&gt;Terraform&lt;/a&gt; is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Terraform Flow&lt;/h3&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;First you have the terraform code.&lt;/li&gt;
&lt;li&gt;Then we have Terraform Plan phase. The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.&lt;/li&gt;
&lt;li&gt;Terraform Apply phase executes the actions proposed in a Terraform plan.&lt;/li&gt;
&lt;li&gt;And everything gets deployed over the CSP, here Azure.
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/46248253650b3a0e10b80fbc5687bd7b675d6f6c7b34fc90cdd3bf293a47d2ab/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f6f6474756e3872626a39686773623962726875712e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/46248253650b3a0e10b80fbc5687bd7b675d6f6c7b34fc90cdd3bf293a47d2ab/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f6f6474756e3872626a39686773623962726875712e706e67" alt="Image description"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is Terraform Cloud?&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://cloud.hashicorp.com/products/terraform" rel="nofollow noopener noreferrer"&gt;Terraform Cloud&lt;/a&gt; is a managed service offering by HashiCorp that eliminates the need for unnecessary tooling and documentation for practitioners, teams, and organizations to use Terraform in production. It allows you to provision infrastructure in a remote environment…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/aniketkumarsinha/azure-terraform-infrastructure" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Share if your like the blog and follow for more!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__475018"&gt;
    &lt;a href="/aniketkumarsinha" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg" alt="aniketkumarsinha image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Aniket Kumar Sinha&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Cloud Consultant at Rapid Circle | Gold Microsoft Learn Student Ambassador | GDSC Lead'21&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>azure</category>
      <category>terraform</category>
      <category>devops</category>
      <category>github</category>
    </item>
    <item>
      <title>Creating Azure Virtual Machine using PowerShell</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Thu, 21 Jul 2022 05:03:34 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/creating-azure-virtual-machine-using-powershell-26hn</link>
      <guid>https://dev.to/playfulprogramming/creating-azure-virtual-machine-using-powershell-26hn</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Virtual Machine?&lt;/strong&gt;&lt;br&gt;
Virtual machine is a virtual environment over your a system. Assume you have a Linux OS on your system, but you want to use Windows for some specific functionality, but you don't want to install it over your system. What you can do is, just create a VM (Virtual Machine) with Windows OS and use in whatever way you want virtually over your system.&lt;br&gt;
So basically, a virtual machine (VM) is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is PowerShell?&lt;/strong&gt;&lt;br&gt;
PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework.&lt;/p&gt;

&lt;p&gt;So, now let's create a VM using PowerShell.&lt;/p&gt;

&lt;p&gt;Before starting, you need to install some modules from the &lt;a href="https://www.powershellgallery.com/" rel="noopener noreferrer"&gt;PowerShell Gallery&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.powershellgallery.com/packages/Az.Accounts/" rel="noopener noreferrer"&gt;Az.Accounts&lt;/a&gt; - Used to connect to Azure Account through PowerShell.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.powershellgallery.com/packages/Az.Resources/" rel="noopener noreferrer"&gt;Az.Resources&lt;/a&gt; - Used to create/get the Resource Group for out VM.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.powershellgallery.com/packages/Az.Compute/" rel="noopener noreferrer"&gt;Az.Compute&lt;/a&gt; - Used to create/connect the Virtual Machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the following syntax to install these modules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Install-Module -Name ModuleName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's start by creating a PowerShell file first. Open &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt; or PowerShell ISE. You can install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell" rel="noopener noreferrer"&gt;PowerShell extension&lt;/a&gt; in the VS Code. Create a PowerShell file with extension &lt;code&gt;.ps1&lt;/code&gt;. For example &lt;code&gt;VMusingPS.ps1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we need to connect to our Azure account using PowerShell script. Run the following command in VS Code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connect-AzAccount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Select the command and then tap on the key F8 to run this.&lt;br&gt;
This command will open up an interface in your browser to sign-in to your Azure account.&lt;/p&gt;

&lt;p&gt;To confirm your connection, run the command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get-AzContext
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command will show you some similar results to this, confirming your account and subscription.&lt;br&gt;
&lt;a href="https://media2.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%2Ftcx9yh7a9sagbrmeby51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftcx9yh7a9sagbrmeby51.png" alt=" " width="800" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want, you can create a new Resource Group for your VM using the command:&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 "VM_RG" -Location "CentralIndia"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or use any existing Resource Group.&lt;/p&gt;

&lt;p&gt;I am using the existing Resource Group named as "VM_RG".&lt;br&gt;
Run the following command to create a Virtual Machine machine using PowerShell:&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 -Name "VMusingPS" -ResourceGroupName "VM_RG" -Location "CentralIndia" -Credential (Get-Credential)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Since the VM needs a credential for it's access, so after running this command, it will ask for the username and password for your VM. Set your credentials and press Enter, and done.&lt;/p&gt;

&lt;p&gt;You can confirm by checking your mentioned Resource Group, it will show your Virtual Machine there.&lt;/p&gt;

&lt;p&gt;You have successfully created an Azure Virtual Machine using PowerShell script.&lt;/p&gt;

&lt;p&gt;Here's the full code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Now you can connect/start your VM using RDP: &lt;a href="https://dev.to/aniketkumarsinha/connecting-to-windows-virtual-machine-created-on-azure-using-rdp-3ed3"&gt;Connecting to Windows Virtual Machine created on Azure using RDP&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docs on the commands used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/powershell/module/az.accounts/connect-azaccount?view=azps-8.1.0" rel="noopener noreferrer"&gt;Connect-AzAccount&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/powershell/module/az.accounts/get-azcontext?view=azps-8.1.0" rel="noopener noreferrer"&gt;Get-AzContext&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroup?view=azps-8.1.0" rel="noopener noreferrer"&gt;New-AzResourceGroup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/powershell/module/az.compute/new-azvm?view=azps-8.1.0" rel="noopener noreferrer"&gt;New-AzVM&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hurray🥳&lt;br&gt;
Enjoy using your VM now!&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__475018"&gt;
    &lt;a href="/aniketkumarsinha" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475018%2F68604f0e-f44e-481f-8bf5-569b9e48f0eb.jpeg" alt="aniketkumarsinha image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Aniket Kumar Sinha&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/aniketkumarsinha"&gt;Cloud Consultant at Rapid Circle | Gold Microsoft Learn Student Ambassador | GDSC Lead'21&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>powershell</category>
      <category>azure</category>
    </item>
    <item>
      <title>Connecting to Windows Virtual Machine created on Azure using RDP</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Thu, 21 Jul 2022 04:40:42 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/connecting-to-windows-virtual-machine-created-on-azure-using-rdp-3ed3</link>
      <guid>https://dev.to/aniketkumarsinha/connecting-to-windows-virtual-machine-created-on-azure-using-rdp-3ed3</guid>
      <description>&lt;p&gt;Let's see how we can start/connect to our Virtual Machine.&lt;/p&gt;

&lt;p&gt;On the Virtual Machine page on &lt;a href="https://portal.azure.com/"&gt;Azure Portal&lt;/a&gt;, you can see this bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA_h3qp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0cx4uprv63ht9oo6qse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA_h3qp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0cx4uprv63ht9oo6qse.png" alt="Image description" width="800" height="29"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you have the option of &lt;strong&gt;Connect&lt;/strong&gt;. So, you need to tap on the arrow with &lt;strong&gt;Connect&lt;/strong&gt; and choose the &lt;strong&gt;RDP&lt;/strong&gt; option from the dropdown menu.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q8SHJLxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwtdevn9j5yj4pvcb9em.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q8SHJLxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwtdevn9j5yj4pvcb9em.png" alt="Image description" width="292" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Connect with RDP&lt;/em&gt;&lt;/strong&gt; interface will open up, and now we need to download the RDP file using the &lt;strong&gt;Download RDP File&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rKkDGeH4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zotogxgw5wgafu0q3p3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rKkDGeH4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zotogxgw5wgafu0q3p3k.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in your downloads folder, you can see a .rdp file with the name of your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8NToLBJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgu7gh09cghf0tii3cq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8NToLBJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgu7gh09cghf0tii3cq3.png" alt="Image description" width="166" height="166"&gt;&lt;/a&gt;&lt;br&gt;
Just open that file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remote Desktop Connection&lt;/strong&gt; interface will open up, and you need to tap on the &lt;strong&gt;Connect&lt;/strong&gt; button to connect to your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JaTV63pj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snatkouau2hda742rw72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JaTV63pj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snatkouau2hda742rw72.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows Security&lt;/strong&gt; interface will open up. But you need to tap on &lt;strong&gt;&lt;em&gt;More choices&lt;/em&gt;&lt;/strong&gt; option given below. And there you need to choose &lt;strong&gt;&lt;em&gt;Use a different account option&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4b78BJAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zeejz805nl16iynb7de.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4b78BJAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zeejz805nl16iynb7de.png" alt="Image description" width="680" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now on the new interface, you need to add the username and password which you set while creating the VM. And then tap on &lt;strong&gt;OK&lt;/strong&gt; button below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e92NAuoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igerlouh5cwk9oed6nmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e92NAuoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igerlouh5cwk9oed6nmu.png" alt="Image description" width="679" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this kind of interface comes up, just tap &lt;strong&gt;Yes&lt;/strong&gt; below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ifqdMgl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdeoh1utq310aee1cnoy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ifqdMgl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdeoh1utq310aee1cnoy.png" alt="Image description" width="582" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can see the Virtual Machine is opening up.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lmdS-OIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/214fo8lwcxjraunz8anf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lmdS-OIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/214fo8lwcxjraunz8anf.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;br&gt;
You can enlarge the VM and make it full screen and use it like your own system.&lt;/p&gt;

&lt;p&gt;Yayy!&lt;br&gt;
You have successfully connected to your Virtual Machine.&lt;/p&gt;

&lt;p&gt;Enjoy your new system 🎉 &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating Virtual Machine on Azure Portal</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Wed, 29 Jun 2022 15:57:10 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/creating-virtual-machine-on-azure-portal-5c95</link>
      <guid>https://dev.to/aniketkumarsinha/creating-virtual-machine-on-azure-portal-5c95</guid>
      <description>&lt;h2&gt;
  
  
  What is Virtual Machine?
&lt;/h2&gt;

&lt;p&gt;Virtual machine is a virtual environment over your a system. Assume you have a Linux OS on your system, but you want to use Windows for some specific functionality, but you don't want to install it over your system. What you can do is, just create a VM (Virtual Machine) with Windows OS and use in whatever way you want virtually over your system.&lt;br&gt;
So basically, a virtual machine (VM) is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system.&lt;/p&gt;

&lt;p&gt;So, let's create a VM on Azure.&lt;/p&gt;

&lt;p&gt;Move to the &lt;a href="https://portal.azure.com"&gt;Azure Portal&lt;/a&gt;, and tap on the + icon with text &lt;strong&gt;&lt;em&gt;Create a resource&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N3tIIM0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrgcfp80j55m2iv0ukvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N3tIIM0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrgcfp80j55m2iv0ukvw.png" alt="Image description" width="800" height="140"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You will get similar interface show below. Choose the &lt;strong&gt;&lt;em&gt;Virtual machine&lt;/em&gt;&lt;/strong&gt; from the given option.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z4eenZbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7f9rppanbbnax0h267d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z4eenZbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7f9rppanbbnax0h267d.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This interface will open up.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UAZ3VhYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkdv7ooqdtqtc71o45r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UAZ3VhYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkdv7ooqdtqtc71o45r1.png" alt="Image description" width="800" height="948"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's now examine each option given.&lt;/p&gt;

&lt;p&gt;Let the &lt;strong&gt;&lt;em&gt;Subscription&lt;/em&gt;&lt;/strong&gt; be as it is. And in &lt;strong&gt;&lt;em&gt;Resource group&lt;/em&gt;&lt;/strong&gt;, let's create a new one using the &lt;strong&gt;&lt;em&gt;Create new&lt;/em&gt;&lt;/strong&gt; option shown in blue below the input bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--51mXFlLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3f02sfsiypuml979crk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--51mXFlLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3f02sfsiypuml979crk.png" alt="Image description" width="800" height="97"&gt;&lt;/a&gt;&lt;br&gt;
I am creating a Resource group named as &lt;strong&gt;&lt;em&gt;VM_RG&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now the question arise that, &lt;strong&gt;What is a Resource group?&lt;/strong&gt;&lt;br&gt;
So, a resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group.&lt;/p&gt;

&lt;p&gt;The time to give our Virtual Machine a name.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gLxTP2lA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hli64oyn8kke4h31uryz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gLxTP2lA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hli64oyn8kke4h31uryz.png" alt="Image description" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;&lt;em&gt;Virtual machine name&lt;/em&gt;&lt;/strong&gt;, I am giving the VM a name as &lt;strong&gt;&lt;em&gt;VMonPortal&lt;/em&gt;&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;&lt;em&gt;Region&lt;/em&gt;&lt;/strong&gt;, choose the region which is nearest to you. I am choose the region as &lt;strong&gt;&lt;em&gt;Central India&lt;/em&gt;&lt;/strong&gt; as it's nearest to me.&lt;/li&gt;
&lt;li&gt;Keep the &lt;strong&gt;&lt;em&gt;Availability option&lt;/em&gt;&lt;/strong&gt; as &lt;strong&gt;&lt;em&gt;No infrastructure redundance required&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Let the &lt;strong&gt;&lt;em&gt;Security type&lt;/em&gt;&lt;/strong&gt; remain as &lt;strong&gt;&lt;em&gt;Standard&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;&lt;em&gt;Image&lt;/em&gt;&lt;/strong&gt; choose the operating system which you want in your virtual machine. I am choosing &lt;strong&gt;&lt;em&gt;Windows 11 Pro&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Leave the &lt;strong&gt;&lt;em&gt;Azure Spot instance&lt;/em&gt;&lt;/strong&gt; as unchecked.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;&lt;em&gt;Size&lt;/em&gt;&lt;/strong&gt;, choose the size which suites your pocket. I am choosing the lowest one, i.e, &lt;strong&gt;&lt;em&gt;Standard_D2s_v3&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Time to set the username and password of our VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BTi_qGBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/km32fkqed0ss56nmofsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BTi_qGBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/km32fkqed0ss56nmofsb.png" alt="Image description" width="800" height="256"&gt;&lt;/a&gt;&lt;br&gt;
You can see that there are some criteria related to the username and password, so choose the username and password accordingly.&lt;br&gt;
And do remember this username and password, because this will help you to signin to your VM.&lt;/p&gt;

&lt;p&gt;Leave the &lt;strong&gt;&lt;em&gt;Inbound port rules section&lt;/em&gt;&lt;/strong&gt; as it is.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g0wEv0Gq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq1guo26jfxiw2k3j5td.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g0wEv0Gq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq1guo26jfxiw2k3j5td.png" alt="Image description" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check mark the licensing confirmation.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kbk9FMlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/151owlxypw0byhkozdnh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kbk9FMlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/151owlxypw0byhkozdnh.png" alt="Image description" width="738" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now your interface should look similar to this, with similar values.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--32N6oxd6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p58mpylpfgax1uhtc62a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--32N6oxd6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p58mpylpfgax1uhtc62a.png" alt="Image description" width="800" height="950"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now tap on &lt;strong&gt;Next: Disks &amp;gt;&lt;/strong&gt; button below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XxR0LqIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1y5w6bm8s1qiw1zvbinr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XxR0LqIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1y5w6bm8s1qiw1zvbinr.png" alt="Image description" width="694" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now this interface will open up which basically ask for the data disks you want in your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--izYv1gPt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wxnv07y9wuoje08ono0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--izYv1gPt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wxnv07y9wuoje08ono0.png" alt="Image description" width="800" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am keeping the &lt;strong&gt;&lt;em&gt;OS disk type&lt;/em&gt;&lt;/strong&gt; as &lt;strong&gt;&lt;em&gt;Standard SSD&lt;/em&gt;&lt;/strong&gt;, leaving the other items same.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aHVndwfl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wconlbow15yf4zrdlffc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aHVndwfl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wconlbow15yf4zrdlffc.png" alt="Image description" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want you add a data disk, but I am not adding any, leaving the other items as it is.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SuWnDBR0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4xdw5ogqy0qm70gvmy5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SuWnDBR0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4xdw5ogqy0qm70gvmy5h.png" alt="Image description" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now tap on the &lt;strong&gt;Next: Networking &amp;gt;&lt;/strong&gt; tab below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kaW2fOwn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5ahkdbj2wisxym10m9l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kaW2fOwn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5ahkdbj2wisxym10m9l.png" alt="Image description" width="753" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am keeping all the items as it is, in the &lt;strong&gt;&lt;em&gt;Networking&lt;/em&gt;&lt;/strong&gt; tab.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dTzpt35h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxtuc7qarndl5lhti1x7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dTzpt35h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxtuc7qarndl5lhti1x7.png" alt="Image description" width="800" height="778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now directly tap on &lt;strong&gt;Review + Create&lt;/strong&gt; button below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--opgB69Ix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2gw6ozc6ut9l068zrt9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--opgB69Ix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2gw6ozc6ut9l068zrt9.png" alt="Image description" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Review + create&lt;/em&gt; tab will open up with some information and costing of your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qt7F-GVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/houebr4kmqnpfoj4vz6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qt7F-GVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/houebr4kmqnpfoj4vz6x.png" alt="Image description" width="800" height="1606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now just tap on the &lt;strong&gt;Create&lt;/strong&gt; button below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vf1jVg5V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8lagazrer96vbwloka1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vf1jVg5V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8lagazrer96vbwloka1.png" alt="Image description" width="800" height="65"&gt;&lt;/a&gt;&lt;br&gt;
This will create the VM with the configurations you mentioned.&lt;br&gt;
The creation process may take some time.&lt;/p&gt;

&lt;p&gt;This kind of message can come up on your screen that the deployment is complete.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QYKLz0tc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2dvt2vmco409r2847ph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QYKLz0tc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2dvt2vmco409r2847ph.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now tap on &lt;strong&gt;Go to resource&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O8Zwbeyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51iuou7rjce5uvzu01fz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O8Zwbeyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51iuou7rjce5uvzu01fz.png" alt="Image description" width="463" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The portal for the virtual machine will open up.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NGD2B8Vn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ce5l4w8ybimwk6onfsf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NGD2B8Vn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ce5l4w8ybimwk6onfsf4.png" alt="Image description" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Awesome!!&lt;br&gt;
We just now created our Virtual Machine on Azure Portal.&lt;/p&gt;

&lt;p&gt;But wait!!!!&lt;br&gt;
How to use the Virtual Machine now.&lt;/p&gt;

&lt;p&gt;Let's see how we can start our Virtual Machine.&lt;/p&gt;

&lt;p&gt;You can see this bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA_h3qp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0cx4uprv63ht9oo6qse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA_h3qp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0cx4uprv63ht9oo6qse.png" alt="Image description" width="800" height="29"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you have the option of &lt;strong&gt;Connect&lt;/strong&gt;. So, you need to tap on the arrow with &lt;strong&gt;Connect&lt;/strong&gt; and choose the &lt;strong&gt;RDP&lt;/strong&gt; option from the dropdown menu.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q8SHJLxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwtdevn9j5yj4pvcb9em.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q8SHJLxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwtdevn9j5yj4pvcb9em.png" alt="Image description" width="292" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Connect with RDP&lt;/em&gt;&lt;/strong&gt; interface will open up, and now we need to download the RDP file using the &lt;strong&gt;Download RDP File&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rKkDGeH4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zotogxgw5wgafu0q3p3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rKkDGeH4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zotogxgw5wgafu0q3p3k.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in your downloads folder, you can see a .rdp file with the name of your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8NToLBJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgu7gh09cghf0tii3cq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8NToLBJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgu7gh09cghf0tii3cq3.png" alt="Image description" width="166" height="166"&gt;&lt;/a&gt;&lt;br&gt;
Just open that file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remote Desktop Connection&lt;/strong&gt; interface will open up, and you need to tap on the &lt;strong&gt;Connect&lt;/strong&gt; button to connect to your VM.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JaTV63pj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snatkouau2hda742rw72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JaTV63pj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snatkouau2hda742rw72.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows Security&lt;/strong&gt; interface will open up. But you need to tap on &lt;strong&gt;&lt;em&gt;More choices&lt;/em&gt;&lt;/strong&gt; option given below. And there you need to choose &lt;strong&gt;&lt;em&gt;Use a different account option&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4b78BJAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zeejz805nl16iynb7de.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4b78BJAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zeejz805nl16iynb7de.png" alt="Image description" width="680" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now on the new interface, you need to add the username and password which you set while creating the VM. And then tap on &lt;strong&gt;OK&lt;/strong&gt; button below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e92NAuoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igerlouh5cwk9oed6nmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e92NAuoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igerlouh5cwk9oed6nmu.png" alt="Image description" width="679" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this kind of interface comes up, just tap &lt;strong&gt;Yes&lt;/strong&gt; below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ifqdMgl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdeoh1utq310aee1cnoy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ifqdMgl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdeoh1utq310aee1cnoy.png" alt="Image description" width="582" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can see the Virtual Machine is opening up.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lmdS-OIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/214fo8lwcxjraunz8anf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lmdS-OIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/214fo8lwcxjraunz8anf.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;br&gt;
You can enlarge the VM and make it full screen and use it like your own system.&lt;/p&gt;

&lt;p&gt;Yayy!&lt;br&gt;
Now finally you have created your own Virtual Machine on Azure Portal and used it too.&lt;/p&gt;

&lt;p&gt;Enjoy your new system 🎉 &lt;/p&gt;

</description>
      <category>virtualmachine</category>
      <category>azure</category>
    </item>
    <item>
      <title>Updating React App deployed on Firebase</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Tue, 14 Jun 2022 17:32:47 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/updating-react-app-deployed-on-firebase-kp2</link>
      <guid>https://dev.to/aniketkumarsinha/updating-react-app-deployed-on-firebase-kp2</guid>
      <description>&lt;p&gt;Be sure that you've deployed your app on Firebase, if not done then follow this blog: &lt;em&gt;&lt;a href="https://dev.to/aniketkumarsinha/how-to-deploy-your-react-app-on-firebase-ibj"&gt;How to deploy your React app on Firebase?&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Make all the changes and save them in your React App.&lt;/p&gt;

&lt;p&gt;Run the following commands in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm run build
$ firebase deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's Done!&lt;br&gt;
Your app is updated.&lt;/p&gt;

&lt;p&gt;Happy Learning!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to deploy your React app on Firebase?</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Tue, 14 Jun 2022 17:25:16 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/how-to-deploy-your-react-app-on-firebase-ibj</link>
      <guid>https://dev.to/aniketkumarsinha/how-to-deploy-your-react-app-on-firebase-ibj</guid>
      <description>&lt;p&gt;Assuming you have created an account on &lt;a href="https://firebase.google.com/"&gt;Firebase&lt;/a&gt;, let’s move forward to creating the project on the Firebase console to the deployment of your React app on Firebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Firebase Project&lt;/strong&gt;&lt;br&gt;
Sign in to Firebase and move to console through the button “Go to console” present at the top right corner of the website. The console panel will open up. Tap on the “Add project” tab there and create the project with any desired name. The project overview window will open up as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sERmfiV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj2ktkee8voqwqbge4ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sERmfiV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj2ktkee8voqwqbge4ae.png" alt="Image description" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tap on the web icon, just beside the android icon present there. Register your app there with a suitable name. Tick the setup of Firebase hosting setup there.&lt;/p&gt;

&lt;p&gt;Just tap Next on the further proceedings and move to Git Bash to your project directory. Run command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install -g firebase-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you need to log in to firebase through your bash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ firebase login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allow the asked permission by running y or yes. It will open the sign-in window. Just sign in there with your account. Coming back to bash. Run command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ firebase init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer the questions as mentioned below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confi
rm your choices. Hosting: Configure and deploy Firebase Hosting sites
? Please select an option: Use an existing project
? Select a default Firebase project for this directory: mylinks-71d4a (mylinks)
? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? No
? File build/index.html already exists. Overwrite? No
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These questions will be asked to you and you need to answer as given above. In the question “Select a default Firebase project for this directory”, choose the project which you created for the web app.&lt;/p&gt;

&lt;p&gt;The next step is to deploy your app to firebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ firebase deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hola! Your React app is deployed to Firebase. You can get its link either from the Git Bash itself. It will show up there as “Hosting URL” ending with “.web.app” or in the project on Firebase, go to &lt;strong&gt;Hosting&lt;/strong&gt; tab, there too you will find your app URL.&lt;/p&gt;

&lt;p&gt;Now the question arises, how to update your already deployed app?&lt;br&gt;
Follow the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make and save changes in your react app.&lt;/li&gt;
&lt;li&gt;Run the following commans:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm run build
$ firebase deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will update your deployed app.&lt;/p&gt;

&lt;p&gt;Happy Learning!&lt;/p&gt;

</description>
      <category>react</category>
      <category>firebase</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to get Microsoft Azure Fundamentals Certified?</title>
      <dc:creator>Aniket Kumar Sinha</dc:creator>
      <pubDate>Fri, 02 Jul 2021 04:47:48 +0000</pubDate>
      <link>https://dev.to/aniketkumarsinha/how-to-get-microsoft-azure-fundamentals-certified-2edl</link>
      <guid>https://dev.to/aniketkumarsinha/how-to-get-microsoft-azure-fundamentals-certified-2edl</guid>
      <description>&lt;p&gt;I recently passed the Microsoft Azure Fundamentals Certification Examination(AZ 900). It was an awesome learning journey and I learned a lot about Azure and Cloud Computing. This article is related to the same. What is Microsoft Certified: Azure Fundamentals examination and how to prepare for it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is Cloud Computing?&lt;/strong&gt;&lt;br&gt;
Cloud computing is the delivery of computing services — including servers, storage, databases, networking, software, analytics, and intelligence — over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale. You typically pay only for cloud services you use, helping lower your operating costs, run your infrastructure more efficiently and scale as your business needs change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Azure?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://azure.microsoft.com/en-in/"&gt;Azure&lt;/a&gt; is a cloud computing platform with an ever-expanding set of services to help you build solutions to meet your business goals. The Azure cloud platform is more than 200 products and cloud services designed to help you bring new solutions to life — to solve today’s challenges and create the future. Build, run and manage applications across multiple clouds, on-premises and at the edge, with the tools and frameworks of your choice.&lt;br&gt;
To become Microsoft certified in Azure Fundamentals, you need to pass the AZ-900 Examination.&lt;/p&gt;




&lt;p&gt;The AZ-900 is the exam needed to get the Azure Fundamentals certification. The exam is intended for candidates who are just beginning to work with cloud-based solutions and services or are new to Azure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to prepare for AZ 900 Examination?&lt;/strong&gt;&lt;br&gt;
Microsoft Learn is an amazing platform to learn about Microsoft technologies. For Azure too, you should visit Microsoft Learn. I am mentioning the important links related to this Certification and also links to the learning paths which you need to prepare for this examination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/certifications/azure-fundamentals/"&gt;Microsoft Certified: Azure Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/certifications/exams/az-900"&gt;Exam AZ-900: Microsoft Azure Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-cloud-concepts/"&gt;Azure Fundamentals part 1: Describe core Azure concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-core-azure-services/"&gt;Azure Fundamentals part 2: Describe core Azure services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-core-solutions-management-tools-azure/"&gt;Azure Fundamentals part 3: Describe core solutions and management tools on Azure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-general-security-network-security-features/"&gt;Azure Fundamentals part 4: Describe general security and network security features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-identity-governance-privacy-compliance-features/"&gt;Azure Fundamentals part 5: Describe identity, governance, privacy, and compliance features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/paths/az-900-describe-azure-cost-management-service-level-agreements/"&gt;Azure Fundamentals part 6: Describe Azure cost management and service level agreements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.coursera.org/specializations/microsoft-azure-fundamentals-az-900?"&gt;Microsoft Azure Fundamentals AZ-900 Exam Prep Specialization
AZ-900 Microsoft Azure Fundamentals Free Full Course and Study Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/NKEFWyqJ5XA"&gt;FreeCodeCamp’s Microsoft Azure Fundamentals Certification Course&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can practice through practice tests like &lt;a href="https://in.mindhub.com/az-900-microsoft-azure-fundamentals-microsoft-official-practice-test/p/MU-AZ-900?utm_source=microsoft&amp;amp;utm_medium=certpage&amp;amp;utm_campaign=msofficialpractice"&gt;Mindhub’s AZ-900: Microsoft Azure Fundamentals Microsoft Official Practice Test&lt;/a&gt; and &lt;a href="https://www.whizlabs.com/microsoft-azure-certification-az-900/"&gt;Whizlabs’ Microsoft Azure Exam AZ-900 Certification Practice Tests&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the question pattern and marks distribution of the AZ 900 examination?&lt;/strong&gt;&lt;br&gt;
According to the most updated terms and conditions, the following is the exam skill outline and question distribution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Describe cloud concepts (20–25%)&lt;/li&gt;
&lt;li&gt;Describe core Azure services (15–20%)&lt;/li&gt;
&lt;li&gt;Describe core solutions and management tools on Azure (10–15%)&lt;/li&gt;
&lt;li&gt;Describe general security and network security features (10–15%)&lt;/li&gt;
&lt;li&gt;Describe identity, governance, privacy, and compliance features (20–25%)&lt;/li&gt;
&lt;li&gt;Describe Azure cost management and Service Level Agreements (10–15%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The questions are mainly theory based and are majorly MCQ based with around 40–60 questions which are to be answered in 60 minutes.&lt;/p&gt;




&lt;p&gt;So, this is it. If you are done with above mentioned stuff, you are good to go for the AZ-900 examination.&lt;/p&gt;

&lt;p&gt;All the best!&lt;/p&gt;

</description>
      <category>azure</category>
      <category>microsoftcertified</category>
      <category>microsoftazure</category>
      <category>cloudcomputing</category>
    </item>
  </channel>
</rss>
