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
If you don't already have it, install Go 1.7.
Clone the repository.
git clone https://github.com:Azure-Samples/network-go-manage-network-interface.git
- Install the dependencies using glide.
cd network-go-manage-network-interface
glide install
Create an Azure service principal either through Azure CLI, PowerShell or the portal.
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`.
- 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 opencode@microsoft.com with any additional questions or comments.