A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/azure-samples/azure-sdk-for-go-samples below:

Azure-Samples/azure-sdk-for-go-samples: Examples of how to utilize Azure services from Go.

languages products page_type description

go

azure

sample

A collection of samples showing how to use the Azure SDK for Go.

This repo contains a collection of sample usages of the new version of Azure/azure-sdk-for-go. All the samples are placed under sdk folder and the folder structures are corresponding to the service packages under the /sdk directory of the Azure/azure-sdk-for-go repo. You can refer to this doc to get started with Azure SDK for Go.

For general SDK help, please refer to the SDK README.

You will need Go 1.18 and latest version of resource management modules.

You will need to authenticate to Azure either by using Azure CLI to sign in or setting environment variables.

Using Azure CLI to Sign In

You could easily use az login in command line to sign in to Azure via your default browser. Detail instructions can be found in Sign in with Azure CLI.

Setting Environment Variables

If your code is going to run in a none-user-interactive environment, you can also authenticate by setting environment variables as below.

You will need the following values to authenticate to Azure

These values can be obtained from the portal, here's the instructions:

  1. Clone the repository.

    git clone https://github.com/Azure-Samples/azure-sdk-for-go-samples.git
    
  2. Set the environment variable.

    # bash
    export AZURE_SUBSCRIPTION_ID=<your Azure subscription id> 
    # If no value is set, the created resource will be deleted by default.
    # anything other than empty to keep the resources
    export KEEP_RESOURCE=1 
    
    # powershell
    $env:AZURE_SUBSCRIPTION_ID=<your Azure subscription id> 
    $env:KEEP_RESOURCE=1
    
  3. Choose one sample and run.

    cd azure-sdk-for-go-samples/sdk/resourcemanager/<service>/<single sample>
    go run main.go
    

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

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4