Questions? Feedback? powered by Olark live chat software
Pomiń nawigację

Getting Started with Azure Blob Service in Go

This example demonstrates how to use the Blob Storage service with Go. If you don't have a Microsoft Azure subscription you can get a FREE trial account here.

Instructions

Using Azure Storage Emulator

  1. Download, install and run the Azure Storage Emulator.
  2. Get the Azure SDK for Go using command go get -u github.com/Azure/azure-sdk-for-go
  3. Get this sample using command go get -u github.com/Azure-Samples/storage-blob-go-getting-started
  4. Compile and run the sample.

Using Storage Service

  1. Create a storage account through the Azure Portal.
  2. Set environment variables AZURE_STORAGE_ACCOUNT_NAME = <ACCOUNT_NAME> and AZURE_STORAGE_ACCOUNT_KEY = <ACCOUNT_KEY>.
  3. Get the Azure SDK for Go using command go get -u github.com/Azure/azure-sdk-for-go
  4. Get this sample using command go get -u github.com/Azure-Samples/storage-blob-go-getting-started
  5. Depending on if you prefer running the sample against Azure or Azure Storage Emulator, comment / uncomment these lines in the blobSamples function in storageExample.go. go credentials, err := getCredentials(emulator) // credentials, err := getCredentials(account)
  6. If using the Storage Emulator, verify it is already running.
  7. Compile and run the sample.

Find documentation


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.