Azure SDK for Go setup (macOS)

To start the "quick start" of the site "Go Developer Azure | Microsoft Docs", when I try to run it with a command line tool,

--Azure CLI (for macOS: Homebrew required)

You need to install. In this article, I have summarized these setup procedures as my own memo by referring to the following site article.

--Tools for developers using Azure SDK for Go | Microsoft Docs --Install Azure SDK for Go | Microsoft Docs

Advance preparation

I have an Azure account. The acquisition procedure is posted in the next article.

--Create an Azure account --Qiita

Go is already installed. Azure SDK for Go requires Go 1.8 (1.9 for Azure Stack profile) or later.

Check the version of Go.

% go version
go version go1.15.6 darwin/amd64

Supplement to the site "Tools for developers using the Azure SDK for Go"

Although it is not a command line tool, the code editor "Visual Studio Code" is already installed.

I'll post about the Azure DevOps (https://azure.microsoft.com/ja-jp/services/devops/) project in a separate article.

The dependency management tool "dep" is not used because the project is finished. Currently, the Azure SDK for Go itself is in the process of dedep.

Azure CLI

Instructions for installing the Azure CLI are available at:

Since my development environment is macOS, I clicked the "Install on macOS" link on the site to check the details.

Homebrew installation

On macOS, use the package manager "Homebrew (brew command)" to install the Azure CLI.

--Homebrew official website: Package manager for macOS (or Linux) — Homebrew

Copy the installation command from the Homebrew official website and paste it into your terminal to start the installation.

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

The installation requires administrator privileges, so you will be prompted to enter the password of the user who logged in to macOS. Enter the login user password and press the [Enter] key.

Password:

You will be asked if you want to continue or cancel the installation. Press the [RETURN] or [Enter] key to continue, and press any other key to interrupt. Press the [Enter] key.

Press RETURN to continue or any other key to abort

After the installation is complete, check the version to see if the command is available.

% brew -v 
Homebrew 2.7.2
Homebrew/homebrew-core (git revision b692fd85; last commit 2021-01-11)

If you want to uninstall, please check the corresponding item in the FAQ document on the official website.

Azure CLI installation

Install the Azure CLI (az command) using brew.

Copy the installation command from the site and paste it into your terminal to start the installation.

% brew update && brew install azure-cli

After the installation is complete, check the version to see if the command is available.

% az version
{
  "azure-cli": "2.17.1",
  "azure-cli-core": "2.17.1",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {}
}

To uninstall, specify uninstall in the brew command.

% brew uninstall azure-cli

Command modernization

Homebrew (brew command)

To update the body, specify update.

% brew update

To update the modules installed by brew, specify upgrade.

% brew upgrade

Azure CLI (az command)

Specify upgrade to update the console.

% az upgrade

Both

To update the brew body, the az body and related modules together, execute the following command.

$ brew update && brew upgrade azure-cli

Azure SDK for Go

Copy the installation command from the site and paste it into your terminal to install or update.

% go get -u -d github.com/Azure/azure-sdk-for-go/...

At this time, Azure/go-autorest will also be installed and updated.

Recommended Posts

Azure SDK for Go setup (macOS)
Learn Service Bus Queue with Azure SDK for Go (1)
Upgrade the Azure Machine Learning SDK for Python
Microsoft Azure Go Introduction
OpenCV3 installation for Python3 @macOS
How to change the log level of Azure SDK for Python