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.
CORS issue on the Azure Table Storage APIs when calling table endpoints
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.
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.
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.
2 answers
Sort by: Most helpful
-
-
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.