The Azure Code Samples are currently available in English

Getting Started with Network - Manage Network Interface - in Go

Mariana Cardoso 提供
在 GitHub 上编辑
  Azure Network sample for managing network interfaces -
   - Create a virtual machine with multiple network interfaces
   - Configure a network interface
   - List network interfaces
   - Delete a network interface.

Running this Sample

  1. If you don't already have it, install Go 1.7.

  2. Clone the repository.

git clone
  1. Install the dependencies using glide.
cd network-go-manage-network-interface
glide install
  1. Create an Azure service principal either through Azure CLI, PowerShell or the portal.

  2. Set the following environment variables using the information from the service principle that you created.

export AZURE_TENANT_ID={your tenant id}
export AZURE_CLIENT_ID={your client id}
export AZURE_CLIENT_SECRET={your client secret}
export AZURE_SUBSCRIPTION_ID={your subscription id}
> [AZURE.NOTE] On Windows, use `set` instead of `export`.
  1. Run the sample.
go run example.go

More information

Please refer to Azure SDK for Go for more information. If you don't have a Microsoft Azure subscription you can get a FREE trial account here

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.