{"record":{"id":"e36be47a51fc6d89","repo":"hashicorp/terraform","slug":"determining-s-endpoint-for-s-missing-primary-en","errorCode":null,"errorMessage":"determining %s endpoint for %s: missing primary endpoint","messagePattern":"determining (.+?) endpoint for (.+?): missing primary endpoint","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/azure/storage_client_helpers.go","lineNumber":112,"sourceCode":"\n\tcase EndpointTypeDfs:\n\t\tbaseUri = ad.primaryDfsEndpoint\n\n\tcase EndpointTypeFile:\n\t\tbaseUri = ad.primaryFileEndpoint\n\n\tcase EndpointTypeQueue:\n\t\tbaseUri = ad.primaryQueueEndpoint\n\n\tcase EndpointTypeTable:\n\t\tbaseUri = ad.primaryTableEndpoint\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"internal-error: unrecognised endpoint type %q when building storage client\", endpointType)\n\t}\n\n\tif baseUri == nil {\n\t\treturn nil, fmt.Errorf(\"determining %s endpoint for %s: missing primary endpoint\", endpointType, ad.StorageAccountId)\n\t}\n\treturn baseUri, nil\n}\n\nfunc populateAccountDetails(accountId commonids.StorageAccountId, account storageaccounts.StorageAccount) (*AccountDetails, error) {\n\tout := AccountDetails{\n\t\tKind:             pointer.From(account.Kind),\n\t\tStorageAccountId: accountId,\n\t}\n\n\tif account.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"populating details for %s: `model.Properties` was nil\", accountId)\n\t}\n\tif account.Properties.PrimaryEndpoints == nil {\n\t\treturn nil, fmt.Errorf(\"populating details for %s: `model.Properties.PrimaryEndpoints` was nil\", accountId)\n\t}\n\n\tprops := *account.Properties","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/azure/storage_client_helpers.go#L94-L130","documentation":"DataPlaneEndpoint (storage_client_helpers.go:112) returns the configured primary endpoint (blob/dfs/file/queue/table) for data-plane calls. If the requested endpoint type's pointer in AccountDetails is nil (never populated because ARM omitted it), the backend cannot build the data-plane URL.","triggerScenarios":"Requesting an endpoint type (e.g. dfs for a non-HNS account, or table) whose value was nil in the storage account Properties.PrimaryEndpoints returned by ARM, then calling DataPlaneEndpoint for that type.","commonSituations":"Using a standard non-HNS account and requesting a dfs endpoint; table/queue/file service disabled on the account; account kind/feature flags not enabling the requested service.","solutions":["Enable the required feature on the storage account (e.g. hierarchical namespace for dfs, or enable the table service).","Use an endpoint type the account actually exposes (blob for standard LRS/GRS).","Verify the account kind (StorageV2/BlobStorage) supports the requested service."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# confirm the requested endpoint is exposed by the account\naz storage account show --name <acct> --resource-group <rg> \\\n  --query \"primaryEndpoints.<blob|dfs|table>\" --output tsv | grep -q '.' \\\n  || echo \"WARN: requested primary endpoint is not set\"","typeGuard":"// confirm the requested endpoint is populated before requesting it\nfunc endpointAvailable(ad *AccountDetails, t EndpointType) bool {\n    e, err := ad.DataPlaneEndpoint(t)\n    return err == nil && e != nil\n}","tryCatchPattern":null,"preventionTips":["Enable the storage service you intend to use (e.g. HNS for dfs).","Prefer blob endpoints for standard accounts.","Verify account kind supports the requested service before configuring the backend."],"tags":["azure","storage","configuration","endpoints"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}