Client - Server model
Cloud computing
No human interaction is needed for resource provisioning. Available 24/7.
Create a network in one part of the world and access it from another. Access is not physical.
Resource is being shared across, multiple customers. But, can be limited.
Can be scaled up and down as needed. Within minutes.
Payment made for resource used. No additional costs. Measurement: Server time or DB Time or Function calls / unit time.
IAAS - PAAS - SAAS
Cloud types
Regions & Availability Zones
Regions: Each data centers location is called a region. There are ~60 regions.
| Americas | Europe | Africa | Asia Pacific |
|---|---|---|---|
| Brazil South | France Central | South Africa North | Australia East |
| Canada Central | Germany West Central | Central India | |
| Central US | North Europe | Japan East | |
| East US | Norway East | Korea Central | |
| East US 2 | UK South | Southeast Asia | |
| South Central US | West Europe | East Asia | |
| US Gov Virginia | Sweden Central | ||
| West US 2 | |||
| West US 3 |
Availability zones: A datacenter is called a zone. When there are more than one data center in a region, its called an Availability zone.
Subscription vs Accounts
Subscription: Everything you subscribe inside the Azure portal.
Account: Your Azure account (identity) using which you can access your subscriptions..
Resource groups
Doing the same with a command line: az group create -l westus -n CLITest-rg
Doing the same with a PowerShell: New-AzResourceGroup -Name PSTest-rg Location westus
Heirarchy of ownership:
Storage accounts: Costs are extemely cheap.
SLA: Costs are extemely cheap. Different SLA's offer 99.9, 99.99, 99.99% uptimes. Free and shared resources don't have SLA's.
Pricing models:
Compute
Azure - Virtual machines
Steps to create a virtual machine:
Steps to delete a virtual machine:
Remember: A virtual machine when created, also creates many dependant resouces. So, to remove a Virtual machine, remove the resource group it is part of.
Cost of a virtual machine:
How to reduce the cost of a virtual machine:
Availability in Azure:
Virtual machine Scale Set (Free):
Steps to create a virtual machine scale set:
Azure instance metadata services:
How to use Azure instance metadata services?
Azure - App services
Azure App Service - Create new:
There's possiblitity to edit files deployed to App service via, a Console and an App Serice Editor window...
Scale up: Add more RAM, Processor and choose bigger and faster disks...
Scale out: Add more parallel machines...
Azure - AKS - Azure Kubernetes Services
Containers:
Containers Vs Virtual Machines:
Problems with Containers:
Deploying a container image to Azure:
Kubernetes:
De facto standard for container management. ProvidesCommand: az aks create -resource-group name-app-rg --name cart-aks --node-count 1 --generate-ssh-keys --attach-acr nameacr --node-vm-size Standard_DS1_v2
Azure - Azure functions
Triggers and Bindings:
namespace AzureExample.Function> {
public static class EvenGridFunction {
[FunctionName("EventGridFunction")]
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get, "post", Route = null)] HttpRequest req,
[EventGrid(TopicEndpointUri = "MyEventGridtopicUriSetting", TopicKeySetting = "MyEventGridTopicKeySetting")]
IAsyncCollector outputEvents, ILogger log) {
string name = req.Query(["name"]);
var myEvent = new EventGridEvent("message-id-3", "user-added", $"{{name: {name}}}", "event-type", DateTime.Utcnow, "1.0");
await outputEvents.AddAsync(myEvent);
}
}
}
Supported Trigger types:
Supported Binding types:
Azure functions: Cold start
Since Azure Functions is a serverless application, incase if the server is shutdown by Azure on low demand scenarios, it might take few seconds for Azure to bring the application back up.
This problem can be avoid using the right hosting plan. The plans are:
Durable functions:
Networking
V Nets
Subnets
Sometimes, to increase security, we want to place resources in a completely different VNet, not just the subnet. That's when we use Network Peering.
Network perring allows two VNets to connect to each other. From a users point of view, it will be single VNet. Just makes sure the addresses assigned are not overlapped.
Peering can work across a region.
Peering is not free. It's like 1 cent per 100 GB
The larger the attack surface - greater the risk
How to reduce the exposed Public IP Addresses:
Service Endpoint and Private link allows access to a managed service (App services...) from a VM
VNet Integration on the other hand, allows access to a Database / VM from a managed service (App services...)
Similar to NSG but for App services
Restricts traffic to App services. Main use case is, backend app service that should only be accessed from the front end app service / VM
Load balancer
Load balancer distribution algorithm
Types of Load balancer
Load balancer configurations:
Load balancer health probes:
When to use a Load balancer:
When to NOT use a Load balancer:
Application gateway
How to configure a Application gateway
Application Gateway and AKS: Application gateway doesn't support AKS as of now.
Application gateway and Functions: Function apps are basically app services. App Gateway can protect function apps.
Data in Azure
Azure provides many data solutions as cloud services that are fully managed, and can be part of Azure app or fully independant. Some of them are:
Major database features:
Azure SQL
Various flavours of Azure SQL are:
How to create a new SQL Server
Cosmos DB
How to create a new COSMOS DB
Azure MySQL
Azure PostgreSQL
Azure Storage
Tiers of Azure Blob Storage
Messaging services
Azure - Active Directory (AD)
Active Directory (AD) - Users and Roles
Azure - Monitoring