Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks
cognot opened this issue Dec 16, 2024 · 3 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Tables

Comments

@cognot
Copy link

cognot commented Dec 16, 2024

  • 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.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Tables labels Dec 16, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @klaaslanghout.

@jeremymeng
Copy link
Member

@cognot thanks for reporting the issue! I think we could probably check whether the url contains "devstoreaccount1" to determine if the endpoint is for tables

@jeremymeng
Copy link
Member

Azurite also supports custom storage accounts, so we may need to check account name against AZURITE_ACCOUNTS env variables.

@jeremymeng jeremymeng assigned jeremymeng and unassigned joheredi Dec 16, 2024
@jeremymeng jeremymeng added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Tables
Projects
None yet
Development

No branches or pull requests

3 participants