Azure Lab Manual-New

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

No Topics

Creating Windows Virtual Machines-IIS


1
Creating Linux Virtual Machine-Apache
2
Capture Windows VM as an Image
3
Capture Linux VM as Image
4
Azure Compute Gallery
5
Azure Managed VM Disks
6
Azure Managed VM Data Disk and Snapshots
7
Linux VM Data Disk
8
Azure Virtual Network with a Subnet
9
Azure Virtual Network with Private and Public Subnets
10
External NIC Card Attachment
11
Virtual Network Peering
12
Private DNS Zone
13
VPN Point to Site Connection
14
Azure Lab 1
Creating Windows Virtual Machines-IIS

Overview of the Lab


In this lab, you will learn how to use the Azure portal to deploy a virtual machine
(VM) in Azure that runs Windows Server 2019 and run web services in Windows
using Internet Information Service (IIS)

Resource Group
A resource group is a container for Azure solutions, containing related resources,
managed by the organization based on their most suitable allocation.

Azure Virtual Machines


Azure virtual machines (VMs) allow for the quick creation of dedicated compute
resources, similar to physical desktop or server machines.

Remote Desktop Protocol


The Terminal Server and Terminal Server Client communicate using Remote
Desktop Protocol (RDP), which is encapsulated and encrypted within TCP.

Hypertext Transfer Protocol


HTTP is a protocol for fetching resources such as HTML documents. It is the
foundation of any data exchange on the Web and it is a client-server protocol

Internet Information Service


IIS is a Microsoft web server that runs on the Windows operating system and is
used to exchange static and dynamic web content with internet users.
Architecture of the Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group:
Provide Name
Select Region
3. Review and Create
4. Create Virtual Machine:
Provide Name
Select Region
Availability Option: No infrastructure redundancy required
Security Type: Standard
Image: Winder Server 2019
Size: 3.5GiB
Provide Your UserName and Password
Select Inbound Port: RDP, HTTP
5. Review and Create
6. Connect Virtual Machine with RDP
7. Open Add Roles and Features
Select Web Server Under Server Roles
Next- Next -Install
8. Test Web Server
Delete Resource Group
Azure Lab 2
Creating Linux Virtual Machine-Apache

Overview of the Lab


This Azure Lab teaches users how to create a Linux Virtual Machine running
Ubuntu Server using Secure Shell (SSH) and run web services in Linux using
Apache2.

Azure Virtual Machines


Azure virtual machines (VMs) allow for the quick creation of dedicated comput
resources, similar to physical desktop or server machines.

Secure Shell
Secure Shell (SSH) is a protocol that securely connects to a remote
server/system, transferring encrypted data between the host and the client.

Hypertext Transfer Protocol


HTTP is a protocol for fetching resources such as HTML documents. It is the
foundation of any data exchange on the Web and it is a client-server protocol.

Apache Web Server


Apache serves as a web server, accepting HTTP requests from internet users
and delivering desired information in the form of files and web pages.
Architecture of the Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group:
Provide Name
Select Region
3. Review and Create
4. Create Virtual Machine:
Provide Name
Select Region
Availability Option: No infrastructure redundancy required
Security Type: Standard
Image: Ubuntu Server Image
Size: 3.5GiB
Provide Your UserName and Password
Select Inbound Port: SSH, HTTP
5. Review and Create
6. Download Putty Software
7. Open Putty- Paste Public IP
Change Font Size -> Click Appearance-> change
8. Type Username and Password
9. Change Root User-> Sudo -i
10.Update-> apt update
11. Install WebServer-> apt install Apache2 -y
12. Test Web Page

Basic Commands
Create directory: mkdir
change directory command: cd
Come out from the directory: cd ..
Create File: touch
Open File: vi
Edit File: Press i
Save and Exit File: press esc Type :wq
Azure Lab 3
Capture Windows VM as an Image

Overview of the Lab


In this Azure lab, you will learn how to prepare and capture a Windows
virtual machine with installed IIS. Before capturing the Windows Virtual
Machine, we use the Sysprep Tool to prepare the VM to remove machine
accounts and other machine-specific information.

Virtual Machine Image


Machine-managed images are beneficial in development and test environments where a
consistent baseline is required.

Virtual Machines - Capture


The VM is captured by copying its virtual hard disks and outputs a template for creating
similar VMs.

SysPrep Tool
Sysprep allows generalising Windows installation by removing PC-specific information
and configuring boot mode to audit mode or Out-of-Box Experience (OOBE).
Architecture of the Lab

Step-by-Step Lab
1. Sign in to Portal
2. Create Resource Group:
3. Create Virtual Machine: (Windows)
4. Connect Virtual Machine using RDP (mstsc)
5. Install IIS using Server Manager in Windows
6. Modify the Index Page
WindowsC/Inetpub/Www
7. Check the modified web server IndexPage
8. Before Capturing run Sysprep
Go to the Sysprep path
Windows C/Windows/System32/Sysprep

Open the Sysprep application


9. Generalised -> Select Shutdown
10. Capture the Virtual Machine using the “Capture” button in Portal.
11. Create Capture
select a resource group
select No, and capture only a managed image.
Provide a Name for your Image
12. Review and Create
13. After Capturing the Virtual Machine you can use the Custom Image
to create a new Virtual Machine.
14. Check the Web Page is working with the newly created Virtual
Machine’s Public IP
Azure Lab 4
Capture Linux VM as an Image

Overview of Lab

In this Azure lab you will learn how to prepare and capture Linux Virtual
Machine with Installed Apache. Before capturing Linux Virtual Machine we
use Waagent Tool to prepare the VM.

Azure Linux Virtual Machines

Azure Virtual Machines (VM) is one of several types of on-demand, scalable


computing resources that Azure offers. Typically, we choose a VM when we need
more control over the computing Infrastructure.

Virtual Machine Image

Managed Images are helpful in development and test environments where you need
a consistent baseline.

Virtual Machines - Capture

Capture the VM by copying virtual hard disks of the VM and output a template that
can be used to create similar VMs.

Azure Linux Agent (Waagent)


The Microsoft Azure Linux Agent (waagent) manages Linux & FreeBSD
provisioning, and VM interaction with the Azure Fabric Controller.
Architecture of Lab

Step-by-Step Lab
1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Machine (Linux)
4. Connect Virtual Machine using Putty
5. Install Apache2
6. Modify the Index Page
Cd /var/www/index
Vi index.html
(Press i for Insert -> Edit 198th line -> press esc :wq)
7. Check the modified web server IndexPage
8. Before Capturing a Generalised VM
Waagent -deprovision+user
halt
9. Go to VM Overview
10. Capture the Virtual Machine using the “Capture”.
11. Create Capture
select a resource group
select No, and capture only a managed image.
Provide a Name for your Image
12. Review and Create
13. After Capturing the Virtual Machine you can use the Custom Image
to create a new Virtual Machine.
14. Check the Web Page is working with the newly created Virtual
Machine’s Public IP
Azure Lab 5
Azure Compute Gallery

Overview of Lab
In this Azure lab you will learn how to replicate VM Custom Image to
different regions using Azure Compute Gallery.

Virtual Machine Image


Managed Images are helpful in development and test environments where
you need a consistent baseline.

Virtual Machines - Capture


Capture the VM by copying virtual hard disks of the VM and output a
template that can be used to create similar VMs.

Azure Compute Gallery


Azure Compute Gallery allows you to build structure and organisation
around your Images. Images can be replicated to multiple regions, for quicker
scaling of your deployment.
.
Architecture of Lab

Step-by-Step Lab
1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Machine (Windows/Linux)
4. Connect Virtual Machine
5. Modify Index Page
6. Generalize VM
7. Capture the Virtual Machine using the “Capture” button in Portal.
8. Create Capture
select a resource group
select yes, share it to a gallery as an image version.
create a new gallery by selecting Create new.
provide a name for a new Image definition.
image version 1.0.0
Replication: select any additional region
Review and Create
9. After Capturing the Virtual Machine you can use the Custom Image
to create a new Virtual Machine.
10. Check the Web Page is working with the newly created Virtual
Machine’s Public IP
Azure Lab 6
Increase the Disk Size in Windows

Overview of Lab
In this Azure lab you will learn how to increase the OS Disk size
(Windows VM).

OS Disk (Managed Disk)


Azure managed disks are block-level storage volumes that are managed by
Azure and used with Azure Virtual Machines.

Managed disks are like a physical disk in an on-premises server but virtualized.

Premium Disk SSD


Azure Premium SSDs deliver high-performance and low-latency disk support
for virtual machines (VMs) with input/output (IO)-intensive workloads.

Standard SSD
Azure standard SSDs are optimised for workloads that need consistent
performance at lower IOPS levels.

Standard HDD
Azure standard HDDs deliver reliable, low-cost disk support for VMs running
latency-tolerant workloads.

Architecture of Lab
Step-by-Step Lab
1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Machine (Windows)
4. Connect Virtual Machine
5. Open Disk Management (diskmgmt.msc) check the size of disk
6. Go to Portal-Stop Virtual Machine
7. Go to VM Overview -> Disks -> Select OS Disk ->
Size+Performance
8. Increase Disk Size & Save
9. Start Virtual Machine
10. Connect Virtual Machine using RDP(mstsc)
11. Open Disk Management(diskmgmt.msc) recheck the disk size.
12. R-Click - Extend C Partition - Add Newly unallocated space.
13. Delete the Resource Group
Azure Lab 7
Azure Managed VM Data Disk and Snapshots

Overview of Lab

In this Azure Lab you will learn how to create an Incremental


Snapshot of a Data Disk and use that snapshot to create a New Data Disk.

Data Disk

A data disk is a managed disk that's attached to a virtual machine to store


application data, or other data you need to keep.

Disk Snapshot - Full Copy

A snapshot is a full, read-only copy of a virtual hard disk (VHD). You can use a
snapshot as a point-in-time backup, or to help troubleshoot virtual machine (VM)
issues.

Disk Snapshot - Incremental Copy

Incremental snapshots are point in time backups for managed disks that, when
taken, consist only of the changes since the last snapshot.
When you restore a disk from an incremental snapshot, the system reconstructs the
full disk which represents the point in time backup of the disk when the incremental
snapshot was taken.
Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Machine (Windows)
4. Go to VM Overview
5. Open Disk
6. Select Create and Attached a New Disk
7. Provide Disk Name (DataDisk1) And Size - Save
8. Connect Virtual Machine
9. Open DiskManagement(diskmgmt.msc)
10. Instalaise the New Disk
11. Right Click on the New Disk - Select New Simple Volume
12. Create Folders in a new partition
Snapshot
13. Go to Portal Search for Snapshot and Create Snapshot
14. Provide Name for Snapshot
15. Snapshot Type: Full Snapshot
16. Source Type: Disk
17. Select DataDisk1
Search Data Disk
18. Create Disk
19. Provide Disk Name (DataDisk2) And Size
20. Go to Portal Select Existing Disk
21. Go to Virtual Machine RDP
22. Open Disk Management
23. Right Click - Online
24. Check New Partition
25. Go to - DataDisk1 Create a new folder.
26. After adding a new folder create a Snapshot again
27. Search Snapshot in Portal to Create DataDisk3
28. Create Incremental Snapshot by selecting DataDisk1
29. create DataDisk3 Use existing Incremental Snapshot
30. Go to Virtual Machine Overview
Attach Existing Disk-Refresh - Select Disk
Go to Virtual Machine RDP
31. Open Disk Management
32. Right Click - Online
33. Check New Partition
34. Delete the Resource Group
Azure Lab 8
Linux VM Data Disk

Overview of Lab

Architecture of Lab

Step-by-Step Lab

35. Sign in to Portal


36. Create Resource Group
37. Create Virtual Machine (Linux)
38. Connect Linux Machine With Putty
39. Type lsblk check Disk detail
40. Go to VM Over view Select Disk -> Create and Attached a New
Disk
41. Putty->Find Disk - lsblk
42. Go to putty - mkfs -t ext4 /dev/sdc
- mkdir (disk Name)

43. Mount disk - mount /dev/sdc (disk Name)


- lsblk

44. Delete the Resource Group


Azure Lab 9
Azure Virtual Network with Subnet

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Network
Provide Name
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 10.0.1.0/24
Add
Create
4. Search Public IP Address -> Create
IP Version: IPv4
SKU: Basic
Tier: Regional
Provide Name
Routing Performance: Microsoft network

Select resource group and subscription

Select location
Create

5. Create a virtual machine


Networking:
Select Vnet and Subnet

Select public IP

Monitoring:
Boot diagnostics: disable
Create
6. Connect with RDP
7. Open command prompt: ipconfig

8. Delete Resource Group


Azure Lab 10
Azure Virtual Network with Private and Public
Subnet

Overview of Lab
Virtual Network

Azure Virtual Network is the fundamental building block for your


private network in Azure. VNet enables many types of Azure
resources, such as Azure Virtual Machines (VM), to securely
communicate with each other, the internet, and on-premises
networks.

VNet is similar to a traditional network that you'd operate in your own data
center, but brings with it additional benefits of Azure's infrastructure such as scale,
availability, and isolation.

Subnet

A subnet is a segmented piece of a larger network. More specifically,


subnets are a logical partition of an IP network into multiple, smaller network
Segments.

The Internet Protocol (IP) is the method for sending data from one
computer to another over the internet. Each computer, or host, on the internet
has at least one IP address as a unique identifier.

Public subnet

A public subnet is a subnet that's associated with a route table that has a
route to an internet gateway.
Architecture of Lab
1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Network
Provide Name
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 10.0.1.0/24
Add
Add Subnet:
Provide Subnet name: private-subnet
Subnet Address: 10.0.2.0/24
Add
4. Create a Public IP Address
5. Create a virtual machine (Windows)
Networking:
Virtual network: Select the Vnet name
subnet: Public subnet
Select public IP
Monitoring:
Boot diagnostics: disable
Create
6. Create virtual machine(Linux)
Networking:
Virtual network: Select the Vnet name
subnet: Private subnet
Public IP: None
Monitoring:
Boot diagnostics: disable
Create

7. Connect Windows VM Using RDP


Connect Linux VM with Private IP

8. Delete Resource Group


Azure Lab 11
External NIC attachment

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Network
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: public subnet
Subnet Address: 10.0.1.0/24
Add
Create
4. Search Public IP Address -> Create
IP Version: IPv4
SKU: Basic
Tier: Regional
Provide Name
Routing Performance: Microsoft network

Select resource group and subscription


Select location
Create

5. Create a virtual machine


6. Connect with RDP
7. Open Local Server
8. Click Ethernet
9. Click Disable Nic Card
10. Go to Portal
11. Search Network Interface
12. Create a New NIC card
13. Create Public IP -> Associate
14. Stop Virtual Machine
15. Click networking
16. Click Attach Network
17. Select New NIC
18. Detached Old Nic card
19. Associate the subnet with the new Nic card
20. Start Virtual Machine
21. Copy IP Address
22. Connect Virtual Machine Using RDP

23. Delete Resource Group


Azure Lab 12
NSG with one Subnet

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Network
Provide Name
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: private-subnet
Subnet Address: 10.0.2.0/24
Add

Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 10.0.1.0/24
Add
Create
4. Create Network Security Group
Go to NSG Overview
Inbound Security Rule
Add-> HTTP and RDP

5. Select subnet
Associate NSG with Subnet

6. Create a virtual machine


Networking:
Select Vnet and Subnet

Select public IP
Monitoring:
Boot diagnostics: disable
Create
7. Connect with RDP

8. Delete Resource Group


Azure Lab 13

NSG with Multiple Subnets

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create Virtual Network
Provide Name
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 10.0.1.0/24
Security:
Network Security Group: Create New
Name: Public NSG
Add
Add Subnet:
Provide Subnet name: private-subnet
Subnet Address: 10.0.2.0/24
Security:
Network Security Group: Create New
Name: Private NsG
Add
4. Go to Public NSG
Add Inbound Rule
Allow HTTP and RDP
Associate NSG with Subnet
5. Go to Private NSG
6. Associate NSG with Subnet
7. Create a virtual machine (Windows)
8. Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Public subnet
Select public IP
Monitoring:
Boot diagnostics: disable
Create
9. Create a virtual machine(Linux)
Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Private subnet
Public IP: None
Monitoring:
Boot diagnostics: disable
Create

10. Connect Windows VM Using RDP


11. Connect Linux VM with Private IP
Azure Lab 14

Virtual Network Peering

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group (Weast US)
3. Create Virtual Network (Weast US)

Provide Name
IP address
Vnet IP address: 10.0.0.0/16
Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 10.0.1.0/24
Security:
Network Security Group: Create New
Name: Public NSG
Add
Add Subnet:
Provide Subnet name: private-subnet
Subnet Address: 10.0.2.0/24
Security:
Network Security Group: Create New
Name: Private NsG
Add
4. Go to Public NSG
Add Inbound Rule
Allow HTTP and RDP
Associate NSG with Subnet
5. Go to Private NSG
6. Associate NSG with Subnet

7. Create Windows virtual machine (Weast US)


8. Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Public subnet
Select public IP
Monitoring:
Boot diagnostics: disable
Create
9. Create Linux virtual machine (Weast US)
Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Private subnet
Public IP: None
Monitoring:
Boot diagnostics: disable
Create

10. Connect Windows VM Using RDP


11. Connect Linux VM with Private IP

12. Create Resource Group (East US)


13. Create Virtual Network (East US)
Provide Name
IP address
Vnet IP address: 172.16.0.0/16
Add Subnet:
Provide Subnet name: public-subnet
Subnet Address: 172.16.1.0/24
Security:
Network Security Group: Create New
Name: Public NSG
Add
Add Subnet:
Provide Subnet name: private-subnet
Subnet Address: 172.16.2.0/24
Security:
Network Security Group: Create New
Name: Private NsG
Add
14. Go to Public NSG
Add Inbound Rule
Allow HTTP and RDP
Associate NSG with Subnet
15. Go to Private NSG
16. Associate NSG with Subnet
17. Create a windows virtual machine(East US)
18. Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Public subnet
Select public IP
Monitoring:
Boot diagnostics: disable
Create
19. Create a Linux virtual machine(East US)
Provide Basic Details
Networking:
Virtual network: Select the Vnet name
subnet: Private subnet
Public IP: None
Monitoring:
Boot diagnostics: disable
Create

Peering:
Go to Vnet (East/West)
Peering -> Provide name and Vnet
Create

20. Connect Windows VM Using RDP


21. Connect Linux VM with Private IP
22. Switch off the firewall on Both Windows virtual machine

Go to Command prompt- firewall.cpl


Advance settings -> property
Domain Profile -> Firewall state: off
Private Profile -> Firewall state: off
Public Profile -> Firewall state: off
23. Now ping VM
24. Delete Resource Group
Azure Lab 15
Private DNS Zone

Overview of Lab

Architecture of Lab

Step-by-Step Lab

1. Sign in to Portal
2. Create Resource Group
3. Create a Virtual Network
4. Create Public and Private Subnet with Nsg
5. Public NSG-> Add inbound Rules Associated with Public NSG
6. Private NSG-> Associate with Private NSG
7. Create Windows Virtual Machine (Public)
8. Create a Linux Virtual Machine (Private)
9. Connect both Virtual Machines
10.Install Apache
11. Go to Portal Create Private DNS Zone
12. Create Recordset

Name: WWW
IP Address: (Linux Private IP)
13. Create Virtual Network Link
14. Test Webserver with DNS Name From Windows Machine
Azure Lab 16
VPN Point to Site Connection

Overview of Lab

Architecture of Lab

Step-by-Step Lab
1. Sign in to Portal
Azure Side
2. Create Resource Group
3. Create a Virtual Network
Add Private Subnet-> Private NSG
Add Gateway Subnet
4. Create a Private Linux VM
5. Create a Virtual Network gateway
Name: Azure Side VPN
GateWay Type: VPN
VPN type: Route based
SKU: VpnGw1
Public IP Type: Stanard
Public IP Address: Create New
Provide Public IP Address Name
Enable Active-Active Mode: Disable
Configure BGP: Disable
Create
6. Open Azure Portal in New Tab
OnPrem Side
7. Create Resource Group
8. Create a Public Virtual Machine(Windows)
9. connect
Open a new Tab Search Azure point to site VPN Configure
Copy Root Certificate
10. Open Power Shell
Paste Root Certificate in Powershell
Enter
11. Copy Client Certificate
Paste Client Certificate in Powershell
Enter
12. Type mmc
Click File
Select Add or remove Snapin
Add Certificate
13. Right Click Root Certificate
All Task
Export
Select No , do not export the private key
Next
Select Base-64 encoded X.509 as export file format.
Browse and Save in Desktop
14. R.Click Client Certificate
Click all Task
Select Yes, Export the Private Key
Next
Format: Personal Information Exchanges
Define PassWord
Save in Desktop
15. Go to VM Desktop
R.Click Child Certificate
define PassWord
R.Click Root Certificate Open with Notepad
Edit First and Last Line
(Begin Certificate/ End Certificate)
Copy Certificate

16. Go to VPN Gateway


Click Point to Site Configuration
Click Configure Now
Address Pool: 192.168.0.0/16
Tunnel type: IKEv2 VPN
Authentication type: Azure Certificate
Root Certificate-> Name: Root Certificate
Public Certificate Data: Paste the Root Certificate Data
Save
17. Download VPN Gateway
Extract the File
Copy and Past the file into a Virtual Machine
18. Install Vpn Gateway file in Windows Virtual Machine
Windows And 64-> VPN Client Setup->more-> Install
Go to Azure VPN Connection
19. Click Connect
20. Open Command Prompt: Ping with Linux Virtual Machine

Delete Resource Group

You might also like