Open philinthecloud opened 3 years ago
That is correct, if you'd like to use triggers other than httpTriggers you will need to use an existing function and link them.
So I have successfully deployed a Blazor WASM app as an Azure Static Web App and linked it to a separately deployed Durable Functions Workflow. From the Blazor App I can successfully start a workflow. I know this because a standard response is returned with the various Uri's for querying and stopping the workflow. Also I can see the activity in the Overview of the Azure Portal.
When I try to access the statusQueryGetUri
of the Durable Functions Workflow from a normal browser window I get a Bad Request response which I assume is because the request is not authenticated.
When I try to access the statusQueryGetUri
from my Blazor App using a relative Url (i.e. from /runtime...
I get the error We couldn’t find that page, please check the URL and try again.
.
When I try to access the statusQueryGetUri
from my Blazor App using a fully qualified Url (i.e. from https://...
the Blazor App bombs with a CORS error.
Is it possible any url from /runtime
is blocked by Static Web Apps?
Are your function paths prefixed with /api? Calls to the function must start with /api in order for us to recognize that call as a function request
Well the out-of-the-box status calls such as /instances
sit under the runtime/webhooks
route but I was able to get this working by adding my own HttpTrigger
ed function under api/
which calls methods such as IDurableOrchestrationClient.GetStatusAsync()
. It's a little inconvenient to have to do this though.
Ah yes, I can see how this is an issue. Other triggers such as Event Grid and SignalR that rely on those webhook endpoints are also affected.
Describe the solution you'd like I would like my Blazor WASM front end to be able to call an Azure Durable Functions backend when deployed to Static Web Apps. This would allow me to quickly build small robust workflows with a web interface.
I have tried this and get the following error:
Error in processing api build artifacts: the file 'ConvertToXlf/function.json' has specified an invalid trigger of type 'activityTrigger' and direction ''. Currently, only httpTriggers are supported. Visit https://github.com/Azure/azure-functions-host/wiki/function.json for more information.
Describe alternatives you've considered Perhaps I can work around this by calling this particular activity function as an external "third party" endpoint from my durable functions workflow but it would be great if there were a simpler option.
Now reading about linking an existing Functions service with my static web app.