nx-plugins
nx-plugins copied to clipboard
Add support for the new Azure Static Web Apps
Is your feature request related to a problem? Please describe. I'd like to help add support for the new Azure Static Web Apps
Check which provider is affected:
- [x] Azure
- [ ] AWS
- [ ] Google Cloud Platform
Additional context Checkout our samples repo here.
Not really familiar with Azure static web apps :) I am trying to understand what exactly the benefits are in comparison to static hosting and an azure function which can be already handled by nx-deploy-it
So currently I can already create a nx workspace with an angular app and nestjs as backend. Both are deployable with Nx DeployIt
- frontend with cdn
- backend as serverless function The only thing which is currently missing is the automated dependency (infrastructure urls) to each other. Means you need to deploy first the backend and use the created endpoint with the frontend.
How can a Azure static app help here? What makes it different?
Ok just read a bit more about it now and see some key features. Thinking about how this could be integrated...
Nx DeployIt is asking at the beginning (scan schematic) which application you want to integrate with infrastructure as code.
Option A: If you select minimum a frontend app with azure option we could ask him how to deploy it
- static hosting
- static web app
Option B: If you select a frontend and a backend app with azure option we could ask him to combine both as Static web app -> This way we have the full potential of the static web app with frontend and backend together
The next thing is that Nx DeployIt is working with Pulumi under the hood. Currently there is no Static Web App resource.
Here again 2 options:
Option A: Waiting for the support in terraform / pulumi
Option B: Writing our own Component / Custom Resources which is provisioning the Static Web App based on azure cli commands (if azure self already supports this -> i guess it's this one)
Azure Static Web Apps is still in preview. CLI support is not available yet (az webapp is another service).
Here are all the benefits of switching to SWA comparing to blob storage:
- Free web hosting for static content like HTML, CSS, JavaScript, and images.
- Integrated API support provided by Azure Functions.
- First-party GitHub integration where repository changes trigger builds and deployments.
- Globally distributed static content, putting content closer to your users.
- Free SSL certificates, which are automatically renewed.
- Custom domains to provide branded customizations to your app.
- Seamless security model with a reverse-proxy when calling APIs, which requires no CORS configuration.
- Authentication provider integrations with Azure Active Directory, Facebook, Google, GitHub, and Twitter.
- Customizable authorization role definition and assignments.
- Back-end routing rules enabling full control over the content and routes you serve.
- Generated staging versions powered by pull requests enabling preview versions of your site before publishing.
- and more
So, if you are using Plumi for Azure management, then you probably need to wait for them to add SWA support.
Cheers.
Than we have to wait a bit till Microsoft provides all the APIs to create this recourses.
After that terraform / pulumi is really quick to adapt and we can for sure integrate it in a beautiful way
We already provide the ARM template to create and manage your SWA instances. However, they are still in PREVIEW ;)
Preview is ok ;) but if you already provide an ARM template its perfect!!
We can use this resource from pulumi! https://github.com/pulumi/examples/blob/master/azure-ts-arm-template/index.ts
I think there is finally a solution in pulumi available
- https://www.pulumi.com/docs/reference/pkg/azure-nextgen/web/webapp/
@manekinekko Can you verify if this is the resource for a static web app?
@MitkoTschimev I don't so because we haven't published official ARM template for SWA yet. So this plugin might be creating a App Service.