mountainss Cloud and Datacenter Management Blog

Microsoft SystemCenter blogsite about virtualization on-premises and Cloud


Leave a comment

#Microsoft Azure CLI 2.0 in Ubuntu #Bash of #Windows 10 #Linux #Azure #DevOps

Azure CLI 2.0 in Bash

If you use Ubuntu Bash in Windows 10 and like to work with Microsoft Azure Cloud Services you can install Azure CLI 2.0 for Linux

For Debian/Ubuntu based systems, you can install Azure CLI 2.0 via apt-get. 

    1. Modify your sources list.
      • 32-bit system
        Copy
        bash
        echo "deb https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \
             sudo tee /etc/apt/sources.list.d/azure-cli.list
        
      • 64-bit system
        Copy
        bash
        echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \
             sudo tee /etc/apt/sources.list.d/azure-cli.list
        
    2. Run the following sudo commands:
      Copy
      bash
      sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893
      sudo apt-get install apt-transport-https
      sudo apt-get update && sudo apt-get install azure-cli
      

 

When you install with apt-get, az component isn’t supported. To update the CLI, use the following commands: 

Copy
bash
sudo apt-get update && sudo apt-get install azure-cli


Leave a comment

#Microsoft Azure CLI 2.0 Command Reference from A – Z is Awesome ! #Azure #AzureStack #DevOps

Microsoft Azure CLI 2.0 from a Docker Container

CMD Azure VM -h

Here you find the Complete Microsoft Azure Command Line Interface 2.0 (CLI) Reference Guide and use -h option in the CLI


Leave a comment

Install #Azure CLI 2.0 and Run Script for VM with Operations Management Suite Agent #MSOMS

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 –version

To install Azure CLI you have to type the following command :
pip install –user azure-cli

Installing Azure CLI 2.0

Done.
Type Azure

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

#!/bin/sh

# Update for your admin password
AdminPassword=ChangeYourAdminPassword1

# OMS Id and OMS key.
omsid=<Replace with your OMS Id>
omskey=<Replace with your OMS key>

# Create a resource group.
az group create --name myResourceGroup --location westeurope

# Create a virtual machine. 
az vm create \
    --resource-group myResourceGroup \
    --name myVM \
    --image win2016datacenter \
    --admin-username azureuser \
    --admin-password $AdminPassword 

# Install and configure the OMS agent.
az vm extension set \
  --resource-group myResourceGroup \
  --vm-name myVM --name MicrosoftMonitoringAgent \
  --publisher Microsoft.EnterpriseCloud.Monitoring \
  --version 1.0 --protected-settings '{"workspaceKey": "'"$omskey"'"}' \
  --settings '{"workspaceId": "'"$omsid"'"}'


Leave a comment

Continuous Delivery to Microsoft #Azure with #Docker #Container for #DevOps #Dev #Code #Cloud

To make it easy for you to deploy your application to Azure we’ve built a container that has the AzureCLI installed. We will set up a simple example showing you how to configure any deployment to Azure. If you don’t have Docker yet you can get it here

With command Docker pull microsoft/azure-cli you get the latest Container

With the command docker run -it microsoft/azure-cli you will start the Container

Now you have the latest Azure CLI in a Docker Container

From inside the Microsoft Docker Container we will make a connection to a Azure subscription, if you don’t have a Microsoft Azure subscription you
can get your free Azure trail subscription here

My Microsoft Docker Container is running.

with command Azure Login you will start the login process

Copy the url https://aka.ms/devicelogin in your browser :

Copy your code from the container login into the Device login

Click on Continue for Microsoft Azure Cross-Platform CLI Login

Login with your Microsoft Azure account of your subscription

Done !

The Microsoft Docker Container with the latest Azure CLI is connected with your Azure Subscription 😉

From here you can do a Continuous Delivery to Microsoft Azure with Docker and #Code.

With the Command Azure Lab you see I can manage my Azure Dev/Test LAB from my Docker Container 😉

Here you see my Container01 in JamesTestLAB in Azure

With the Command Azure vm start we run the Azure Container01

Now the Azure Container01 is running and started from a Microsoft Docker Container with Azure CLI

Get started with Azure CLI 2.0 Technical Docs

Have a look at CodeShip here to make it your self easy for continuous delivery on Microsoft Azure Cloud