How to Install Azure PowerShell Module

To install Azure PowerShell Module, please follow the below steps:

1. Open Windows PowerShell from your system, using the Run as administrator option.

2. From within the PowerShell command window, enter the following command:

Install-Module AzureRM -AllowClobber

3. Import the AzureRM module within PowerShell, using the following command:

Import-Module AzureRM

4. Validate the AzureRM module is installed properly, by using the following command:

Get-Module -Listavailable AzureRM

If AzureRM module has been successfully installed, you should see output within PowerShell that looks similar to below:

PS C:\WINDOWS\system32> Get-Module -Listavailable AzureRM

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 6.13.1 AzureRM

Amazon AWS VPC Components

Amazon AWS VPC consists of the following components:

  1. Internet Gateways or Virtual Private Gateways (note that a VPC can have only one internet gateway)
  2. Route Tables
  3. Network Access Control lists (NACLs), applied at the subnet level and is stateless
  4. Security Groups, applied at the instance level and is stateful
  5. VPC traffic can be logged via Flowlogs

Example bash script for cloud environments

The following bash script example, is a script which can be used to automate some basic tasks, associated with setting up a virtual resource, such as an Amazon AWS EC2 instance:

yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
aws s3 cp s3:///index.html /var/www/html/

What this bash script will perform on your behalf, will update the instance repositories (yum update), and also install Apache web server (install httpd). This particular script was used in Amazon AWS for an EC2 instance and a static website hosted on a S3 bucket storage resource.

The script will also ensure that the Apache web server will persist during system reboots (chkconfig), and the last instruction, will copy the contents between locations.