Compute
Compute
Images
✓ Images are used in Azure to provide a new virtual machine with an operating system.
✓ An image might also have one or more data disks.
✓ Images are available from several sources: Azure offers images in the Marketplace. You'll find
recent versions of Windows Server and distributions of the Linux operating system.
Types of images in azure: There are 2 types.
1) OS image: This is the default images which Microsoft providing in the market place.
2) VM image: This is the image which we created based on the company requirement.
OS Image:
✓ This again subdivided into 2 types. Those are Gen1 and Gen2.
✓ Majorly we are using now a days gen2. Gen1 is old image.
VM Image:
✓ This is a customized image or we called as golden image.
✓ Each and every company will be having one customized image.
✓ This contains the set of software which are required for the software development.
✓ This is also vulnerable free image.
Demo-2:
✓ Click on create the VM, select the image as Linux image or Linux custom image.
✓ We got 2 options, one option is username and password. Provide them.
✓ After VM created click on login using the credentials.
Demo-3:
✓ Click on create the VM, select the image as Linux image or Linux custom image.
✓ We got 2 options, second option is ssh public key.
✓ We have 3 check boxed there, username. This is the root user we are going to provide on the server.
✓ SSH public key source: We have 3 options here.
1. Generate new public key pair: If this option selected, we need to provide the name of the key pair. While review
and creating the VM, it will allow you to download the pem file. Using the file separate both public key and
private key using puttygen. Go to puttygen and click on load the pem file and save the both public and private
keys. After that use private key to login to the VM.
2. Use existing key store in Azure: This required azure key vault. We need to upload the public key to key vault.
Then use the key to create a VM.
3. Use the existing public Key: Here we use the existing public key or generate the new public and private key,
then use them in VM creation and login.
✓ For login click on putty, then click on ssh, after that click on auth and click on credentials. Upload the private key in
the private key for authentication box. Also on the session provide the IP or DNS name of the server. Then provide
your user name.
Inbound port rules:
✓ Select which virtual machine network ports are accessible from the public internet.
✓ These are inbound ports on the network.
✓ Once you selected the ports, these ports will be automatically created on the NSG in the incoming rules
session.
✓ Its our which weather to opt this ports or not.
✓ We have majorly 4 types of ports are applicable here. Those are SSH(22), HTTP(80), HTTPS(443) and RDP
(3389).
Public inbound ports: This option only will allow you to select public ports or not.
Select inbound ports: If you opted the public inbound ports, here we have option to select what port needs to be
opened to the internet.
Delete NIC when VM is deleted: This option is used to cost control. This will allows you to delete NIC once the VM’s gets deleted by you.
Accelerated network:
✓ With this option set to on, which will improves the networking performance on the VM.
✓ This is bypasses the host from the data path which reduces the latency and cpu utilization on network supported VM types.
✓ Without the accelerated network option enabled the traffic will flow through network switch (NSG, routes, firewalls etc..) of the
VM.
✓ With accelerated network option, the entire traffic first comes to NIC and go to VM. The NIC contains entire information of network.
Hence NIC will respond fast, and send the traffic as per the client request.
Demo:
✓ By Default accelerated network is on.
✓ Create a VM with accelerated network enabled option.
✓ Go to NIC and check the properties, you will find the accelerated network is enabled.
✓ If you want to change the acceleration set to off first shutdown the VM.
✓ Open cloud shell, by clicking the cloud shell option on the portal. And run the following
command.
• To get the NIC info
$NIC=Get-AzNetworkInterface -Name devvm430_z1 -ResourceGroupName devvm_group
• Declare the NIC Accelerated property to false.
$NIC.EnableAcceleratedNetworking=$false
• Set the NIC Accelerated property to false.
$NIC | Set-AzNetworkInterface
• Start the VM using the following command.
Start-AzVM -ResourceGroup dev -Name devvm
✓ Load Balancer: This is external devise which allows route the target VM in proper manner. We
have 3 types. Currently lets take it as None.
Microsoft Defender for Cloud: This is additional security later on the VM, which gives the information
about the vulnerabilities, traffic monitoring, and other security aspects. This requires additional
license.
Identity: If this option enabled, will get one user type principle in the active directory.
Azure AD: If you want access as per azure AD, then we ned to integrate this option.
Auto-shutdown: This helps the costing. This allows shutdown your VM at a particular time. We also
can have the email notification VM shutdown info.
Alerts: These are part of azure monitoring. If this option selected the default alerts will be configured
on the VM.
Boot Diagnostics: Use this feature to troubleshoot boot failures for custom or platform images. Boot
diagnostics with managed storage account significantly improves creation time of Virtual machines
by using pre-provisioned storage accounts managed by Microsoft. We have 3 methods.
• Enabled with managed storage account: This will enable boot diagnostics with Microsoft
managed storage account.
• Enable with custom storage account: This will also enable boot diagnostics. But with
customer storage account.
• Disable: Boot diagnostics will be disabled.
Extensions: These are all additional software provided by Microsoft. If you want we can install while
creating the VM.
✓ Custom data and cloud init: This helps to write our own scripts and execute while creating the VM.
#!/bin/bash
apt install apache2 -y
service apache2 start
echo "Hello DevOps" > /var/www/html/index.html
✓ User Data:
✓ User data is a new version of custom data and it offers added benefits.
✓ This is also same like custom data option in the azure VM.
✓ User data can be retrieved from Azure Instance Metadata Service(IMDS) after provision.
✓ User data is persistent. It will be available during the lifetime of the VM.
Availability Set/ Availability zone/ VMSS
Availability Set:
• This is the concept of servers within the data center.
• This contains multiple servers.
Fault Domains: In datacenter each rack of servers will have its own power supply and network
switch. Each rack in datacenter is one fault domain. This required for eliminating the single point
of failure. Eg: if only one switch, if that gone, entire datacenter servers will gone.
Why not the data center servers are present below way.
Reason: If the network switch or power supply switch has problem then all servers in the data
center will not work.
Update domains: This is logical separation of each and every VM. This used for patching
updates.
Availability set: It is made up of multiple fault domains and update domains.
Demo:
1. Create Availability set with the specific options.
2. Go to VM and create the VM with availability set option and select our availability
set.
Availability Zone:
➢ A Zone is subset of region.
➢ Each zone has one or more data centers.
➢ Each data center of course has independent power and network switch.
➢ The region who has availability zone has minimum 3 zones.
➢ And each availability zone has its own fault domains and update domains. That means if you
created 3 vms in all 3 zones your vms will have 3 update domains and 3 fault domains.
➢ If one VM deleted still you have 2 more in another zones. The chances of losing the VM is very less.
SLA for VM’s:
Demo:
Create a VM with availability zone option enabled.
VMSS:
✓ The abbreviation of VMSS is virtual machine scale set.
✓ This used to create and manage the multiple VM’s easily.
Use Case:
1. Initially business will only opt for few servers. Because they started just now.
2. But when ever the business goes they need to add the similar VM’s to the tier for effective
load distribution. This is because of traffic increased.
3. For this example we need to use VMSS.
EG: Gmail, facebook, Instagram.
VMSS:
1. Easily create and manage multiple VM’s.
2. All VM’s are in scale set are identical or flexible.
3. Azure load balancer also deploys along with VMSS for load balancing the VM’s
4. We can do the auto scale based on the metrics
Network (V-net/Subnet)
VMSS
Network (V-net/Subnet)
VMSS
✓ A Recovery Services vault is a management entity that stores recovery points that are created over
time, and it provides an interface to perform backup-related operations
✓ These operations include taking on-demand backups, performing restores, and creating backup
policies.
✓ Also this is used on the disaster recovery scenarios.
✓ Recovery service vault can do the back up of Azure VM’s, Azure file shares, SQL server in azure VM,
SAP Hana in Azure VM, Microsoft Sql server, sharePoint, also on-prem servers (shares, vmware, sql
server, etc…).
Networking of Site Recovery vault: We have 2 types of networking.
1) Public network: Traffic from all public networks can access this resource.
2) Private end point: Private endpoints allow access to this resource using a private IP address from a
virtual network, effectively bringing the service into your virtual network.
BackUp:
✓ This is major resource for creating the back up and backup policies for azure VM’s.
✓ The way it will do the back up it, all the disks which are attached to the VM will be taken as the
snapshots and store into the azure site recovery vault.
✓ The backup will be taken as per the policy attached to the VM.
Backup Policy: By default 3 will have 3 policies already created while creating the site recovery
vault.
1) HourlyLogBackup: This policy is for SQL servers in azure VM. The backup will be taken every 1 hour
and transfer the snapshots to site recovery vault.
2) Default Policy: The most used policies. This will applied on the Azure Virtual machines. The
frequency is every day one backup. And this for old disks. This uses standard policy type.
3) Enhanced Policy: Enthused policy is also for azure virtual machines. Using this we can have
multiple snapshots in a day. And this will supports the Ultra SSD (preview) and Premium SSD v2
(preview) disks as well. This uses enhanced policy type.
NAT: incoming traffic allow. By default no traffic allowed from the load balancer ip.
1) Click on incoming nat, and create nat rule using vm’s or using pools.
2) Provide the IP, and target ip could be 3389. And test the connectivity it should work now.
Application Gateway
Path-Based Routing: In the rule we can do the path-based routing. This means, when ever the path
changes on a single url, the request will go to different backend or server.
Redirection: This is used for the redirecting the listeners or external urls.
Redirection Type: we have total 4 ways, the majorly used is permanent. This is just a cause. The
redirection will happen similar way if you select any option.
Redirection target: We can redirect our listeners or external sites.
1. Listener: The current listener on the rule will be redirected to the another listerner url which
again mentioned in the same application gateway.
2. External Site: We need to mention our external url. The current URL of the listener will be
redirected to updated url on the rule.
Listener:
➢ A listener is a logical entity that checks for incoming connection requests by using the port, protocol, host, and IP
address.
➢ When you configure the listener, you must enter values for these that match the corresponding values in the incoming
request on the gateway.
➢ We have total 2 types of listeners in the gateway.
1) Basic: This type of listener listens to a single domain site, where it has a single DNS mapping to the IP address of the
application gateway (frontend ip address). This listener configuration is required when you host a single site behind an
application gateway.
2) Multi Site: This listener configuration is required when you want to configure routing based on host name or domain
name for more than one web application on the same application gateway. It allows you to configure a more efficient
topology for your deployments by adding up to 100+ websites to one application gateway. Each website can be
directed to its own backend pool. For example, three domains, contoso.com, fabrikam.com, and adatum.com, point to
the IP address of the application gateway.
1) Single: Only you have one host name, then use this option.
2) Multiple Wild cards: on the multisite configurations, if you have more than one hostnames of wild card names
then use this option.
Error Page URL: For suppose your backend is not working find, and you want the custom page needs be displayed to your
customer when ever there is wanted or unwanted downtime, keep that url here.
Certificate: When ever you want the traffic needs to present on the secure protocol, then we need to upload our
certificate to the listener. We need to select the port 443 on this requirement.
Backend Settings: How the traffic has to go to the backend from the frontend can be mentioned
here.
Private link: Private link configuration allows enablement of this resource to be accessed privately
from another virtual network, through private endpoint connection.
SSL Settings: We can upload the backend certificate here and use at the time of configuration.
Health Probe: This exactly work same as the health probe in azure load balancers.
➢ This will monitor the health of the backend server on the gateway.
➢ This also can be monitored external urls.
➢ We need to mention the host and the protocol, path etc…
Interval: Probe interval in seconds. This value is the time interval between two consecutive probes.
Timeout: Probe time-out in seconds. If a valid response is not received within this time-out period, the probe is marked
as failed. Note that the time-out value should not be more than the Interval value.
Unhealthy Threshold: Probe retry count. The back-end server is marked down after the consecutive probe failure count
reaches the unhealthy threshold.
Demo:
1) Create 2 ubuntu virtual machines.
2) Open the required ports on the network security group.
3) Install apache2 on each server and update the html pages.
4) Check the application using pubic ip of the servers.
5) Click on application gateway. And create one.
6) On the frontent ip, select public IP. That means we are creating external gateway.
7) Create 2 backends one is app1 backend and second one is app2 backend.
8) Click on add routing rule, mention the name and rule number.
9) Provide the listener details, listener type is basic.
10) Select targe type as backend pool and select app1 backend target, and create new backend
settings.
11)Click on path based routing and create 2 back based routings.
12)1st route path should be /app1/*, target name, and mention the details.
13)Do the same thing for the second path.
14)Once everything is done, create the application gateway.
15)Finally test the application using frontend ip and path.
16)Click on health probe and crate new, name, hostname, protocol, path should be /app1/, select the
backend settings and click on test. Once test is done, then click on add the probe.
CDN and frount Door:
CDN: this is a load balancing solution to the world where we can retrieve the application much faster due to edge
location.
→ The way how it works is initially the application or data will be copied from the source region to remaining all azure
regions we called them as edge locations. So next time if you hit again the same application the data or site we will
access from your near location.
Demo: Create a azure app service.
→ Create container and made like a public.
→ Upload some files
→ Access it from internet.
→ Now create cdn
→ Create end point
→ Now open the website by changing with cnd end point.
→ We can clearly see the website response.
Thank You! Happy Learning