{"record":{"id":"6f21f98deadadb2e","repo":"dotnet/orleans","slug":"azuretable-serviceuri-must-be-an-absolute-https-az","errorCode":null,"errorMessage":"AzureTable:ServiceUri must be an absolute HTTPS Azure Table service URI.","messagePattern":"AzureTable:ServiceUri must be an absolute HTTPS Azure Table service URI\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"samples/Deployment/AzureContainerApps/Infrastructure/AzureTableServiceClientFactory.cs","lineNumber":18,"sourceCode":"using Azure.Data.Tables;\nusing Azure.Identity;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Infrastructure;\n\npublic static class AzureTableServiceClientFactory\n{\n    public static TableServiceClient Create(IConfiguration configuration, IHostEnvironment environment)\n    {\n        var serviceUriValue = configuration[\"AzureTable:ServiceUri\"];\n        if (!string.IsNullOrWhiteSpace(serviceUriValue))\n        {\n            if (!Uri.TryCreate(serviceUriValue, UriKind.Absolute, out var serviceUri)\n                || serviceUri.Scheme != Uri.UriSchemeHttps)\n            {\n                throw new InvalidOperationException(\n                    \"AzureTable:ServiceUri must be an absolute HTTPS Azure Table service URI.\");\n            }\n\n            var credentialOptions = new DefaultAzureCredentialOptions();\n            var managedIdentityClientId = GetRequiredValue(configuration, \"AZURE_CLIENT_ID\");\n            if (!Guid.TryParse(managedIdentityClientId, out _))\n            {\n                throw new InvalidOperationException(\n                    \"AZURE_CLIENT_ID must contain the user-assigned managed identity client ID.\");\n            }\n\n            credentialOptions.ManagedIdentityClientId = managedIdentityClientId;\n            return new TableServiceClient(serviceUri, new DefaultAzureCredential(credentialOptions));\n        }\n\n        var connectionString = configuration[\"AzureTable:ConnectionString\"];\n        if (environment.IsDevelopment()\n            && string.Equals(connectionString, \"UseDevelopmentStorage=true\", StringComparison.OrdinalIgnoreCase))","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/samples/Deployment/AzureContainerApps/Infrastructure/AzureTableServiceClientFactory.cs#L1-L36","documentation":"An InvalidOperationException thrown by AzureTableServiceClientFactory.Create when AzureTable:ServiceUri is present but is not an absolute HTTPS URI. The factory only supports token/managed-identity auth over HTTPS to the Azure Table service, so a relative URL, http:// URL, or non-URI string is rejected before constructing a TableServiceClient.","triggerScenarios":"Configuration sets AzureTable:ServiceUri to an http:// endpoint, a relative path, a connection string, or a malformed value. Uri.TryCreate with UriKind.Absolute fails or the scheme is not 'https'.","commonSituations":"Pasting a connection string into the ServiceUri key by mistake. Using http during local debugging (Azurite) instead of the connection-string branch. Typos like missing 'https://'.","solutions":["Set AzureTable:ServiceUri to a valid absolute https Table service URI (e.g., https://<account>.table.core.windows.net).","For local dev with Azurite, leave ServiceUri unset and set AzureTable:ConnectionString=UseDevelopmentStorage=true (the dev branch handles it).","Double-check there is no leading/trailing whitespace or missing scheme."],"exampleFix":"// before (config)\n\"AzureTable\": { \"ServiceUri\": \"http://127.0.0.1:10002/devstoreaccount1\" }\n\n// after (production)\n\"AzureTable\": { \"ServiceUri\": \"https://myaccount.table.core.windows.net\" }","handlingStrategy":"validation","validationCode":"var uri = configuration[\"AzureTable:ServiceUri\"];\nif (!string.IsNullOrWhiteSpace(uri)\n    && (!Uri.TryCreate(uri, UriKind.Absolute, out var u) || u.Scheme != Uri.UriSchemeHttps))\n    throw new InvalidOperationException(\"AzureTable:ServiceUri must be an absolute HTTPS URI.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use the https:// scheme for cloud Table endpoints.","For local dev, prefer the Azurite connection-string branch.","Validate URIs in a config-validation step at startup."],"tags":["azure-storage","configuration","deployment","azure-container-apps","validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}