Virtual Academy for Microsoft Azure Fundamental in Thai Language

ChubChai
23 min readJul 18, 2020

--

Lecture by Khun Wisit & AiPEN Studio

Part I

  1. Principle of Cloud Computing
  2. Introduction to Microsoft Azure

Part II

  1. Azure Architecture and Service Guarandteesm
  2. Create an Azure Account
  3. Manage Services with the Azure Portal

Part III

  1. Azure Compute Options
  2. Azure Data Storage Options
  3. Azure Networking Options

Part IV

  1. Security, Responsibility, and Trust in Azure

Part V

  1. Apply and Monitor Infrastructure Standards with Azure Policy
  2. Control and Organize Azure Resources with Azure Resource Manager

Part VI

  1. Predict Cost and Optimize Spending for Azure

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART I

Principle of Cloud Computing

Cloud Computing

การให้บริการ Computing Service ได้แก่ compute power (ไว้สร้าง virtual machine), storage (เช่น database), networking (เช่น firewall), analytics (เช่น monitor performance, availability, security) โดยที่ผู้ใช้บริการต้องจ่ายเงินให้กับผู้ให้บริการ และทางฝั่งผู้ให้บริการจะติดตั้ง data center เพื่อให้บริการ computing server

  • ทางฝั่งผู้ให้บริการ เราจะเรียกว่า Cloud Provider หรือ Cloud Service Provider หรือบางพื้นที่มี Local Cloud Provider เช่น Microsoft Azure, AWS, GCP โดยมีหน้าที่ดูแล physical data center และ physical hardware, ให้บริการ resources
  • ทางฝั่งผู้รับบริการ เรียกว่า Customer

สำหรับองค์กรที่ไม่ใช้ cloud จะต้องคำนึงถึง capacity ของ on-premise data center จะสามารถรองรับได้ไหม, sand storage, จะรองรับ requirement ที่เพิ่มขึ้นได้ไหม, lifecycle ของ hardware, ระยะเวลาของกระบวนการการจัดซื้อ

Cloud Computing-Benefits

  1. Cost-Effective
    รูปแบบการคิดค่าใช้จ่าย เรียกว่า Pay-as-you-go หรือ Comsumption-Based Pricing Model ไม่มีค่า upfront cost เช่น สร้าง virtual machine แล้วปล่อยให้ run ก็คิดราคาจากจำนวนเวลาที่ใช้
  2. Scalable
    service ที่อยู่บน data center ของผู้ให้บริการ ฝั่งผู้รับบริการสามารถปรับเปลี่ยน spec ของ service หรือสร้าง instance ของ virtual machine ได้ สามารถเพิ่มหรือลด resources ได้ และคิดค่าบริการตามการใช้จริง (workload)
  3. Elastic
    ผู้รับบริการสามารถเพิ่มหรือลด resources ได้แบบ on-demand
  4. Current
    การอัพเดท patch ปรับเปลี่ยน hardware และอัพเดทต่าง ๆ เป็นหน้าที่ของผู้ให้บริการ ผู้รับบริการไม่ต้องพะวงเรื่องการติดตั้งและอัพเดท
  5. Reliable
    business continuity, SLA, recovery rate, data loss protection, backup and data replication ทางผู้ให้ผู้บริการจะวางแผนสิ่งเหล่านี้ไว้เรียบร้อย ซึ่งใน data center ของ Microsoft Azure จะมี SLA อยู่ที่ 99.95
  6. Global
    ควรพิจารณาว่าผู้ให้บริการมี data center กระจายอยู่กี่ location หากมีปัญหาเกิดขึ้นจะสามารถโยกย้ายไปที่อื่นได้หรือไม่ และลูกค้าของเราอยู่ที่ไหน เขาสามารถเข้าถึงบริการบน web app ของเราได้หรือไม่
  7. Secure
    มีการเข้ารหัสข้อมูล, มี service สำหรับ secure web application

Cloud Computing-Compliance

  1. General Data Protection Regulation (GDPR) เป็นกฎหมายคุ้มครองข้อมูลส่วนบุคคลของพลเมืองสหภาพยุโรป ดังนั้นไม่ว่าพลเมืองจะไปอยู่ที่ใด GDPR จะตามไปคุ้มครองทุกแห่ง
  2. Health Insurance Portability and Accountability Act (HIPAA) เป็นกฎหมายของสหรัฐอเมริกาที่คุ้มครองข้อมูลสุขภาพ การรักษาพยาบาลของผู้ป่วยในทุกรูปแบบ (Protected Health Information: PHI) เช่น ข้อมูลการวินิจฉัยโรค ข้อมูลการรักษา
  3. Health Information Technology for Economic and Clinical Health Act (HITECH) บทบัญญัติส่งเสริมการใช้งานเทคโนโลยีสารสนเทศทางสุขภาพ โดย HIPAA และ HITECH ระบุข้อกำหนดเกี่ยวกับการใช้และเปิดเผย PHI, การรักษาความปลอดภัยที่เหมาะสมสำหรับปกป้อง PHI, สิทธิส่วนบุคคล และความรับผิดชอบต่อการบริหารจัดการ
  4. International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) 27018
    Microsoft เป็น cloud provider เจ้าแรกที่ใช้ ISO/IEC 27018 เป็น เป็นมาตรฐานสากลสำหรับความเป็นส่วนตัวและการปกป้องข้อมูลบนคลาวด์
  5. Service Organization Controls (SOC) 1, 2, and 3
    แสดงภาพรวมความปลอดภัยภายในองค์กร โดย Microsoft Cloud Services ครอบคลุมเรื่อง data security, availability, processing integrity, confidentiality
  6. National Institute of Standards and Technology (NIST) Cybersecurity Framework (CSF)
  7. Federal Risk and Authorization Management Program (FedRAMP)
  8. Health Information Trust Alliance (HITRUST)

ดูรายละเอียดเพิ่มเติมได้ใน Microsoft Trust Center
มีแนะนำเรื่อง compliance

Cloud Computing — Economies of Scale

เราจะสร้างได้มากขึ้น มีประสิทธิภาพมากขึ้น ด้วยค่าใช้จ่ายที่น้อยลง

  1. Capital Expenditure (CapEx)
    ค่าใช้จ่าย physical infrastructure upfront สูง แต่ค่าใช้จ่ายจะน้อยลงในระยะยาว
    - server cost: design fault tolerance & redundancy
    - storage cost: storage hardware components, cost of supporting
    - network cost: on-premise hardware components (cabling, switches, access points, routers, wide area network, internet connections)
    - backup and archive cost: backup, copy, archive data, backup maintenance and consumables
    - organization continuity and disaster recovery costs: business continuity planning (BCP), data recovery site, backup generators
    - datacenter infrastructure costs: construction and building equipment, future renovation remodeling cost
    - technical personnel: technical expertise, workforce
  2. Operational Expenditure (OpEx)
    มีค่าใช้จ่ายเฉพาะ product หรือ service ที่ใช้งาน เป็นรูปแบบ pay-as-you-use / consumption-based pricing model ไม่มี upfront cost
    - leasing software and customized features: require managing subscriptions
    - scaling changes based on usage/demand instead of fixed hardware or capacity: the number of users, CPU usage time, allocated RAM, I/O operations per second (IOPS), storage space
    - billing at the user or organization level: users can scale, customize, provision computing resources ex. software, storage, development platforms

Cloud Service Models

องค์กรต้องเข้าใจ cloud computing concept แล้วค่อยพิจารณาว่าจะใช้การบริการรูปแบบไหน

Cloud Service Models (I)
  1. Traditional On-premises
    - ต้องพิจารณาตามกล่องสีฟ้า เช่น
    sand storage, physical server, hyper v/ vm ware, O/S ใน virtual machine
    - ทุก 4 ปีจะต้องเปลี่ยน networking, storage, servers, virtualization
    - ต้องคิดวิธีย้าย data center / วางแผน backup / การทำ DR
  2. Infrastructure as a Service (IaaS)
    - เช่น Microsoft Azure, Amazon Web Services, IBM, Google Compute Engine
    - ผู้ใช้บริการรับผิดชอบ O/S, middleware, runtime, data, applications หรือจะทำ cloud migration ก็ได้ (นำสิ่งที่อยู่ด้านซ้ายขึ้น cloud)
    - ผู้ให้บริการแต่ละรายมี service model ต่างกัน
    - Data Center ของ Microsoft Azure มี SLA อยู่ที่ 99.95
    Scenarios
    - Migrating workloads (ย้ายขึ้น cloud)
    - Test and development (ให้ environment ในการทำ dev test)
    - Storage, backup, recovery
  3. Platform as a Service (PaaS)
    - เช่น Microsoft Azure, Heroku, Google App Engine, Salesforce
    - ผู้ใช้บริการรับผิดชอบ data, applications
    - สำหรับ developer ไว้ build, deploy webapp ex. .Net, Java, Ruby
    Scenarios
    - Development framework (develop and customize cloud-based applications)
    - Analytics or business intelligence (analyze and mine data)
  4. Software as a Service (SaaS)
    - เช่น Microsoft Dynamic 365, Office 365, SAP SuccessFactors, SalesForce, Email, Calendars
    - เรียกว่า Cloud App, SaaS Spp
    - ผู้ใช้งานแค่ใช้งานตามฟีเจอร์ โดยที่ไม่ต้องดูแลส่วนอื่น ๆ

Microsoft Azure รองรับทั้ง IaaS, PaaS, SaaS

Cloud Service Models (II)

Cloud Deployment Models

  1. Public Cloud
    - ทุกอย่าง run ใน Cloud Provider’s Hardware
    - เรียกผู้ให้บริการว่า Cloud Services or Hosting Provider
  2. Private Cloud
    แบ่งเป็น 2 รูปแบบ คือ on-premise กับ off-premise
    on-premise ไม่เกี่ยวข้องกับ cloud provider แต่เพิ่ม cloud management solution (system center) / VM ware cloud stack
    off-premise ใช้บริการ infrastructure ของผู้ให้บริการ สิ่งต่าง ๆ ที่สร้างจะเป็นของผู้รับบริการ
  3. Hybrid Cloud
    เอา public กับ private มาใช้งานร่วมกัน เช่น
    - ใช้ Office 365 แล้ว sync เพื่อทำ office 365 single sign-on
    - เอา service model มาใช้งานร่วมกัน เช่น ใช้ IaaS ร่วมกับ SaaS
    - สร้าง virtual machine run webapp แต่ต้องติดต่อกับ datacenter on-premise

Data Center Characteristics -> on-demand, self-service, elasticity, broad network access, measure service, resource pulling

Create an Azure Account

หากต้องการใช้บริการ Cloud Provider ของ Microsoft Azure จะต้องซื้อ Azure access ซึ่งต้องเตรียม 2 อย่าง

  1. Azure account (=Microsoft Account)
    Azure Free Account มี credit $200 สำหรับ 30 วัน
    https://azure.microsoft.com/en-us/
    free service
  2. Azure subscription
    เป็น logical container ที่ไว้ตรวจดู resource ต่าง ๆ ใน Azure
Azure subscription

Azure Purchasing Options
- Azure.com: เป็นการซื้อแบบ direct จาก Azure.com ซึ่งผูกกับบัตรเครดิต
- Microsoft Representative: ตัวแทนขายของ Microsoft ซึ่งอาจซื้อเป็น volume licence (หรือเรียกว่า token ซึ่ง1 licence = $100) หรือซื้อเป็น EA
- Microsoft Partner: จะได้ Azure account, billing management, support
- Cloud Service Provider (CSP): เป็นแบบ post-paid

Azure Support Options
*Azure Free Support Resources

- Billing and Subscription Management Support
- Azure Quickstart Center: guidance
- Azure Service Health: plan maintenance จะเตือนเฉพาะ service ที่เราใช้งาน
- Azure Advisor: เป็นที่ปรึกษาส่วนตัวที่ตรวจสอบ performance, availability, security พร้อม recommendation

*Azure Support Plans
- Developer: ใช้ทดสอบ service บางอย่างแล้วเกิดปัญหา เป็น service ที่ไม่ critical ไม่ต้องใช้ response time ที่รวดเร็ว ($29/month)
- Standard: $100 /month
- Professional Direct: $1000/month

Azure Support Plan

Azure Support Plans

*Azure Community Support
- Azure Knowledge Center: แหล่งค้นหาข้อมูลเพื่อตอบคำถามด้านการ support ทั่วไป
- Microsoft Tech Community: แหล่งหาคำตอบจากผู้พัฒนาและผู้ทดสอบของ Microsoft
- Microsoft Q&A: หาคำตอบของปัญหาทางเทคนิคที่เกี่ยวข้องกับผลิตภัณฑ์ของ Azure
- Stack Overflow: เป็น community ของผู้พัฒนา ให้คนอื่น ๆ สามารถหาข้อมูลได้
- Server Fault: เป็น community ที่เกี่ยวกับ system & network administrator ของ Azure
- Azure Feedback Forums: หาไอเดียและข้อเสนอแนะในการปรับปรุง Azure จากผู้ใช้ด้วยกัน
- Twitter: เป็น official Microsoft Azure Twitter channel @AzureSupport

Introduction to Microsoft Azure

“Open” + “Flexible” Cloud Platform -> build, deploy, manage solutions (จะใช้ window หรือ linux ก็ได้)

Microsoft Azure Services

Microsoft Azure Regions

region = กลุ่มของ datacenter
- เวลาจะเลือกใช้ให้ดูว่ามีกี่ location มีการรองรับ fault tolerance ไหม
- เลือก region ที่อยู่ใกล้กับผู้ใช้งาน
- ระวังเรื่อง Region Deployment Availability
- ปัจจุบันมี 57 regions ใน 140 ประเทศ
- 1 region จะมีประมาณ 1–3 datacenter

Microsoft Azure-Services

Compute
- Azure Virtual Machines:
Windows or Linux virtual machines (VMs) hosted in Azure
- Azure Virtual Machine Scale Sets:
Scaling for Windows or Linux VMs hosted in Azure (auto scale set)
- Azure Kubernetes Service:
Enables management of a cluster of VMs that run containerized services
- Azure Service Fabric:
Distributed systems platform. Runs in Azure or on-premises
- Azure Batch:
Managed service for parallel and high-performance computing applications
- Azure Container Instances:
Run containerized apps on Azure without provisioning servers or VMs
- Azure Functions:
An event-driven, serverless compute service

Networking
- Azure Virtual Network:
Connects VMs to incoming Virtual Private Network (VPN) connections
- Azure Load Balancer:
Balances inbound and outbound connections to applications or service endpoints
- Azure Application Gateway:
Optimizes app server farm delivery while increasing application security
- Azure VPN Gateway:
Accesses Azure Virtual Networks through high-performance VPN gateways
- Azure DNS:
Provides ultra-fast DNS responses and ultra-high domain availability
- Azure Content Delivery Network:
Delivers high-bandwidth content to customers globally
- Azure DDoS Protection:
Protects Azure-hosted applications from distributed denial of service (DDOS) attacks
- Azure Traffic Manager:
Distributes network traffic across Azure regions worldwide
- Azure ExpressRoute:
Connects to Azure over high-bandwidth dedicated secure connections
- Azure Network Watcher:
Monitors and diagnoses network issues using scenario-based analysis
- Azure Firewall:
Implements high-security, high-availability firewall with unlimited scalability
- Azure Virtual WAN:
Creates a unified wide area network (WAN), connecting local and remote sites

Storage
- Azure Blob Storage:
Storage service for very large objects, such as video files or bitmaps
- Azure File Storage:
File shares that you can access and manage like a file server
- Azure Queue Storage:
A data store for queuing and reliably delivering messages between applications
- Azure Table Storage:
A NoSQL store that hosts unstructured data independent of any schema

Databases
- Azure Cosmos DB:
Globally distributed database that supports NoSQL options
- Azure SQL Database:
Fully managed relational database with auto-scale, integral intelligence, and robust security
- Azure Database for MySQL:
Fully managed and scalable MySQL relational database with high availability and security
- Azure Database for PostgreSQL:
Fully managed and scalable PostgreSQL relational database with high availability and security
- SQL Server on VMs:
Host enterprise SQL Server apps in the cloud
- Azure Synapse Analytics:
Fully managed data warehouse with integral security at every level of scale at no extra cost
- Azure Database Migration Service:
Migrates your databases to the cloud with no application code changes
- Azure Cache for Redis:
Caches frequently used and static data to reduce data and application latency
- Azure Database for MariaDB:
Fully managed and scalable MariaDB relational database with high availability and security

Web
- Azure App Service:
Quickly create powerful cloud web-based apps
- Azure Notification Hubs:
Send push notifications to any platform from any back end.
- Azure API Management:
Publish APIs to developers, partners, and employees securely and at scale.
- Azure Cognitive Search:
Fully managed search as a service.
- Web Apps feature of Azure App Service:
Create and deploy mission-critical web apps at scale.
- Azure SignalR Service:
Add real-time web functionalities easily.

Internet of Things
- IoT Central:
Fully-managed global IoT software as a service (SaaS) solution that makes it easy to connect, monitor, and manage your IoT assets at scale
- Azure IoT Hub:
Messaging hub that provides secure communications between and monitoring of millions of IoT devices
- IoT Edge:
Push your data analysis models directly onto your IoT devices, allowing them to react quickly to state changes without needing to consult cloud-based AI models.

Big Data
- Azure Synapse Analytics:
Run analytics at a massive scale using a cloud-based Enterprise Data Warehouse (EDW) that leverages massive parallel processing (MPP) to run complex queries quickly across petabytes of data
- Azure HDInsight:
Process massive amounts of data with managed clusters of Hadoop clusters in the cloud
- Azure Databricks:
Collaborative Apache Spark–based analytics service that can be integrated with other Big Data services in Azure.

Artificial Intelligence
- Azure Machine Learning Service:
Cloud-based environment you can use to develop, train, test, deploy, manage, and track machine learning models. It can auto-generate a model and auto-tune it for you. It will let you start training on your local machine, and then scale out to the cloud
- Azure Machine Learning Studio:
Collaborative, drag-and-drop visual workspace where you can build, test, and deploy machine learning solutions using pre-built machine learning algorithms and data-handling modules
- Vision:
Image-processing algorithms to smartly identify, caption, index, and moderate your pictures and videos.
- Speech:
Convert spoken audio into text, use voice for verification, or add speaker recognition to your app.
- Knowledge mapping:
Map complex information and data in order to solve tasks such as intelligent recommendations and semantic search.
- Bing Search:
Add Bing Search APIs to your apps and harness the ability to comb billions of webpages, images, videos, and news with a single API call.
- Natural Language Processing:
Allow your apps to process natural language with pre-built scripts, evaluate sentiment and learn how to recognize what users want.

DevOps
- Azure DevOps:
Azure DevOps Services (formerly known as Visual Studio Team Services, or VSTS), provides development collaboration tools including high-performance pipelines, free private Git repositories, configurable Kanban boards, and extensive automated and cloud-based load testing
- Azure DevTest Labs:
Quickly create on-demand Windows and Linux environments you can use to test or demo your applications directly from your deployment pipelines

Derived From Azure Services

Addition Notes:
การคิดค่าใช้จ่ายของ Virtual Machine

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART II

Azure Architecture and Service Guarantees

Understand Datacenters and Regions in Azure

Region = Geographical Area ซึ่งใน 1 region จะมี datacenter(resource-pull) มากกว่า 1 โดยทั่วไปจะไม่ต่ำกว่า 3 เพื่อความทนทาน (fault-tolerant) และการทำซ้ำ (redundant) ของข้อมูล หากผู้ใช้งานอยู่ใกล้บริเวณไหน ให้เลือกใช้ region บริเวณนั้น และต่อให้เป็น service เดียวกัน แต่ต่าง region ค่าใช้บริการก็จะต่างกัน

*ต้องรู้ราคาก่อนที่จะสร้าง

Special Azure Regions

เป็น Datacenter ที่ Azure ไม่ได้เข้าไปบริหารเอง แต่จะ comply ตาม legal ของประเทศนั้น และไม่เปิดให้คนทั่วไปนอกจากรัฐบาลใช้งาน เช่น

  • US DoD Central, US Gov Virginia, US Gov Iowa and more
  • China East, China North and more: Microsoft and 21Vianet เป็นผู้ดูแล
  • Germany

Understand Geographies in Azure

Geographies = border แบ่งตามขอบเขตของประเทศนั้น ๆ

1 geographies มากกว่า 1 region

1 region มีมากกว่า 1 datacenter

regions แต่ละแห่งเชื่อมกัน

Geographies:

  • Americas
  • Europe
  • Asia Pacific
  • Middle East and Africa

Understand Availability Zones in Azure

Availability Zones = แยก datacenter ภายใน region ออกมาเป็น zone ซึ่งเป็นไปได้ว่า datacenter ใน region นั้นอาจอยู่คนละประเทศ

Supported Regions:

  • Central US
  • East US 2
  • West US 2
  • West Europe
  • France Central
  • North Europe
  • Southeast Asia

Supported Services (Zone Services, Zone-redundant Services):

  • VMs
  • Managed Disks
  • IP Addresses
  • Load Balancers
  • SQL Databases
  • etc.

Understand Region Pairs in Azure

Region Pair = แต่ละ region จะเชื่อมต่อระหว่าง region โดยมีระยะห่างระหว่าง region อย่างน้อยประมาณ 300 ไมล์ ประโยชน์ของ region pair คือเพื่อให้ผู้ใช้งานมั่นใจในการสร้าง service หรือเก็บข้อมูลใน Azure datacenter (resiliency)

ถ้า service ต่าง ๆ ไปหมดทั้ง region จะถูกย้ายไปอีก region อัตโนมัติ

Azure Regional Pair

Understand Service-Level Agreement for Azure

SLA = performance standards
- ถ้าหากเกิดเหตุการณ์ไม่คาดฝันเกิดขึ้น ระบบยังสามารถใช้งานต่อได้ หรือถ้าไม่ได้ จะใช้ได้เร็วสุดภายในระยะเวลาเท่าใด
- แต่ละ service มี SLA ต่างกัน

Consideration:

  • เข้าใจ concept ของ service ที่จะเลือกใช้
  • ราคา
  • SLA ได้ทันที หรือต้องทำอะไรเพิ่มเติมไหม
Uptime and Connectivity Guarantees by Microsoft Learn

Compose SLAs across Services

Web App (PaaS) -> Azure App Service

Web App (IaaS) -> Azure Virtual Machine -> กำหนด SLA เอง

SQL Server (PaaS) -> Azure SQL -> SLA 99.99%

SLA = 99.95 percent × 99.99 percent = 99.94 percent

Improve Your App Reliability in Azure

Resiliency = ความสามารถในการ recover หลังการ fail ให้กลับมาทำงานได้ตามปกติ เช่น disk, main board, หรือ hardware ใช้งานไม่ได้ ทำอย่างไรให้ downtime & data loss น้อยที่สุด

  • High Availability ทำยังไงให้ยังใช้งานได้อยู่ตลอด เช่น การทำ clustering
  • Disaster Recovery ย้ายทุกอย่างไปอยู่อีกที่หนึ่ง

ถ้าผู้ใช้งานสร้าง VMs แล้ว disk ไม่ใช่ premium solid state disk -> No SLA
แต่ถ้ามากกว่าระดับ premium -> SLA = 99.9

Manage Services with the Azure Portal

Azure Management Options

Day-to-day management & interaction:

  • Azure Portal: interact with Azure
  • Azure PowerShell & Azure Command-Line Interface (CLI)
  • Azure Cloud Shell: Web-based command-line interface
  • Azure Mobile App: monitor & manage resource from mobile devices

กรณีมีผู้ดูแลมากกว่า 1 สามารถสร้าง dashboard เพื่อช่วยกันบริหารจัดการหรือแบ่งหน้าที่ความรับผิดชอบด้วย Azure Portal Dashboards

Access Public and Private Preview

เป็น feature/service ใหม่ที่แค่ให้ทดลองใช้งาน แต่ยังไม่ใช้การใช้งานจริง

  • Private preview (เฉพาะบางคน)
  • Public preview

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART III

Azure Compute Options

Essential Azure Compute Concepts

Azure Compute = on-demand compute / computing service ที่ให้บริการ computing resources, serverless computing โดยที่ไม่ต้องติดตั้ง infrastructure หรือ configuration ex. Azure Virtual Machines, Containers, Azure App Service, Serverless computing

Explore Azure Virtual Machine

Azure Virtual Machines (VMs) — IaaS
- Hyper V
- เลือก spec และ OS ที่ต้องการติดตั้งได้
- charge เป็นนาที
- เป็น environment สำหรับ dev test
- Moving to the Cloud with VMs (Migration)
- Scaling VMs in Azure (Availability Set, Virtual Machine Scale Sets and Azure Batch)

Availability Set

- ถ้าไม่ใช่ premium solid state จะไม่มี SLA
- ใช้กรณีที่มี VMs มากกว่า 1 ตัว แต่ run service เดียวกัน (Active Directory Domain Service)
- VM dca กับ dcb อยู่คนละตู้ เพื่อกระจายความเสี่ยง
- SLA 99.95%

availability set

Availability Zone
- dca กับ dcb เลือก zone ที่แตกต่างกัน(datacenter ที่จะไปวาง)

Explore Containers in Azure

Container (Containerization) เป็น tech ที่ถูกออกแบบมาเพื่อ Developer
- เอา Code ใส่เข้าไป config ใน container แล้วไปรันใน container server เสร็จแล้ว app จะพร้อมทำงาน ซึ่งจะ deploy ที่ไหนก็ได้
- รับผิดชอบเฉพาะ coding
- รองรับ Docker Containers (standardized container model)

  • Azure Container Instances (ACI)
  • Azure Kubernetes Service (AKS)

Microservice เนื่องจาก app แต่ละตัวจะออกแบบมาแบบ monolithic เมื่อต้องการปรับเปลี่ยนหรือขยายจะทำได้ลำบาก จึงมี concept ให้ app แยกออกมาเป็นส่วนเล็กๆ Developer จึงสามารถแยกกันพัฒนาแต่ละชิ้น แล้วเอามาเชื่อมตัวกัน run บน serverless computing

Explore Azure App Service

Azure App Service — Focus ที่การ coding & deploy การใช้งาน หรือจะเอา docker ขึ้นไป run ก็ได้ โดยคิดค่าใช้จ่ายตาม App Service Plan
- รองรับการ deploy จาก GitHub, Azure DevOps, Git repo ต่างๆ

Types of App Services
- Web Apps
- API Apps
- WebJobs
- Mobile Apps

Explore Serverless Computing in Azure

ถ้าออกแบบ app ให้ run บน serverless computing จะ maintain หรือ deploy ก็จะยืดหยุ่นมากกว่า run บน service อื่น

หาก app ยังไม่มีการใช้งาน ก็ยังไม่คิดค่าใช้จ่าย แต่นับตาม execution (แตกต่างจาก Azure Virtual Machine หรือ Azure App Service ซึ่งคิดเป็นรายเดือนหรือตาม App Service Plan)

  • Azure Functions — execute code in almost any modern language
  • Azure Logic Apps — สร้าง workflow ได้โดยไม่ต้อง coding

Azure Data Storage Options

Benefits of using Azure to store data

Azure Data Storage options — cloud-based, secure, scalable
- automated backup and recovery
- replication across the globe
- support for data analytics
- encryption capabilities
- multiple data types: structured, unstructured, semi-structured
- data storage in virtual disks
- storage tiers: hot, cool, archive

Types of Data
- Structured data — มี schema ชัดเจน เช่น relational database
- Semi-structured data
- Unstructured data

How Azure Data Storage can meet your business storage needs

Azure SQL Database — SQL server (PaaS)
- Azure Database Migration Service -> Microsoft Data Migration Assistant สำหรับการย้ายจาก on-premise

Azure SQL Database

Azure Cosmos DB — Unstructured/ Schema-less data และรองรับ globally distributed database, globally replicate ส่วนใหญ่ใช้กับ mobile/ web application

Azure Cosmos DB

Azure Blob Storage — Unstructured Data

Azure Blob Storage

Azure Data Lake Storage — เก็บข้อมูล raw data เพื่อเตรียมทำ big data หรือ data analysis

Azure Data Lake Storage

Azure Files — (Azure Files Share) type หนึ่งของ azure storage
- Server Message Block (SMB) Protocol
- มีการ encrypt ข้อมูล ทั้ง at rest (ผ่าน SSE) และ in transit state (http)

Azure Files

Azure Queue — type หนึ่งของ azure storage เหมาะสำหรับ developer
- messaging service ถ้า dev พัฒนาหลายแอพ หลาย service แล้วต้องการส่งข้อมูลข้าม service จะต้องใช้ service นี้

Azure Queue

Disk Storage — ใช้งานคู่กับ Azure Virtual Machine

Disk Storage

[Azure Storage →blob, table, queue, file, disk]

Storage Tiers

  1. Hot storage tier — มีการ read, write อยู่บ่อยๆ
  2. Cool storage tier — ไม่ค่อย read, write ไม่ค่อยได้ access อย่างน้อย 30 วัน
  3. Archive storage tier — ไม่ค่อยได้ access อย่างน้อย 180 วัน

คิดตาม GB ที่เก็บ (hot) → คิดตาม tray ที่เก็บ (archive)

Encrytion

  1. Azure Storage Service Encryption (SSE)
    - data at rest
    - ถูกใช้งานเมื่อไหร่จะ decryption อัตโนมัติ
  2. Client-side encryption

Benefits

  • Cost Effectiveness
    ใช้เท่าไหร่ จ่ายเท่านั้น
  • Reliability
    แทบทุกตัวเป็น PaaS จึงมี SLA ให้อยู่แล้ว
  • Storage Types
    เลือกตามรูปแบบข้อมูล
  • Agility
    ตอบสนองความต้องการได้รวดเร็ว (on-demand)
Compare on-premises storage to Azure data storage

Azure Networking Options

Azure Networking Services

Azure Virtual Network (V-NET) — เหมือน network ที่อยู่บน datacenter on-premise โดยเวลาจะใช้ VMs ต้องใช้คู่กับ Virtual Network
- ใน 1 virtual network จะมีอย่างน้อย 1 subnet
- ไม่มีค่าใช้จ่าย
- VMs ที่สร้างต้องเลือกว่าจะใช้ network ใด subnet ใด
- เชื่อมกับ Network ใน datacenter ได้ โดยผ่านการเชื่อมแบบ VPN site-to-site ใช้โปรโตคอลในการทำ VPN tunnel
- แบ่ง subnet ได้
- ต้องกำหนด address space ในแต่ละ subnet

Network Security Group — Firewall ที่มาพร้อม Virtual Machine แต่ละตัวที่สร้าง
- Windows Server: NSG → Port 3389 RDP
- Linux: NSG → Secure shell

Network Traffic Management

Load Balancing /Load Balancer— Network traffic management/ distributed traffic เป็นการกระจาย traffic เพื่อรองรับผู้ใช้งาน
- สำหรับ stateless application

Load Balancing

Azure Load Balancer — มาพร้อมกับ public IP
- สามารถ configuration rule
- ทำงานที่ layer 4

Azure Application Gateway
- ทำงานที่ layer 7
- สำหรับ web application
- WAF: web application firewall ป้องกัน fiber threat
- มี public IP

Azure Content Delivery Network (CDN)
- ทำอย่างไรให้ content ที่ผู้ใช้งานต้องการ ไปถึงผู้ใช้งานโดยเร็วที่สุด
- content: document, image, video, etc.

Azure Traffic Manager
- เว็บแอปที่สร้างหรือบริการอยู่มีการเข้าถึงจากผู้ใช้หลายประเทศ
- คอยเช็คว่าผู้ใช้งานมาจากไหน

Create a resource group

Resource group (Basics)
Project detail:
- Subscription: ใส่ subscription
- Resource group: ตั้งชื่อ resource group
Resource details:
- Region: ใส่ region ควรอยู่ใกล้กับผู้ใช้งานมากที่สุด
Create

Create a virtual machine

Window server → datacenter → create
Virtual Machine (Basics)
Project details:
- Subscription: เลือก subscription ที่มี
- Resource group: เลือก resource group ที่สร้างไว้แล้ว

Instance details:
- virtual machine name: ตั้งชื่อ VM
- Region: เลือก region
- Availability options: ตั้งชื่อ availability set/zone
- Image: เช่น Windows Server 2019 Datacenter
- Azure Spot instance
- Size: เลือก VM size

Administrator account
- Username: ตั้งชื่อ user ซึ่งจะกลายเป็น local admin ใน windows server ที่ติดตั้ง
- Password: รูปแบบ complex
- Confirm password

Inbound port rules
- Public inbound ports:
- Select inbound ports: default เป็น RDP (3389)

Virtual Machine (Disks)
Disk options:
- OS disk type: type ที่เลือกขึ้นกับ spec ที่เลือก
- encryption type: (default) Encryption at-rest with a platform-managed key

Virtual Machine (Network)
Network interface:
- Virtual network: ถ้ายังไม่มีมันจะให้สร้างเลย โดย default จะเป็นชื่อ resource group-vnet
- Subnet: default (10.0.0.0/24)
- Public IP: (default)
- NIC network security group: Basic
- Public inbound ports: Allow selected ports
- Select inbound ports: RDP (3389)

Next → Create ไม่เกิน 15 นาที

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART IV

Security, Responsibility, and Trust in Azure

Cloud Security is a Shared Responsibility

สิ่งที่ต้องรับผิดชอบจะอ้างอิงจาก service model

Cloud Security Service Model

Area ที่ต้อง focus ในมุมมอง security ได้แก่
- Data: ex. blob, azure virtual machine
- Endpoints: ex. web app
- Accounts: user identity
- Access management

Defense-In-Depth

เป็น strategy model ที่ใช้ในการ secure ระบบทั้ง datacenter ที่อยู่ใน on-premise หรือ on cloud ประกอบด้วย layer ทั้งหมด 7 layer

Defense-In-Depth

ตัวอย่าง

Physical Security: มีการแสกนลายนิ้วมือก่อนเข้าห้อง server, มีการบันทึกการเข้าออก, มีกล้องวงจรปิด

Identity & Access: กำหนดสิทธิ์, บัตรผ่านเข้าออก

Perimeter (control traffic ในการเข้าออก): Azure application gateway, firewall

Network: Azure Virtual Network

Compute: วิธีการ secure Azure Virtual Machine scale set, Azure App Service

Azure Security Center

- ทำหน้าที่ monitor service ต่าง ๆ ที่ได้สร้างและใช้งาน เช่น virtual machine มีพฤติกรรมอะไรแปลกๆ หรือควรติดตั้งอะไรเพิ่มเติม
- มี knowledge และ best practices
- มี recommendation ให้ว่าแต่ละ service ควรททำอะไรบ้างให้ปลอดภัย
- มี feature ให้ติดตั้งใช้งานเพิ่มเติมนอกเหนือจาก threat protection & security เช่น just-in-time access (สามารถ remote เข้า virtual machine ได้ทันที โดยให้ RDP port ของ virtual machine เปิดเมื่อถึงเวลาที่ต้องการ)

2 pricing tiers:
1. Free: 30-day trial
2. Standard: $15 per node per month

Identity and Access

Authentication and Authorization
Authentication
— verify ว่าบุคคลหรือ service นั้นคือใคร
Authorization — กำหนดว่าสามารถ access อะไรได้บ้าง และสามารถ access ได้ที่ level ไหน เช่น read only

Azure Active Directory — Identity management
- เป็นตัวทำ authentication & authorization
- เป็น flat structure
- สร้างได้แค่ user กับ group account

  • Authentication
  • Single-Sign-On (SSO)
  • Application management
  • Business to business (B2B) identity services
  • Business-to-Customer (B2C) identity services
  • Device Management

Active Directory Domain Service
- อยู่ใน windows server
- เครื่องที่ใช้และให้บริการจะต้อง join เข้า domain (LDAP service)
- เป็น forest tree

Multi-Factor Authentication (MFA)
- เพิ่ม secure ในการทำ authentication
- เช่น นอกจาก username, password อาจจะมี passcode/ mobile app authenticator

Role-Based Access Control (RBAC)
- กำหนดสิทธิ์และการเข้าถึงของผู้ใช้งานตาม level

Role-Based Access Control (RBAC)

Management Group — เมื่อทำ governance & compliance (policy)

Privileged Identity Management
- สร้าง user account, reset user & pass, ทำอะไรก็ได้
- เป็นสมาชิกถาวรจนกว่าผู้ดูแลระบบจะลบออก

Encryption

Process ที่ทำให้เราไม่สามารถทำความเข้าใจได้ว่าข้อมูลนั้นคืออะไร ถ้าไม่มีสิทธิ์ในการ decryption โดยใช้ key ในการ encrypt + decrypt

  • Symmetric Encryption: ใช้ key เดียว ใช้กับข้อมูลขนาดใหญ่ ทำงานได้เร็ว
  • Asymmetric Encryption: paired key (public key, private key) ใช้สำหรับ Transport Layer Security (TLS)

Concept การ secure data

  • Encryption At Rest: Microsoft จะ encrypt ให้อัตโนมัติ
Encryption At Rest
  • Encryption In Transit
Encryption In Transit

Encryption on Azure

Encrypt Raw Storage →Storage Service Encryption (SSE): encrypt data หากเก็บอยู่ใน Azure Storage

Encrypt Virtual Machine Disks →Azure Disk Encryption (ADE): ต่อให้ download ไปก็เปิดไม่ได้หากไม่มี key

Encrypt Databases →Transparent Data Encryption (TDE): encrypt databases ex. Azure SQL

Azure Key Vault: build, manage, deploy, maintain key ที่ใช่ encrypt ซึ่งมีค่าใช้จ่าย

Overview of Azure Certificates
- x.509 v.3
- Certificate Authority: Generate, issue, track, revoke certificate
- Self-sign certificate: No CA สำหรับองค์กรไม่ใหญ่มาก
- CA Requested certificate
- ใช้ Azure Key Vault จัดการ certificate ได้

Protect Your Network

Internet Protection

  • Azure Firewall
    - PaaS
    - เหมือน on-premise firewall
    - กำหนด filter, inbound-outbound, packages
  • Azure Application Gateway
    - support HTTP, HTTPS
    - web application firewall
  • Network Virtual Appliances (NVAs)
    = third-party firewall

Stopping Distributed Denial of Service (DDoS) attacks

DDoS — ส่ง package มาถี่ๆ ไม่ได้จะขโมยข้อมูล

Distributed Denial of Service (DDoS) attacks

Controlling the traffic inside your Virtual Network

Virtual Network Security
- control traffic ที่อยู่ใน virtual network
- Network Security Groups (NSGs) default มาพร้อมกับ Azure Virtual Machine

Network Integration
- VPN Gateway: กำหนด traffic ที่จะเข้ามา, connection ผ่าน public network (Internet)
- Express Route: เชื่อมต่อ on-premise datacenter กับ Azure Virtual Network, connection with reliable, low latency, more bandwidth, secure แต่ค่าใช้จ่ายสูงกว่า VPN Gateway

Protect Your Shared Documents

Microsoft Azure Information Protection (AIP)
- Protect document & mail
- กำหนดว่าใครสามารถทำอะไรได้บ้าง เช่น อ่านได้อย่างเดียว print หรือ forward ไม่ได้
- พัฒนาต่อยอดมาจาก Azure write management
- กำหนด label เช่น ถ้าเป็นเอกสาร secret อาจกำหนด label เป็น confidential
- กำหนด expiration
- analyze data flows to gain insight into business
- detect risky behaviors and take corrective measures
- track access to documents
- prevent data leakage or misuse of confidential information

Azure Advanced Threat Protection (Azure ATP)
- identify, detect และตรวจสอบภัยคุกคาม (identity focus)
- เช่น เวลา sign-in เพื่อ access resource หากมีการ sign-in จากหลาย device หรือมาจากหลาย location Azure ATP จะบล็อกให้
Azure ATP sensor: แจ้งเตือน
Azure ATP cloud service: อยู่ในชุด Enterprise Mobility + Security E5 suite

Understand Security Considerations for Application Lifecycle Management Solutions

พิจารณาเรื่อง Architecture และ Coding
Microsoft Security Development Lifecycle (SDL)
- Security & Privacy Cosiderations
- Threat modeling
- White paper, best practices

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART V

Apply and Monitor Infrastructure Standards with Azure Policy

Good governance sample cases
- multiple engineering teams working in Azure
- multiple subscriptions in your tenant
- regulatory requirements that must be enforced
- want to ensure standards are followed for all IT allocated resources

Governance
1. ออกแบบ policy ในรูปแบบผังองค์กร โดยใช้ Azure Policy เช่น assign policy ไป enforce subscription, resources group, resources ให้ comply ตาม policy
2. access control: การนำเอา feature RBAC เข้ามาใช้ใน Azure AD เช่น กำหนดสิทธิ์คนที่จะเข้ามาใน subscription หรือ resource group

*จะทำ governance ต้องเก็บ requirement ก่อน

Define IT Compliance with Azure Policy

Azure Policy
- Create, assign, manage policy เพื่อไป enforce resources
- จะ evaluate แล้วแจ้งว่า resources อันไหน compliance / non-compliance
- ให้ resource เป็นไปตามมาตรฐานที่องค์กรกำหนด

Creating a Policy
1. Create Policy Definition — กำหนดค่า settings
2. Assign a Definition to a Scope of Resources
3. View Policy Evaluation Results

Management group จะต้อง enabled โดยอยู่บนสุดของ subscription ซึ่ง route management group จะไม่สามารถลบได้ จะเปลี่ยนได้แค่ display name แล้วถึงสร้าง management group เพื่อสร้าง subscription เพิ่มได้

ดังนั้นถ้า assign policy มาที่ management group มันจะ inherit ไปที่ child management group ด้วย

Policy Definition
- เช่น ถ้าสร้าง Web App จะต้องเป็น HTTPS เท่านั้น หรือถ้าสร้าง Virtual Machine จะต้องมี Antivirus ด้วยเพื่อให้มี status เป็น compliance
- สามารถ customize ได้

Organize Policy with Initiatives

Defining Initiatives

Enterprise Governance Management

Enterprise Governance Management

โดย default จะต้องไป enable management group เช่น ผ่าน portal หรือ power shell

Define Standard Resources with Azure Blueprints

Azure Blueprint — สิ่งที่ออกแบบเพื่อติดตั้งใช้งาน services ใน Microsoft Azure แต่ต้องการเรื่อง governance และ compliance ด้วย รวมถึงการกำหนดให้ user สามารถเข้าถึงได้ และมีการ backup ข้อมูล
concept การใช้งาน
- ต้องอยู่ใน region นี้เท่านั้น
- encrypt disk ใน virtual machine
- ติดตั้ง antivirus ใน virtual machine
- ติดตั้ง backup agent
- สร้างใน Southeast Asia region
- อนุญาตให้ทุกคน access virtual machine นี้
-> ใช้ Virtual Machine, Azure Policy, Access Control
ต้องอาศัยการทำ Azure Manager Resource Template เพื่อให้มีความยืดหยุ่น

Explore Your Service Compliance with Compliance Manager

  1. Microsoft Privacy Statement — เวลาตัดสินใจซื้อ product ของ Microsoft ผู้ใช้งานจะกรอกข้อมูล โดยมีการแจ้งว่ากรอกเพื่ออะไร และมีนโยบายว่าจะไม่นำข้อมูลส่วนตัวของลูกค้าไปเปิดเผย
  2. Microsoft Trust Center —เว็บไซต์ที่เป็นแหล่งข้อมูล เช่น ต้อง concern เรื่องทุก service ต้อง comply ตาม GDPR Compliance ใน Microsoft Trust Center จะมีข้อมูล guidance แนะนำ; overview concept + in-depth
  3. Service Trust Portal — แสดง compliance relation information ดู report ได้ โดยจะสอดคล้องกับ ISO, SOC, NIST, FedRAMP, GDPR ปกติใช้คู่กับ Compliance Manager
  4. Compliance Manager — workflow-based risk assessment dashboard อยู่ภายใน Service Trust Portal หากสงสัยว่าต้องทำอะไรเพิ่มเติมเพื่อให้สอดคล้องกับ compliance จะเป็นลักษณะการให้คะแนนแต่ละ Area โดยมีเราร่วมกำหนดมาตรฐาน

Monitor Your Service Health

  1. Azure Monitor — เป็น service หลักที่ใช้ตรวจสอบการทำงาน โดย Focus performance & availability
  2. Azure Service Health — ช่วยตรวจสอบว่า datacenter ของ Azure มีปัญหาอะไรหรือไม่ แจ้งเฉพาะ datacenter ที่มีผลต่อ resources ของผู้ใช้งานเท่านั้น
Azure Monitor

- แต่ละ layer จะมี service มาทำงานร่วมกับ Azure Monitor ด้วย
- Metric Data — ข้อมูลที่บ่งชี้ performance เช่น CPU, memory, disk, network
- Log Data — ข้อมูลที่บันทึกเหตุการณ์ต่าง ๆ ที่เกิดขึ้น
- ทั้ง metric data และ log data จะมาเก็บที่ log analytics
- มีการแจ้งเตือน
- เพิ่มลด instance ได้ตามต้องการ

Azure Advisor — เป็นที่ปรึกษา Azure ส่วนตัว เช่น Azure Virtual Machine ที่สร้างและทำงานจนถึงตอนนี้ มีตัวไหนบ้างที่ under utilized หรือปลอดภัยไหม ต้องทำอะไรเพิ่มเติม
- ตรวจสอบ service ที่สร้างขึ้นมาใน subscription
- Free
- ให้คำปรึกษา 5 เรื่อง ได้แก่
1. cost: underutilized → เปลี่ยน series size, จำนวนเงินที่ประหยัดกว่าเดิม
2. security: แยกตามลำดับความสำคัญ เช่น ใช้ MFA, ติดตั้ง endpoint solution protection ex. antivirus
3. reliability
4. operation excellence: แนะนำให้สร้าง template หากมีการใช้ service ลักษณะนี้บ่อยๆ
5. performance

Control and Organize Azure Resources with Azure Resource Manager

Principle of Resource Groups

Resource groups — สร้างขึ้นเพื่อเก็บรวบรวม resources หรือ service ที่สร้างขึ้นใน Microsoft Azure ซึ่ง 1 resource จะอยู่ภายใต้ resource group เดียวเท่านั้น และไม่มี resource group ย่อยใน resource group
- ชื่อ resource group ไม่สามารถเปลี่ยนได้
- อาจแบ่งตาม department, functionality, etc.
- resource กับ resource group อาจไม่ได้อยู่ใน region เดียวกัน

Create a Resource Group

- Azure Portal
- Azure PowerShell
- Azure CLI — Command Line Interface
- Templates
- Azure SDKs (.NET, Java)

Use Tagging to organize Resources

Tags = label
- ตอนที่สร้าง service ใน Microsoft Azure จะให้กำหนด tag แปะไปยัง resource ที่สร้างขึ้น โดยอาจจะ force ไปยัง policy ซึ่ง 1 resource มีได้ถึง 50 tags แต่ classic resource จะไม่ support tag
- Department (ex. finance, marketing)
- Environment (ex. prod, dev, test)
- Cost Center
- Life Cycle and Automation (ex. Shutdown and Startup of Virtual Machines)

Secure Resources with Role-Based Access Control (RBAC)

- กำหนดสิทธิ์
- เตรียม build-in / pre-define RBAC role มาให้ ผู้ใช้งานแค่ assign user หรือ group เข้า role เพื่อทุ่นเวลา ผู้ใช้งานจะได้ไม่ต้องเสียเวลากำหนดอะไรเอง หรือจะ customize role เองก็ได้

Role-Based Access Control (RBAC)

Use Resource Locks to protect Resources

Resource Locks — ป้องกันไม่ให้ใครลบ resource ของเรา โดยมีค่า setup คือ Delete กับ Read-only
- จะสร้างทีละอันหรือ force ผ่าน Azure Policy ก็ได้

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

PART VI

Predict Cost and Optimize Spending for Azure

Consumption-based pricing model → ให้ balance performance กับ cost ให้เหมาะสม

คำถามที่อาจเกิดขึ้น
1. ค่าใช้จ่ายเท่าไหร่ถ้าจะ run บน Azure
2. มีวิธีการที่ทำให้ค่าใช้จ่ายถูกกว่านี้ไหม
3. ถ้ามีการเปลี่ยนแปลงเกิดขึ้นจะส่งผลต่อราคาและประสิทธิภาพมากแค่ไหน

Purchase Azure Products and Services

Azure Marketplace — แสดงลิสต์ของ service ทั้งของ Microsoft & third-party ถ้าเป็น Microsoft จะชาร์จจาก subscription ที่ซื้อ แต่ถ้าเป็น third-party ค่าใช้จ่ายจะเกิดขึ้นต่างหาก เช่น อาจจะจ่ายเป็นรายเดือน หรือจาก license

Usage Meters — เมื่อ provision Azure Resource จะเริ่มคิดค่าใช้จ่ายซึ่งขึ้นกับ resource ที่ใช่งาน ออกเป็นรายเดือน

  1. ค่า compute
  2. ค่า storage
  3. ค่า data-transfer ขาออก
  4. ค่า license

Cloud Architect — คนที่รวบรวม requirement พิจารณาค่าใช้จ่าย ดูว่าควรจะใช้ service อะไรบ้าง แล้วทำเป็น diagram ออกมาเป็น high-level แล้วแตกรายละเอียดออกมา

Factors affecting Costs

Resource Type — แต่ละ service มีราคาแตกต่างกัน ใช้เท่าไหร่ก็จ่ายเท่านั้น (ส่งผลต่อราคามากที่สุด)

Services — พิจารณาการซื้อ Azure Subscription
1. Web Direct
2. Open License (prepaid) อยู่ได้ 1 ปี ถ้าเงินหมด ทุกอย่างหยุดทำงาน
3. Enterprise Agreement
4. Cloud Solution Provider (postpaid)

Location — 60+ regions, 140+ countries แต่ละที่ราคาแตกต่างกัน
best practices: ให้เลือก location ที่อยู่ใกล้กับผู้ใช้งานมากที่สุด เช่น หากผู้ใช้งานอยู่ในประเทศไทยให้เลือก region South East Asia

Azure Billing Zones — Data Transferring (inbound: Free/ outbound: Paid) เช่น 5GB แรกฟรีต่อเดือน

Estimate Costs with the Azure Pricing Calculator

Azure Pricing Calculator — Free web-based tools เพื่อประเมินราคาก่อนจะสร้างจริง โดยเลือก service ที่สนใจแล้วกำหนด option ไป ซึ่ง calculator จะบอกว่าราคาประมาณเท่าไหร่ต่อเดือน โดยสามารถ share หรือ export เป็น excel file ได้

Predict and Optimize with Cost Management and Azure Advisor

ใช้ในกรณีที่องค์กรมีการใช้งาน Azure ไปเรียบร้อยแล้ว แล้วอยากรู้ว่า service ที่ใช้มีราคาเป็นอย่างไร และทำอย่างไรให้ถูกลง

Azure Advisor — Free Service built-in in Azure ทำหน้าที่เป็นที่ปรึกษา ตรวจสอบ service ต่าง ๆ ที่อยู่ในทุก subscription จะตรวจสอบ High Availability, Security, Performance, Operational Excellence, Cost แล้วให้ recommendation ว่าตัวไหน under utilized และควรปรับเปลี่ยนเป็น series size ไหน พร้อมบอกจำนวนค่าใช้จ่ายที่ประหยัดได้ รวมถึงแนะนำว่าขาด service ใด ต้องทำอะไรเพิ่มเติมไหม

Azure Cost Management — Free, build-in ใช้ในกรณีที่อยากได้ report อาจเป็น schedule report แยกตาม resource group, service และสามารถ set budget ได้

Estimate the Total Cost of Ownership with the Azure TCO Calculator

เปรียบเทียบค่าใช้จ่าย on-premise กับ on cloud

Azure TCO Calculator

https://azure.microsoft.com/en-in/pricing/tco/calculator/

Save on Infrastructure Costs

Use Azure credits
- $50 per month for Visual Studio Professional
- $150 per month for Visual Studio Enterprise
- สำหรับ Visual Studio Subscribers

Use spending limits
- สำหรับ Free Account

Use reserved instances (Azure RI)
- ควรใช้สำหรับคนที่ใช้ Azure Virtual Machine
- ซื้อสัญญาล่วงหน้า ถ้าซื้อ 1 ปีจะถูกลงมากถึง 72% หรืออาจจะซื้อถึง 3 ปี
- จะซื้อ series size ใด กี่ตัว ระยะเวลาเท่าไหร่

Azure RI

Choose Low-Cost Locations and Regions
สร้างที่อื่นที่ราคาถูกกว่าดีไหม

Research Available Cost-Saving Offers
มีความเป็นไปได้ในแต่ละช่วงเวลาว่าอาจจะมีช่วย promotion หรือราคาพิเศษ

Right-Size Underutilized Virtual Machines
ปรับเปลี่ยนให้อยู่ใน series size ที่เหมาะสม

Deallocate Virtual Machines in off hours
shut down Virtual Machine ในช่วงเวลาที่ไม่มีการใช้งาน

Azure Virtual Machine Status
- Running จ่ายค่า compute & storage ตามปกติ
- Stop: Azure ยังคง reserve compute power ให้กับ Azure Virtual Machine อยู่
- Stop (deallocated): ไม่ได้ reserve compute service แต่ยังมีค่า storage อยู่

Delete Unused Virtual Machines
ไม่ต้องเสียค่า compute service & storage

Migrate to PaaS or SaaS Services
ถูกกว่า on-premise และ IaaS

Save on Licensing Costs

Azure Virtual Machine ยังต้องคิดเรื่อง licensing เช่น แต่ windows server (datacenter edition) ฟรี ถ้าเป็นตัวอื่นจะมีค่าใช้จ่าย

Linux vs. Windows
Azure Hybrid Benefit for Windows Server (AHB) + Azure Hybrid Benefit for SQL Server สำหรับลูกค้า Microsoft ที่มีการซื้อ license windows server หรือ SQL server + Software Assurance (SA) ใช้งานอยู่แล้วใน on-premise datacenter หลังจากนั้นลูกค้าใช้ Azure Virtual Machine ติดตั้ง Windows Server กรณีนี้จะสามารถใช้ Azure Hybrid Benefit โดยเอา license ที่ใช้บน on-premise มาใช้ on cloud ได้ ซึ่งจะประหยัดไป 49% และถ้าบวกกับ Azure RI ค่าใช้จ่ายก็จะถูกลงอีก

Use Dev/Test subscription offers
- ราคาถูกกว่า pay-as-you-go
- เหมาะสำหรับ developers

Bring Your Own SQL Server License
ในกรณีที่ซื้อเป็น EA สำหรับ license SQL Serverไว้ตอน on-premise แล้ว จะสามารถเอา SQL Server มาติดตั้งใน Virtual Machine บน Azure ได้ฟรี

BYOL

SQL Server Developer Edition
- ใช้สำหรับ dev/test เท่านั้น
- non production use

Use constrained instance sizes for database workloads
ปกติถ้าจะ run database ดี ๆ จะอยู่ที่ CPU กับ memory ทาง Azure เลยมี CPUs และ Memory ให้เลือกตามต้องการและราคาถูก

VM Size

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Content and images in this article derived from https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/

--

--