Needs help: Deploying redwood graphql function to Azure function app

Context
I am building up on the following two discussions:

Goal
I want to deploy my redwood app similar to the serverless deployment for AWS to the matching services on Azure. This would be Lambda → Azure function app and S3/Cloudfront → Azure static web app

What did I manage to do
I set up an example repo here: GitHub - tilmann/rw-deploy-to-azure

It deploys the frontend to the static web app :tada:: https://yellow-meadow-0ef970b03.2.azurestaticapps.net

And the backend via the azure cli to https://sls-weur-dev-simpletest.azurewebsites.net/api/

There you can find 3 endpoints:

You can find the files that are deployed in directory api/deployment.

What is the idea and what is missing
My idea was to write a wrapper function that takes the request that is send to /api/graphql and convert it to a Lambda structure. Currently this lambda structure is used inside redwood (redwood/graphql.ts at 97c36e1de6ed3579056aedaf6c0076fdff550c4a · redwoodjs/redwood · GitHub).

How to deploy
This is done in a manual way in the moment:

  1. To build it I am running yarn redwood deploy serverless --pack-only to get the packaged code.
  2. Then I copy the wrapTest.zip from api/dist/zipballs and extract it into the folder deployment.
  3. There I overwrite the content in api/deployment/graphql with the extract from wrapTest.
  4. The I zip in deployment the folders yoga, goodbye and graphql and deploy the zipped file Archive.zip.

Conclusion
I made good progress but it seems like in the end the packaging of the request is not working. Therefore the error message that can be seen here: https://yellow-meadow-0ef970b03.2.azurestaticapps.net/
I have the feeling it is not a lot missing to get this running. The example yoga functions shows that it should work like charm.

What would be next steps
It would be super helpful if someone who has the knowledge to build a prototype version of redwood that can run on azure based on the functions mentioned above or if someone could fix my wrapTest function so it would work with the existing graphql structure. Then we could solve it via the build.

I hope someone can build up on this and together we can figure this out. I am happy to provide more information if anything is missing or invest more time to try out ideas.

3 Likes