{"record":{"id":"2a39db6e0dea22db","repo":"dotnet/orleans","slug":"unable-to-create-or-connect-to-the-azure-table-in","errorCode":null,"errorMessage":"Unable to create or connect to the Azure table in {StoragePolicyOptions.CreationTimeout}","messagePattern":"Unable to create or connect to the Azure table in (.+?)","errorType":"exception","errorClass":"OrleansException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureTableDataManager.cs","lineNumber":93,"sourceCode":"        public async Task InitTableAsync()\n        {\n            const string operation = \"InitTable\";\n            var startTime = DateTime.UtcNow;\n\n            try\n            {\n                TableServiceClient tableCreationClient = await GetCloudTableCreationClientAsync();\n                var table = tableCreationClient.GetTableClient(TableName);\n                var response = await table.CreateIfNotExistsAsync();\n                var alreadyExisted = response.GetRawResponse().Status == (int)HttpStatusCode.Conflict;\n\n                LogInfoTableCreation(Logger, alreadyExisted ? \"Attached to\" : \"Created\", TableName);\n                Table = table;\n            }\n            catch (TimeoutException te)\n            {\n                LogErrorTableCreationInTimeout(Logger, te, StoragePolicyOptions.CreationTimeout);\n                throw new OrleansException($\"Unable to create or connect to the Azure table in {StoragePolicyOptions.CreationTimeout}\", te);\n            }\n            catch (Exception exc)\n            {\n                LogErrorTableCreation(Logger, exc, TableName);\n                throw;\n            }\n            finally\n            {\n                CheckAlertSlowAccess(startTime, operation);\n            }\n        }\n\n        /// <summary>\n        /// Deletes the Azure table.\n        /// </summary>\n        /// <returns>Completion promise for this operation.</returns>\n        public async Task DeleteTableAsync()\n        {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureTableDataManager.cs#L75-L111","documentation":"Thrown by AzureTableDataManager.InitTableAsync when creating/connecting to the Azure table times out, i.e. the underlying CreateIfNotExistsAsync raises a TimeoutException within StoragePolicyOptions.CreationTimeout. The original TimeoutException is wrapped in an OrleansException whose message echoes the configured CreationTimeout. This blocks table initialization and therefore grain activation for that storage.","triggerScenarios":"Slow or unreachable Azure Table endpoint; throttling; network/DNS latency exceeding CreationTimeout; misconfigured endpoint; table create racing against throttling. The catch specifically matches TimeoutException and re-throws as OrleansException.","commonSituations":"Local dev pointing at a wrong/non-existent account; network egress restrictions; CreationTimeout too small for cold-start table creation; Azure-side throttling during heavy parallel init.","solutions":["Increase StoragePolicyOptions.CreationTimeout to allow for slow first-time table creation.","Verify connectivity, endpoint URL, credentials, and that the storage account is reachable from the host.","Pre-create the table out-of-band so InitTable only attaches, and check for throttling/network restrictions.","Retry startup after confirming DNS/firewall allow egress to table.core.windows.net."],"exampleFix":"// before\nbuilder.AddAzureTableGrainStorage(\"Default\", o =>\n{\n    o.TableServiceClient = client;\n    o.TableName = \"grainstate\";\n    // CreationTimeout left very small / network slow\n});\n// after\nbuilder.AddAzureTableGrainStorage(\"Default\", o =>\n{\n    o.TableServiceClient = client;\n    o.TableName = \"grainstate\";\n    o.StoragePolicyOptions.CreationTimeout = TimeSpan.FromMinutes(2);\n});","handlingStrategy":"retry","validationCode":"if (options.StoragePolicyOptions.CreationTimeout < TimeSpan.FromSeconds(30))\n    options.StoragePolicyOptions.CreationTimeout = TimeSpan.FromMinutes(2);","typeGuard":"static bool EndpointReachable(Uri u) => /* quick TCP/DNS probe */ true;","tryCatchPattern":"catch (OrleansException ex) when (ex.InnerException is TimeoutException) { /* raise CreationTimeout, verify connectivity/credentials, then retry startup */ }","preventionTips":["Set CreationTimeout generously for cold-start table creation.","Confirm DNS/firewall allow egress to the table endpoint.","Pre-create tables out-of-band so InitTable only attaches."],"tags":["orleans","azure-storage","azure-table","timeout","network","retry"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}