{"record":{"id":"193d9c8280539f0b","repo":"kubernetes/kops","slug":"no-storage-account-specified-in-q-expected-azure","errorCode":null,"errorMessage":"no storage account specified in %q; expected azureblob://<account>/<container>/<key>","messagePattern":"no storage account specified in %q; expected azureblob://<account>/<container>/<key>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/context.go","lineNumber":585,"sourceCode":"}\n\nfunc (c *VFSContext) buildAzureBlobPath(p string) (*AzureBlobPath, error) {\n\tif os.Getenv(\"AZURE_STORAGE_ACCOUNT\") != \"\" {\n\t\treturn nil, fmt.Errorf(\"unset AZURE_STORAGE_ACCOUNT; the storage account belongs in the URL:  azureblob://<account>/<container>/<key>\")\n\t}\n\n\tu, err := url.Parse(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse %q: %s\", p, err)\n\t}\n\n\tif u.Scheme != \"azureblob\" {\n\t\treturn nil, fmt.Errorf(\"invalid Azure Blob scheme: %q\", p)\n\t}\n\n\taccount := strings.TrimSuffix(u.Host, \"/\")\n\tif account == \"\" {\n\t\treturn nil, fmt.Errorf(\"no storage account specified in %q; expected azureblob://<account>/<container>/<key>\", p)\n\t}\n\n\trest := strings.TrimPrefix(u.Path, \"/\")\n\tcontainer, key, _ := strings.Cut(rest, \"/\")\n\tif container == \"\" {\n\t\treturn nil, fmt.Errorf(\"no container specified in %q; expected azureblob://<account>/<container>/<key>\", p)\n\t}\n\n\treturn NewAzureBlobPath(c, account, container, key), nil\n}\n\n// getAzureBlobClient returns the client for azure blob storage for the given\n// storage account, caching it for future reuse.\nfunc (c *VFSContext) getAzureBlobClient(ctx context.Context, account string) (*azblob.Client, error) {\n\tif account == \"\" {\n\t\treturn nil, fmt.Errorf(\"Azure storage account is required\")\n\t}\n","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/context.go#L567-L603","documentation":"The kOps VFS layer parses Azure Blob Storage paths of the form azureblob://<account>/<container>/<key>. This error is thrown by buildAzureBlobPath when the URL has the azureblob scheme but the host portion (the storage account name) is empty. The VFS path cannot be constructed without knowing which storage account to talk to.","triggerScenarios":"Calling VFSContext.BuildVfsPath (directly or via cluster config/state store flags) with a URL like \"azureblob:///container/key\" or \"azureblob://\" — any azureblob:// URL with an empty host.","commonSituations":"A misconfigured --state-store or OSS/KOPS_STATE_STORE environment variable where the account name was dropped (e.g. trailing-slash stripping or a templating variable that expanded to empty), or a hand-edited cluster spec pointing at an incomplete azureblob URL.","solutions":["Fix the azureblob:// URL so the host is the storage account name: azureblob://<account>/<container>/<key>.","If the URL comes from an env var (KOPS_STATE_STORE) or template, verify the variable is non-empty and contains the account before invoking kops.","If using managed Azure identity config, confirm the storage account name matches the resource created in the resource group."],"exampleFix":"// before\nBuildVfsPath(\"azureblob:///mystorage/mycontainer/kops-config\")\n// after\nBuildVfsPath(\"azureblob://mystorageaccount/mycontainer/kops-config\")","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(stateStore)\nif u.Scheme == \"azureblob\" && u.Host == \"\" {\n    return fmt.Errorf(\"azureblob state store %q is missing the storage account\", stateStore)\n}","typeGuard":"func isValidAzureBlobURL(p string) bool {\n    u, err := url.Parse(p)\n    return err == nil && u.Scheme == \"azureblob\" && u.Host != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always use the full azureblob://<account>/<container>/<key> form in KOPS_STATE_STORE or --state-store.","Validate the state store URL at startup, before any VFS call.","Avoid shell stripping of empty variables when templating the URL."],"tags":["azure","vfs","configuration","url-parsing"],"backgroundTag":"azureblob-url-missing-storage-account","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}