Install the Azure SDK for Go
Welcome to the Azure SDK for Go! The SDK allows you to manage and interact with Azure services from your Go applications.
Get the Azure SDK for Go
The Azure SDK for Go is compatible with Go versions 1.8 and higher. For environments using Azure Stack Profiles, Go version 1.9 is the minimum requirement. If you need to install Go, follow the Go installation instructions.
You can download the Azure SDK for Go and its dependencies via
go get -u -d github.com/Azure/azure-sdk-for-go/...
Make sure that you capitalize
Azure in the URL. Doing otherwise can cause case-related import problems
when working with the SDK. You also need to capitalize
Azure in your import statements.
Some Azure services have their own Go SDK and aren't included in the core Azure SDK for Go package. The following table lists the services with their own SDKs and their package names. These packages are all considered to be in preview.
Vendor the Azure SDK for Go
The Azure SDK for Go may be vendored through dep. For stability reasons, vendoring is recommended. To use
in your own project, add
github.com/Azure/azure-sdk-for-go to a
[[constraint]] section of your
Gopkg.toml. For example, to vendor on version
14.0.0, add the following entry:
[[constraint]] name = "github.com/Azure/azure-sdk-for-go" version = "14.0.0"
Include the Azure SDK for Go in your project
To use Azure services from your Go code, import any services you interact with and the required
You get a complete list of the available modules from GoDoc for
available services and
AutoRest packages. The most common packages you need from
|github.com/Azure/go-autorest/autorest||Objects for handling service client authentication|
|github.com/Azure/go-autorest/autorest/azure||Constants for interactions with Azure services|
|github.com/Azure/go-autorest/autorest/adal||Authentication mechanisms for accessing Azure services|
|github.com/Azure/go-autorest/autorest/to||Type assertion helpers for working with Azure SDK data structures|
Go packages and Azure services are versioned independently. The service versions are part of the module import path, underneath
services module. The full path for the module is the name of the service, followed by
the version in
YYYY-MM-DD format, followed by the service name again. For example, to import the
2017-03-30 version of the Compute service:
It's recommended that you use the latest version of a service when starting development and keep it consistent. Service requirements may change between versions that could break your code, even if there are no Go SDK updates during that time.
If you need a collective snapshot of services, you can also select a single profile version. Right now, the only locked profile is version
2017-03-09, which may not have the latest features of services. Profiles are located under the
profiles module, with their version in the
Services are grouped under their profile version. For example, to import the Azure Resources management module from the
There are also
latest profiles available. Using them is not recommended. These profiles are rolling versions and service behavior may change at any time.
To begin using the Azure SDK for Go, try out a quickstart.
- Deploy a virtual machine from a template
- Transfer objects to Azure Blob Storage with the Azure Blob SDK for Go
- Connect to Azure Database for PostgreSQL
If you want to get started with other services in the Go SDK immediately, take a look at some of the available sample code.
Submit and view feedback for