Digitaleclub
Best for you!

Building your first Azure Static Web App

One of the more interesting current Web development concepts is Jamstack. Popularized by Web application platform Netlify, it’s a Web application model that uses JavaScript, APIs, and Markup (hence JAM) to deliver static sites that aren’t delivered as server-generated dynamic content. The result is a low-impact way to deliver apps that are built externally and served up by a content delivery network like Azure’s or Cloudflare’s.

Jamstack: a new generation of static Web content

With Jamstack there are no dependencies on app servers or technologies like node.js. Instead there’s only standard markup that can be built and tested anywhere and pushed to your servers as you update both content and code. This model works well with modern, devops-driven build processes, fitting in with CI/CD (continuous integration/continuous delivery) platforms such as GitHub, where collaborative development can happen in code branches before pull requests populate a deployment branch and an automated deployment to your site host.

It’s an interesting and increasingly popular way to build apps. Although page code is static, its content isn’t; dynamic content is rendered locally using JavaScript with loosely coupled API connections to other services. For example, a static site could host an e-commerce store by using JavaScript to render catalog content retrieved by a RESTful query against a store service. There’s no direct connection between site and back end beyond the API call, and code in the page can detect errors and warn users. Decoupling Web and application like this, using well-defined APIs, allows application and Web development to work in parallel, simplifying development while increasing the speed of delivery.

That loosely coupled model makes a lot of sense when you’re thinking about adding front ends to cloud-native applications. Both front end and back end can scale independently, using low-latency metropolitan content delivery to cache markup near users, ready to take advantage of those CDN platforms’ cache tools to deliver Web applications to users without having to spin up multiple servers. If you’re using a service such as Azure, the model can offer significant cost savings, as well as reduce the lag between requesting and spinning up a host VM and delivering a response. As fast as Azure can be, it’s often still too slow to keep a customer engaged.

Introducing Azure Static Web Apps

Build 2020 saw Microsoft unveil its own platform for supporting Jamstack-style applications: Azure Static Web Apps. Available in preview, it brings together GitHub, Azure App Service, and Azure Functions in a single workflow, with a Visual Studio Code plug-in to drive development and deployment.

At the heart of the Azure Static Web Apps workflow are GitHub Actions, with a deployment action automatically created when you link your application repository to Azure. This action monitors a specific branch, and when commits are made to the branch it automatically runs a build and deploys the app to Azure. The same process runs when you merge a pull request.

Copyright © 2020 IDG Communications, Inc.

Leave A Reply

Your email address will not be published.