{"record":{"id":"2ae8af439a3acbf9","repo":"hashicorp/terraform","slug":"populating-details-for-s-model-properties-prima","errorCode":null,"errorMessage":"populating details for %s: `model.Properties.PrimaryEndpoints` was nil","messagePattern":"populating details for (.+?): `model\\.Properties\\.PrimaryEndpoints` was nil","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/azure/storage_client_helpers.go","lineNumber":127,"sourceCode":"\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\n\tout.IsHnsEnabled = pointer.From(props.IsHnsEnabled)\n\n\tendpoints := *props.PrimaryEndpoints\n\tif endpoints.Blob != nil {\n\t\tendpoint := strings.TrimSuffix(*endpoints.Blob, \"/\")\n\t\tout.primaryBlobEndpoint = pointer.To(endpoint)\n\t}\n\tif endpoints.Dfs != nil {\n\t\tendpoint := strings.TrimSuffix(*endpoints.Dfs, \"/\")\n\t\tout.primaryDfsEndpoint = pointer.To(endpoint)\n\t}\n\tif endpoints.File != nil {\n\t\tendpoint := strings.TrimSuffix(*endpoints.File, \"/\")\n\t\tout.primaryFileEndpoint = pointer.To(endpoint)\n\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/azure/storage_client_helpers.go#L109-L145","documentation":"Even when Properties is present, PrimaryEndpoints may be nil. populateAccountDetails (storage_client_helpers.go:127) needs it to build blob/dfs/etc. endpoints, so a nil value is fatal.","triggerScenarios":"ARM returns Properties but no PrimaryEndpoints object, so populateAccountDetails cannot derive the data-plane endpoints.","commonSituations":"Provisioning race (account created but endpoints not yet populated); AzureStack/sovereign cloud returning a reduced shape; account in a failed provisioning state.","solutions":["Wait for the storage account to finish provisioning and retry.","Verify the account provisioning state is Succeeded.","On sovereign clouds, confirm the environment metadata is correct and complete."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# confirm PrimaryEndpoints is populated before running\naz storage account show --name <acct> --resource-group <rg> \\\n  --query \"primaryEndpoints\" --output tsv | grep -q '.' \\\n  || echo \"WARN: storage account PrimaryEndpoints is empty\"","typeGuard":"// guard populateAccountDetails against nil PrimaryEndpoints\nfunc hasPrimaryEndpoints(a storageaccounts.StorageAccount) bool {\n    return a.Properties != nil && a.Properties.PrimaryEndpoints != nil\n}","tryCatchPattern":null,"preventionTips":["Wait for provisioning state Succeeded before running.","Validate sovereign-cloud environment metadata completeness.","Re-check after account creation/feature changes."],"tags":["azure","storage","arm","provisioning"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}