{"record":{"id":"b3ff5b412d4058ea","repo":"hashicorp/terraform","slug":"no-storage-domain-suffix-defined-for-environment","errorCode":null,"errorMessage":"no storage domain suffix defined for environment: %s","messagePattern":"no storage domain suffix defined for environment: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/azure/storage_client_helpers.go","lineNumber":163,"sourceCode":"\t}\n\tif endpoints.Queue != nil {\n\t\tendpoint := strings.TrimSuffix(*endpoints.Queue, \"/\")\n\t\tout.primaryQueueEndpoint = pointer.To(endpoint)\n\t}\n\tif endpoints.Table != nil {\n\t\tendpoint := strings.TrimSuffix(*endpoints.Table, \"/\")\n\t\tout.primaryTableEndpoint = pointer.To(endpoint)\n\t}\n\n\treturn &out, nil\n}\n\n// naiveStorageAccountBlobBaseURL naively construct the storage account blob endpoint URL instead of\n// learning from the storage account response. This can be incorrect if private dns zone is used.\nfunc naiveStorageAccountBlobBaseURL(e environments.Environment, accountName string) (string, error) {\n\tpDomainSuffix, ok := e.Storage.DomainSuffix()\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"no storage domain suffix defined for environment: %s\", e.Name)\n\t}\n\treturn fmt.Sprintf(\"https://%s.blob.%s\", accountName, *pDomainSuffix), nil\n}\n","sourceCodeStart":145,"sourceCodeEnd":167,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/azure/storage_client_helpers.go#L145-L167","documentation":"naiveStorageAccountBlobBaseURL (storage_client_helpers.go:163) builds a blob URL from the environment's Storage.DomainSuffix (e.g. core.windows.net). If the selected environment does not define one (ok=false), it cannot synthesize the URL and fails.","triggerScenarios":"Selecting a custom/sovereign environment (via ARM_ENVIRONMENT or a metadata endpoint) whose definition lacks a storage domain suffix, then hitting the naive blob-URL construction path.","commonSituations":"Pointing at AzureChina/Germany/USGov or a custom cloud whose environment metadata is incomplete; a misspelled environment name.","solutions":["Use a fully-supported environment name (Public, China, USGovernment, etc.).","Provide complete custom environment metadata including the storage suffix.","Avoid the naive path by ensuring primary endpoints are read from ARM instead."],"exampleFix":"# before\nexport ARM_ENVIRONMENT=MyCustomCloud   # no storage suffix defined\n# after\nexport ARM_ENVIRONMENT=AzurePublicCloud","handlingStrategy":"validation","validationCode":"# confirm the environment defines a storage domain suffix\naz cloud show --name \"$(az cloud show --query name -o tsv)\" \\\n  --query \"suffixes.storageEndpoint\" --output tsv | grep -q '.' \\\n  || echo \"WARN: no storage domain suffix for this cloud\"","typeGuard":"// confirm the environment exposes a storage suffix before building a naive URL\nfunc hasStorageSuffix(e environments.Environment) bool {\n    _, ok := e.Storage.DomainSuffix()\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Use supported environment names.","Provide complete custom cloud metadata including the storage suffix.","Prefer ARM-derived endpoints over naive URL construction."],"tags":["azure","storage","environment","configuration"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}