Azure Weekly

Azure Weekly: May 29, 2017

Do you find it difficult to keep up-to-date on the frequent updates and changes in the Microsoft Azure cloud? If so, Build Azure Weekly is the solution you’ve been looking for! Build Azure Weekly is a weekly newsletter that includes all the latest Microsoft Azure Service Updates from the week in addition to links to many other blog articles, podcasts and videos from all over the Internet.

If you want to receive the newsletter in your email every week, then you’ll absolutely want to Subscribe!

Service Updates

Here’s a list of the Microsoft Azure Service Updates from over the past week:

Top Links

Here are some of the most notable links from the week:

Sponsor

opsgility-new-high-res-logo-no-gear-with-taglineOpsgility is the leading Microsoft cloud technology trainer for developers and IT professionals, built around an esteemed network of industry experts and technical authors that includes Microsoft MVPs and Microsoft Insiders in more than 10 countries.

We provide live, instructor-led (onsite and virtual) courses as well as self-paced, online courses that go above and beyond simple videos or blog posts. Each course is designed to comprehensively guide the student through the subject by providing expert instructors, step-by-step hands-on labs, and knowledge measures to assess and ensure new skills are mastered.

Get started today with Microsoft Dev Essentials and get 3 months Free of Opsgility on-demand streaming service! Read More

Azure CLI

Install Azure CLI 2.0 on macOS

The Azure CLI is the cross-platform, command-line tool for managing and automating cloud resources in Microsoft Azure. The tool is supported across macOS, Linux, Windows, and more newly usable from within a web browser in the Azure Portal. While you can run it in the browser now, there are certainly benefit from being able to run the Azure CLI from your local machine. One of these benefits is to easily execute bash scripts locally to perform automation and other tasks. This article will guide you through the step-by-step process of installing the Azure CLI 2.0 on macOS. Read More

Internet of Things

Setup Raspberry Pi with Windows 10 IoT Core

Windows 10 IoT Core is Microsoft’s version of the Windows 10 operating system being built to run Internet of Things (IoT) devices. There are a few hardware IoT devices that Windows 10 IoT Core supports and can run on. One of these devices is the Raspberry Pi; specifically the Raspberry Pi 2 and Raspberry Pi 3. This article lists out the steps necessary to load Windows 10 IoT Core onto a MicroSD Card that can be inserted into a Raspberry Pi to run Windows 10 IoT Core as the operating system.

Flash Windows 10 IoT Core to MicroSD Card

In order to boot Windows 10 IoT Core from a Raspberry Pi, you must first flash the Windows 10 IoT Core operating system to an SD Card that can be used to boot the Raspberry Pi from. To do this you need to use a Windows PC and the IoT Dashboard utility.

Step 1: Using a Windows PC, download and install the Windows 10 IoT Core Dashboard.

Step 2: Insert your Micro SD Card into your PC.

Note: Before you start, you’ll want to make sure you have an MicroSD Card that is supported by Windows 10 IoT Core. It’s important to be aware that NOT all MicroSD Cards are supported, with the primary restriction that they are at minimum a Class 10 SD Card.

Step 3: Run the IoT Dashboard app, and click on the “Set up a new device” button.

Step 4: Select the “Raspberry Pi 2 & 3” device type, and fill in the necessary configuration values, then accept the software license terms and click the “Download and install” button.

Something to note on the Wi-Fi Network Connection setting is that it will pull from the Wifi Profiles on your local PC. This means that you will be able to easily configure your device to connect to the same Wifi network your Windows PC is connected to once it boots up from the SD Card. You won’t need to plugin a display, keyboard, or mouse in order to configure anything, so long as you select the correct Wifi network.

Step 5: When prompted to erase the SD Card, you need to click Continue. Just make sure you are aware that this will essentially format the SD Card before copying the Windows 10 IoT Core image, so you will lose any data that’s existing on the SD Card.

Step 6: The tool will continue by downloading the latest release of Windows 10 IoT Core. This ensures that you always have the latest version that you’re flashing.

Step 7: After the download completes, the dism.exe command-line tool will then automatically kick off to flash the downloaded Windows 10 IoT Core image to the SD Card.

Step 8: Once the flashing is completed, the IoT Dashboard will show a message stating that “Your SD card is ready.”

Step 9: You can now safely remove the SD Card from your PC and plug it into the Raspberry Pi and power it on.

Connect to the Windows 10 Device Portal

One of the features of Windows 10 IoT Core that makes it easier to manage, especially with headless devices, is the Windows Device Portal. This is a web interface that is hosted on the Windows 10 IoT Core device by default. This interface allows you to perform some remote monitoring, configuration, and deployment options for Windows 10 IoT Core.

Step 1: Once you’ve booted up a device with Windows 10 IoT Core you can then use the “My devices” option of the IoT Dashboard to easily discover what Windows 10 IoT Core devices are connected to the network that your PC is connected to. To view some details about the specific device, you can double-click on the device in the list.

Step 10: On the info for the specific Windows 10 IoT Core device, you can click on the “Open Windows Device Portal in browser” link to open up a new browser window navigating to the Windows Device Portal for that device.

Step 11: When the browser opens up and connects to the Windows Device Portal, it’ll prompt you to login. The Username you need to use will be Administrator, and the Password will be the password you configured when you flashed Windows 10 IoT Core to the SD Card.

Step 12: Once authenticated, you will be logged in and able to access the Windows Device Portal.

Overall the tools from Microsoft, including the IoT Dashboard, are extremely easy to use. You don’t need to use any command-line tools or open any configuration files to install Windows 10 IoT Core to an SD Card. You can then simply insert the SD Card into your device and boot it up to get it running.

Azure CLI

Azure CLI 2.0: Generate SAS Token for Blob in Azure Storage

Azure Storage is a cloud service at the very center of Microsoft Azure. It provides the foundations for storing data in many services and systems within the Azure cloud platform. You can use Azure Blob Storage to store any binary data such as files, images, backups, .vhd’s, videos, and pretty much any other file. The Azure Blob Storage will secure all blobs / files by default where they can’t be access without a key. You can configure the service to allow anonymous access to blobs, however, there are many circumstances that you want to securely share a file with Azure Blob Storage.
Read More

Azure Weekly

Azure Weekly: May 22, 2017

Are you having difficulty keeping up to date on all the frequent changes and updates in the Microsoft Azure space? Then the Build Azure Weekly has the solution you’re looking for. Build Azure Weekly is a weekly blog post that includes all the latest Microsoft Azure Service Updates from the week in addition to links to many other blog articles, podcasts and videos from all over the Internet.

If you want to receive these in your email, then you’ll absolutely want to Subscribe!

Service Updates

Here’s a list of the Microsoft Azure Service Updates from over the past week:

Top Links

Here are some of the most notable links from the week:

Sponsor

opsgility-new-high-res-logo-no-gear-with-taglineOpsgility is the leading Microsoft cloud technology trainer for developers and IT professionals, built around an esteemed network of industry experts and technical authors that includes Microsoft MVPs and Microsoft Insiders in more than 10 countries.

We provide live, instructor-led (onsite and virtual) courses as well as self-paced, online courses that go above and beyond simple videos or blog posts. Each course is designed to comprehensively guide the student through the subject by providing expert instructors, step-by-step hands-on labs, and knowledge measures to assess and ensure new skills are mastered.

Get started today with Microsoft Dev Essentials and get 3 months Free of Opsgility on-demand streaming service! Read More

HardwareInternet of Things

Azure IoT DevKit Preview built with Arduino and VSCode

There have been a number of Azure IoT Starter Kits available for some time now. I’ve written about the Starter Kits in the past. Some of these like the Raspberry Pi Azure IoT Starter Kit from Adafruit require you to wire up sensors and things, while the GrovePi+ is similar to a Lego Mindstorm but for prototyping Internet of Things devices. It seems that Microsoft is finally consolidating onto a specific “Azure IoT Developer Kit”, and they’ve already made early previews available upon application. This new Azure IoT “DevKit” is a single board packed with sensors, buttons, OLED screen, and more! Plus, it’s Arduino compatible! Read More

Internet of Things

Microsoft IoT Central Enables SaaS-based IoT Solutions

Many software systems can become fairly complex with many different interconnected and communicating components. Internet of Things (IoT) solutions can especially become complex. Instead of individual tiers for each piece of the software system, an IoT solution can be composed of thousands or even millions of IoT hardware devices in addition to the backend tiers for processing data, predicting analytics, reporting, business intelligence, and on, and on. Internet of Things solutions are becoming some of the most complex solutions on the planet.

The newly announced Microsoft IoT Central is a Software as a Service (SaaS) solution in the Microsoft Azure cloud that will help build, use, and maintain Internet of Things solutions. It provides an easier way to create connected products, and takes away much of the work necessary to build IoT solutions. Microsoft IoT Central reduces the complexity of IoT, thus enabling businesses to better utilize IoT to propel their business forward in the newly emerging age of IoT. Read More

Azure CLI

Azure CLI 2.0: Reset Azure SQL Database Password

The Azure SQL Database service allows you to set an Admin login and password when you provision a database server in the service. However, if you happen to forget the password for the Azure SQL Database server, it can be problematic. There is an option in the UI of the Azure Portal to reset this admin password. However, there may be times when you want to update the password from the command-line or in an automated fashion. Perhaps, you may want to automate the updating of the admin password for your Azure SQL Database servers periodically. Thankfully, there is a command in the Azure CLI 2.0 that does support updating or changing the password. 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!!