CORS Error when I query Azure ADT using Rest Api's.

Jithin J 1 Reputation point
2022-02-23T11:38:43.747+00:00

This is the error I am getting
Access to fetch at 'https://tagwaye-twin-instance01.api.wcus.digitaltwins.azure.net/digitaltwins/Molding?api-version=2020-10-31' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
231 questions
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,271 Reputation points
    2022-02-24T23:28:01.007+00:00

    Hello anonymous user-8890 Thanks for posting this helpful query on this forum.

    We have discussed this with Microsoft's ADT PG team and we have the below information! I hope this helps with your initial query!

    This is by design today, Yes, web apps are not supported against the DT APIs, due to CORS restrictions browsers impose.
    PostMan is not a webapp with cross-origin policies enabled, hence it works.

    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.