Merge pull request #5141 from richgrov/missing-azure-env-error

Return error if AZURE_ACCOUNT_NAME not set
This commit is contained in:
Michael Eischer authored and GitHub committed 2024-12-01 14:01:56 +01:00
commit 2f0049cd6c
2 files changed
+12

No files matched your search

+5
View File
@@ -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{