0% found this document useful (0 votes)
6 views32 pages

SS18256 - Azure CLI

The document provides an overview of Azure CLI, a command line tool for managing Microsoft Azure, detailing its structure, advantages, and various commands for resource management. It also covers cloud migration strategies, including rehosting, replatforming, and refactoring, along with a six-step migration process. Additionally, it discusses Azure monitoring tools and steps to configure monitoring for virtual machines.

Uploaded by

bxx6ggpn9y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views32 pages

SS18256 - Azure CLI

The document provides an overview of Azure CLI, a command line tool for managing Microsoft Azure, detailing its structure, advantages, and various commands for resource management. It also covers cloud migration strategies, including rehosting, replatforming, and refactoring, along with a six-step migration process. Additionally, it discusses Azure monitoring tools and steps to configure monitoring for virtual machines.

Uploaded by

bxx6ggpn9y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Azure CLI

Source : from various sites from Internet


For training only

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

Azure CLI can be installed or be triggered using the Cloud shell

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'

• Formatting output data


• To format data your commands in Azure CLI produce you can choose between the following formats:
• json – regular JSON output
• jsonc – JSON.. but with colors!
• yaml – output in “YAML Ain’t Markup Language”
• table – ASCII table because 1985
• tsv – Tab-separated values
Generic Azure CLI commands
• Get help
azure help
• To get your basic subscription details
Get-AzureRMSubscription
• To get your azure modules installed
get-module az*
• To get Accessible cloud list
az cloud list
• To get all resources
az resource list -o table
• To get the version of azure
azure –version
• To get the size of vm’s
az vm list-sizes --location eastus
• To get the images for windows and linux
az vm image list --output table
Compute

• Getting group names


az group list --query '[].name‘
• Getting group from a particular location
az group list --query "[?location=='eastus']" -o table
_________________________________________________
• Creation of resource group
az group create --name mycligroup --location eastus
• Creation of vm’s
az vm create --resource-group mycligroup --name mycliVM --image win2019datacenter
- Opening a port
az vm open-port --port 80 --resource-group mycligroup –name mycliVM
Compute – Virtual machines

• List your VMs


az vm list
• Start a VM
az vm start --resource-group mycligroup --name mycliVM
• Stop a VM
az vm stop --resource-group mycligroup --name mycliVM
• Deallocate a VM
az vm deallocate --resource-group mycligroup --name mycliVM
• Restart a VM
az vm restart --resource-group mycligroup --name mycliVM
• Redeploy a VM
az vm redeploy --resource-group mycligroup --name mycliVM
• Delete a VM
az vm delete --resource-group mycligroup --name mycliVM
Compute – Virtual machines – image creation

• 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

• Application design complexity


• Integration complexity
• The host operating system
• The application database
• Network
Migration workflow
Steps involved in migration
• Create a cloud migration plan
• Involve stakeholders / Create the Business Plan
• Discover the Application Landscape/Decide a Migration Method for
each application
• Execute the Migrations to cloud /Transition to cloud
• Retrospective –adapting and improving migrations through learning
• Calculate your TCO
• Discover and evaluate apps
• Tools – Azure migrate, Corent, movere, Cloudamize, turbonomic
Migration & Assessment Framework

6 Step Migration Process – Platform and Technology Neutral

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

Manual Install Manual Config

Using Migration Tool Manual Deploy

Automate

Determine Transition
Migration Path
Validate Production

Discover/Assess Applications

Production

Decommissioned

Re-Host Sample Path


Re- hosting
• Also called Lift and shift
• Lift and shift cloud migration involves copying, bit by bit, the workloads, tasks, and applications
housed within an organization’s virtual machines, and storing the replicated version in a cloud-
based location. Because the data is simply a replication, no code is modified and no costly, time-
consuming redesign is required during migration.
• Comparatively less complicated
• Use for:
• Moving applications from your datacenter to the cloud quickly.
• Apps that are architected to use Azure infrastructure as a server (IaaS) scalability.
• Businesses that require the applications but don’t need to change app capabilities right away.
• Applications or database requirements that can only be met using an Azure IaaS virtual machine.
• Moving the application with no-code changes.

Zerto , Azure migrate are tools


R-Path: Re-Platform migration
approach
Using Migration Tool

Modifying underlying
Infrastructure
Transition
Determine
Migration Path
Validate Production

Discover/Assess Applications

Re-Platform Sample Path


Production

Decommissioned
Re-platform migration approach

• Often referred to as repackage, this cloud migration strategy involves


• some change to the application design but no wholesale changes to the application
code.
• application can take advantage of infrastructure as a service (IaaS) and platform as a
service (PaaS) products, such as Azure App Service, Azure SQL Database Managed
Instance, and containers.
• When do you go for replatform
• When you have an existing codebase and development skills, and code portability is
a concern.
• A quick way to modernize your apps.
• Driving continuous innovation by taking advantage of DevOps and containers.
• replatforming involves some amount of “up-versioning” following the lifting portion
R-Path: Re-Architect approach

Transition
Discover/Assess Applications
Re-Architect Sample Path Validate Production

Re-Design App Code


App/Infra SDLC Integrate
Development
Architecture

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..

 Take advantage of existing application investments.


 Meet scalability requirements in a cost-effective way.
 Bring new Azure capabilities to existing applications.
 Improve agility by applying innovative DevOps practices

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

Rebuild an application from scratch using cloud-native technologies.

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 service status


- Issue can be from azure side or from our VM side
- Azure status from website - https://status.azure.com/en-us/status

- Azure monitor
- Inbuilt monitoring tool provided by Microsoft

- Activity and diagnostic logs


- Activity log takes care of audit logs and operational within your subscription
- The diagnostic log will take your traditional metrics on the VMs .

- 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

Demo of alerts,logs, querying log activity monitor etc..


32
Copyright © 2019 Tech Mahindra. All rights reserved.

You might also like