Skip to content

[BUG] TableClient.CreateTableIfNotExists uses wrong HTTP Verb (405) #48745

Open
@trondjun

Description

@trondjun

Library name and version

Azure.Data.Tables 12.10.0

Describe the bug

The TableClient.CreateTableIfNotExists function returns a 405 when trying to call the Storageaccount to set up a new table client.

Expected behavior

The expected behaviour should be to return the table.

Actual behavior

Throws an exception:

Azure.RequestFailedException
HResult=0x80131500
Message=Service request failed.
Status: 405 (The resource doesn't support specified Http Verb.)

Content:

UnsupportedHttpVerbThe resource doesn't support specified Http Verb.
RequestId:8ab81019-701e-0071-102e-9396a4000000
Time:2025-03-12T09:10:41.8509096Z

Headers:
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-error-code: REDACTED
x-ms-request-id: 8ab81019-701e-0071-102e-9396a4000000
x-ms-version: REDACTED
x-ms-client-request-id: be5ab76a-5a53-4293-88cf-6206a9ae4fbf
Date: Wed, 12 Mar 2025 09:10:41 GMT
Allow: REDACTED
Content-Length: 243
Content-Type: application/xml

Source=Azure.Data.Tables 12.10.0
StackTrace:
at Azure.Data.Tables.TableServiceClient.CreateTableIfNotExists(String tableName, CancellationToken cancellationToken)
at LoggingTester.Logger.AzureTableLogger..ctor(AzureTableLoggerProvider provider) in Y:\Skill\Borregaard\IntegrationPlatform\Logging\LoggingTester\LoggingTester.Logger\AzureTableLogger.cs:line 26
at LoggingTester.Logger.AzureTableLoggerProvider.CreateLogger(String categoryName) in Y:\Skill\Borregaard\IntegrationPlatform\Logging\LoggingTester\LoggingTester.Logger\AzureTableLoggerProvider.cs:line 28
at Microsoft.Extensions.Logging.LoggerFactory.CreateLoggers(String categoryName)
at Microsoft.Extensions.Logging.LoggerFactory.CreateLogger(String categoryName)
at Microsoft.Extensions.Logging.Logger1..ctor(ILoggerFactory factory) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.Extensions.Hosting.HostBuilder.<>c__DisplayClass36_0.<PopulateServiceCollection>b__2(IServiceProvider _) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.HostBuilder.ResolveHost(IServiceProvider serviceProvider, DiagnosticListener diagnosticListener)
at Microsoft.Extensions.Hosting.HostApplicationBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
at Program.

$(String[] args) in Y:\Skill\Borregaard\IntegrationPlatform\Logging\LoggingTester\LoggingTester.Web\Program.cs:line 35

Reproduction Steps

Created a new Storage Account in Azure, and used this code:

 public AzureTableLogger(ConfigProvider provider)
 {
     _tableName = provider.Options.TableNameForApp;
     _tableLoggerProvider = provider;

     _tableServiceClient = new TableServiceClient(new Uri(provider.Options.Url), new TableSharedKeyCredential(provider.Options.Url, provider.Options.Key));
     TableItem table = _tableServiceClient.CreateTableIfNotExists(_tableName);
 }

Environment

Running locally through Visual Studio 17.13.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Tablescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions