SS18256 - Azure CLI
SS18256 - Azure CLI
1
Copyright © 2019 Tech Mahindra. All rights reserved.
Azure CLI
Azure CLI is a cross-platform command line tool, that is used to manage and administrate Microsoft Azure.
It doesn’t replace PowerShell but provides an alternative to using managing Azure from the command line
Click on Cloud Shell button from the top navigation bar of the Azure portal
Select the PowerShell environment from the drop-down and you will be in Azure drive (Azure:)
Advantages of Azure CLI
Azure CLI format
• Actually an Azure CLI command has the following structure:
• a command group which represents an Azure service and which can be the composition of subgroups
• a command which is the action you want to do on the group / Azure service
• arguments optionally which are a list of parameter names and values
Example –
- az group list
- az webapp list --resource-group 'myResourceGroupName'
• Steps
• Generalize the vm
• Log in to vm
• sysprep.exe to be run
• Deallocate
az vm deallocate --resource-group mycligroup --name mycliVM
• Generalize
az vm generalize --resource-group mycligroup --name mycliVM
• Create image of a VM
image create --resource-group mycligroup --source mycliVM --name
mycliimage
• Create VM from image
az vm create --resource-group mycligrop --name myimgVM --image
mycliImage
Storage
• Storage account
• Types of storage
• Blob, disk and file and archive
• Blob storage
• Storage account – containers – BLOB
• Hot, cold and archive types
• Disk storage
• SSD standard and premium
• File storage
• Archive storage
Networking
-Subnet
-Vnet( belongs to a region ,belongs to a particular subscription)
-VPN Gateway
-Application gateway
-Load balancer
-Content delivery network
VM using storage account and networking
• Create resource group
az group create –n resgrp1 –l eastus
• Create a subnet and vnet
az network vnet create -g resgrp1 -n vnetgrp1 --subnet-name snetgrp1
• Assign a public ip address
az network public-ip create -g resgrp1 -n publicipgrp1
• Create a network security group
az network nsg create –g resgrp1 –n nsggrp1
• Create nic
az network nic –g resgrp1 –subnet subnetgrp1 –-vnet vnetgrp1 –public-ip publicipgrp1 –
network-security-group nsggrp1 –name nicgrp1
• Create vm
az vm create –g resgrp1 – image win2019datacentre -l eastus –nics nicgrp1
--admin-username azureuser
Overview of types of cloud services
Cloud services
Migration to a cloud environment depends on
3 0
Pre-Migration
1
Architecture
2
Solution
3
Execution
4
Testing
5
Post Migration Support
Assessment Modeling
Discovery Analysis Virtualization Designing Application Infra System Data Monitoring Support
Identify potential apps. Service Modeling Reconfigure /Rebuild apps, services, Setup Cloud based Testing Utilize Resource Monitoring tools
• Create Service Blueprint platforms Environment for optimization
Analyze AS-IS / TO-BE Architectural • Define business Rules & Policies
Blueprints. Application Redesign Setup target virtualized developer Develop Cloud Test Cases / Service Reporting – SLA, KQI, KPI
Perform Gap Analysis • Enable Multi-tenancy environment Scenarios/Plan
• Enable Elastic Scalability Performance Tuning – Hypervisor,
Recommend solutions and • Enable Failover / DR Deploy new application builds in UFT/Scalability/Failover / DR OS, DB
Develop Migration Plan development environment Testing
Virtualized Infra Design
A
P
P
I
N
A
F
R
17
Copyright © 2019 Tech Mahindra. All rights reserved.
The R’s involved in migration
Cloud
• Rehost
• Known as “Lift & Shift”.
• Most rehosting can be automated with tools like Azure migrate etc.
• Though some customers decide to do this manually, they get to know how to apply their legacy systems in the cloud.
• Applications are easier to optimize when they are already running in the cloud
• Replatforming
• Also called as “lift-tinker & Shift.”
• Change application platform while preserving existing functionality.
• Repurchasing
• This is a move to a SaaS platform.
• Runs outside the infrastructure and is maintained by a third party.
• Eliminates the need for you or your team to spend time on maintenance or updates
• Example: Moving CRM to Salesforce.com, a CMS to Drupal.
• Refactoring
• Re-imagining how the application is architected and developed, using cloud-native features.
• The drive for this strategy would be to improve scalability, agility, and overall performance.
• Retire
• To “Get Rid-off”
• To discover everything in your IT portfolio that are no longer useful and can be eliminated.
• These savings can improve the business, guide your team’s attention and reduce the surface area you have to secure.
• Retain
• Also called as “Revisit”
• Maybe you’re still riding out some depreciation, aren’t ready to prioritize an application that was recently upgraded or are
otherwise not inclined to migrate some applications.
R-Path: Re-Host migration approach
Automate
Determine Transition
Migration Path
Validate Production
Discover/Assess Applications
Production
Decommissioned
Modifying underlying
Infrastructure
Transition
Determine
Migration Path
Validate Production
Discover/Assess Applications
Decommissioned
Re-platform migration approach
Transition
Discover/Assess Applications
Re-Architect Sample Path Validate Production
24
Copyright © 2019 Tech Mahindra. All rights reserved.
Comparison of the various R’s
25
Copyright © 2019 Tech Mahindra. All rights reserved.
Modify or extend your application's code base to scale and optimize it for the cloud.
Modernize your app into a resilient, highly scalable, independently deployable architecture and use Azure to
accelerate the process, scale applications with confidence, and manage your apps with ease..
Involves modifying the app itself and a large chunk of its codes to better take advantage of cloud-based features and
the extra flexibility that comes with them.
Rebuild
Azure platform as a service (PaaS) provides a complete development and deployment environment in the cloud,
without the expense and complexity of software licenses, the need for underlying application infrastructure, or
middleware and other resources. With this cloud migration strategy, you manage the applications and services you
develop, and Azure manages everything else.
26
Copyright © 2019 Tech Mahindra. All rights reserved.
Azure monitor
• Compute
• Basic state of machines, up/down
• Storage
• Detailed metrics on blobs, tables, queues
• SQL Database
• Canned queries to Azure SQL Database
• PaaS
• Azure Diagnostics (.NET)
• Active Directory
• Graph API and differential queries
27
Copyright © 2019 Tech Mahindra. All rights reserved.
Azure monitoring
28
Copyright © 2019 Tech Mahindra. All rights reserved.
How is it monitored
- Azure monitor
- Inbuilt monitoring tool provided by Microsoft
- Application insights
29
Copyright © 2019 Tech Mahindra. All rights reserved.
Detect and diagnose issues across
applications and dependencies
with Application Insights.
Correlate infrastructure issues with Azure
Monitor for VMs and Azure Monitor for
Containers.
Drill into your monitoring data with Log
Analytics for troubleshooting and deep
diagnostics.
Support operations at scale with smart
alerts and automated actions.
Create visualizations with
Azure dashboards and workbooks.
30
Copyright © 2019 Tech Mahindra. All rights reserved.
What can you do with Azure Monitor Logs?
The following table lists the different waysthat you can use Logs in Azure Monitor
31
Copyright © 2019 Tech Mahindra. All rights reserved.
Steps to configure monitoring
1.Create a workspace
2.Create a virtual machine
3.Connect to the workspace
4.Connect to the vm
5.This will help installing the monitoring agent
6.Create alerts
7.Create conditions
8.Create action groups
9.Create rule