AZ900 Cert Prep :: Lesson 5 : Azure Compute and Networking Services
Let's get a few definitions out of the way before we get into all the different types of compute services available in Microsoft Azure
Compute : Any cloud service that uses CPU, memory etc.
Virtual Machines (VM) : VM emulates the entire OS and runs on top of a physical host machine. It requires a hypervisor like VMWare to manage and allocate the resources. Each VM has its own OS and kernel, and runs applications as if it were a separate physical machine. They provide strong isolation and security between different instances, but can be very resource intensive due to the duplication of OS components.
Docker : Docker is a platform and ecosystem that simplifies the creation, deployment and management of applications using containerization. Containers are lightweight, isolated and portable environments that the host machine's OS kernel. Multiple containers can run on a single host and each container has its own isolated runtime, including file systems and network interfaces. Docker has a more efficient resource utilization and a faster runtime compared to the VMs
Containers : Containers are the runtime instances created from Docker. Containers are created using an image. An image is basically a zip file that contains the OS, database, web servers, apps, modules required to run the application. Important note : Although the image might have an OS, it'll only have the user-made components of the OS, the container uses the kernel-mode OS of the host computer. So if an image is built to run on Linux, it can only run on a host computer that's running Linux
Here's the flow of how the application runs in the cloud :
To run the app, you need a computer -> that computer has a container runtime (like Docker) -> Docker downloads the image from a repo -> Docker runs it in a special environment (container) or in case of VM, you take the computer -> download all the dependencies and the app -> you run it
With all the definitions cleared, here are some of the key computer types offered in Azure :
Azure Compute Types
Azure Virtual Machines
Azure Container Instances
Azure Kubernetes Service
If you want to run an application for a longer period of time.
Azure Functions
Azure Virtual Machines
Fault Domains
Update Domains
There is another option with VMs, which is called a Virtual Machine Scale Sets (VMSS)
Virtual Machine Scale Sets (VMSS)
And another form of virtualization that you can use in Azure are called Azure Virtual Desktops
Azure Virtual Desktops
This essentially allows you to run application in a virtualized environment without having to install anything in your personal computer. It has clients for Windows, MacOS, Android, iOS, web browsers and everything. So you can use any device to access this virtual PC and do any work without using any of of your devices resources (apart from everything used to actually run the virtual desktop app in your device)
Resources Required for a Virtual Machine
Open Azure Portal -> Click on "Virtual Machine" -> Click on Create -> Azure Virtual Machine -> Create a new resource group (or choose an existing one from the dropdown menu) -> name it whatever -> name your Virtual Machine -> Select Region -> Pick availability option (Base, availability zones, VMSS or Availability Set) -> Select image (linux or Windows) -> Size of the VM -> Use SSH public key -> Review + Create -> Download the private key and create resources -. Deployment in progress ----after completion---> Go to Resource
What are the different resources that are required for a virtual machine?
Go to homepage -> Click on the name of the given resource group (it's a cube like icon) -> have a look at all the resources in the resource group
You'd notice that even after creating just 1 VM, we have multiple resources getting created. We would have :
Go to the homepage -> Select "All resources" -> You'll see all the things that exist in your Azure Subscription (even though all you created was just one VM). But just look at the resources group and you'll be able to tell where each resource belongs
Application Hosting Options
Azure App Service
How to create one?
Go to dashboard -> Click on App Service -> Select the resource group -> VM name has to be unique within a subscription. So you can't create two VMs with same name. But someone else with a different Azure subscription can create a name with your name. But the name that you give your Web App has to be unique across Azure App Service. Because this is a DNS name. -> Also notice that in the bottom right of the name box, there's written ".azurewebsite.net", this means we can browse to it by just browsing to <name>.azurewebsite.net And that's another reason why the name has to be unique across all of Azure. -> Choose if you want a code, docker container or a static web app -> Choose runtime stack (like python, JAVA etc) -> Since this is a PaaS, there are fewer options, and lesser control, but also lesser complexity for us to deal with -> select OS -> In pricing plan, it'll say Windows Plan (central US) -> That's the App Service Plan -> Click on "Create New" and rename it to whatever -> Click "Review and Create" -> Click "Create"
Creating an App Service is faster than creating a VM because that Virtual Machine that this app is going to run on is already sitting there waiting to create a webapp within it.
Go to resource and that'll show you your web app running inside Azure -> on the left, if you scroll down, you'll see a "scale up" and a "scale out" option.
领英推荐
Any scaling operating applies to the App Service Plan. So if you have 2 web apps on the same app service plan then both of those apps are on the same VM, so any scaling options to all apps running in the app service plan.
In the "Scale out" tab there's two options:
Azure Kubernetes Service
If you need a powerful container solution. Kubernetes is a powerful container orchestration service, which implies that it excels at scaling containers and making sure they're available when you need them.
The control plane orchestrates the cluster, and it is responsible for scaling in or out.
You still only pay for the compute resources that are in your cluster.
Azure Networking Services
Azure Virtual Networks
Enables you to configure your networking in Azure without the hassle of configuring networking hardware, running cables etc.
Azure Virtual Network is an IP address specified in a classless inter domain format as 10.0.0.0/16. Which means it has 65,534 usable IP addresses. Within this, you can also specify 3 subnets, each with 254 usable IP addresses.
Web Tier
Subnet 1 (10.0.1.0/24) Used for hosting the website that provides the user interface for the application. It is the only subnet that has access to the internet
Middle Tier
Subnet 2 (10.0.2.0/24) where we implement business rules, data validation, etc.
Data Tier
Subnet 3 (10.0.3.0/24) Used for storing all the data that our application uses
Typically your Web Tier can communicate with your Middle Tier, and your Middle Tier can communicate with your Data Tier. But your Web Tier and Data Tier shouldn't be able to communicate with each other directly
Ultimately Azure Virtual Networks allow you to lift and shift your entire network topology from on-premises to the cloud and gives you plenty of capability to enable future growth as your network grows.
You can create multiple network in Azure based on your needs and you might find that you need to connect resources that in different virtual networks. For this, Azure offers a feature called, "Virtual Network Peering", and this allows you to connect two Azure networks together. This network traffic runs through Microsoft's private network (and NOT the internet), therefore peered traffic is not encrypted.
You can peer Virtual Networks in the same region or in different regions, but when you're peering a VNet in two different regions, it's called "Global Virtual Network Peering
Azure DNS
Azure VPN Gateway
VNet to VNet
Allows you to connect 2 Azure Virtual Networks together using a VPN gateway
Site to Site
Allows you to connect an Azure VNet to another network that's outside of Azure.
Point to Site
Allows you to connect a single device such as a mobile or a laptop to an Azure VNet
Azure Express Route
Also used to connect Azure resources to on-premises network, but unlike VPN gateway, Express Route offers speed upto 10 gbps over a dedicated fiber and upto a 100 gbps if you use "Express Route Direct" which is a high level offering that connects you directly to Microsoft's network.
Another advantage is that the traffic doesn't flow over the internet, instead you directly connect via a Microsoft Enterprise Edge (MSEE) Router
When you're using Express Route, you'll typically connect using a third party provider and that's usually your Internet Service Provider. The provider will have a direct connection to the MSEE, and that MSEE is directly connected to Microsoft's network in Azure. The key point here is that Microsoft calls an express route connection, a "Circuit".
Public and Private Endpoints
Two simple points.
When we were creating a VM and that created the Virtual Network. That virtual network had a private address space with a private endpoint for our virtual machine, but also, a public IP address resource, and that public IP address provides us with a public endpoint for a virtual machine