{"record":{"id":"42a41f6d312d3e38","repo":"kubernetes/kops","slug":"azure-storage-account-is-not-set-on-path-q","errorCode":null,"errorMessage":"Azure storage account is not set on path %q","messagePattern":"Azure storage account is not set on path %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/azureblob_terraform.go","lineNumber":43,"sourceCode":"\ntype terraformAzureBlobFile struct {\n\tName               string                   `cty:\"name\"`\n\tStorageContainerID string                   `cty:\"storage_container_id\"`\n\tType               string                   `cty:\"type\"`\n\tSource             *terraformWriter.Literal `cty:\"source\"`\n\tProvider           *terraformWriter.Literal `cty:\"provider\"`\n}\n\nfunc (p *AzureBlobPath) RenderTerraform(w *terraformWriter.TerraformWriter, name string, data io.Reader, acl ACL) error {\n\tbytes, err := io.ReadAll(data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading data: %w\", err)\n\t}\n\n\tw.EnsureTerraformProvider(\"azurerm\", map[string]string{})\n\n\tif p.account == \"\" {\n\t\treturn fmt.Errorf(\"Azure storage account is not set on path %q\", p.Path())\n\t}\n\tif w.AzureStorageAccountID == \"\" {\n\t\treturn fmt.Errorf(\"Azure storage account ID is not set; it is required to render blob %q\", p.Path())\n\t}\n\n\tsource, err := w.AddFilePath(\"azurerm_storage_blob\", name, \"source\", bytes, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"rendering Azure Blob file: %w\", err)\n\t}\n\n\ttf := &terraformAzureBlobFile{\n\t\tName:               p.key,\n\t\tStorageContainerID: w.AzureStorageAccountID + \"/blobServices/default/containers/\" + p.container,\n\t\tType:               \"Block\",\n\t\tSource:             source,\n\t\tProvider:           terraformWriter.LiteralTokens(\"azurerm\", \"files\"),\n\t}\n\treturn w.RenderResource(\"azurerm_storage_blob\", name, tf)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/azureblob_terraform.go#L25-L61","documentation":"RenderTerraform refuses to render an azurerm_storage_blob resource when the AzureBlobPath has no storage account configured (p.account == \"\"). The account name is needed to build the blob's storage container ID, so an empty account is treated as a configuration error and rendering aborts with the path quoted for diagnosis.","triggerScenarios":"Calling RenderTerraform on an *AzureBlobPath constructed without an Azure storage account name — e.g. NewAzureBlobPath (or equivalent) was given an empty account, or the account was never set from cluster config, then `kops update cluster --target=terraform` renders the blob.","commonSituations":"Cluster spec missing Azure storage account settings (azure storageAccount fields not populated); environment variable / cloud config for the Azure subscription absent; creating a VFS path manually for tests without setting the account.","solutions":["Set the Azure storage account in the cluster spec (kops create/set Cluster.Spec.ConfigStore or azure config) so the path is built with a valid account","Recreate the AzureBlobPath with a non-empty account name argument","Check the value with p.Path() or the config that produced it to confirm the account is empty","Re-run kops update cluster --target=terraform after fixing config"],"exampleFix":"// before\npath := vfs.NewAzureBlobPath(\"\", container, key)\n\n// after\naccount := os.Getenv(\"AZURE_STORAGE_ACCOUNT\")\nif account == \"\" {\n\treturn fmt.Errorf(\"AZURE_STORAGE_ACCOUNT must be set\")\n}\npath := vfs.NewAzureBlobPath(account, container, key)","handlingStrategy":"validation","validationCode":"if p.Account() == \"\" {\n\treturn fmt.Errorf(\"Azure storage account must be configured before rendering blob %s\", p.Path())\n}","typeGuard":null,"tryCatchPattern":"if err := p.RenderTerraform(w, name, data, acl); err != nil {\n\tif strings.Contains(err.Error(), \"storage account is not set\") {\n\t\treturn fmt.Errorf(\"cluster Azure storage account config missing; set it via `kops set cluster` : %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Validate the Azure storage account is present in the cluster spec before running `kops update cluster --target=terraform`","Fail fast at config-load time when required Azure fields are empty","Use `kops get cluster -o yaml` to confirm azure storage settings before targeting terraform"],"tags":["azure","terraform","configuration","vfs"],"backgroundTag":"missing-config-value","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}