Describe the bug
When debugging locally a combination of a azure function/durable task and a front end application. If I want to track the progress of my task in the front end application, it is not possible because the durable tasks extension doesn't handle CORS request, so the browser will block any request to the statusQueryGetUri and other URIs
Investigative information
To Reproduce
Steps to reproduce the behavior:
//fetch request to the function getting the status response
await fetch(status.statusQueryGetUri);
Expected behavior
fetch request to succeed when debugging locally.
Actual behavior
Getting CORS error messages in the console
Access to fetch at 'http://localhost:7071/runtime/webhooks/durabletask/instances/3e0095001e644680873312373400cb68?taskHub=DurableFunctionsHub&connection=Storage&code=r3IuoMv54hcP4ULprjOIBJvvnVxbN54s7asAtczw77fStYZbIMo4ug==' from origin 'https://baywet.sharepoint.com' 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.
When running locally, the Azure Functions Core Tools allows you to specify CORS configuration in either the command-line or in the local.settings.json file, as described here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#local-settings-file. Does doing this unblock your scenario?
Thanks! I had somehow not come across that in my searches. Closing.
Most helpful comment
When running locally, the Azure Functions Core Tools allows you to specify CORS configuration in either the command-line or in the local.settings.json file, as described here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#local-settings-file. Does doing this unblock your scenario?