Core Cloud Services - Azure compute options
availability sets
- An availability set is a logical grouping of two or more VMs that help keep your application available during planned or unplanned maintenance. - A planned maintenance event is when the underlying Azure fabric that hosts VMs is updated by Microsoft. A planned maintenance event is done to patch security vulnerabilities, improve performance, and add or update features. - When the VM is part of an availability set, the Azure fabric updates are sequenced so not all of the associated VMs are rebooted at the same time. - VMs are put into different update domains. - Update domains indicate groups of VMs and underlying physical hardware that can be rebooted at the same time. - Update domains are a logical part of each data center and are implemented with software and logic.
Web Apps
- App Service includes full support for hosting web apps using ASP.NET, ASP.NET Core, Java, Ruby, Node.js, PHP, or Python. - You can choose either Windows or Linux as the host operating system.
Azure App Service
- Azure App Service enables you to build and host web apps, background jobs, mobile backends, and RESTful APIs in the programming language of your choice without managing infrastructure. - It offers auto-scaling and high availability, supports both Windows and Linux, and enables automated deployments from GitHub, Azure DevOps, or any Git repo to support a continuous deployment model. - This platform as a service (PaaS) allows you to focus on the website and API logic while Azure takes care of the infrastructure to run and scale your web applications.
Azure App Service
- Azure App Service is a platform-as-a-service (PaaS) offering in Azure that is designed to host enterprise-grade web-oriented applications. - You can meet rigorous performance, scalability, security, and compliance requirements while using a fully managed platform to perform infrastructure maintenance.
Azure Container Instances (ACI)
- Azure Container Instances (ACI) offers the fastest and simplest way to run a container in Azure. - You don't have to manage any virtual machines or configure any additional services. - It is a PaaS offering that allows you to upload your containers and execute them directly. - containers virtualize operating systems - VM's virtualize the hardware - In containers you only wait for Apps to launch - In VM's you wait for OS and apps to launch
Azure has two implementations of serverless compute:
- Azure Functions which can execute code in almost any modern language. - Azure Logic Apps which are designed in a web-based designer and can execute logic triggered by Azure services without writing any code.
Azure Logic Apps
- Azure Logic Apps are similar to Functions - both enable you to trigger logic based on an event. - Where Functions execute code, Logic Apps execute workflows built from predefined logic blocks. - They are specifically designed to automate your business processes. - You create Logic App workflows using a visual designer on the Azure Portal or in Visual Studio. The workflows are persisted as a JSON file with a known workflow schema.
Azure supported container
- Azure supports Docker containers, and there are several ways to manage containers in Azure. - Azure Container Instances (ACI) - Azure Kubernetes Service (AKS)
containers
- Containers are a virtualization environment for running applications. - Just like virtual machines, containers are run on top of a host operating system but unlike VMs, they don't include an operating system for the apps running inside the container. - Instead, containers bundle the libraries and components needed to run the application and use the existing host OS running the container. - For example, if five containers are running on a server with a specific Linux kernel, all five containers and the apps within them share that same Linux kernel.
Using containers in your solutions
- Containers are often used to create solutions using a microservice architecture. - This is where you break solutions into smaller, independent pieces. - For example, you may split a website into a container hosting your front end, another hosting your back end, and a third for storage. - This allows you to separate portions of your app into logical sections that can be maintained, scaled, or updated independently.
Functions vs. Logic Apps
- Functions and Logic Apps can both create complex orchestrations. - An orchestration is a collection of functions or steps, that are executed to accomplish a complex task. - With Azure Functions, you write code to complete each step, with Logic Apps, you use a GUI to define the actions and how they relate to one another. - You can mix and match services when you build an orchestration, calling functions from logic apps and calling logic apps from functions. - Here are some common differences between the two.
Learning objectives
- Identify compute options in Azure - Select compute options that are appropriate for your business
API Apps
- Much like hosting a website, you can build REST-based Web APIs using your choice of language and framework. - You get full Swagger support, and the ability to package and publish your API in the Azure Marketplace. - The produced apps can be consumed from any HTTP(s) based client.
Important while creating VMs
- Selecting an image is one of the most important decisions you'll make when creating a VM. - An image is a template used to create a VM. - These templates already include an OS and often other software, like development tools or web hosting environments.
Serverless Computing
- Serverless computing is a cloud-hosted execution environment that runs your code but completely abstracts the underlying hosting environment. - You create an instance of the service, and you add your code; no infrastructure configuration or maintenance is required, or even allowed.
Functions
- State - Normally stateless, but Durable Functions provide state - Development - Code-first (imperative) - Connectivity - About a dozen built-in binding types, write code for custom bindings - Actions - Each activity is an Azure function; write code for activity functions - Monitoring -Azure Application Insights - Management - REST API, Visual Studio - Execution context - Can run locally or in the cloud
Logic Apps
- State - Stateful - Development - Designer-first (declarative) - Connectivity - Large collection of connectors, Enterprise Integration Pack for B2B scenarios, build custom connectors - Actions- Large collection of ready-made actions - Monitoring - Azure portal, Log Analytics - Management - Azure portal, REST API, PowerShell, Visual Studio - Execution context - Runs only in the cloud
Azure Kubernetes Service (AKS)
- The task of automating and managing and interacting with a large number of containers is known as orchestration. - Azure Kubernetes Service (AKS) is a complete orchestration service for containers with distributed architectures with multiple containers.
Unplanned maintenance
- Unplanned maintenance events involve a hardware failure in the data center, such as a power outage or disk failure. - VMs that are part of an availability set automatically switch to a working physical server so the VM continues to run. - The group of virtual machines that share common hardware are in the same fault domain. - A fault domain is essentially a rack of servers. - It provides the physical separation of your workload across different power, cooling, and network hardware that support the physical servers in the data center server racks. - In the event the hardware that supports a server rack becomes unavailable, only that rack of servers is affected by the outage.
With an availability set, you get:
- Up to three fault domains that each have a server rack with dedicated power and network resources - Five logical update domains - Your VMs are then sequentially placed across the fault and update domains. - There's no cost for an availability set. - You only pay for the VMs within the availability set.
Mobile Apps
- Use the Mobile Apps feature of Azure App Service to quickly build a back-end for iOS and Android apps. With just a few clicks in the Azure portal you can: - Store mobile app data in a cloud-based SQL database - Authenticate customers against common social providers such as MSA, Google, Twitter and Facebook - Send push notifications - Execute custom back-end logic in C# or Node.js -On the mobile app side, there is SDK support for native iOS & Android, Xamarin, and React native apps.
Moving to the cloud with VMs
- VMs are also an excellent choice when moving from a physical server to the cloud ("lift and shift") - You can create an image of the physical server and host it within a VM with little or no changes. - Just like a physical on-premises server, you must maintain the VM. - Update the OS and the software it runs.
four common techniques for performing compute in Azure:
- Virtual machines - Containers - Azure App Service - Serverless computing
Which computing strategy is right for me?
- Virtual machines, - containers, - App Service, and - serverless computing each provide benefits as well as tradeoffs against other options. - For example, although serverless computing removes the need for you to manage infrastructure, serverless computing expects work to be completed quickly; usually within seconds or less. Therefore, you might run your core application on a virtual machine or container but offload some of the data processing onto a serverless app.
virtual machines
- Virtual machines, or VMs, are software emulations of physical computers. - They include a virtual processor, memory, storage, and networking resources. - They host an operating system (OS), and you're able to install and run software just like a physical computer. - And by using a remote desktop client, you can use and control the virtual machine as if you were sitting in front of it.
to avoid single point of failure in VM architecture
- We highly recommend that you place each workload in an availability set to avoid a single point of failure in your VM architecture.
Web Jobs
- WebJobs allows you to run a program (.exe, Java, PHP, Python or Node.js) or script (.cmd, .bat, PowerShell, or Bash) in the same context as a web app, API app, or mobile app. - They can be scheduled, or run by a trigger. - This is often used to run background tasks as part of your application logic.
Azure Functions
- When you're concerned only about the code running your service, and not the underlying platform or infrastructure, Azure Functions are ideal. - They're commonly used when you need to perform work in response to an event, often via a REST request, timer, or message from another Azure service and when that work can be completed quickly, within seconds or less. -Azure Functions scale automatically based on demand, so they're a solid choice when demand is variable. - Using a VM-based approach, you'd incur costs even when the VM is idle. - With functions, Azure runs your code when it's triggered and automatically deallocates resources when the function is finished. - In this model, you're only charged for the CPU time used while your function runs. - Furthermore, Azure Functions can be either stateless (the default) where they behave as if they're restarted every time they respond to an event), - or stateful (called "Durable Functions") where a context is passed through the function to track prior activity.
Types of web apps
- With Azure App Service, you can host most common web app styles including: - Web Apps - API Apps - WebJobs - Mobile Apps - Azure App Service handles most of the infrastructure decisions you deal with in hosting web apps: - deployment and management are integrated into the platform, endpoints can be secured, sites can be scaled quickly to handle high traffic loads, and the built-in load balancing and traffic manager provide high availability. - All of these app styles are hosted in the same infrastructure and share these benefits. This makes App Service the ideal choice to host web-oriented applications.
Explore Serverless computing in Azure
- With serverless computing, Azure takes care of managing the server infrastructure and allocation/deallocation of resources based on demand. - Infrastructure isn't your responsibility. - Scaling and performance are handled automatically, and you are billed only for the exact resources you use. - There's no need to even reserve capacity. - You focus solely on the logic you need to execute and the trigger that is used to run your code. - You configure your serverless apps to respond to events. - This could be a REST endpoint, a periodic timer, or even a message received from another Azure service. - The serverless app runs only when it's triggered by an event.
Scaling VMs in Azure
- You can run single VMs for testing, development, or minor tasks, or group VMs together to provide high availability, scalability, and redundancy. - Azure has several features so that no matter what your uptime requirements are, Azure can meet them. These features include: Availability sets Virtual Machine Scale Sets Azure Batch
App Service costs
- You pay for the Azure compute resources your app uses while it processes requests based on the App Service Plan you choose.
Azure Batch
- enables large-scale job scheduling and compute management with the ability to scale to tens, hundreds, or thousands of VMs. - When you're ready to run a job, Batch: - Starts a pool of compute VMs for you - Installs applications and staging data - Runs jobs with as many tasks as you have - Identifies failures - Requeues work - Scales down the pool as work completes - There may be situations in which you need raw computing power or supercomputer level compute power. Azure provides these capabilities.
Containers in Azure
- if you want to run multiple instances of an application on a single virtual machine, containers are an excellent choice. - Containers are meant to be lightweight, created, scaled out, and stopped dynamically. This design allows you to respond quickly to changes in demand or failure. - Another benefit of containers is you can run multiple isolated applications on a single VM host. - Since containers are secured and isolated, you don't need separate VMs for each app.
What is Azure compute?
- is an on-demand computing service for running cloud-based applications. - provides computing resources like multi-core processors and supercomputers via virtual machines and containers. - also provides serverless computing to run apps without requiring infrastructure setup or configuration. - The resources are available on-demand and can typically be created in minutes or even seconds. - You pay only for the resources you use and only for as long as you're using them.
What is a microservice?
- it is a webservice that is small well defined scope and is losely coupled from any other web services - for implementing a single business capability - each service is a separate code base that can be managed by a small development team - does not need to share same technology stack, libraries or frameworks which allows each team to choose the right tool for the job - this means single team can build, deploy a service in a continuous way.
virtual machine scale sets
- let you create and manage a group of identical, load balanced VMs. - Scale sets allow you to centrally manage, configure, and update a large number of VMs in minutes to provide highly available applications. - The number of VM instances can automatically increase or decrease in response to demand or a defined schedule. - you can build large-scale services for areas such as compute, big data, and container workloads.
Azure Virtual Machines (VMs)
- let you create and use virtual machines in the cloud. - provide infrastructure as a service (IaaS) in the form of a virtualized server and can be used in many ways. - Just like a physical computer, you can customize all of the software running on the VM. - VMs are an ideal choice when you need: - Total control over the operating system (OS) - The ability to run custom software, or - To use custom hosting configurations
Azure Compute Options
We can create compute resources, configure them to do the work we need, and pay only for what we use.