Skip to content

Bad assumption in isCosmosEndpoint.ts makes it impossible to run azurite table service using custom ports. #32239

Open
@cognot

Description

@cognot
  • Package Name: @azure/data-tables
  • Package Version: 13.3.0
  • Operating system: Any
  • [* ] nodejs
    • version: 18.X
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
Since 13.3.0 and the introduction of the CosmoDB table support, it is impossible to start the azurite emulator on custom ports for the table service and make table access with a SAS key anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Start Azurite table service on a custom port (for example 20002)
  2. Instantiate a table client with a SAS key (note: in our case the SAS key was generated with a service that was still using @azure/[email protected])
  3. Try to use that client to access the table: you get a "AuthorizationPermissionMismatch" error.

Expected behavior
Accessing the table should match the authorizations from the SAS key.

Additional context
This happens because of this line:

if (parsedURL.hostname === "localhost" && parsedURL.port !== "10002") {

Which basically assumes that if this is not the default emulator port it must be CosmoDB...

In our local setup we have cases where we want to emulate locally our data separation in multitenant mode by accessing different azure storage servers depending on tenant. So we need to be able to run multiple azurite instances on custom ports to achieve that.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.TablesbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-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 team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions