AZ 300 Microsoft Azure Architect Technologies Notes
Azure Fundamentals
Some comparisons
Accounts and Subscriptions Overview
- Recently added “management groups”
Quotas Cost Analysis and Tagging Demonstration
- Like AWS, there is TAG concept, which helps you to tag resources for billing and other purposes. So a tagging strategy is very useful.
- You get a lot of soft limits for quotas, and with a ticket you can increase it, just like AWS.
- Limits for vCPU’s, VM’s …
Billing Alerts
Policies
You can assign policies, (also with JSON), so that any a suscription for example, can only
deploy certain type of virtual machines.
So we want maybe to set such “Allowed virtual Machine SKUs” for services.
Policies can be assigned to multiple subscriptions by using management groups.
Resource Groups and Tagging
Resource groups are an arbitrary grouping of related resources. You can put resources from another
region (aside of the one defined in the resource group). But the meta data of the resource group will be stored
in the defined region.
Tips for tagging
- Cost center (who Pays)
- Business Owner
- Maintenance window
We can also do IAM and policies on a resource group basis.
You can check all the deploys that happened in a Resource Group.
A resource group has its own view, you can do deployments, policies, iam, cost, automation scripts, metrics, …
A resource group is always assigned to a subscription.
Moving Resources Between Resource groups
You can move resources from one resource group to another.
Metrics from monitoring are stored in a “Diagnostics Storage Account”.
Somre resources cannot be moved, like alerts and (at the moment) managed disks.
Azure Monitoring Overview
You can create metric filters and then pin them to your dashboard.
When creating an alert, you choose the target resource(s), then what condition to trigger it, then the action group
which is to notify a team via mail, text, trigger webhooks, runbooks, functions, or many others.
A runbook is basically certain actions you dfine (like scale up) or such. This can be triggered manually or automatically.
Azure by default monitors the host level metrics (from the hypervisor) like CPU usage and such,
this is different from the guest level metrics, being the usage of certain services or programs in your OS.
For this you need to install an agent on your guest OS which runs on your virtual machine.
You can enable guest level metrics collection in the VM > Monitoring > Diagnostic Settings > Enable guest level monitoring.
ITSM (IT Service Management)
Log Analytics Key Features
Log Analytics is the layer that is used to gather all logs and then other services can query this layer.
The log analytics takes care of auto storing, creating tables and everything necessary to persist data.
Data Sources (for logs)
- source : Event Type : desc
- Custom Logs : _CL : Text files from the gues level agents
- Windows Event Logs : Event : Collected form the event logon windows computers
- Windows Performance Counters : Perf : Perf from windows machines
- Linux Performance Counters : Perf : Per from linux machines
- IIS Logs : W3CIISLog : IIS logs in W3C format
- Syslog : Syslog : Syslog events on Windows or Linux machines
other ones are like Azure Activity Log and Storage account logs.
Search query fundamentals
- Start with the source table (e.g Event)
- Follow on with a series of operators (which VM)
- Separate out additonal operations by using pipe
|
- Join other tables and workspaces using “union”
You are charged for the service “Log Analytics”
Seems that resource groups are often mandatory in many setups.
You pay for Log Anayltics per GB
So you create a Log Analytics workspace, here you pay per GB, you can then attach data sources, like VMs to it.
You can then query in the workspace, somehow you can also query accross multiple workspaces.
Log analytics stores in a region its data.
Again IAM is applicable to such a workspace.
With the query language, you start with a source, then you always do PIPING to the next thing, like:
Perf
| where TimeGenerated > ago(1h)
| where CounterName == @"% Processor Time"
| summarize avg(CounterValue) by Computer, (bin(TimeGenerated, 1m))
| render timechart
Reminds a bit of F# syntax
From a query you can create an alert rule.
Like S3, storage accounts are assigned some public URL, therefore it needs to be universily unique,
https://<your-storage-account-name>.<type>.core.windows.net/<container>/filename.extension
Types
- General Purpose v1 (GPV1)
- General Purpose v2 (GPV2) - Main choice (merged GPV1 and Blob account)
-
Blob account
- Block Blob
- Ideal for storing text or binary files, a singlicke block blob can contain up to 50K blocks of up to 100MB each, max 4.75TB
- Append blobs are optimized for append operations (e.g. logging)
- Page Blob
- Efficient for read/write operations
- used by Azure VM’s
- Up to 8 TB in size.
- Storage Tiers
- Hot (high storage costs, low access costs)
- Cold (lower storage costs, higher access cost, intended for data that will remain cool for 30 days or more)
- Archive (Lowest storage, highest access cost, when a blob is in archive storage it is offline and cannot be read)
- Choosing between Blobs, Files and Disks
- Blobs : Access app data from anywhere, large amount of objects to store images, video
- Files : Access files across multiple machines, jumpbox scenarioas for shared development scenarios
- Disks : Do not need to access data outside of the VM, Disk expansion for application installations
Storage accounts must have unique names across Azure (like a bucket on AWS).
- Replication
- Locally redundant Storage (LRS) - 3 copies in the same zone
- Zone redundant Storage (ZRS) - 3 copies across different zones but same region
- Geo redundant Storage (GRS) (Cross zone) - 6 copies accross multiple regions
- Read Access Geo Rendundant Storage (RA-GRS) - replicate to another region for reading
A storage account can be allowed to a single VPC or to all of your VPCs.
The Secure transfer flag enforces access to be over HTTPS and other equivalents depending the type of access.
You can use Azure Storage Explorer for managing files, uploading, viewing, get urls, and such.
You also have azcopy CLI to copy from and to a storage account.
Managing Access: Container permissions
- Public Access level : By default disabled for obvious reasons
- Levels:
- Private
- Blob (anonymous read access for blobs only)
- Container (anonymous read access for containers and blobs), public access to the entire container
We can have more granular access management
- Shared Access Signature
- Is is a query string that we add on to the url of the storage resources
- string informs Azure what access should be granted (basically signed urls)
- Utilized a hash based message auth (again, typical signed url)
- The SAS can be used as
- Account SAS Tokens
- Granted at the account level to grant permissions to services within the account. (Service to Service communication)
- Service SAS Tokens
- Grants access to a specific service within a storage account
Breakdown
https://<your-storage-account-name>.<type>.core.windows.net/<container>/filename.extension
?sv=2017-7-29 # Storage service version
&ss=bfqt # Signed services (Blob, File, queue, Table)
&srt=sco # Signed Resource Types (Service, Container, Object)
&sp=rwdlacup # Signed Permission (Read, Write, Delete, List, Add, Create, Update, Process) (process is queue messages)
&se=UTCTIMESTR # Signed Expiry
&st=UTCTIMESTR # Signed Expiry & Start
&spr=https # Signed Protocol
&sig=... # Signature hash
You can create a Access Policy that a SAS refers to. Since the SAS refers to an policy, you can change the policy itself
dynamically.
Encryption Keys and Key Vault
HSM : Hardware Security Modules
SSE : Service Encryption
Custom Domains
e.g. have http://acloud.guru instead of http://account.blob.core.windows.net *can also points directly a specific container)
It’s all DNS anyway!
2 ways to do this
- Create a CNAME record with your DNS provider that points from
- Your Domain (eg www.yourdomain.com to youraccount.blob.core.windows.net) - Simple but results in brief downtime as Azure verifies the registration of your domain
- “asverify” subdomain (verify.yourdomain.com to asverify.youraccount.blob.core.windows.net)
- When step complete, create CNAME record that points to youraccount.blob.core.windows.net
- No downtime
- This is the indirect CNAME validation
Azure Import/export Use Cases
Business Continuity Strategies
Virtual Machines
- Azure VM Networking
- One NIC can be attached to a VPC and subnet, attached/detacched as needed
- Network security groups can be attached to a NIC or to a subnet
- You can customize the DNS for a NIC, but by default it inherits from the Virtual Network
- I think the Network Security Group is equivalent to NACL
- Availability Sets
- TODO : Compare the limitations of VPC/SUBNET limitations with the Virtual Network/SUBNET limitations regarding regions and zones.
- TODO : Read more on this availability sets VS AWS
- Availability sets can be directly mapped to a backend pool of a Load Balancer
- Potential for VM Impact
- Planned Maintenance
- Unplanned Hardware maintenance
- Unexpected Downtime
- With Availability sets
- Group two or more machines in a set
- Separated based on fault Domains and Update Domains
- An availability set can have up to 3 Fault domains. Each fault domain is a different rack with own power and networking connectivity.
- This is for teach, downtime
- Update domains is to make sure when they patch stuff, they never patch the same update domains at the same time.
- One availability set per TIER ? (WEB/APP/DATA) - YES
- Scale Sets
- Horizontal scaling
- Virtual Machine Scale Sets (VMSS)
- This can be auto scaling or fixed scale or schedule
- Auto scaling can be on simple metrics like CPU Usage, but also in application metrics
Networking
Managing and Securing Identities
- Domain Services Overview
- 3 Major Options for Auth in AD
- Azure AD (AAD) -> Primary mechanism
- Modern AD service directly build for the cloud
- Often the same as 265 directory service
- Can sync with in premises directory service
- A “tenant” in AD is like a brand new AD isolated from others
- Features
- Enterprise Identity Solution
- Single Sign-On (you can reuse the same cookie sort to say, so you don’t need to keep relogging in for each app)
- MFA
- Self Service (empower users to do complete password resets, request access, ….)
- Creating a new directory (TODO: Does that equal creating a new tenant?)
- Must be UUID name, as this gets a public subdomain for
*.onmicrosoft.com
- A subscription can only be owned within one “directory/tenant”, so users from different directories cannot have access to the exact same subscription.
- When creating a new user, a password is created you can check, but they will be prompter to change it after login
- new users will get an email like
<freetochoose>@direcotryname.onmicrosoft.com
- Guest users are supported
- Via the IAM of an object (like a subscription), you can assign a role so that a User, group or service principal can access that subscription/object.
- Tiers
- Free
- 500K Object Limit
- 10 Apps/user
- Basic Reports
- No SLA/group based access/password self service/branding
- Limited MFA
- Basic
- 10 Apps/User
- Basic Reports
- Limited MFA
- Premium P1
- Premium P2
- Privileged Identity Management -> Temporary switch to higher access role when necessary and then degrade again, so like temp root access
- Office 365 Apps (thats not one you choose)
- Active Directory Domain Services (ADDS) -> On premise solution, prob self hosted
- Windows server with Activey Directory Domain Services role installed on it
- Legacy Active Directory since Windows 2000
- Traditional Kerbos and LDAP functionality
- Deployed on Windows OS usually on VMs
- Azure Active Directory Domain Services (AADDS) -> Manager service
- Provides managed Active Directory Domain Services (instead of self hosted)
- Allows you to consume domain services without the need to patch and maintain domain controllers on IaaS
- Domain Join, Group Policy, LDAP, Kerberos, NTLM; all supported
- Perfect for unexperienced devs with AD
- Need to create a dedicated subnet for this? - No, it is just recommended. To separate the IP space related to AADDS.
- You will need to update DNS settings for your VNet that runs AADDS
- Azure AD Overview
- Azure AD Connect (Connects a Azure AD (cloud) and ADDS (On Premise))
- Components
- Synchronization Services (create users and keep in sync and such)
- Filtering : Limit which objects are synced to Azure AD
- Default filtering : All users, contacts, groups and windows 10 users are synced
- Password Hash Sync : Syncs password hash of your on premise AD to the Azure AD
- Password writeback : Change/reset password in the cloud and write back to the on premise AD
- Device writeback : Allow register devices back to on premise AD
- Prevent accidental deletes : (by default on)
- Automatic upgrade : (default on for express) auto update/patch the version
- Password Sync Options
- Password Sync : Ensures user passwords ar the same in both directories (ADDS and Azure AD)
- Passthrough authentication : When user logs in, request is forwarded to ADDS. So Azure AD just acts as a proxy. Single Source
- AD FS - AD Federation services server to fully federate accross AD DS and Azure AD along with other services.
- Identity Federation : Linking identity across different identity systems. (related to SSO)
- Technologies used : SAML, OAuth, OpenID, JWT, Windows Identity Foundation
- Examples : Being able to login with Google Account to other services, same with FB, Microsoft, Github, …
- Active Directory Federation Services (optional)
- Health Monitoring
- Agent that you have to install on your ADDS
- Signel Sign On : Using password sync or passthrough authentication (not Federation)
- Requires Company device with modern browser
- User not required to authenticate with Azure AD if they are logged on with their AD DS credentials
- MFA
- Sth you know (password)
- Sth you have (phone)
- Sth you are (Biometrics)
- Methods
- Phone call
- Text Message
- Mobile App notification
- Mobile app verification code (code generator like Google Authenticator)
- 3th party tokens
- Azure AD B2C
- Allow people ot login with LinkedIn/Facebook/…
- Cloud Identity Solutions for Web And Mobile Apps
- Highly scalable to hundres of millions of identities
- Enables authentication for:
- Social Accounts
- Enterprise Acccounts
- Azure AD B2B
- Allowes you to collaborate with partners outside of your organization
- Users receive an email with a confirmation link upon invitation
- Imported users are “Azure AD External User Objects”
- Access to shared apps, resources, documents, …
- Partners access with their own credentials
- Enterprise-level security
- Privileged Identity Managment (PIM)
- What ?
- A user with some admin rights.
- Put some control around these privileged users
- Visibility into users with privileged access
- On Demand administrative access
- View administrator history
- Setup alerts
- Require approvals (via workflows)
- PIM Process
- User, with not too much access (but should sometimes)
- When they need this elevated access
- They go through activation process (customizable)
- Additional Auth
- Approval workflow (sent to a manager or sth)
- Can put time restriction on it
- Now you have an activated user, ready to work.
- Requirements
- PIM Roles
- Privileged Role Admin : Can manage role assignments and all aspects of PIM
- Security Administrator : Can read security information and reports, manage config in Azure Ad and Office 365
- Need to be global admin to setup PIM, this user is assigned both of the above roles.
- Only Privileged Role Admin can mange Azure AD directory role assignments of users.
- Assigned roles
- Directory
- Azure AD roles
- Can be “eligble” or “permanent”
- E.g. Global Admin
- Resource
- Azure RBAC
- Built or custom roles
- E.g. Subscription admin
- RBAC : Role Based Access Control
- TODO : Real difference between Azure AD and AADDS
Governance and RBAC Controls
- Role Based Access Control (RBAC)
- Azure RBAC Built in roles
- Owner : Full access to all resources, including the right to delegate access to others.
- Contributor : Can create and manage all types of Azure resources, but cannot grant access to others.
- Reader : Can view existing Azure resources, but cannot performan any actions against them
- Other Roles (some examples)
- API Management Service Contributor - Can manage API management service and the APIS
- API Management Service Operator Role - Can manage API management service, not not the APIS themselves.
- API Management Service Reader Role - Read-only access to API management service and the APIS.
- Application Insights Component Contributor - Can manage Application Insights components
- Automation Operator - Able to start, stop, suspend and resume hobs
- Backup Contributor - Can manage backup in Recovery Serices vault
- Backup Operator - Can manage backup except moving backup in Reovery services vault
- Backup reader - Can view all the backup management services
- Roles include various actions
- Action defines what type of operations you can perform on a given resource type
- Write enables POST, PUT, PATCH, DELETE
- Read enables GET
- Use PowerShell to get latest roles
Get-AzureRMRoleDefinition
- RBAC Custom Roles
- Create if none of built in works for you
- Each tenant can have 2000 roles
- Use “Actions” and “NonActions”
- Assignable scopes
- Subscriptions
- Resource Groups
- Individual Resources
- Example
{
"name" : "my-role-name",
"Description" : "My Description",
"Actions": [
"Microsoft.Storage./*/read",
"Microsoft.Compute/VirtualMachines/start/action"
],
"NotActions" : [],
"AssignableScopes": ["my-subscription"]
}
- User rights
- Resulting rights are the union of a user and the roles.
- Azure Policies
- Enforce governance
- Built in or custom code
- Assigned to subscriptions or resource groups (not specific resources)
- Create a policy and then assign it
- So this is an alternative approach from RBAC ?
- Seems to be some logical/coded limitations, like don’t allow regions to be deployed in, as you can’t do that with a role
- Example
{
"if": {
"not": {
"field" : "location",
"in" : "[parameters('listOfAllowedLocations'')]"
}
},
"then": {
"effect" : "Deny"
}
}
- Azure Resource Locks
- Mechanism for locking down resources you want to ensure to have an extra layer of protection before they can be deleted.
- 2 options
- CanNotDelete : Authorized users can read and modify but not delete the resource
- ReadOnly : Authorized users can read the resource but cannot update or delete
- can be done on Subscription, resource group or specific resource
Create and Deploy Apps
App Services Overview
- PaaS for apps
- Types
- Web Apps
- Build and host apps with various languages
- Auto scale
- HA
- DevOps features
- Mobile Apps
- Build mobile device backend
- HA
- High Scalabale
- Build native apps for iOs, Android, Windows, Cross platform
- Shares same APp service deployment ro reduce run rates
- Logic Apps
- Automate business processes and workflows
- Use the orchestration engine to build a solution
- Examples
- Every time your app calls an API do some task
- Routinely ingest data from a storage blob or external Saas Service
- Regulary check Tweets or #Slack messages from a specific account
- API App
- Allow us to easily create, consume and call APIS
- Option to use APIs you create
- Could also be from external API services
- Security Features
- Features run on isolated VN
- ISO, SOC, and PCI Compliant
- Fully integrated Azure AD
- Managed Service Identity
- Support custom domains, SSL/TLS, including custom certificates using wildcards or subject alternate name
- Supports multiple auth protocols: OAuth, OpenId, and Microsoft AD
- Integrates with WAF
- DevOps Features
- CI/CD Support
- IDE Tool integration
- Deployment Slots - Stage environemnt for example and flip it to prod
- App Service Plans Overview
- First define the following
- Subscription the plan belongs to
- Location (region)
- Pricing Tier (Free, Shared, Basic, Standard Premium, Isolated)
- Instance size (small, Medium, Large)
- Then configure settings
- Scale count
- Scale rules - Allow auto sclae if plan allows it
- Scale up - Increase resources associated with the App Service Plan (auto switch the plan that you defined at start)
- So scale rules to scale the pricing plan
- App Service Plan Pricing Tiers
- Free (shared compute resources - runs on same VM as some other apps, so even other customers)
- Shared (shared compute resources - runs on same VM as some other apps, so even other customers)
- Basic (dedicated compute resources)
- Standard (dedicated compute resources)
- Premium (dedicated compute resources)
- Isolated (dedicated compute resources) - Dedicated VMs on Deciated network, max scale and isolation
- Comes with SLA’s
- A plan might have a limited amount of
- Apps (free 10, Shared 100, after, unlimited)
- Max Instances (0, from basic 3 to more)
- SLA (free and shared have none, others 99.95%)
- Functions only starting basic
- Auto scale only starting with basic
- Guideliness
- Create a plan for a specific applications
- Deploy app servies to support the application
- Do not use a single plan for every web app
- Combine app services vs mass VM creation
- Combine other services in the same resource group
- A plan is something you deploy first before deploying apps on it
- App Service Environments (ASEs)
- Fully isolated environment
- For high performing apps - high CPU and/or memory
- Individual or multiple services plans
- 2 ways to deploy: Internal (internal load balancer, so internal access) or External (internet facing)
- Create in a subnet of a Vnet , which acieves isolation
- May you take a few hours to spin up
- Management Tools
- Management Portal
- Kudu
- Visual Studio
- PowerShell
- CLI
- App Service Plan Metrics
- CPU % : Avg CPU used across all instances of the plan
- Memory % : Avg memory used across all instances of the plan
- Data In : Av income bandwith used across all instances of the plan
- Data Out : Av outgoing bandwith used across all instances of the plan
- Disk Queue Length : Avg of both read and write requests that were queued on storage.
- High disk queue indicates of an app that might slow down due to excessive disk I/O
- HTTP Queue Length : Avg of HTTP requests that sit in queue before being fulfilled.
- High queue is symptom of a plan under heavy load
- Free and Shared App Quotes
- CPU (short) - CPU allowed for this app in a 5min interval. Resets every 5 min.
- CPU (day) - CPU allowed for this app in a day. Resets at mignight UTC
- Memory - Total memory allowed for this app
- Bandwith - Total bandwith allowed for this app in a day. Resets at mignight UTC
- Filesystem - Total amount of storage allowed
- Results of exceeding quote
- CPU - App stopped until quote resets. During this time, all requests get a 403
- Memory - App restarts
- Bandwith - App stoped until quote rests. During this time, all requests get a 403
- Filesystem - Write operations will faill (including logs)
- Azure Web App Diagnostic Logs
- Web Server
- Web Server logging (requests)
- Detailed Error Message
- Failed Request Tracing (detailed info regarding failed requests)
- Application
- levels Error, Warning, Information, Verbose
- Logs and locations
- Type : Application Logs -
Application/
- Failed Request Traces -
W3SVC###########/
- Detailed Error Logs -
DetailedErrors/
- Web Server Logs -
http/RawLogs
- Deployment Logs -
/Git
- Creating Alerts in Application Insights, metric types
- Metric - A metric crosses a threshold for a period of time
- Web Tests - A site is not available or responding slowly
- Proactive diagnostics - Triggered when something out of the ordinary occurs
- KUDU - Fast analytics on fast data
- Application Settings
- Setting - summary - Default - other options
.NET
- .NET version - v4.5 - v3.5
PHP
- version - v5.5 - OFF, v5.6, v5.7, v7.0, v7.1
JAVA
- version, web container option to choose Tomacat or Jetty - OFF - Java 7, 8
PYTHON
- python version - OFF - v2.7, v3.4
- Platform - 32 or 64bit mode (free and shared only have 32bit) - 32bit - 32bit
- Web Sockets - enable websockets - OFF - ON
- Always On - Unload on Idle (only basic and standard?) - OFF - ON
- Auto-Swao - Swap slot into prod when code pushed to it - ON - OFF
- Connection Strings
- Configure db connectiong strings per slot
- Variable instead of configuration file
- Secure as it’s not stored in a file
- Prefixes
SQLCONNSTR_
MYSQLCONNSTR_
SQLAZURECONNSTR_
CUSTOMCONNSTR_
- Handler Mappings
- Define for a file extension, which script process to execute them.
- Virtual Applications and Directories
- Create subdirectories with specialized sub apps
- Virtual Directory (URL path) > Physical Path > Application or not
- Custom Domains obviously
- Deployment slots
- Allow you to deploy in on production slots
- Applies to WebApps, API and Mobile Apps (not logic apps of whatever!)
- Reduces risk and increase speed
- Are live running apps
- Staging slot can be seamlessly be swapped to prod
- Seamlessly reverse back to staging if needed
- Swapped vs Not Swapped Settings
- Swapped (what is being swapped)
- General Settings (framework version ,32/64 bit, …)
- App settings (can be configured to stick to a slot)
- Connection Strings (can be configured to stick to a slot)
- Handler mappings
- Monitoring and diagnostic settings
- WebJobs content
- What is not swapped
- Publishing endpoints
- Custom domain names
- SSL certificates and bindings
- Scale settings
- Webjobs schedulers
- When you swap
- You basically staging and production, it swaps the apps (Prod becomes the staging one, and the staging one becomes the prod one)
Serverless Computing
- What is Serverless ?
- Only pay what you use, flexible to scale, stitch stuff together, fully managed
- Types
- Azure Functions
- Languages : C#, F#, Java and JavaScript
- Pay per use pricing
- Consumption Plan
- App Service Plan (Run on the same plan as other services, not sure how that works)
- Integrated Security with OAuth providers
- Code in the portal or deploy via DevOps tools
- Function App
- Requires global unique name again
- Choose OS (JUST WHY ? ITS SERVERLESS)
- With Linux version you can publish code or docker image
- needs a storage account where you will save it
- A function app is a grouping of multiple functions
- Logic Apps (if this then that, workflow/steps like in AWS)
- Workflow engine
- Used to orchestrate and stitch together functions and services (Just like regular orchestration tools)
- Visualize, Design, Build, Automate
- Triggers -> Actions
- You have an event that happens, which fires of an action
- Even Grid
- First you create a “topic”, so you can then tell which services subscribe to the topic, so pub/sub
- This is where you assign subscribers
- Event Hub
- Push a LOT of events, high performance (can use Kafka), more for streaming for IoT ?
- TODO Read a bit more about it ?
- You can stream the audit log of AD to a Event Hub
Design and Develop Apps that run in Containers
- Install Docker Demo : Whatevs
- Prepare App for AKS Demo
- Checkout the Azure examples github repo yml files and try to deploy one Link
Server Migrations
Azure Migrate
Azure Site Recovery (ASR)
- Quick recap on Business Continuity Strategies
- HA - Run instances on different places - Proactive
- Disaster Reovery (run apps in secondary datacenter IF error occurs) - reactive
- Backup - Restore data
- Overview
- On-premises to Azure Recovery : On-Premise VMware and Hyper-V to Azure replication
- Azure to Azure Recovery : Recover workloads from Primary region in a Secondary targer region (in case a region fails)
- Automation and Orchestration : Setup recovery plans to customer which services are restored, as well any subsequent scripts
- Rich integration into Azure automation for additional automation requirements
- RTO and RPO Targets : Continious replication for Azure from VMWare and Hyper V
- VMware to Azure Recovery
- ASR Process
- Converts VM (vmd file) to VHD
- Upload to Azure
- Migration completed from recovery vault
- VMWare migration
- Prepare Azure
- Verify Account Permissions
- Can you create a VM in selected Resource Group
- Can you create a VM in selected Network
- Can you write to the selected Storage account
- Recommended to use a Generap Purpose v1
- Create Storage Account
- Create Recovery Services Vault
- Setup an azure network
- Prepare VMWare
- VMware permissions
- Prepare an account for Mobility service installation
- Verify compatibility
- Prepare connectivity to Azure VMs (VPN ? Jumpbox ? …)
- Setup Recovery
- You install like before with a ova file a VM that will run the on premise logic.
- Once installed, RDP in it and follow the setup
- Login to azure, choose subscription, reovery services vault, …
- RPO : Recovery Point Objective (max amount of time you might have lost)
- TODO : Check out what the recovery options are
Automation
VM Custom Images
- Custom Images
- DIY Image
- Windows - Sysprep
- Linux - sudo waagent / deprovision + user
- Generalize in Azure
- Create Image
- Marketplace Images
- Provided for you in the Azure Marketplace
- Properties
- Publisher
- Offer
- SKU (Stock Keeping Unit)
- Create Custom Image (windows example)
- Start
c:/Windows/System32/Sysprep.sysprep.exe
- “Enter System Out-of-Box Experience (OOBE)”
- [] Generalize checkbox -> if not checked, any VM created of this image won’t start
- Shutdown options : Reboot
- When you “capture” and image of a VM (at least with linux), you’re not able to use this VM anymore.
- From that Image you can build directly a VM
DSC Overview
- Introduction to Configuration Management
- Enterprise level configuration management for multiple nodes
- Smaller size
- PowerShell (of f*cking bash?)
- PowerShell DSC : Desired State Configuration
- Specify configuration of a machine decleratively (like a docker-compose.yml-ish)
- Specific for Windows machines again
- Key Components
- Configurations -> Declaritive powershell scripts that define the instances of the resources
- Resources -> The resource itself (contain the code to keep a resource in a specific state, so the adapter for the specific resource)
- Logical Configuration Manager (The engine that tries to keep the state, like k8s engine)
- Example Command
> Publish-AzureRmVNDscConfiguration -ConfigurationPath <your-declarative-powershellfile> -OutputArchivePath somefile.zip
- Here you publish the declartive part into some zip file with all desires files?? I guess ? (like IIS and.NET ?)
- To use this now,
- Go to a VM
- Settings > Extensions
- Add -> Powershell DSC
- Select here the published archive from the first command
Custom Script Extension
- Execute VM Tasks without logging into the VM
- Upload via Portal or download scripts from Azure Blob storage or GitHub
- These are scripts that run POST configiration. It can download the scripts from Blob Storage and then run them for further setup.
- Can be automated using PowerShell
- Benefits
- No local or domain credentials needed to login to Azure VM
- VM does not need an accessibly IP to internet
- Simple to implement
- Drawbacks
- Must be enabled for each VM you want to run your script on.
- VMs will need internet access if using GitHib or Blob storage for scripts.
- Relatively Slow
PowerShell VM Commands
NewAzureRmResourceGroup -Name <myResourceGroup> -Location <EastUS>
New-AzureRmVM \
-ResourceGroupName "<...>"
-Name "<...>"
-Location "<...>"
-VirtualNetworkName "<...>"
-SubnetName "<...>"
-SecurityGroupName "<...>"
-PublicIpAddressName "<...>"
-OpenPorts "<...>"
- Create VM Configuration :
NewAzureRmVMConfig -VMName <...>
Start-AzureRmVM
Stop-AzureRmVM
More… TRY THIS
ARM Templates
- Apply infrastructure as code
- Declare Azure Resources in JSON (cloudformation in AWS)
- Download templates from Azure Portal
- AUthor new templates
- Use quickstart templates
- Found on azure docs and githib
- File Types
- ARM Template file (JSON)
- ARM Template Parameter File (separate your parameters optional)
- Deployment Scripts
- ARM Template Constructs
- Parameters : Define the inputs to pass in ARM during deploying
- Variables (for reusing) :
- Resources : Define the resources to deploy or updated
- Outputs : Values tha are returned after the ARM deployment is complete (e.g. output public IP address)
- Notice that you saw these things during the deploy of a VM
{
"$schema": "...",
"contentVersion": "1.0.0.0",
"parameters" : {
"skuName" : {
"type" : "string"
}
},
"variables" : {},
"resources" : [],
"outputs" : {}
}
ARM Linking Templates
- You can link templates for reusability and flexibility.
- Main Template
- Optional Resource Template
- Shared Resource template
- Member Resource temlate
- Methods
- Inline : Create entire ARM template in body of existing template
- External : Link to an external template with an
INLINE
or EXTERNAL
parameter set.
- Key ARM Functions
Copy
- Declare resource and copy it
copyIndex()
- Copy f
dependsOn
- Variable depends on another
- example
"name" : "[concact(copyIndex(), 'storage, uniqueString(resourceGroup(),id))]"
TODO ! Learn some ARM code for templates
Think which part of the Azure automation makes sense to “start P9 on windows server”
Azure Runbooks
- Automated workflows (various tasks) that you do often
- Create a Automation account
- Fill out
- Runbook can bound to webhook or schedule easily
Azure Automation DSC
- You can define, then compile a DSC, then apply it to multiple VMs and immediatly see if all of those VMs are Compliant or not
Azure Files
- Go to a storage account (or create)
- Click on “files” in file servcie
- Create a file share > Name and Quota
Remember, this is like EFS on AWS. So you can attach such file share to different VMs and any other
Azure File Sync
- How to cache some files when using Azure files, which is a centralized file service.
- Service/app you install on a Windows Server VM on premise
- This turns your VM as a cache of Azure FIle share in your premise
Use Azure File Sync to centralize your organization’s file shares in Azure Files, while keeping the flexibility, performance, and compatibility of an on-premises file server. Azure File Sync transforms Windows Server into a quick cache of your Azure file share. You can use any protocol that’s available on Windows Server to access your data locally, including SMB, NFS, and FTPS. You can have as many caches as you need across the world.
- Prereq :
- Azure File Share in same region where to deploy Azure File Sync
- Windows Server instance (on prem)
- Powershell
Self study notes
- Directory + global subscription : Set for the portal which directory/subscription to only show