Musings of a trainer of geeks.

Starting a project for Azure Static Web Apps

A quick perusal of this blog shows how much I love Azure Static Web Apps, a wonderful service for hosting full-stack web applications. Static Web Apps uses Azure Functions for server-side code, and provides wonderful functionality including authentication. When it comes time to start doing local development, the initial setup can require a couple of steps as there’s a fair bit being provided to you by the service. I want to explore how to setup a project for Azure Static Web Apps. Continue reading

The importance of link text

Here’s a blog post about the word here. What we have here is an issue where here isn’t clearly defined. Here has lost all meaning here, and it’s hard to know where here is when here we use here to highlight things here, here, and here. I know what you’re thinking. I’m going overboard to try to make a point. You’re probably right. But it’s time we banish the word here from our link text, here an now. Continue reading

Python Type Hints

I was on a community call on the Microsoft Python Discord channel when I was asked what my favorite new feature for Python was. My answer was immediate - “Type hints, type hints, type hints”. I find questions like this make for great blog posts, so let’s give it a whirl! The problem Before we get into type hints and why they’re so amazing, let’s explore the problem space. Let’s say I’ve created the following function: Continue reading

Deploy Astro sites to Azure Static Web Apps

There’s been a push of late to limit the amount of JavaScript sent down to the client as part of single-page or static web applications. I for one welcome this shift, as it means we as web developers are listening to the needs of our users, who don’t have limitless bandwidth or computing power. Sites load faster, scale better, have decreased load, consume less resources, help with climate change… It’s goodness all around. Continue reading

Configuring authentication in Azure Static Web Apps

Azure Static Web Apps is a fantastic Azure hosting service designed for full-stack (sometimes called static) applications. Among the various features offered is built-in authentication for Azure Active Directory (AAD), GitHub and Twitter. No additional actions or configurations are required to use these providers; they’re available out of the box! To support this, three routes are added to every static web app - /.auth/login/aad, /.auth/login/github and /.auth/login/twitter for AAD, GitHub and Twitter respectively. Continue reading

Deploying SvelteKit apps to Azure Static Web Apps

Note: SvelteKit is currently in early development. As such, things may be different than the post below. This post was lasted updated on 18 May 21. SvelteKit is a framework built on top of Svelte, my current favorite front-end framework. Svelte is based around svelte files which closely resemble standard HTML/JavaScript files, making it feel rather natural. SvelteKit is designed to enhance the Svelte development experience by providing bootstrapping, a build/dev toolkit, a routing engine, and server-side rendered pages. Continue reading

Troubleshooting Azure Static Web Apps

Azure Static Web Apps is probably my favorite product Microsoft has released since Visual Studio Code. It’s built for “static web apps” (ones where you rely quite heavily on client-side code, such as blogs, single page apps, or other “modern” web apps), and offers integration with GitHub and the workflows you’re already using. But, as everyone knows, when deploying your application things may not go exactly as planned despite our best efforts. Continue reading