func (a *AzureBackend) Delete(key string) error {
	defer metrics.MeasureSince([]string{"azure", "delete"}, time.Now())
	a.permitPool.Acquire()
	defer a.permitPool.Release()
	_, err := a.client.DeleteBlobIfExists(a.container, key, nil)
	return err
}
Delete is used to permanently delete an entry
package physical
import (
	"encoding/base64"
	"fmt"
	"io/ioutil"
	"os"
	"sort"
	"strconv"
	"strings"
	"time"
	log "github.com/mgutz/logxi/v1"
	"github.com/Azure/azure-sdk-for-go/storage"
	"github.com/armon/go-metrics"
	"github.com/hashicorp/errwrap"
)
var MaxBlobSize = 1024 * 1024 * 4
type AzureBackend struct {
	container  string
	client     storage.BlobStorageClient
	logger     log.Logger
	permitPool *PermitPool
}
func newAzureBackend(conf map[string]string, logger log.Logger) (Backend, error) {
	container := os.Getenv("AZURE_BLOB_CONTAINER")
	if container == "" {
		container = conf["container"]
		if container == "" {
			return nil, fmt.Errorf("'container' must be set")
		}
	}
	accountName := os.Getenv("AZURE_ACCOUNT_NAME")
	if accountName == "" {
		accountName = conf["accountName"]
		if accountName == "" {
			return nil, fmt.Errorf("'accountName' must be set")
		}
	}
	accountKey := os.Getenv("AZURE_ACCOUNT_KEY")
	if accountKey == "" {
		accountKey = conf["accountKey"]
		if accountKey == "" {
			return nil, fmt.Errorf("'accountKey' must be set")
		}
	}
	client, err := storage.NewBasicClient(accountName, accountKey)
	if err != nil {
		return nil, fmt.Errorf("Failed to create Azure client: %v", err)
	}
	client.GetBlobService().CreateContainerIfNotExists(container, storage.ContainerAccessTypePrivate)
	maxParStr, ok := conf["max_parallel"]
	var maxParInt int
	if ok {
		maxParInt, err = strconv.Atoi(maxParStr)
		if err != nil {
			return nil, errwrap.Wrapf("failed parsing max_parallel parameter: {{err}}", err)
		}
		if logger.IsDebug() {
			logger.Debug("azure: max_parallel set", "max_parallel", maxParInt)
		}
	}
	a := &AzureBackend{
		container:  container,
		client:     client.GetBlobService(),
		logger:     logger,
		permitPool: NewPermitPool(maxParInt),
	}
	return a, nil
}
func (a *AzureBackend) Put(entry *Entry) error {
	defer metrics.MeasureSince([]string{"azure", "put"}, time.Now())
	if len(entry.Value) >= MaxBlobSize {
		return fmt.Errorf("Value is bigger than the current supported limit of 4MBytes")
	}
	blockID := base64.StdEncoding.EncodeToString([]byte("AAAA"))
	blocks := make([]storage.Block, 1)
	blocks[0] = storage.Block{ID: blockID, Status: storage.BlockStatusLatest}
	a.permitPool.Acquire()
	defer a.permitPool.Release()
	err := a.client.PutBlock(a.container, entry.Key, blockID, entry.Value)
	err = a.client.PutBlockList(a.container, entry.Key, blocks)
	return err
}
func (a *AzureBackend) Get(key string) (*Entry, error) {
	defer metrics.MeasureSince([]string{"azure", "get"}, time.Now())
	a.permitPool.Acquire()
	defer a.permitPool.Release()
	exists, _ := a.client.BlobExists(a.container, key)
	if !exists {
		return nil, nil
	}
	reader, err := a.client.GetBlob(a.container, key)
	if err != nil {
		return nil, err
	}
	data, err := ioutil.ReadAll(reader)
	ent := &Entry{
		Key:   key,
		Value: data,
	}
	return ent, err
}