azure-sdk-for-go-samples

module
v0.0.0-...-57c00fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: MIT

README


languages:

  • go products:
  • azure page_type: sample description: "A collection of samples showing how to use the Azure SDK for Go."

Azure SDK for Go Samples

azure-sdk-for-go-samples is a collection of sample usages of the current version of the Azure/azure-sdk-for-go. The current version of the Azure/azure-sdk-for-go is referring the service packages under the /services directory.

We have a collection of sample usages of the new version of the Azure/azure-sdk-for-go here. The new version of the Azure/azure-sdk-for-go is referring the service packages under the /sdk directory.

Build Status

For general SDK help start with the main SDK README.

To run tests

  1. set up authentication (see following)
  2. go test -v ./network/ (or any package)

To use service principal authentication, create a principal by running az ad sp create-for-rbac -n "<yourAppName>" and set the following environment variables. You can copy .env.tpl to a .env file in each package for ease of use.

export AZURE_SUBSCRIPTION_ID=
export AZURE_TENANT_ID=
export AZURE_CLIENT_ID=
export AZURE_CLIENT_SECRET=

export AZURE_LOCATION_DEFAULT=westus2
export AZURE_BASE_GROUP_NAME=azure-samples-go
export AZURE_KEEP_SAMPLE_RESOURCES=0

For device flow authentication, create a "native" app by running az ad app create --display-name "<yourAppName>" --native-app --requiredResourceAccess @manifest.json; and specify the -useDeviceFlow flag when running tests.

Other notes

AZURE_SP_OBJECT_ID represents a service principal ObjectID. It is needed to run the Create VM with encrypted managed disks sample.

Resources

License

This code is provided under the MIT license. See LICENSE for details.

Contribute

We welcome your contributions! For instructions and our code of conduct see CONTRIBUTING.md. And thank you!

Directories

Path Synopsis
internal
config
package config manages loading configuration from environment and command-line params
package config manages loading configuration from environment and command-line params
iam
quickstarts
sdk
services module
Package sql tests basic functionality for an existing mssql db
Package sql tests basic functionality for an existing mssql db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL