Hi @forestfire ,
Thanks for using Microsoft Q&A!
Yes, I believe your scenario is possible using the new Static Web app feature (Bring your own functions to Azure Static Web Apps) . You can create a scheduler using Azure Functions and connect it to Azure static web app by following the below steps. Keep in mind Bring your own functions (BYOF) is only available in the Azure Static Web Apps Standard plan.
Consider an existing Azure Functions app that exposes an endpoint via the following location.
https://my-functions-app.azurewebsites.net/api/getProducts
Once linked, you can access that same endpoint through the api path from your static web app, as shown in this example URL.
https://red-sea-123.azurestaticapps.net/api/getProducts
Both endpoint URLs point to the same function.
Before you associate an existing Functions app, you first need to adjust to configuration of your static web app.
- Set
api_location
value to an empty string ("") in the workflow configuration file. Make sure to set theapi_location
value to an empty string ("") in the workflow configuration file before you link an existing Functions application. - Open your Static Web Apps instance in the Azure portal.
- From the Settings menu, select Functions.
- From the Environment dropdown, select Production.
- Next to the Functions source label, select Link to a Function app.
- From the Subscription dropdown, select your Azure subscription name.
- From the Function App dropdown, select the name of the existing Functions app you want to link to your static web app.
- Select the Link button.
Hope that helps. Please let us know if you have further questions.
Best,
Grace