CORS issue on the Azure Table Storage APIs when calling table endpoints

Elio Struyf 21 Reputation points MVP
2025-01-29T11:26:52.5666667+00:00

For one of my projects, I'm aggregating information in the browser and have to push metrics to Azure Table Storage. For this, I use the @azure/data-tables dependency and a SAS token.

On the Azure Storage Account, I enabled the CORS settings to allow any endpoint described in the @azure/data-tables dependency documentation.

eliostruyf-2025-01-29-12.20.47

The API calls to the https://<account>.table.core.windows.net/Tables endpoint work fine. I am able to create my new table or verify if it exists.

When I try to create, update, upsert, ... a record. That is where it goes wrong. Then I receive CORS errors.

enter image description here

I'm guessing there is something wrong or the CORS settings are not propagated to the table API endpoints. Is there a way to get this fixed?

PS: Nothing is wrong with the API call itself, as I tested it out via Postman and the records are created successfully.

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
176 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Elio Struyf 21 Reputation points MVP
    2025-01-30T13:57:55.2+00:00

    The issue was related to the browser extension host that was not able to call the API. For some reason, it only works on the Table API. Moved the API calls to the background service worker and added the extension ID to the CORS-allowed origins. That made it work.

    0 comments No comments

  2. KarishmaTiwari-MSFT 20,472 Reputation points Microsoft Employee
    2025-01-30T21:38:22.7533333+00:00

    @Elio Struyf I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

    Issue: CORS issue on the Azure Table Storage APIs when calling table endpoints

    Solution: Customer shared - "The issue was related to the browser extension host that was not able to call the API. For some reason, it only works on the Table API. Moved the API calls to the background service worker and added the extension ID to the CORS-allowed origins. That made it work."


    If your issue remains unresolved or have further questions, please let us know in the comments how we can assist. We are here to help you and strive to make your experience better and greatly value your feedback.
    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.