Thursday, 24 March 2022

Azure Virtual Machine vs Web App

 

Azure Virtual Machine

Azure Web App

Description

Infrastructure as a service, if you need to have full control over your computing environment.

Platform as a service, it allows you to integrate the app without managing the underlying infrastructure.

Deploy

Uses an OS image.

Uses a runtime stack.

State Management

Stateful or stateless

Stateless

Autoscaling

You need to use VM scale sets to support autoscaling in virtual machines.

Autoscaling is a built-in service in App Service.

Scale Limit

1000 nodes per scale set for platform image and 600 nodes per scale set for custom image

20 instances and 100 with App Service Environment

Traffic Distribution

Distribute the incoming network traffic using Azure load balancer.

Load balancing is integrated into App Service.

Architecture Styles

The supported architecture styles are N-Tier and Web-Queue-Worker.

The supported architecture styles are N-Tier and Big compute (HPC).

Azure User Tools

 

  • Manage your Azure resources through; Portal, CLI, Powershell, and Cloudshell

Azure Portal

  • Create, manage, and monitor all resources in one console, from simple web applications to complex cloud applications.
  • Portal Features:
    • Personalize – create your own dashboards, layouts, workflows, and colors
    • Access Control – fine-grained access control to all your resources
    • Cost Management – keep track of current and projected costs
    • Multi-Platform – available through web and mobile devices
    • Marketplace – an online store that consists of thousands of built-in product offerings such as:
      • Virtual machine images
      • Managed applications
      • Software-as-a-service solutions
      • Consulting and managed services

Azure User Tools

Azure CLI

  • Command Line Interface (CLI)  works on Windows, Mac, and Linux
  • You can create and manage Azure resources with a set of commands
  • It’s built to get you to work with Azure quickly, with focus on automation.

Azure Powershell

  • Fully supported by Azure with modules and cmdlets
    • cmdlet is a lightweight command, which is used in PowerShell.
  • PowerShell provides powerful features for automation
  • PowerShell also uses Azure Resource Manager to manipulate Azure resources

Azure Cloud Shell

  • An interactive, browser-accessible shell for managing Azure resources.
  • You can choose between Bash or PowerShell
  • Shell access from anywhere using the web or mobile app
  • Cloud Shell attaches Azure Files share to persist your data
  • It also offers an integrated file editor built on the open-source Monaco Editor

Azure Mobile App

  • You can monitor the status and health of your Azure resources
  • Monitor your metrics and alerts and take the necessary actions to fix common issues
  • You can run commands via Azure CLI or PowerShell to manage your Azure resources

Azure Global Infrastructure

 

Regions

  • Each region has more than one data center, which is a physical location.
  • A group of data centers deployed in a latency-defined perimeter and connected through a dedicated regional low latency network.
  • Criteria in choosing a Region:
    • Location – a region closest to your users minimizes the latency
    • Features – some features are not available in all regions
    • Price – the price of services vary from region to region
  • Each Region is paired within the same geographic area
  • If the primary region has an outage, you can failover to the secondary region
  • You can use paired regions for replication
  • Regions that are unique when it comes to compliance:
    • Azure Government Cloud – only US federal, state, local, and tribal governments and their partners have access to this dedicated instance
    • China Region – data center is physically located within China and has no connection outside of China, including other Azure regions

Availability Zones

  • Each availability zone is a physical location within a region
  • A zone is composed of one or more data centers with independent power, cooling, and networking facilities.
  • Azure services that support Availability Zones fall into two categories:
    • Zonal services – a resource is pinned to a specific zone
    • Zone-redundant services – replicates automatically across zones
    • The data moving in and out of Azure data centers, as well as data moving between Azure data centers, is called bandwidth.
    • Data transfer to Azure is always free.
    • Data transfer between Availability Zones is not free.
    • Data transfer within the same Availability Zone is free.
    • Data transfer between Azure regions and to other continents is not free.

Resource Groups

  • A container that holds related resources
  • Each resource can only exist in a single resource group
  • You can add or remove resources to any resource group at any time
  • Allows you to move a resource from one resource group to another
  • Resources from multiple regions can be in one resource group
  • You can give users access to a resource group
  • Resources can interact with other resources in different resource groups
  • A resource group has a location, or region, as it stores metadata about the resources

Azure Resource Manager (ARM)

  • A management layer allowing you to create, update and delete resources within your account.
  • You can deploy, manage, and monitor resources as a group
  • Resource Manager template is mainly used to deploy the resources consistently and repeatedly.
  • Define the dependencies between resources so they’re deployed in the correct order.
  • Tag resources to logically organize all the resources in your subscription.
  • You can check the costs for a group of resources sharing the same tag.

Azure Site Recovery

  • Azure’s disaster recovery as a service (DRaaS)
  • You can minimize recovery issues by sequencing the order of multi-tier applications that run on several virtual machines.
  • Keep applications available from on-premises to Azure or Azure to another Azure region during outages with automatic recovery.

Azure Cloud Architecture Models


  • Cloud computing is the delivery of services over the Internet that helps you reduce your operating costs, run your infrastructure efficiently, and scale as business requirements change.
    • Benefits of cloud computing:
      • Cost – eliminates capital expense.
      • Global scale – ability to scale elastically.
      • Performance – computing hardware is always upgraded to the latest generation.
      • Security – data stored in the cloud has a broad set of policies, technologies, and controls.
      • Speed – computing resources can be provisioned in minutes.
      • Productivity – enables the customer to focus on business requirements instead of setting up on-site datacenters.
      • Reliability – availability of your resources at all times.
  • Three deployment methods of cloud computing: Public vs Private vs Hybrid.
  • The model you choose for cloud deployment depends on your budget, security, scalability, and maintenance needs.

Public Cloud

  • Focus on maintaining your applications without having to worry about purchasing, managing, or maintaining the hardware on which it runs.
  • You can use multiple public cloud providers of varying scale.

Advantages

Disadvantages

High scalability/agility

Specific security requirements

Pay-as-you-go pricing

Government policies, industry standards, or legal requirements

You are not responsible for the updates and maintenance of the hardware.

You don’t own the hardware or services and you also can’t manage them as you may want to.

The required technical knowledge is minimal.

Maintaining a legacy application might be hard to meet

 

Private Cloud

  • A dedicated on-premises datacenter configured to be a cloud environment that provides users in your organization with self-service access to compute resources.
  • You are responsible for the purchase and maintenance of the hardware and software services.
  • You can use a private cloud when an organization has data that cannot be put in the public cloud, perhaps for legal reasons.

Advantages

Disadvantages

Any scenario or legacy application configuration is supported.

CapEx involved – principal cost is the procurement of the equipment.

You have control (and responsibility) over security

To scale, you must buy, install, and set up new hardware

Compliance, or security requirements in your organization

Private clouds require IT skills and expertise

 

Hybrid Cloud

  • Data and applications can move between private and public clouds.
  • When there is a spike in demand in your private cloud, you can “burst through” to the public cloud for additional computing resources.

Advantages

Disadvantages

Maintain a private infrastructure for sensitive assets.

More expensive than selecting one deployment model since it involves some CapEx cost upfront

Take advantage of the resources in the public cloud when needed.

It can be more complicated to set up and manage

With the ability to scale to the public cloud, you pay for extra computing power only when needed.

Allows you to use your own equipment to meet the security and compliance requirements in your organization.

Azure Cloud Service Models

 

  • The three cloud computing service models are IaaS, PaaS, and SaaS.
  • You can also use serverless computing to eliminate the need to manage infrastructure.
  • The shared responsibility model determines the security tasks that are handled by the cloud provider and handled by the customer.
    • Azure is responsible for protecting the infrastructure such as hosts, network, and data center.
    • The customer is responsible for protecting their data, endpoints, account, and access management.
  • IaaS, PaaS, and SaaS have different levels of managed services:

azure cloud service models

Infrastructure as a service (IaaS)

  • Most user management
  • You are responsible for managing the operating systems, data, and applications.
  • IaaS helps you to extend resources rapidly to meet the spikes required for your application.
  • Used in the following scenarios:
    • Migrating workloads – move existing applications to the cloud.
    • Test and development – quickly set up and dismantle test and development environments. IaaS makes scaling development and testing environments, fast and economical.
    • Storage, backup, and recovery – simplify the planning and management of backup and recovery systems.
    • Website hosting – less expensive than traditional web hosting.
    • High-performance computing (HPC) – clusters of computers that help solve complex problems involving millions of variables or calculations.
    • Big data analysis – for massive data sets that require a huge amount of processing power.

Platform as a service (PaaS)

  • Less user management
  • The operating systems are managed by the cloud provider, while the user is responsible for the applications and data they run and store.
  • PaaS offers all the functionality you need to support the entire lifecycle of web applications: building, testing the applicationdeploying the source codemanaging, and updating within the same integrated environment.
  • Used in the following scenarios:
    • Development framework – a framework for creating or customizing cloud-based applications.
    • Analytics or business intelligence – find insights and patterns, and predict outcomes to improve business decisions.

Software as a service (SaaS)

  • Least amount of management
  • The cloud provider is responsible for managing everything, and the end-user just uses the software.

Serverless Computing

  • Function as a Service (FaaS)
  • You simply deploy the code with a serverless platform, and it runs at high availability.
  • Dynamically scales up and down to meet the demands of each workload within seconds.
  • pay-per-execution model that charges sub-second billing only for the time and resources required to execute the code.

Azure CapEx vs. OpEx

 

Capital Expenditure (CapEx)

  • Upfront cost on physical infrastructure
  • You need to plan your expenses at the start of a project or budget period.
  • CapEx computing costs:
    • Server costs – server clustering, redundant power supplies, and uninterruptible power supplies.
    • Storage costs – centralized storage and fault-tolerant storage for critical applications.
    • Network costs – cabling, switches, access points, routers, wide area networks, and Internet connections.
    • Backup and archive costs – backup maintenance and consumables like tapes.
    • Organization continuity and disaster recovery costs – recover from a disaster and continue operating using backup generators.
    • Datacenter infrastructure costs – costs for construction and building equipment.
    • Technical personnel – technical expertise and workforce to install, deploy, and manage the systems in the data center and at the DR site.

Operational Expenditure (OpEx)

  • No upfront cost but you pay for the service/product as you use it
  • Ex is particularly appealing if the demand fluctuates or is unknown
  • OpEX computing costs:
    • Leasing software and customized features –  responsibility to de-provision the resources when they aren’t in use so that you can minimize costs.
    • Scaling charges based on usage/demand instead of fixed hardware or capacity – plan for backup traffic and disaster recovery traffic to determine the bandwidth needed.
    • Billing at the user or organization level – when using a dedicated cloud service, you could pay based on server hardware and usage.

Azure CapEx vs OpEx

Azure Cloud Concepts

  • Terminologies of the cloud: High Availability, Fault Tolerance, Disaster Recovery, Scalability, Elasticity, and Agility

High Availability

  • If hardware fails, you can get a new, exact copy of it in very little time
  • Use clusters (a group of virtual machines) to ensure high availability

Fault Tolerance

  • Fault tolerance is part of the resilience of cloud computing
  • Zero Down-Time –  if one component fails, a backup component takes its place

Disaster Recovery

  • Plan to recover critical business systems:
    • Recovery Time Objective (RTO) is the time it takes after a disruption to restore business process to its service level
    • Recovery Point Objective (RPO) is the acceptable amount of data loss measured in time before the disaster occurs
  • Services for backup and disaster recovery:
    • Azure Backup – simplify data protection while saving costs
    • Azure Site Recovery  keep your business running with disaster recovery service
    • Azure Archive Storage – store rarely used data in the cloud

Scalability

  • You may increase or decrease the resources and services used at any given time, depending on the demand or workload.
    • Vertical Scaling – adding resources to increase the power of an existing server
    • Horizontal Scaling – adding more servers that function together as one unit
  • Use scale sets for critical scenarios

Elasticity

  • Quickly expand or decrease computing resources
  • Automatically allocates more computing resources to handle the increased traffic. When the traffic begins to normalize, the cloud automatically de-allocates the additional resources to minimize cost

Agility

  • The ability to design, test, and launch software applications quickly that stimulate business growth.
  • Cloud agility enables companies to concentrate on other concerns such as security, monitoring, and analysis, instead of provisioning and maintaining the resources.