Az 104
Az 104
Skaria
Certification Roadmap
Configuring
containers
Identity
Learn how to use Azure Active Directory to secure your identities. Also, understand how users and groups are implemented in Azure AD.
Self-Service Password
Azure Active Directory Azure AD Join
Overview of Azure AD and concepts Joining and registering devices to Azure
Reset
Enabling users to reset their passwords
related to Azure AD AD
without reaching out to IT helpdesk.
Multi-tenant
User Accounts Group Accounts
Managing users and bulk user Group Management in Azure AD
environments
operations in Azure AD. Managing multiple tenants or directories
Managing Azure Active
Directory
Section Overview
Identity
Learn how to use Azure Active Directory to secure your identities. Also, understand how users and groups are implemented in Azure AD.
Self-Service Password
Azure Active Directory Azure AD Join
Overview of Azure AD and concepts Joining and registering devices to Azure
Reset
Enabling users to reset their passwords
related to Azure AD AD
without reaching out to IT helpdesk.
Multi-tenant
User Accounts Group Accounts
Managing users and bulk user Group Management in Azure AD
environments
operations in Azure AD. Managing multiple tenants or directories
Introduction to Azure AD
Azure Active Directory
AZURE Active
Directory
Offers self-service options including password
reset, authentication, device management, hybrid On-Premises Active
identities, and single sign-on. Application Directory
Premium No directory Single Sign on B2B O365 Identity Hybrid Conditional Identity Identity
P2 object limit & Core IAM collaboration & Access identities Access Protection Governance
Create a user: This will create a user in your Azure AD. The
identity created as part of this process will have a sign in name
from your tenant.
Group Types
Security groups
Assignment Types
Assigned
Dynamic user
Subscriptions can also help in setting There are different types of subscriptions
up environmental boundaries based on the use case scenario.
Every subscription will have a unique Subscription also act as a scope for
ID and it’s called the subscription ID. access management.
Subscription offer types
Resource groups
Each subscription will contain one or more resources
groups for logically grouping resources like virtual
machines, databases etc.
Production Dev
Hierarchy helps in implementing policies, access
and cost management
Resources
Subscription C
Subscription A Subscription B
Working with Role Based
Access Control
Role Based Access Control
Enables administrators to grant access to Azure resources and to segregate duties within the team.
],
"NotDataActions": [
Custom roles ],
"AssignableScopes": [
"/"
]
}
Scope
Management Group
Subscription
Resource Group
Resources
Azure RBAC vs Azure AD Roles
Global Admin/
/ Root User Access Admin
(elevated access)
Azure RBAC
Roles
Root Management Subscription
Owner Group
Contributor
Reader Management
User access admin
Group Resource Group
…
Azure RBAC
Resource
Roles
Owner Contributor
Full access to all resources and can Create and manage all types of
O C
Reader R U User Access Administrator
Read access to all resources, no User access to Azure resources can be
permission to make changes to the managed using this role.
resources.
Custom RBAC Roles
Custom RBAC roles can be used to create fine tuned roles for
your environment, if the built-in roles doesn’t meet your specific
needs
Tags doesn’t follow inheritance by default, we can use Azure Policy to inherit tags from resource group or subscription.
Resource Locks
Resource Locks
Avoids accidental
Inheritance
changes
With the help of resource locks, we can protect Locks can be applied at the subscription, resource
our resources from accidental changes or group, and resource level. The lock will inherit to
deletion. the lower scopes.
Resources with read-only locks cannot be Resources with delete lock can be modified,
modified and this will prevent any changes to the however, they cannot be deleted. Ideal for
resource. resources which you would like to modify and at
the same time, prevent accidental deletion.
.
Analyzing costs
Analyzing costs
Budgets and
Cost Analysis Export data
Recommendations
We can analyze the current spending and see cost Using Cost Management, we can define fine tuned We can export our cost data to a storage account
forecast. We can also connect our AWS cost to budgets targeting specific scopes and further narrow it in Azure. The data can be exported as a one-time
Azure Cost Management down using filters. We can also generate cost related export or a recurring export which works based on
recommendations. the schedule we define.
.
Cost savings
Azure Reserved Azure Hybrid Benefit
Instances (RI) (AHUB)
For instances that are planned for long term and You can purchase Windows and SQL licenses from
is running 24x7 can be reserved. Reservations can Software Assurance can use with your Azure VMs
be purchased for 1 year or 3 year with upfront and PaaS services. AHUB is cheaper than PAYG
payment or equated monthly payments. licensing cost
Credits Regions
Credit based subscriptions such Visual Studio In Azure, every region has a different pricing.
Enterprise, Visual Studio Professional, MPN could When you deploying resources, choose low-cost
provide you monthly credits that can be used for regions. While selecting low-cost regions, make
testing and developing solutions on Azure. sure you are not comprising the compliance or
performance of your workloads.
.
100% 60% 80%
PAYG Azure Azure
RI RI +
AHUB
Azure Policy
Azure Policy
Helps us to create, manage, and assign policies. Policies can be used to define organizational standards and identify non-compliant resources
Definition Scope
D S
Policy definition is a JSON document Like RBAC, we must specify the scope
which is used to define the policy and to which we want to enforce the
its effect. Azure has built-in policies policy. We can scope to management
that we can use, or you can write your group, subscription, or to resource
own custom policies group.
Assignment
Assignment is the process assigning a
policy definition to a scope. Once it’s
assigned policy enforcement is done.
A T
C Compliance
After assigning the policy, we can
evaluate the compliance to
understand compliant and non-
compliant resources.
Azure Policy – Use cases
Azure Backup
should be enabled
for Virtual
Not allowed Require a tag Allowed Machines
Audit all VMs and
Allowed Virtual
resource types on resources locations Machine SKUs
make sure VM
Cosmos DB, ExpressRoute, CostCenter
East US, West US and Backup is enabled BS, DSv2, DSv3, F, FS
Redis Cache, Cognitive
Central US
Services
Azure Initiative
Creating and configuring
virtual networks
Virtual Networks
Logical representation of your network in Every VNet instance in Azure is private and With the help of VNets, we can extend our Virtual Network is responsible for facilitating
the cloud. Azure Virtual Networks (VNets) dedicated communication to on-premises datacenters connectivity between Azure Virtual Machines and
helps us to create and manage networking and other cloud providers securely. other Azure services. Also, enables Azure VMs to
in Azure connect to Internet.
Virtual Network Concepts
Region
Virtual Network
(192.168.0.0/16)
Virtual Network
(192.168.0.0/16)
Static Dynamic
Allocation methods Helps in setting up static IP address for domain controllers, web servers This is the default option, where the IP address is dynamically allocated from
and DNS servers which do not change even if the servers are rebooted. the address pool. If you restart a server and if the previous IP address is not
Also used with services such internal LBs and Application Gateways. available, Azure will assign another available IP address from the address
space.
Public IP addresses
Virtual Network
Allocation types : Static and Dynamic (192.168.1.0/24)
default
(192.168.1.0/24)
frontendSubnet databaseSubnet
192.168.1.0/24 192.168.2.0/26
Communication via Site-to-Site and ExpressRoute connection while using VPN gateways
User Defined Routes
NVA
dmzSubnet
System route
192.168.0.0/24
Virtual Network
(192.168.0.0/16)
Route table
frontendSubnet databaseSubnet
192.168.1.0/24 192.168.2.0/26
The next hope can be a virtual network gateway, virtual network, internet,
or virtual appliance
Service Endpoints
Service Endpoints Virtual Network
(192.168.0.0/16)
Source IP : VM Private IP
Service Endpoint
Public IP
192.168.1.0/24
Azure Storage Service
Supported services include Azure Storage, Azure SQL Database, Azure Synapse Analytics, Azure Database for PostgreSQL server, Azure
Database for MySQL server, Azure Database for MariaDB server, Azure Cosmos DB, Azure Key Vault, Azure Service Bus, Azure Event
Hubs, ADLS Gen1, Azure App Service, Azure Cognitive Services, and Azure Container Registry (preview)
Private Link
Private Link Virtual Network
(192.168.0.0/16)
ServicePrivate
Endpoint
Link
Private Endpoint
Virtual Machine Storage account
192.168.1.4 kodekloud
workloadSubnet
192.168.1.0/24
Azure Storage Service
kodekloud.org
Azure DNS will help us host safe and The zone name should be unique within the You can create delegated DNS zones in Records having the same name and type are
kodekloud.org
reliable DNS zones for name resolution. resource group. You can have same zone within your on-premises DNS servers can provide grouped together to form record sets. Maximum
Delegated DNS zone
We will be creating records inside this DNS multiple resource groups, in this case the name the Azure DNS name servers for name number of records allowed to a record set is 20
servers will be different for these zones.
zone. resolution. and they need to be unique.
>_
dig @ns1-09.azure-dns.com.
azure.kodekloud.org A
Private zones
Private DNS zones
Name resolution for services deployed in Azure Virtual Network
Name IP
vm-01 vm-02 vm-03
10.0.0.4 10.0.0.5 10.0.0.6
vm-01 10.0.0.4
vm-04 10.1.0.4
vm-05 10.1.0.5
NSG operate at layer 4 and allows us to filter the NSG comprises a set of priority-based rules that
incoming and outgoing traffic from a virtual can be used to allow or deny inbound or
network outbound traffic.
Association Evaluation
NSGs can be associated to subnets and network Rules applied at subnet and network interface
interfaces. You can associate multiple subnets level is evaluated separately. Traffic requires
and network interfaces to a single NSG. “allow” rule at both levels to be admitted.
.
Network Security Group Rules
Priority: Lower the number higher the priority. Values range from
100-4096. Values in 65000 range is for default rules.
Subnet
HTTP
NSG
HTTPHTTP
Inbound traffic : Source → Subnet NSG → Network Interface NSG
HTTP
Outbound traffic : VM → Network interface NSG → Subnet NSG
NSG
HTTP
HTTP
Azure Firewall
Azure Firewall
Public IP support
Threat
Intelligence
Multiple types
of rules
Redundancy
Highly available
and scalable
Azure Firewall
SpokeNetworkA CentralVNet
AzureFirewallSubnet
Internet
SpokeNetworkB Azure Firewall
Connectivity to on-premises
Planning VMs
Shared responsibility model
Networking Naming
We need to plan our networking address spaces Naming convention helps us in recognizing VMs by
based on the number of virtual machines you are looking their names. Try adding environment, role,
planning to create. Also, make sure the network service, and region details to VM names. For
Location L P Pricing
You need to check the availability of VM sizes in Consider pricing models such as Pay-As-You-Go and
Azure regions. Choose low-cost regions if you are Reserved Instances. For low priority development
flexible with data residency. Also, for production workloads choose Spot VMs. Licensing cost can be
resources choose regions closer to your customers reduced by using Azure Hybrid Benefit.
to avoid performance issues. Azure has 60+ regions
to choose from.
Managing VM sizes
Virtual Machine Sizing
Choosing the virtual machine size and family depends on what type of workload you are running. Azure offers different VM families targeting different types of workloads
Type Sizes Targeted workloads
General Purpose B, Dsv3, Dv3, Dasv4, Dav4, DSv2, Dv2, Balanced CPU-to-memory ratio. Ideal for testing and
Av2, DC, DCv2, Dv4, Dsv4, Ddv4, Ddsv4, development, small to medium databases, and low to medium
Dv5, Dsv5, Ddv5, Ddsv5, Dasv5, Dadsv5 traffic web servers.
Compute optimized F, Fs, Fsv2, FX High CPU-to-memory ratio. Good for medium traffic web
servers, network appliances, batch processes, and application
servers.
Memory optimized Esv3, Ev3, Easv4, Eav4, Ebdsv5, Ebsv5, High memory-to-CPU ratio. Great for relational database
Ev4, Esv4, Edv4, Edsv4, Ev5, Esv5, Edv5, servers, medium to large caches, and in-memory analytics.
Edsv5, Easv5, Eadsv5, Mv2, M, DSv2, Dv2
Storage optimized LSv2 High disk throughput and IO ideal for Big Data, SQL, NoSQL
databases, data warehousing and large transactional
databases.
GPU NC, NCv2, NCv3, NCasT4_v3, ND, NDv2, Specialized virtual machines targeted for heavy graphic
NV, NVv3, NVv4, NDasrA100_v4, rendering and video editing, as well as model training and
NDm_A100_v4 inferencing (ND) with deep learning. Available with single or
multiple GPUs.
HPC HB, HBv2, HBv3, HC, H Our fastest and most powerful CPU virtual machines with
optional high-throughput network interfaces (RDMA).
Confidential computing DCsv2, DCsv3, and DCdsv3 Confidential computing allows you to isolate your sensitive
data while it's being processed. Ideal for banks and hospitals
which handle customer PII.
Virtual Machine
Performance tiers
Azure disks can be created in different performance tiers such as Standard
HDD, Standard SSD, Premium SSD or Ultra SSD. Based on the tiers the
IOPS and performance will vary. Standard HDD is the cheapest option. You
can change tier even after creating the disks. Premium SSD is required for
IO intensive applications.
OS Disk Temporary disk Data disk
Management
When creating VMs, you can choose between, Managed disks and
Unmanaged disks. In Unmanaged disks, customer needs to take care of
the underlying storage account which is used to store the VHD file. In
case of Managed disks, the underlying storage account will be managed
by Microsoft, and you can use the service. Microsoft recommends to use Azure Blob Storage
Managed disks.
Creating VMs
Creating Virtual Machine (Portal)
Virtual Network
(192.168.0.0/16)
Bastion Host
Virtual Machine
Virtual Machine
192.168.1.4 192.168.0.4
AzureBastionSubnet
jumboxSubnet
workloadSubnet
192.168.0.0/24
192.168.1.0/24
Connecting to Virtual Machines
Unplanned Hardware
Maintenance
Unexpected downtime
Planned maintenance
Configuring High Availability
Region B
Region C
Availability Zone Availability Zone Availability Zone
Region A Region D
GEOGRAPHY
Availability Set
Datacenter
FD0 FD1 FD2
UD0
UD1 UD4
UD3
UD2
Availability zones
Availability Zone
Region A
Deploying VM Scale Sets
Deploying VM Scale Sets
Vertical Scaling
Horizontal Scaling
Current
Current count
instance size Scale out
Increasing or decreasing number of instances is called horizontal
scaling. This is usually automated with the help of some criteria like
Scale in
Scale down Scale up
metrics or schedule; hence it’s also called autoscaling. Increasing
instances is called scale out and decreasing instances is called scale in.
Deploying VM Scale Sets
For images from marketplace and custom images, scale set can
scale up to 1000 instances. If you create scale set using a
managed image, the limit is set to 600.
Azure Load Balancer
Azure Load Balancer
Backend
Load Balancer SKU
Basic Load Balancer Standard Load Balancer
Ideal for testing and development. No SLA offered Recommended for production scenarios because of the SLA. Offers
HTTPS health probe
80
WebSubnet
Internal Load Balancer
Port 80
Virtual
VirtualNetwork
Network
Ideal for internal workloads Public Load Balancer
80
WebSubnet
distributed across the backend servers
DataSubnet
Internal Load Balancer
Load Balancer Rules Admin Users
The incoming traffic to backend pools is distributed with the help of load
WebSubnet
Instead of backend pool, we can target a specific virtual machine and create a
NAT rule. Frontend IP and port combination is used to send traffic to IP and port
of the designated VM.
Outbound rule
Allows instances in the backend pool to communicate to the Internet and other
endpoint.
Session Persistence
None (default)
Client IP
This is also called as three-tuple hash, where the hash of source IP,
destination IP and protocol is used to route the traffic to the VM. Requests
coming from same IP and protocol will be handled by the same VM.
Azure Application
Gateway
Application Gateway
HTTP POOL
Setting
VMSS
Servers
Manages HTTP, HTTPS, HTTP/2, and WebSocket Requests can be routed to the backend pool based on URL The web servers can be hosted in Azure Virtual
requests. Requests will be routed to the backend pool. also known as path-based routing. Also, we can host multiple Machines, Azure Virtual Machine Scale Sets, Azure App
Web Application Firewall can be added to Application sites behind an application gateway. Features includes URL Services, and even on-premises servers.
Gateway as an option component. Redirect, SSL termination, Rewrite HTTP headers and Custom
error pages.
Application Gateway - Components
Frontend IP
Defines the VIP or ILB Frontend listener on
a port, IP and
certificate
Listener
For SSL
offloading
Port Certificate
Bridge between frontend
Rule and backend
Based on the path in the URL, we can route the request Multiple sites can be hosted behind a single application
to different backend pools. Ideal for routing requests to gateway. Based on the domain, the request can be routed to
different backend pools optimized for different paths. the backend pool hosting the requested domain.
Modern CDN solution that provides reliable, fast content delivery . ATM or Azure Traffic Manager is a DNS based load balancer. Traffic coming to
Azure Front Door is a global solution which leverages the Microsoft’s your public facing applications can be distributed across the globe with the
global edge network with hundreds of global and local point-of- help of ATM.
presence locations. These endpoints are distributed across the
As this is a DNS load balancer, it uses DNS to direct the client request to an
globe and closer to your customers.
endpoint based on the routing rule we configure. Traffic Manager finds the best
We can deploy our solutions in multiple regions and load balance endpoint for you based on the routing and returns a DNS response with the
using the Azure Front Door. Path based routing and multiple-site endpoint name. Client then directly reaches out to the endpoint.
routing is available.
ATM can be used with the public facing services deployed in Azure or non-
Web Application Firewall can be added as an optional component. Azure environments. Routing methods includes Priority, Weighted, Geography,
Performance and Nested Profile.
Comparing Load Balancing Solutions
Feature Application Gateway Front Door Load Balancer Traffic Manager
Usage Optimize delivery from Scalable, security- Balance inbound and Distribute traffic optimally
application server farms enhanced delivery point outbound connections to services across global
while increasing for global, micro service- and requests to your Azure regions, while
application security with based web applications. applications or server providing high availability
web application firewall. endpoints. and responsiveness.
Protocols HTTP, HTTPS, HTTP2 HTTP, HTTPS, HTTP2 TCP, UDP Any
Internal support Yes Yes
Cross Region No Yes Preview Yes
Environment Azure, non-Azure cloud, Azure, non-Azure cloud, Azure Azure, non-Azure cloud,
on premises on premises on premises
Security WAF WAF, NSG NSG -
Admins
Subnet AzureBastionSubnet
Virtual Network
Azure Bastion
No need to manage and write complex rules in your NSG Since we are not exposing any public IPs, attackers cannot perform
as Bastion is connecting to private IP address port scanning.
Bastion is a platform managed service and hardening in Basic SKU provides base functionality as in direct RDP/SSH access. The Standard
one place only. SKU enables premium features that allow Azure Bastion to manage remote
connectivity at a larger scale.
Intersite connectivity
Intersite Connectivity – Azure-to-Azure
connectivity
Peering
VNet-to-Vnet Connection
Site-to-Site Connection
GatewaySubnet
(192.16.0.0/24)
ExpressRoute Connection
subnet ERSubnet
(192.16.1.0/24) (192.16.2.0/24)
Virtual Network Peering
Virtual Network Peering
VNet-A VNet-A
Global VNet Peering VNet-B Peering Regional VNet Peering VNet-CVNet-B
Region X Region Y
Types of peering: Global VNet Peering and Regional VNet High speed data transfer, easy configuration and great
Peering. performance
VNet-to-VNet VNet B
VNet A
LON NYC
VPN Gateway SKUs
Gen SKU S2S/VNet-to-VNet Tunnels P2S IKEv2 Connections Throughput Benchmark
SKU is selected based on the number of Within generation, we can resize the VPN gateway In addition to the above SKUs, we have Basic SKU
connections and throughput you require. based on the requirement. which is considered as legacy and should not be
used.
VNet-to-VNet Connection
Establish VNet-to-VNet connection using VPN gateways
Create Gateway Subnet in Create the VPN gateway in Create the VPN connection
both virtual networks. both virtual networks
Number of connections Up to 500 VNet peerings per VNet One VNet can have only VPN Gateway and
connection count is SKU dependent
Pricing Ingress + Egress Gateway hourly cost + egress
Route Routed via Microsoft backbone network and Routed via public internet, however encrypted
is private
Public IP No public IP or internet is used Public IP is involved
Use cases Data replication, database Scenarios where encryption is needed and not
failover, and other scenarios latency/bandwidth sensitive.
needing frequent backups of
large data.
Site-to-Site and Point-to-
Site
Site-to-Site connection
Connecting to your virtual network to an on-premises site or non-Azure site.
Site-to-Site
Site-to-Site
vnet-a Site-to-Site vnet-b vnet-c
On-premises network
Gateway Transit
vnet-b
Peering
Peering Peering
hub-vnet
vnet-a vnet-c
S2S
On-premises network
High Availability
High Availability
Active/standby Active/Active
There will be always two instances of VPN The cost of the gateway includes the cost of two High availability can be ensured by enabling
Gateway, default selection is Active/standby instances. Regardless of whether it’s Active/active configuration. You should make sure
active/standby or active/active cost will be same. that you have similar setup in on-premises.
ExpressRoute
ExpressRoute
Any-to-Any (IPVPN)
With the integration of your WAN to Microsoft cloud, you
can make it look like Microsoft cloud is one of your branch
offices. Supports managed L3 connectivity.
Direct model
Establish connectivity by directly connecting to Microsoft’s
global network at a peering location nearby.
ExpressRoute
ExpressRoute Gateway
Site-to-Site
Corp HQ
VPN Gateway
Site-to-Site
Branch office
Seamless connectivity
Connects Azure virtual networks and resources to
the hub seamlessly.
Advanced architecture
With the help VWAN, we can advance our hub-
spoke architecture. End-to-end traffic flow can be
visualized.
Management layer
Azure Resource Manager or ARM is the
management layer responsible for creating,
updating and managing resources.
Features
Access Control, Locks, Tags, Resource Groups,
and Templates are some of the features offered
by ARM, which was not available in the previous
model – Azure Service Manager
Virtual Machine
SQL Database
ARM template design
Nested VM
template Virtual Machine
Nested App
Template App Service
Service reference()
template
SQL Database
Nested SQL
template
ARM template design
VM Virtual Machine
template
reference()
SQL Database
SQL
template
ARM Extension for VS Code (optional)
ARM Template structure
Visual Studio Code
{
"$schema":
"https://schema.management.azure.com/schema
s/2019-04-01/deploymentTemplate.json#",
}
$schema*
References the location of the JSON file schema that describes the version of the template language. We can
deploy ARM templates to different scopes like tenant, management groups, subscriptions; based on the scope
that we are selecting the schema will change.
ARM Template structure
Visual Studio Code
"contentVersion": "1.0.0.0",
contentVersion*
Used to version the template, the default value is 1.0.0.0. Any value can be given to this element. Content
version is useful if you are storing your templates in a source control and would like to keep the changes
tracked in different versions. Proper versioning will help users to pick the latest version of your template.
ARM Template structure
Visual Studio Code
"parameters": {
"location": {
"type": "string",
"allowedValues" :[
"East US",
"West US"
],
"defaultValue": "East US",
"metadata": {
"description": "Location of the resource"
}
}
},
parameters
During resource deployment, the parameter value can be provided as an input to the template. Parameters
helps making the templates reusable, where users can supply different values during execution without the
need to modify the template.
ARM Template structure
Visual Studio Code
"variables": {
"publicIPAddressName": “app-gw-pip"
},
variables
Variables can be used to hardcode value to the templates. If you are referencing a value with the help of
variables and if that value needs to be modified; instead of updating all occurrences, you just need to update
the value of the variable.
ARM Template structure
Visual Studio Code
"functions": [
{
"namespace": "userspace",
"members": {
"VMNameGenerator": {
"parameters": [
{
"name": "userstring",
"type": "string"
}
],
"output": {
"value": "function-return-value",
"type": "string"
}
}
}
}
],
functions
We can create user defined functions in ARM templates that can be used to replace repeated code blocks.
ARM Template structure
Visual Studio Code
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-12-01",
"location": "[parameters('location')]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
}
]
resources*
Resources we intend to create, or update will be declared inside this element. Here, we can reference the
parameters, variables, and functions we created earlier.
ARM Template structure
Visual Studio Code
"outputs": {
"hostname": {
"type": "string",
"value":"[reference(resourceId('Microsoft.Network/publicI
PAddresses',variables('publicIPAddressName'))).dnsSettings.fqd
n]"
},
}
outputs
Display values that are returned after deployment.
Azure Quickstart Templates
Deploy ARM template
Deploy ARM template
$ New-AzResourceGroupDeployment `
-ResourceGroupName <resourcegroup> `
-TemplateFile <path-to-file>
$ Export-AzResourceGroup `
-ResourceGroupName <resource-group>
$ az group export \
--name <resource-group-name>
Creating VHD Templates
Creating VHD Templates
Operating
System State
Virtual Machine
Extensions
Virtual Machine Extensions
Small applications
Automation tasks and post deployment configuration can be done with
the help of extension.
Management
Extensions can be managed with Azure Portal, Azure PowerShell,
Azure CLI and ARM templates..
Scope
Extensions can be used for post-deployment configuration during the
VM deployment or on existing VMs.
Platform
Extensions and their availability will vary based on the operating
system. We have different extensions available for Windows and Linux
VMs.
Custom Script Extension
Supported scenarios
Custom Script extension can be used for simple and complex scripts.
Scripts will not continue execution if the workflow includes reboot.
PowerShell scripts can be selected and optionally arguments can be
passed.
Duration
Script can run up to 90 minutes, if the script takes more than 90
minutes to execute, then it will be a timed-out operation. Also, the VM
should be in running state to execute the script.
Dependency access
Storage and network access is required by the extension. For successful
execution of the script, we need to make sure that the content is
available.
WindowsFeature IISManagementTools
{
When to use DSC? Name = "Web-Mgmt-Tools"
Ensure = "Present"
If your post deployment configuration includes complex steps such as reboots, then CSE is }
not the right choice. Choose DSC in all complex scenarios where CSE is not supported.
WindowsFeature IISDefaultDoc
{
Name = "Web-Default-Doc"
Ensure = "Present"
Blocks }
}
Configuration block is the outermost script block, we will give a name to the configuration }
define the script. Node block defines the computers that are under the scope of the
configuration. Each node block has one or more resource where we define the configuration.
Storage accounts
Storage accounts
Microsoft Azure’s storage solution for object storage, file storage, message queue and a NoSQL store for meeting modern application requirements.
Security
Standard Premium
By default, all data written to the storage account is encrypted by Storage Encryption Service.
To access the data storage accounts, provide different authorization methods such as storage
keys, shared access signature, and Azure AD.
Unstructured data
Access
HTTP or HTTPS can be used to access the data that is stored in Azure Storage. With the help
SDKs provided by Microsoft, developers can easily integrate Azure Storage with their code. Structured data
Azure Storage also supports Azure PowerShell, Azure CLI and REST API.
Storage services
Documents Backup files
Images Databases
Container Blobs Video Log files
Audio Big Data
*.txt
Files Directories *.exe
*.*
Name = Sandy
Table Entities Country= US
State= TX
ZIP= 03445
resizeImage
Queue Messages cropImage
processImage
General Purpose V1 Blob, File, Queue, Table, Standard, Premium LRS, GRS, RA-GRS
and Disk
General Purpose V2 Blob, File, Queue, Table, Standard, Premium LRS, ZRS, GRS, RA-GRS,
and Disk GZRS, RA-GZRS
Region
Datacenter
Region
Geo-replication
Datacenter Datacenter
Failover
Datacenter Datacenter
Failover
Service Endpoint
Container service https://kodekloud.blob.core.windows.net
Queue service https://kodekloud.queue.core.windows.net
File service https://kodekloud.file.core.windows.net
Table service https://kodekloud.table.core.windows.net
If needed, we can use our own custom domain with CNAME mapping
Protection Compliance
Data at rest is protected using SSE. All data Organizations doesn't need develop in-house
written to Azure Disks, Blob, File, Queue, and encryption methods to encrypt data stored in Azure
Table is encrypted using SSE and is decrypted storage. Using SSE organizations can meet their
when the data is retrieved. compliance and security requirements.
SSE uses 256-bit AES encryption to encrypt the If you would like to control the encryption keys and their
data. The encryption, decryption, data rotation, you replace Microsoft managed keys with
management and key management is done by Customer Managed Keys. You need to create an Azure Key
storage service. SSE cannot be disabled. Vault to store the key and the storage service will retrieve
the key from Key Vault for encryption and decryption.
.
Azure Disk Encryption (ADE)
Using ADE, we can encrypt OS and Data Disks of Since the disk is encrypted, only the VM owner will be
Windows and Linux virtual machines. ADE uses able to retrieve the data stored in the VM. If anyone
BitLocker for Windows and DM-Crypt for Linux to downloads the VHD and attaches to another VM,
encrypting the disks. Encryption keys are stored in without the keys, they will not be able to read the data.
Azure Key Vault.
When you are using Azure Backup, the encryption If you are encrypting both OS and Data disk, there will be a
keys are backed up to the recovery service vault. small performance impact due to the encryption and
Also, the backups are encrypted. ASE uses AES decryption activity. The impact is very minimal, however, if
256-bit encryption. your application is CPU intensive then you can skip the OS
disk and encrypt data disk only to enhance performance.
.
Storage security -
Authorization
Storage security - Authorization
S S
Two 512-bit keys will be generated for Delegate access to storage at a very
every storage account, and this can granular level. SAS are generated
be rotated. Account keys are like root using account keys but with fine
passwords, and we need to secure tuned access.
them to avoid unauthorized access.
A T
A
Azure AD Anonymous
Using Azure AD and RBAC we can We can enable anonymous access to
authenticate and authorize requests from our blobs and containers. As the
users. Currently Azure AD authentication is request is anonymous, we don’t need
supported by Blobs, Queues, and Tables pass any authorization header.
only. For Files, SMB access can be given
with the help of AAD Domain Services.
Storage Account
Keys
Storage Account
Keys
Be cautious with the account key!
Account key is like the root password, the user possessing the
account keys can perform any action against the storage
account. Microsoft recommends to save the key to Azure Key
Vault and regularly rotate them.
Two keys
S
Azure provides two 512-bit keys for every storage account. You can either
one of these in your API calls in your authorization header. Users with
permission to Microsoft.Storage/storageAccounts/listkeys/action can
view, read or copy the key via Azure Portal, Azure CLI, and Azure
PowerShell.
Shared Access
Signature
Shared Access
Signature
Fine tuned access
Instead of giving full access via account keys we can fine tune the
access via SAS. We can control the allowed services, allowed
resource types, permissions, start time, end time, IP address and
protocol using SAS
S
✓ User delegation SAS
✓ Service SAS
✓ Account SAS
Shared Access Signature
Even if you are the Owner or Contributor of the subscription, you would
A
still require storage specific RBAC to authorize storage access requests.
These RBAC can be assigned to any scope and the access will be
inherited. Example: Storage Blob Data Owner, Storage Queue Data
Storage Blob
Contributor. Container
Anonymous access to
blobs
Anonymous
access
Public access without authorization
A
blob storage to public.
Creating Azure File share
Creating Azure File Share
With file shares, we can share files across virtual machines and non-Azure
workloads. Any number of Azure or non-Azure virtual machines can mount
and work on the file share simultaneously. Also supports backup and
snapshot for data recovery.
Azure provides easy to use scripts to mount the file share to Windows, Linux
and macOS computers. Computers can interact with Azure file share as they
work with on-premises file shares. Port 445 needs to be open for SMB traffic.
Use cases
💽 💽 💽 💽
Centralize your file share and provide You can easily onboard new branch Azure Backup will backup your on- File Sync caches data that has been
access to file shares across Windows offices and share files with them. premises data once the sync is used recently. Data which is not in
Servers and Azure Files. Helps to established. Restoring data after a consumption will be stored in Azure
share files across multiple sites at catastrophic failure will be quick. Files and is retrieved only upon
ease. request. You can control this using the
cloud tiering feature.
Azure File Sync - Components
Azure Backup
Deploy the Storage Sync Service Prepare Windows File Servers Installing File Sync agent Registering Windows Server
Deploy the Storage Sync Prepare Windows File Installing File Sync Register Windows
Service Servers Agent Server
In the Azure Portal, we need to All servers we are planning to File Sync Agent needs to be Once the agent is installed, you
create a Storage Sync Service. register requires preparation. Some installed on the prepared will be redirected to the server
This will be deployed to a prerequisites include disabling IE Windows Server. Agent is registration window. Registration
resource group like the storage Enhanced Security and installing responsible for the sync to is required to establish trust with
account latest version of PowerShell Azure file share. the Storage Sync Service.
Configuring Azure Blob
Storage
Azure Containers (Blob Storage)
Provides storage for storing unstructured data as in any type of text or binary data. Blob Storage is referred to as “object storage”
Document1.pdf
Documents
webfiles Document2.pdf
Videos IntroVideo.mp4
Embed images or documents in webpages Strong files for distribution for example Backup, recovery and archiving
installation packages on websites
Stream video and audio directly to Act as a disaster recovery site for your on- Store data for analysis which can be
browser premises site accessed by tools like Power BI
Creating Containers
All objects or blobs we upload should be in a container. A storage account can have unlimited number of containers and each container can have unlimited blobs.
Containers provides logical grouping of blobs, acts as a scope of assign RBAC and public access level
Document1.pdf
Documents
webfiles Document2.pdf
Videos IntroVideo.mp4
Private
No anonymous access to data stored in the container
Blob
Anonymous read access to blobs only
Container
Permission to read and list entire container, which includes all the blobs
Storage Tiers
Blob Access Tiers
Based on the frequency of access, we can optimize storage cost using access tiers.
Hot
Ideal for storing data that is frequently accessed.
Cool
Ideal for storing large amounts data that is not accessed frequently and is stored for at
least 30 days.
Archive
Ideal for that can tolerate several hours of retrieval latency and will remain the archive
tier for at least 180 days.
Identifying that data that needs Ship the drives to the Azure Data is copied from the
to moved to Azure. Using the datacenter and update the hard drive to the storage
WAImportExport tool, prepare Import job with the tracking ID account.
the disks and copy the contents of the package. Also provide the
to the disk. This will generate return address for Microsoft to
the journal files. return the drives
Import/Export Service
Export workflow
Ship your drives to Azure The hard drives are Hard drives are shipped back to
datacenter and the carrier encrypted with BitLocker and the customer, and they can
delivers them. the job will be updated with decrypt the disk using the keys in
the keys the job
Identify the data that you want Drives are processed at the The hard drives are
to move and create an export datacenter and the data from packed, and they are
job in Azure Portal storage account is copied to the ready for shipping
hard drives
Azure Storage Explorer
Azure Storage Explorer
AzCopy
AzCopy
>_ Terminal
Supports multiple scenarios
#Get help
AzCopy can be used as a multi-cloud datar transfer tool. It supports azcopy /?
Azure Blobs, Azure Files, Amazon S3, GCP, ADLS Gen2 APIs etc. Data
movement between these and on—premises is supported by azcopy. #Copy files
azcopy copy <source> <destination> [options]
Enhanced resiliency azcopy copy ./myfiles/visio.png
Every instance will create a job ID and related log file. If your job is
https://kodekloud.blob.core.windows.net/files
getting failed, you can restart or review the logs to understand what
/files?sv=2020-08-
04&ss=bfqt&srt=sc&sp=rwdlacup&se=2022-05-
went wrong.
19T14:31:40Z&st=2022-05-
Supports include, exclude, wildcards and 19T06:31:40Z&sip=168.11.12.13-
recursive 168.11.12.19&spr=https&sig=66iXqzZSakarJO5J21
We can use include or exclude flags along with wildcard patterns.
0%2ByoPRVXTeT%2FTJcHHSEkUjHr0%3D
Recursive can be used to copy all files within a folder. We can also list
or remove blobs in a given path.
#Copy using AAD
azcopy login --tenant-id xxxx-xxxx-xxxxx-
Authentication and suppport
xxxxxxx-xxxxx
AzCopy can be authenticated using SAS tokens or Azure Active azcopy copy ./myfiles/visio.png
Directory. AzCopy can be installed on Windows, Linux or macOS https:///kodekloud.blob.core.windows.net/file
computers. s/files
Creating an App Service
App Service Plans
Compute
App Service Plan defines a set of compute resources required to run our Data & access
App Service.
Performance tier
Applications Application & Data Application & Data
Like VMs, App Service Plans also come in different tiers. These tiers represents the
performance, features, size and the price you pay.
Storage/Network/Compute
App Service Plans
Selected Features Free Shared Basic Standard Premium Isolated
Deployment Slots 0 0 0 5 20 20
Shared Compute (Free & Shared): Run apps on the shared Azure VM infrastructure where your app will be placed
along with other apps.
Dedicated Compute (Basic, Standard, and Premium): Dedicated VMs will be provisioned, and your apps will be
running on that
Authentication
Security
• SSL certificates
• Network ACL
domain. You can bring in your own domain and add to ownership. Once that’s done, you can add an A record onwards.
your app service. You need to validate the domain, or CNAME record to map the custom domain to App
before you could add to the App Service Service.
Backup App Service
Backup App Service
Manual and scheduled backups Filters and multiple restore options Plan dependent
Backup supports manual or scheduled backup which Backup can be up to 10 GB of app and database. Full Backup requires Standard or Premium plan
includes the backup of configuration, file contents, and partial backups can be configured. We can restore
and the connected database. the app to a previous restore point or create a new app
altogether.
CI/CD and Deployment
slots
CI/CD
Automated deployment (CI/CD) is where developers will be push Manual Deployment is where developers can store their code in a
new code which includes features, patches and bug fixed with remote cloud storage like OneDrive/Dropbox or to an external git.
minimal impact to end users. These features will be immediately In manual deployment, developers need to manually push the
updated in Azure App Service. We can integrate App Services with code to the location for the App Service to update.
GitHub, Bitbucket, Local Git and Azure Repos
Deployment slots
commit
CI/CD Swap
Staging Production
commit
CI/CD Swap
Staging Production
commit
Libs/Bin App A
Libs/Bin App A
Guest OS Libs/Bin
Guest OS Libs/Bin
Host
HostOSOS
Server
Server
Azure Container Instances
Port 80
(Public IP)
Faster startup
Unlike Virtual Machines, containers can startup in seconds
Scalability
You can choose custom sizes as per your resource requirements.
Persistent storage
Container storage is ephemeral, using Azure Files we can create
persistent storage for ACI. Container Host
OS and VNet
Virtual Network
ACI can be directly deployed to virtual networks. Both Windows
and Linux containers are supported by ACI.
Container Groups
Container groups
Collection of containers that get scheduled on the same container host machine they share resources, lifecycle, local network, and storage volumes.
80
1433
Container Host
Shared networking
Deployment options Resource allocation
Public IP address, one or more ports,
Container Groups can be deployed Resource requests of the container
and DNS label can be shared within
using ARM templates or YAML file. If group is calculated by summing up
container group. In order to reach the
your container group includes Azure resource request of individual
containers from internet, we need to
resources like a file share, then ARM containers that’s part of the container
expose the port to the internet.
template is the better option. group.
Azure Kubernetes Service
Azure Kubernetes Services
Customer managed node Azure managed node (Master) Customer managed node
Node
Pools
Logical grouping of nodes with identical configuration Deployment
Nodes Pod
VMs that are running containerized application. Nodes are managed by
Kubernetes master node which is not visible to the end user.
Pods
Smallest unit of deployment which is a collection of one or more
containers representing a single instance of your application. Pod
Deployment
Creates one or more identical replicas of your pod
Manifest
YAML or JSON file used for deployment
Node Node
Pod Pod
AKS Networking
AKS Networking
Services in Kubernetes provide internal and external network connectivity to pods
:80
Internal traffic ClusterIP
:31000
Incoming direct traffic AKSPods
Node NodePort
:80
:80
Incoming non-direct traffic
AKS Node
Storage class
While creating storage, we can use StorageClasses to define the tier of the
storage required. You can select Premium or Standard. With the help of
reclaimPolicy parameter, we can define if the storage needs to be persisted
Persistent Volume
or not.
Cluster Autoscaler
Scale
out
Pod
Virtual
Node Node Node Node
Horizontal Pod Autoscaler Pod
Scale
out
On-premises
MARS agent
Windows Server
Virtual Machine Backup
Virtual Machine Backup – Azure VMs
Configure
Azure Backup Service
Managed disks
Snapshot HTTPS
Instant Recovery Snapshot Incremental Blocks
Transfer
Virtual Machine Backup – On-premises VMs
Specialized Workloads
Backup
Files/Folders/Volumes
MABS or DPM Recovery Services vault
2012 and 2012 R2 Windows XP
2008 and 2008 R2 Windows 7
2003 and 2003 R2 Windows 8 and 8.1
Windows 10 and 11
Physical servers
(Physical server)
Azure Site Recovery
Azure Site Recovery
Source Environment (Region A) Source Environment (Region A) Target Environment (Region B)
Disks Disks
Failover
Network Watcher is a regional service that can be used to diagnose, monitor, and setup logging for resources that are
deployed in Azure Virtual Network
Network Watcher
IP Flow verify is used Next hop is used to VPN diagnostics will NSG Flow Logs will Connectionn Topology can be
to verify inbound identify the next help you diagnose store the details of troubleshoot can be used to see the
and outbound destination the VPN connectivity the traffic through used to identify topology of your
connectivity from or traffic will be routed issues and an NSG in a storage network Azure infrastructure.
to a VM from a to. troubleshoot them. account. performance and
remote IP address connectivity issues
Azure Monitor
Azure Monitor Azure Monitor
EXPERIENCES
…
Application Container VM Network
VISUALIZE
Application
Workbooks Dashboard
OS
ANALYZE
Azure Resources
RESPOND
Azure Tenant
Custom
Alerts & Actions Auto Scale
INTEGRATE
Monitor and visualize metrics
Retention
Activity Log is enabled byHost VM
default and as retention
period of 90 days, if needed, we can extend by
sending the data to a storage account.
Activity Logs Activity Logs
Azure Infrastructure Azure Infrastructure
Querying data
Compute
Filters like Subscriptions, Timespan, resource only
Severity, Non-compute resource only
Resource group, Resource, Operation, Event
initiated by, and Search for keywords
Azure Activity Log – Event Categories
Administrative
All Resource Manager create, update, delete, and
action operations are categorized under
Administrative
Security
All security alerts generated by Microsoft Defender
for cloud will be mapped under this category.
Service Health
Any service health incidents happened to Azure
Resources, this may or not may not include your
Recommendation Autoscale
resources.
All recommendations generated in Azure Advisor This category contains all scale in and out events
Unified Authoring Experience Classify based on severity and response Integrate with Action Groups
We can create alerts for Activity Logs, Service Azure Alerts supports severity (0-4), so you easily Define your notification and automation
Health Events, Log Analytics, Metrics etc. In all prioritize the alerts. Secondly, we can categorize preferences with the help of Action Groups.
these scenarios the authoring experience is same. by user response New, Acknowledged or Closed.
Azure Monitor Alerts
Scope Condition
Defines the scope for alert Helps you to define the signal and criteria for alert
Rule details
Actions
Specify name, severity, region, resource group and
Integrate alerts with Action Groups
subscription for the alert.
Action Groups
Notification
• Email Azure Resource Manager Role ( Owner/
Contributor/ Reader/ Monitoring Contributor/
Monitoring Reader)
Actions
• Automation Runbook
• Azure Function
• Event Hub
• ITSM
• Logic App
• Secure Webhook
• Webhook
Log Analytics
Log Analytics
Data collection
Data generated from resources in cloud and on-
premises can be collected to Azure Log Analytics
workspace.
Workspace
A workspace should be created for data ingestion.
You can create one or more workspaces in
different regions as per your requirement.
Pricing
Cost is for data ingestion (GB) and data retention
(days). Log Analytics offers 30 days of cost-free
data retention.
Log Analytics Workspace
Workspace
Resource created in Azure to collect, analyze,
aggregate, and visualize the data from onboarded
resources.
Data isolation
You can create workspaces in different regions to
meet compliance and data residency
requirements.
Heartbeat
Syslog
Syslog | where ComputerIP startswith "52"
and Computer startswith "DC"
| where OSType == "Windows" and
Agents OSName contains "2016"
Heartbeat
Perf
Performance metrics
| where CounterName == "Available
Perf
MBytes" and Computer == "JBOX00"
| project TimeGenerated,
Custom Logs
CounterValue
CustomLog_01 | sort by TimeGenerated asc
| render timechart
Alerts
Alert
Application Insights
Application Insights
Alerts
namespace DemoWebApp.Controllers
{
public class HomeController : Controller
{
Power BI
public ActionResult Index()
{
return View();
}
}
return View(); REST API
}
}
Continuous Export
Ability to monitor failures and unavailability of our Ability to perform availability test from different We can install the instrumentation package on
applications continuously. geographic regions to observe latency and Azure and non-Azure environment to monitor our
performance. applications.