AWS vs Azure
AWS |
Azure |
|
Infrastructure | ||
|
|
|
Nil |
RG (Resource Group) | |
Networking |
||
Networking & Content Delivery:
|
Virtual Network (Vnet):
|
|
Compute |
||
|
|
|
Storage |
||
|
|
|
Security, Identity & Compliance / Identity |
||
|
|
|
Databases |
||
|
|
|
Containers |
||
|
|
|
Web & Mobile (Web App) |
||
|
|
|
Azure Login | Login |
PS: Connect-AzAccount (A popup windows will appear, enter credentials) PS: Connect-AzAccount -TenantId "xxxxxxxx" (connect to a different Tenant ID) |
Logout | PS: Logout-AzAccount | |
Subscription | List | PS: Get-AzSubscription |
list of specific subscription | PS: Get-AzSubscription-TenandId "xxxxxxxx" | |
select subscription | PS: Get-AzSubscription "xxxxxxx" | |
Resource Group | List of all RG | Ps:Get-AzResourceGroup |
Create empty RG | PS: New-AzResourceGroup -Name RG01 -Location "uksouth" | |
PS: New-AzResourceGroup RG02 "uksouth" | ||
with Tags | PS:New-AzResourceGroup -Name RG03 -Location "uksouth" -Tag @{Empty=$null; Department="Marketing"} | |
Delete RG | PS:Remove-AzResourceGroup -Name "RG01" confirm yes/no |
>
Management Group:
Blank ARM Template json file.
Deploy the above blank template in TestRG (Resource Group):
Remove Storage Account with powershell:
PS: Remove-AzStorageAccount -ResourceGroupName "TestRG" -AccountName "starstorage1973" -Force
Parameters: It refers to actual values, which can be call multiple times in code. Example
5+5 = 10 (these values can be defined in varibales)
$a=5
$b=5
$c = $a+$b
$c
In powershell when you define $c it gives result = 10.
Storage Account deployment using Parameters:
Functions:
Variables:
PS: New-AzResourceGroup -Name RG01 -Location "uksouth" (Required Parameter):
Azure Login | Login | PS: Connect-AzAccount (A popup windows will appear, enter credentials) |
Logout | PS: Logout-AzAccount | |
Subscription | List | PS: Get-AzSubscription |
list of specific subscription | PS: Get-AzSubscription-TenandId "xxxxxxxx" | |
select subscription | PS: Get-AzSubscription "xxxxxxx" | |
Resource Group | List of all RG | Ps:Get-AzResourceGroup |
Create empty RG | PS: New-AzResourceGroup -Name RG01 -Location "uksouth" | |
PS: New-AzResourceGroup RG02 "uksouth" | ||
with Tags | PS:New-AzResourceGroup -Name RG03 -Location "uksouth" -Tag @{Empty=$null; Department="Marketing"} | |
Delete RG | PS:Remove-AzResourceGroup -Name "RG01" confirm yes/no |
After adding txt record go back to azure and click verify and once it is verified custom domain is configured.
Topology:
#Set the variables
$SubscriptionI = "<Subscription ID>"
$VM = "<VM Name>"
$ResourceGroup = "<Resource Group>"
$VNET = "<Virtual Network>"
$IP = "NEWIP"
#Log in to the subscription
Add-AzAccount
Select-AzSubscription -SubscriptionId $SubscriptionId 
#Check whether the new IP address is available in the virtual network.
Test-AzureStaticVNetIP –VNetName $VNET –IPAddress $IP
#Add/Change static IP. This process will not change MAC address
Get-AzVM -ServiceName $ResourceGroup -Name $VM | Set-AzureStaticVNetIP -IPAddress $IP | Update-AzVM
Lab: Add Multiple IP Address to a VM:
Public IP addresses can be used in the following resources:
Basic:
Standard:
Login | PS:Connect-AzAccount - select correct subscritpion PS:Select-AzSubscription -SubscriptionId "xxxx" | |
RG | Create | PS:New-AzResourceGroup -Name TestRG -Location UKSouth |
Vnet | Create | PS:New-AzVirtualNetwork -ResourceGroupName TestRG -Location UKSouth -Name Test-Vnet -AddressPrefix 10.0.0.0/16 |
List | PS:Get-AzVirtualNetwork | |
Subnet | Create | PS: New-AzVirtualNetworkSubnetConfig -Name Test-Subnet1 -AddressPrefix 10.0.0.0/24 |
Vnet-Subnet | Link | PS: |
$vNetName = 'Test-Vnet'
$resourceGroupName = 'TestRG'
$location = 'UKSouth'
$AddressPrefix = @('10.0.0.0/16')
$subnet01Name = 'Test-Subnet1'
$subnet01AddressPrefix = '10.0.1.0/24'
#Create new Azure Virtual Network with above subnet configuration
New-AzVirtualNetwork -Name $vNetName -ResourceGroupName $resourceGroupName -Location $location -AddressPrefix $AddressPrefix -Subnet $subnet01
#########################################################
#Remove Azure Virtual Network
Remove-AzVirtualNetwork -Name $vNetName -ResourceGroupName $resourceGroupName
#########################################################
configure a private and a public IP address in PowerShell, and associate them to this VNet.
When we created the VNet, a private IP address was already created for us automatically by Azure. However, we are going to create another and associate it, together with the public IP address, to a network interface card (NIC).
-Name PacktPrivateIP `
-Subnet $subnet `
-PrivateIpAddress 10.0.0.4 `
-PublicIPAddress $publicIP `
-Primary
-Name PacktNIC `
-ResourceGroupName PacktVNetResourceGroup `
-Location EastUS `
-IpConfiguration $IpConfig
Same region but different virtual networks. They may be on same/diff subscription, same/diff tenant.
connection between two Vnets where both are on same region but different virtual network. They may be on same/diff subscription, same/diff tenant.
Peering means transfer of data between connected sources without using internet. When you create peering your resources will communicate using private IP address but name resolution will not take place.
There is no DNS in peering and you need to define your DNS for name resolution.
Adding address space or new subnets after peering is created not possible, so delete peering and add new address space or subnet and recreate peering.
The traffic between virtual machines in the peered virtual networks is routed through the Microsoft backbone infrastructure, much like traffic is routed between virtual machines in the same virtual network, through private IP addresses only.
Peering provides IP connectivity only. It does not contain name resolution. The Cloud Administrator must understand clearly if the machines are being joined to a domain (Active Directory DNS resolution recommended) or if they are going to rely on default Azure name resolution.
Peering Data Transfer charges: When using VNET peering traffic is charged for ingress (inbound) and egress (outbound) at both ends of the peered networks.
Peering is a 1-to-1 relationship, and they are intransitive.
For example: if you have these following peering connections configured A<to>B and A<to>C networks, there is no IP connectivity between B and C networks. If there is a need to connect those networks, we would have a couple of options to choose from:
You can also configure spokes to use the hub VNet gateway to communicate with remote networks.
You can also configure spokes to use the hub gateway to communicate with remote networks. To allow gateway traffic to flow from spoke to hub, and connect to remote networks, you must:
Important:
Check ICMP Allowed in VMs:
Let’s review the different data charges in the following common scenarios.
1. VPN
Azure supports Site-to-Site and Point-to-Site VPN connections from on-premises data centers. These connections terminate in a virtual network gateway created for a specific Azure Virtual Network. While a Site-to-Site VPN is used for extending an on-premises network to Azure, it can also be used to connect one Azure VNet to another. On the other hand, a Point-to-Site VPN is for mobile users or traveling users who want to connect securely to an Azure network from a public network.
Data egress for Site-to-Site and Point-to-Site connections are charged at regular data transfer rates.
The first 5GB/month (outbound) is free, and any data transfer beyond that is charged based on the following usage slab:
Outbound Data Transfers:
For data transfers beyond 500TB, customers should contact the Microsoft sales team to get an organization-specific deal.
2. ExpressRoute
Microsoft Azure ExpressRoute offers direct connections without traversing the internet between on-premises data centers and Azure. There are two types of billing plans associated with ExpressRoute; data charges depend on the plan selected by the client. For metered plans, inbound data transfer is free, but customers are charged for outbound data transfer based on Azure data center regions grouped as zones.
For ExpressRoute traffic, the zones are defined as follows:
Zone 1: West US, East US, North Central US, South Central US, East US 2, Central US, West Europe, North Europe, France Central, France South, Canada East, Canada Central.
Zone 2: East Asia, Southeast Asia, Australia East, Australia Southeast, Japan East, Japan West, Korea Central, Korea South, India South, India West, India Central.
Zone 3: Brazil South.
Outbound data is charged at a rate of;
In unlimited billing plans, both inbound and outbound data transfers are free because the client must pay a flat fee based on the selected port speed.
3. Application Access:
Outbound data transfer rates apply when hosted applications or VMs are accessed directly over the Internet. Some common examples include accessing or downloading files from applications, management activities through RDP and SSH connections for VMs.
The data transfer rates are the same as what was explained in the VPN section above.
Data Traffic Costs and Availability Zones.
Azure offers three availability zones in enabled regions to ensure high availability.
Azure places VMs in fault domain and update domains after the VMs are deployed in an availability zone.
Azure availability zones are generally available now and all inbound and outbound data is free until February 1, 2019. From that date forward, charges of $0.01/GB will be applied to all data transfers connected to the same VNet from a resource in an availability zone to another resource in a different availability zone.
4. Intra-Network Traffic: Peering
VNet peering seamlessly connects two Azure VNets, allowing traffic to traverse the Microsoft backbone infrastructure without using a virtual network gateway. VNet peering is a preferred method of connecting two Azure VNets because it helps avoid charges associated with a virtual network gateway. It’s also more secure because the traffic passes through the Microsoft backbone network.VNet peering is particularly useful in hub-spoke topologies.
In such topologies, the hub VNet hosts the management components and applications are segregated to different spoke VNets. These spoke VNets are connected to the Hub network through VNet peering.
Different data charges apply for VNet peering between the same Azure region and different Azure regions, otherwise known as Global VNet Peering. It’s important to note that both inbound and outbound traffic incurs charges for VNet peering. VNet peering in the same region incurs an inbound and outbound data transfer charge of $0.01/GB. For Global VNet Peering, the transfer rates are dependent on the zones between which the data is being transferred.
If you want to add additional connections, navigate to the virtual network gateway from which you want to create the connection, then select Connections. You can create another VNet-to-VNet connection, or create an IPsec Site-to-Site connection to an on-premises location. Be sure to adjust the Connection type to match the type of connection you want to create.
You can create site to site connection with on-premise 2 and 3, site to site connection from subscription1 to subscription 2 etc..
1. Create a Vnet:
2. Create a Gateway subnet:
3. Create a Virtual Network Gateway : selecting connection type site-to-site
4. Create Local Network Gateway: Create a local network gateway to represent the on-premises site that you want to connect toa virtual network. The local network gateway specifies the public IP address of the VPN device and IP address ranges located on the on-premise site.
5. VPN Connection:
Need to create tunnel between Azue and On-premise:
Go to connection and download file after selecting the on-prem device. a configuration file will be downloaded and it contain steps to perform at on-prem vpn device.
6. Create a VM for testing:
On-Premise Configuration.
1. Configure your VPN Device: use downloaded file
Example of fault domain and update domain count:
There will be 2-3 fault domain and 5-20 update domains in any availability set, how it calculate as follows:
1 VM: there will be 1 fault domain and 1 update domain. (FD0 and UD0)
2 VM: 2 fault domain and 2 update domain.(FD0, FD1 and UD0, UD1)
3 VM: 2,1 fault domain and 3 update domain.(FD0,FD1,FD0) and (UD0,UD1,UD2)
4 VM : 2,2 fault domain and 4 update domain (FD0,FD1,FD0,FD1) and (UD0,UD1,UD2,UD3)
5 VM: 2,2 fault domain and 4,1 update domain (FD0,FD1,FD0,FD1,FD0) AND (UD0,UD1,UD2,UD3,UD4,UD0) et...
#Install IIS server role.
Install-WindowsFeature -name Star-WebServer -IncludeManagementTools
#Remove default html file
Remove-Item c:\inetpub\wwwroot\iisstart.htm
#Add a new html file that display server name
Add-Content -Path "C:\inetpub\wwwroot\iisstart.htm" -Value $("Welcome from " + $env:computername)
Enter required fields.
paste the following text into a vbs file:
Dim goal
Dim before
Dim x
Dim y
Dim i
goal = 2181818
Do While True
before = Timer
For i = 0 to goal
x = 0.000001
y = sin(x)
y = y + 0.00001
Next
y = y + 0.01
Loop
INFO: Scanning...
INFO: Autologin not specified.
INFO: Authenticating to destination using Azure AD
INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
Job 999f5f49-405c-8f41-5ee3-476974829fa3 has started
Log file is located at: C:\Users\Admin\.azcopy\999f5f49-405c-8f41-5ee3-476974829fa3.log
INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission PUT https://starstorage2.blob.core.windows.net/blobcontainer1/sv=2022-11-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2024-09-12T20:09:42Z&st=2024-09-12T12:09:42Z&spr=https&sig=-REDACTED-
--------------------------------------------------------------------------------
RESPONSE 403: 403 This request is not authorized to perform this operation using this permission.
ERROR CODE: AuthorizationPermissionMismatch
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.
RequestId:8cd1509c-601e-007c-710c-05aed1000000
Time:2024-09-12T12:08:40.4260833Z</Message></Error>
--------------------------------------------------------------------------------
INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission PUT https://starstorage2.blob.core.windows.net/blobcontainer1/sv=2022-11-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2024-09-12T20:09:42Z&st=2024-09-12T12:09:42Z&spr=https&sig=-REDACTED-
--------------------------------------------------------------------------------
RESPONSE 403: 403 This request is not authorized to perform this operation using this permission.
ERROR CODE: AuthorizationPermissionMismatch
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.
RequestId:25f2b890-d01e-0046-800c-05b4a9000000
Time:2024-09-12T12:08:40.4276234Z</Message></Error>
--------------------------------------------------------------------------------
After adding txt record go back to azure and click verify and once it is verified custom domain is configured.
Configure/Manage Azure Entra ID Blade:
Manage:
User Blade/settings: Perform configuration and settings for a user.
Monitoring:
Troubleshooting + Support:
Lab: Microsoft Entra Domain Services:
Basics:
Networking:
Administration:
Synchronization:
Security settings:
Review and create: it will take 1/2 hr to 2 hr. Once deployment is succeeded, check it.
Overview:
Settings:
Configure DNS IP address in Virtual Network:
Create a VM and join domain: Whenever a virtual machine join the domain, it first contact the DNS server, configuration of DNS is done in above step.
RBAC- Role Based Access Control:
Lab:
AWS Administration: