Skip to content

[BUG] Index was outside the bounds of the array. #53463

@vsag96

Description

@vsag96

Library name and version

Azure.Data.Tables 12.9.0

Describe the bug

We're current trying to use the cosmosdb emulator and in production we use the following constructor: azure-sdk-for-net/sdk/tables/Azure.Data.Tables/src/TableServiceClient.cs at 0c36268aa19fd9f52f483013ee05266330e386e2 · Azure/azure-sdk-for-net. So, when we're using the constructor for the cosmos db emulator we generate the parameters from the following connection string: "DefaultEndpointsProtocol=http;AccountName=localhost;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;TableEndpoint=http://localhost:8902/;". 

The uri for the constructor is http://localhost:8902/, the credential is created using the following constructor new TableSharedKeyCredential(localhost, C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==). The creation of TableServiceClient fails with the following exception. Can you please help us to understand what we're doing wrong? We're using the nuget with version 12.9.0. Let me know if you need any other information. 

System.IndexOutOfRangeException
  HResult=0x80131508
  Message=Index was outside the bounds of the array.
  Source=Azure.Data.Tables
  StackTrace:
   at Azure.Data.Tables.TableConnectionString.GetSecondaryUriFromPrimary(Uri primaryUri, String accountName) in //sdk/tables/Azure.Data.Tables/src/TableConnectionString.cs:line 386
   at Azure.Data.Tables.TableServiceClient..ctor(Uri endpoint, TableSharedKeyPipelinePolicy policy, AzureSasCredential sasCredential, TableClientOptions options) in /
/sdk/tables/Azure.Data.Tables/src/TableServiceClient.cs:line 308
   at Azure.Data.Tables.TableServiceClient..ctor(Uri endpoint, TableSharedKeyCredential credential, TableClientOptions options) in /_/sdk/tables/Azure.Data.Tables/src/TableServiceClient.cs:line 183
   at Cis.DataAccess.Tables.TableClientFactory.CreateTableServiceClient() in Q:\src\cis-pfm\src\Cis\DataAccess\Tables\src\TableClientFactory.cs:line 67
   at Cis.DataAccess.Tables.TableClientFactory.CreateTableClient(String tableName) in Q:\src\cis-pfm\src\Cis\DataAccess\Tables\src\TableClientFactory.cs:line 51
   at CosmosTables.Program.Main(String[] args) in Q:\source\CosmosTables\Program.cs:line 17

Expected behavior

Create a table service client that could be used to interact with local cosmos emulator.

Actual behavior

Throws exception shown in description.

Reproduction Steps

Try creating the table Service client with the parameters shows in the description you can see the bug.

Environment

No response

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageTablescustomer-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