Download Python for Windows here
Be sure to install the Pip component when you install Python. After the install completes, add Python to your PATH environment variable
(the installer will prompt you).
The Azure CLI 2.0 is Azure’s new command-line experience for managing Azure resources. It can be used on macOS, Linux, and Windows.
Azure CLI 2.0 is optimized for managing and administering Azure resources from the command line, and for building automation scripts that work against the Azure Resource Manager.
Open Command Prompt and type : python –versionTo install Azure CLI you have to type the following command :
pip install –user azure-cli
Installing Azure CLI 2.0
With Microsoft Azure CLI 2.0 scripts you can deploy complete solutions, like this example for a Virtual Machine with Microsoft OMS agent active :
Sample script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <span class="hljs-comment">#!/bin/sh</span> <span class="hljs-comment"># Update for your admin password</span> AdminPassword=ChangeYourAdminPassword1 <span class="hljs-comment"># OMS Id and OMS key.</span> omsid=<span class="hljs-string"><Replace with your OMS Id></span> omskey=<span class="hljs-string"><Replace with your OMS key></span> <span class="hljs-comment"># Create a resource group.</span> <span class="hljs-keyword">az</span> <span class="hljs-keyword">group</span> <span class="hljs-keyword">create</span><span class="hljs-parameter"> --name </span>myResourceGroup<span class="hljs-parameter"> --location </span>westeurope <span class="hljs-comment"># Create a virtual machine. </span> <span class="hljs-keyword">az</span> <span class="hljs-keyword">vm</span> <span class="hljs-keyword">create</span> <span class="hljs-parameter"> --resource-group </span>myResourceGroup <span class="hljs-parameter"> --name </span>myVM <span class="hljs-parameter"> --image </span>win2016datacenter <span class="hljs-parameter"> --admin-username </span>azureuser <span class="hljs-parameter"> --admin-password </span><span class="hljs-variable">$AdminPassword</span> <span class="hljs-comment"># Install and configure the OMS agent.</span> <span class="hljs-keyword">az</span> <span class="hljs-keyword">vm</span> <span class="hljs-keyword">extension</span> <span class="hljs-keyword">set</span> <span class="hljs-parameter"> --resource-group </span>myResourceGroup <span class="hljs-parameter"> --vm-name </span>myVM<span class="hljs-parameter"> --name </span>MicrosoftMonitoringAgent <span class="hljs-parameter"> --publisher </span>Microsoft.EnterpriseCloud.Monitoring <span class="hljs-parameter"> --version </span><span class="hljs-number">1.0</span><span class="hljs-parameter"> --protected-settings </span><span class="hljs-string">'{"workspaceKey": "'</span><span class="hljs-string">"<span class="hljs-variable">$omskey</span>"</span><span class="hljs-string">'"}'</span> <span class="hljs-parameter"> --settings </span><span class="hljs-string">'{"workspaceId": "'</span><span class="hljs-string">"<span class="hljs-variable">$omsid</span>"</span><span class="hljs-string">'"}' </span> <a href="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png"><img data-attachment-id="4134" data-permalink="https://mountainss.wordpress.com/2017/02/11/microsoft-map-toolkit-9-6-now-available-winserv-sql2016-azure-office365-cloud-tool/microsoft-mvp-cdm-azure-advisor-banner/" data-orig-file="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=611&h=110" data-orig-size="2000,359" data-comments-opened="1" data-image-meta="{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data-image-title="microsoft-mvp-cdm-azure-advisor-banner" data-image-description="" data-medium-file="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=611&h=110?w=300" data-large-file="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=611&h=110?w=611" class="aligncenter size-full wp-image-4134" src="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=611&h=110" alt="" width="611" height="110" srcset="https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=611&h=110 611w, https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=1222&h=220 1222w, https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=150&h=27 150w, https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=300&h=54 300w, https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=768&h=138 768w, https://mountainss.files.wordpress.com/2017/02/microsoft-mvp-cdm-azure-advisor-banner.png?w=1024&h=184 1024w" sizes="(max-width: 611px) 100vw, 611px" /></a> |