bagetter / BaGetter

A lightweight NuGet and symbol server
https://www.bagetter.com
MIT License
166 stars 38 forks source link

Incorrect AzureTable name when using a custom AzureTable name #157

Closed mbaksh01 closed 3 days ago

mbaksh01 commented 1 week ago

Describe the bug

When using a custom Azure Table name, the table is created on startup but when connecting to the table in the TableSearchService the wrong table name is used.

To Reproduce

Steps to reproduce the behaviour:

  1. Using the latest version of BaGetter.
  2. Run the project with AzureTable setup.
  3. When setting the table name property use any value other than "Packages".
  4. An error occurs immediately on startup.

Expected behaviour

This error should not be thrown and the correct table should be connected to and checked for values.

Screenshots

N/a

Additional context

Registering the TableServiceClient correctly creates the table with the right name, as shown below (line 30):

https://github.com/bagetter/BaGetter/blob/7c9f535e7bd6f49b49335de07e3aaa6ee3a0ecf6/src/BaGetter.Azure/AzureApplicationExtensions.cs#L25-L32

When using the TableServiceClient in the TableSearchService class, a TableClient is created but the table name used is a const string set to "Packages". See line 15 being used at line 27:

https://github.com/bagetter/BaGetter/blob/7c9f535e7bd6f49b49335de07e3aaa6ee3a0ecf6/src/BaGetter.Azure/Table/TableSearchService.cs#L15-L29

Therefore when any name other than "Packages" is specified the TableSearchService fails with a 404 Not Found from Azure.

FroggieFrog commented 3 days ago

This is fixed with version 1.4.3.