Today Is an Important Day
Over the past few years, I've read a lot about Azure Static Web Apps, but I've never had a reason to create one. Mainly because I am a back-end developer but also because I haven't had a need for a web site in recent years. Well today that all changed.
I'd like to say my recent Azure experience has been excellent. Unfortunately, I can't. It started off on the wrong foot as my personal Microsoft account is associated with the tenant of a company from a former contract assignment. Microsoft support has been unexpectedly wonderful and very responsive assisting me on circumventing the situation to keep me moving. Thank you, Microsoft - Kashawn you've been amazing. As glorious as that has all been, it's delayed everything by at least a week and there may be more to be done.
The next hurdle I encountered was getting the build to succeed using GitHub Actions. The Azure extension in VS Code allows you to create a Static Web App. Part of the process is to automatically create the GitHub Actions workflow. Which is awesome. What isn't awesome is a cryptic error message in the build log:
The web site is a plain vanilla web site. No frameworks. Just plain HTML, CSS and JavaScript. Vanilla isn't exactly the hottest trend for web development frameworks lately. There is very little information or tutorials for deploying such a boring, simple web site to Azure Static Web Apps. "Could not detect any platform?" Of course not, there is no "platform" to detect. "Could not detect the language from repo?" What language? English?
Recommended by LinkedIn
Multiple internet searches came up empty. Even Stack Overflow didn't cough up a solution. After digging through the build log, buried in a flurry of warning and error messages is a tiny detail: failed to find default file. Oh, the default file MUST be named index.html or Index.html.
I've been around long enough to know, yes, it can be that simple. After renaming index.htm to index.html and pushing the commit, like magic, a successful deployment. Learning new things can be frustrating at times. Ask me how I know. I guess assuming the behavior of IIS allowing multiple default file names applies to Azure Static Web Apps is a really poor plan.
The backend API is an Azure Functions App with a single endpoint. The API will expand a little bit, however, the site is pretty basic at this time. A few changes to get the front-end to work correctly with the API and get the API communicating with the backend database and everything magically started working.
You might be wondering by now why today is so important? Deploying a Static Web App in of itself is inconsequential. Today is important because I've just published the first 3 web pages of the web site for my new business. The business launch date is getting closer, and I can't wait.
See you at the races!