When trying to call a remote Azure function from my client side, I get this error (URL censored):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://x.x.com (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
For testing purposes I have set CORS allowed origins in the portal to *
as shown below:
This is my client side code:
$.get({
url: "https://x.x.com",
crossDomain: true,
data: {
weight: weight,
height: height
},
success: function (data) {
console.log(data);
alert(data);
},
error: function(xhr) {
console.log("Error");
}
});
Could anyone point me in the right direction? Many thanks.