From dfbd4fb983f0f789da8130906ea0bfd2ae51e717 Mon Sep 17 00:00:00 2001 From: Richard Grover <38992201+richgrov@users.noreply.github.com> Date: Wed, 13 Nov 2024 08:02:22 -0700 Subject: [PATCH] Error if AZURE_ACCOUNT_NAME not set --- internal/backend/azure/azure.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/backend/azure/azure.go b/internal/backend/azure/azure.go index c1c049a94..27390ee13 100644 --- a/internal/backend/azure/azure.go +++ b/internal/backend/azure/azure.go @@ -62,6 +62,11 @@ func open(cfg Config, rt http.RoundTripper) (*Backend, error) { } else { endpointSuffix = "core.windows.net" } + + if cfg.AccountName == "" { + return nil, errors.Fatalf("unable to open Azure backend: Account name ($AZURE_ACCOUNT_NAME) is empty") + } + url := fmt.Sprintf("https://%s.blob.%s/%s", cfg.AccountName, endpointSuffix, cfg.Container) opts := &azContainer.ClientOptions{ ClientOptions: azcore.ClientOptions{