0

We have a gatsby Azure SWA running on port 8000 and a separate functions App running on port 7071 (Functions app not part of the SWA). Have the latest static-web-app-cli and have been using the following command for proxying function calls with no issues.

swa start http://localhost:9000 --api-location http://localhost:7071

Recently we added non HTTP triggered functions to our functions app and this caused the following error with swa start in the dev environment (works fine in production when deployed)

Function app contains non-HTTP triggered functions. Azure Static Web Apps managed 
functions only support HTTP functions. To use this function app with Static Web Apps, 
see 'Bring your own function app'

We are already using the 'Bring your own function app' as our functions app is a separate app and not part of SWA. How can I get the non-HTTP functions working locally for debugging with our static web app? Thank you

WiredEntrepreneur
  • 101
  • 1
  • 1
  • 8
  • Have you tried adding your azure existing function app to the SWA instance in the azure portal (ref - https://learn.microsoft.com/en-us/azure/static-web-apps/functions-bring-your-own#link-an-existing-azure-functions-app) –  Dec 23 '21 at 15:31
  • Yes, the functions app has been added to our SWA on the portal and production deployments work with no issues for all functions (HttpTrigger or non HttpTrigger). The issue is only with debugging in the dev environment. – WiredEntrepreneur Dec 23 '21 at 15:38

1 Answers1

0

non-HTTP functions working locally for debugging with our static web app?

We cannot access functions via non-HTTP endpoints in a static web app.

The static web app has some restrictions to link an existing azure functions app which follows;

Restrictions

  • Only one Azure Functions app is available to a single static web app.
  • The api_location value in the workflow configuration must be set to an empty string.
  • Only supported in the Static Web Apps production environment.
  • While your Azure Functions app may respond to various triggers, the static web app can only access functions via Http endpoints.

Refer here for more information

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15