Category: Infrastructure

Infrastructurepricing

Azure Subscription Resource Limits and Quotas

Azure Resource Manager (ARM) imposes limits and quotas on how many resources of each type you can provision per Azure Subscription, and even per Azure Region. Some limits are a hard maximum, while others are a soft limit that can be increases upon request. When working with Virtual Machines (VMs), Storage Accounts, Databases, and other resources in the Microsoft Azure cloud you can easily hit up against these limits, so it’s important to know they exist and how to work around them. This article will explain the details around the Limits and Quotas on resources within Microsoft Azure; including tips on how to work around these limits to scale as high as your organization needs. Read More

Azure CLIInfrastructure

Azure CLI 2.0: Quickly Start / Stop ALL VMs

You can easily Start and Stop Virtual Machines (VMs) through the Azure Portal. Previously, I’ve written about the importance of Stopping unused VMs to save money and place them in a “Stopped (Deallocated)” state. While it’s easy and simple to do through the Azure Portal, it’s also time consuming if you have multiple VMs; especially if you have a dozen or more VMs. The following Azure CLI 2.0 tip will show you how you can easily use the Azure CLI to Start and Stop multiple VMs with a single command!

Before we get into how to Start, Stop and Deallocate Virtual Machines (VMs) in batches, we must first cover the basics of Starting, Stopping and Deallocating VMs one at a time. After those commands are defined and demonstrated, then you’ll have the foundation necessary to extend on that to do the batching. Please be patient as you read through as you’ll need to step through this to fully understand the end result. And, you’ll be glad you did once you get there as this will really enable you to be immensely more productive in your management of Azure Virtual Machines when it comes to Starting, Stopping, and Deallocating them. Read More

Azure CLIInfrastructure

Azure CLI 2.0: Manage Resource Groups

All cloud resources created / provisioned in Microsoft Azure need to be associated with Resource Groups. This is one of the basic features of the Azure Resource Management model to cloud resource management, and it makes it far easier to manage groupings of resources that comprise full applications and workloads. The Azure Portal makes it extremely simple to create and delete Azure Resource Groups. This article takes a look at managing Azure Resource Groups form the cross-platform command-line using the Azure CLI 2.0. Read More

Azure CLIInfrastructureOpen Source

Azure CLI 1.0 vs 2.0 Compared, Installation and Usage

The Azure CLI is the cross-platform, command-line tool for managing resources in Microsoft Azure. Microsoft recently released the Azure CLI 2.0 and the commands start with “az” instead of “azure” like Azure CLI 1.0. This article runs through the main differences between Azure CLI 1.0 and Azure CLI 2.0 to help you understand how to use each one.

Installation and Platform

When the Azure CLI 1.0 was first released it was call the X-Plat CLI, and offered a new cross-platform command-line tool to use for Azure automation tasks. It offered an alternative to the Azure PowerShell cmdlets that gave a command-line tool for use on macOS and Linux, in addition to Windows. In the early days it was built on top of the Azure Service Management API’s, and has since been migrated over to support the newer Azure Resource Management API’s.

The new Azure CLI 2.0 was built with Azure Resource Management (ARM) from the start. It was also built with the lessons learned from 1.0 in mind to make 2.0 a better cross-platform, command-line tool. The development platform and language used to build the Azure CLI 2.0 was changed, and the commands essentially changed a bit in the process. It’s really not an “in-place” migration, and requires you to understand a little more than to just install the new version.

The Azure CLI 1.0 was written with Node.js to achieve cross-platform capabilities, and the new Azure CLI 2.0 is written in Python to offer better cross-platform capabilities. Both are Open Source and available on Github.

Azure CLI 2.0 is written in Python, Azure CLI was written in JavaScript. Both are Open Source!

Here’s the platform differences between the 2 version of the Azure CLI along with links where you can find the Open Source repository for each:

Azure CLI 1.0

Azure CLI 2.0

Azure CLI Installation

Since the Azure CLI is cross-platform it can be installed on Windows, macOS, and Linux. This is true for both the Azure CLI 1.0 and Azure CLI 2.0. Since the Azure CLI 1.0 is written with Node.js, it will require Node.js to be installed on your machine. While the Azure CLI 2.0 is written in Python, and requires Python.

Azure CLI 1.0 Installation

Here’s commands to install Azure CLI 1.0 at the command-line using Node.js:

[code language=”bash”]
sudo npm install -g azure-cli
[/code]

Use a Docker Container to run the Azure CLI 1.0:

[code language=”bash”]
docker run -it microsoft/azure-cli
[/code]

You can also use an installer with Windows and macOS to install the Azure CLI 1.0 more easily as well. You can find the installers for the Azure CLI 1.0 on the Github repository.

Azure CLI 2.0 Installation

Here’s commands to install Azure CLI 2.0 on different platforms. Keep in mind that it does require Python.

Windows Command-Line

You can download the .MSI installer for Azure CLI 2.0 to install the Windows command-line support for Azure CLI.

Bash on Windows 10

The Ubuntu Bash on Windows 10 can be used to run the Azure CLI 2.0 while utilizing it’s full support for Bash and on a Windows 10 machine at the same time.

  1. First step, if you don’t have Bash on Windows installed (Ubuntu Bash on Windows 10, or the newer (coming soon) support for SUSE and Fedora on Windows 10 too!) then install it!
  2. Using Bash, modify your sources list:

    [code language=”bash”]
    echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \
    sudo tee /etc/apt/sources.list.d/azure-cli.list
    [/code]

Run the following sudo commands to install the Azure CLI 2.0:

[code language=”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
[/code]

macOS and Linux
Here’s the installation command to install the Azure CLI 2.0 on macOS as well as Linux using Curl:

[code languge=”code”]

curl -L https://aka.ms/InstallAzureCli | bash

[/code]

Additionally, you may need to restart your command-lim in order for some changes to take affect. You can do this with the following command:

[code lanugage=”bash”]

exec -l $SHELL

[/code]

Docker Container

You can also run the Azure CLI 2.0 in a Docker Container fairly easily. Here’s the “docker run” command to do this:

[code language=”bash”]

docker run azuresdk/azure-cli-python:<version>

[/code]

apt-get on Linux

You can also use the following commands to install Azure CLI 2.0 on Linux using apt-get.

On 32-bit systems:

[code language=”bash”]

echo "deb https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \
sudo tee /etc/apt/sources.list.d/azure-cli.list

[/code]

On 64-bit systems:

[code language=”bash”]

echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \
sudo tee /etc/apt/sources.list.d/azure-cli.list

[/code]

After you run the above 32-bit or 64-bit specific command, then you’ll need to run the following sudo commands as well:

[code language=”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

[/code]

There is some further documentation for installing the Azure CLI 2.0 available in the Azure Documentation site.

Getting Started with Azure CLI Commands

Both the Azure CLI 1.0 and 2.0 have very similar commands. However, the command start differently. With the Azure CLI 1.0 commands start with “azure” and with the Azure CLI 2.0 command start with “az”.

Before you can go about running Azure CLI commands, you need to first login to your Azure Subscription. Here are commands to do this in both Azure CLI versions:

[code language=”bash”]

# Azure CLI 1.0

azure login

#Azure CLI 2.0

az login

[/code]

To get a full list of the available commands and full help information you can run the following command:

[code language=”bash”]

# Azure CLI 1.0

azure

# Azure CLI 2.0

az

[/code]

Also, you can find the version of Azure CLI you have installed by using the following command:

[code language=”bash”]

# Azure CLI 1.0

azure –version

# Azure CLI 2.0

az –version

[/code]

Azure CLI Command Examples

Here’s some example commands using both the Azure CLI 1.0 and Azure CLI 2.0. You can see that they aren’t really all that different outside of the trigger command of either “azure” or “az”.

Create New Azure Resource Group

[code language=”bash”]

# Azure CLI 1.0

azure group create –name MyGroup1 –location eastus

# Azure CLI 2.0

az group create –name MyGroup1 –location eastus

[/code]

Create Azure App Service Plan

[code language=”bash”]

# Azure CLI 1.0

azure appserviceplan create –name MyPlan –resource-group MyGroup1 –location eastus –sku F1

# Azure CLI 2.0

az appservice plan create –name MyPlan –resource-group MyGroup1 –location eastus –sku F1

[/code]

List All Azure Virtual Machines

[code language=”bash”]

# Azure CLI 1.0

azure vm list

# Azure CLI 2.0

az vm list

[/code]

More Information

You can find much more information about using the Azure CLI 1.0 and 2.0 in the documentation on the Open Source project sites hosted on Github, and in the Microsoft Azure documentation. Here’s some link to those resources:

Also, don’t forget to try out the new Azure Cloud Shell to use bash with both the Azure CLI 1.0 and Azure CLI 2.0 command directly in the Azure Portal from anywhere!

Happy cross-platform, command-line scripting in the cloud!!

Infrastructureportal

Azure Portal goes Native on iOS and Android

Since the beginning of Microsoft Azure with the initial General Availability in February 2010, then Azure Portal has always been a Web Application. It’s gone through a couple of different HTML5 / Javascript versions, including a Silverlight version back in the early days. One things has been constant the entire time, and that is that the Azure Portal has always been a Web Application. That is until now! The Azure Portal is now available as a native mobile application for your mobile devices.

Many people have asked over the years, “Why doesn’t Microsoft make a native app for the Azure Portal?” There was a time when I even thought it was logical that Microsoft would build a Windows Store app for the Azure Portal. However, then I gave up that idea and started rationalizing the benefits of a Web Application over going Native.

While the Azure Portal has always been usage from a mobile device, after all it is an HTML5 / Javascript web application, it’s been a little clunky and cumbersome to use on a small screen. To our delight, Microsoft has decided to practice what they are preaching about mobile development and build a native, mobile application experience for the Microsoft Azure Portal.

Read More

Infrastructurepricing

How to Compare Azure VM Pricing Across Azure Regions

At first glance, Virtual Machine pricing in Microsoft Azure seems fairly straight forward. However, the different VM pricing tiers actually do vary in price from region to region. In fact comparing the prices across regions can be a little tricky whether you’re using the Pricing Calculator or the pricing info in the Azure Portal. However, Victor Kiselev has compiled all the Azure pricing together into an easy to use comparison tool. Read More

Infrastructurepricing

Top 10 Tricks to Save Money with Azure Virtual Machines

This post contains 10 tips and tricks you can use to save money on your Virtual Machines (VMs) running in the Microsoft Azure cloud. The cost analysis of the cloud can be scary at first, and it’s actually one of the reasons companies are shy to start adopting the cloud. Once you know these tricks you’ll feel confident that you won’t overspend and go broke in Microsoft Azure.

Some of these tips are almost secrets, as they aren’t really talked about anywhere. I know these from my years of experience working with Microsoft Azure and getting to know many of the ins and outs of the platform. So, read below, and benefit from my years of Azure experience in just a few minutes.

Using these tips will certainly help you save your company or organization money, and will likely impress your boss! Read More

InfrastructureVideo

Create Ubuntu Linux VM in the Azure Portal

This is a short video that shows how to create an Ubuntu Linux Virtual Machine (VM) in the Microsoft Azure Management Portal. It also explains a few details on how VMs are hosted in Azure, along with a demo on how to connect to the Ubuntu Linux VM using ssh and bash.

Please, subscribe to get more videos like this all around Microsoft Azure.

This is one of the first videos I’ve published to the Build Azure YouTube Channel where I’m starting to build out video content to accompany this site. Enjoy!