Microsoft Azure Cloud | A to Z

To setup our client workstation – let’s use PowerShell and Chocolatey. We can setup chocolatey by running a Windows batch file or directly executing the command in the command prompt.

Install Chocolatey | Command Prompt

  1. Click on Start
  2. Type Command Prompt
  3. Right Click and select Start As Administrator
  4. Copy paste and run the below command.
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Install AzureRM | PowerShell

Introduction to AzureRM (Resource Manager)
Terraform | Microsoft AzureRM Provider
Configure Microsoft Azure to work with Terraform

We install AzureRM using PowerShell. These commands can go into a script or you can run them directly within a PowerShell window (remember to Run as Administrator).

We install the AzureRM

Get-Module -ListAvailable AzureRM
Install-Module AzureRM
Set-ExecutionPolicy unrestricted
Login-AzureRmAccount

You will now be prompted to enter your Azure email-address and password. After that you should see the below output.

Account : apolloakora@gmail.com
SubscriptionName : Free Trial
SubscriptionId : 50ed2f8e-e60f-4fbc-9e79-2bef07f98572
TenantId : 3e4cbe7a-05bb-4009-ad7b-fef4eecedf7d
Environment : AzureCloud

Terraform | Provision an ec2 Instance

# Configure the AWS Provider
provider "aws" {
  region = "us-east-1"
}

# Create an EC2 instance
resource "aws_instance" "example_for_talk" {
  # AMI ID for Amazon Linux AMI 2016.03.0 (HVM) in us-east-1
  ami = "ami-0b33d91d"
  instance_type = "t2.micro"
}

Leave a Reply

Your email address will not be published. Required fields are marked *