I have so many little side projects I want to complete, but one thing that has been bugging me lately is moving the #LAHistoricalMarkers backend off of #AzureFunctions and onto #AzureContainerApps.

The main thing I got out of #AzureFunctions was free service with the ability to scale up if the app ever got popular (it won’t, but yay free stuff). The downside is that the SDK is painful, especially for the isolated runtime, which was “recommended” when I kicked this project off.

Keep in mind, I’m coming from an #AspNetCore background, where there is robust support for common web scenarios. It was frustrating that basic things didn’t work out of the box with Functions (at least as of #net6).

The biggest example of this, is the absolute silliness that is the photo upload feature in #LAHistoricalMarkers. Support for a basic file upload seems like a must for any web-based platform, but in #AzureFunctions, there is no recommended approach. (To this day I am subscribed to a GitHub issue on the topic that has seen no meaningful movement in 2 years)

So what do we do in LAHM? Encode the image as a base64 string (after compressing the hell out of it so it doesn’t reach body size limits).

The result of this is that the photos of markers (a key feature in the app) look bad on larger devices.

So I’d like to be done with Functions. They were a fun little experiment, but they clearly aren’t ready for the most basic of web apps. And now we have container apps, which also scale to 0, include some free compute, and allow me to run full #AspNetCore.

So hopefully higher res photos are coming soon for #LAHistoricalMarkers. Although I haven’t published to the app stores in ages… 😬

If I am going to go full #AspNetCore via #AzureContainerApps, I’ll definitely have to spice it up somehow to keep it from being too close to the day job. Maybe it’s time to fiddle around with #FastEndpoints?

Yeah, I’m one endpoint in and this is going to be a huge improvement. The #FastEndpoints model maps really well over the existing structure of my #AzureFunctions (endpoint per file).

The authn and authz framework built into #AspNetCore also accommodates my super silly auth scheme really well.

And because request and response parsing are handled, its just less code overall!

Coming back around to this thread. The first few functions have been moved over to asp.net core and deployed to #AzurecContainerApp. I still need to get some of the configuration worked out so that it can talk to the production db, but #Swagger is there (another benefit of being in a full web server and not functions).

Lots of bonuses here, but my favorite is being halfway to fully automated deployments already (thanks to #Docker).

https://lahm-prod.blackbush-81e2bd05.southcentralus.azurecontainerapps.io

Swagger UI

An hour or so later, the baby is fed and fast asleep and I have fully automated deployments of the new backend. It was the Auth between GitHub Actions and Azure that tripped me up.

#AzureAD and BRAC are things I don’t touch very often in the day job. All our connections between services and azure were configured long ago.

So far this has been smoother than I could have hoped. I’m actually getting excited for the prospect of a #LAHistoricalMarkers mobile app release!

Still more functions to migrate over, but I got a little distracted with setting up the domain for the new #LAHistoricalMarkers api. So not only is it live, but you can view/interact with it via #Swagger at https://api.lahistoricalmarkers.com

#AzureContainerApps require manual cert uploads for setting up a custom domain, which I thought was going to be a deal-breaker. Enter the #OpenSource community with an #AzureFunction that automates #LetsEncrypt with #AzureDNSZones. Maybe this should be a blog post?

Swagger UI

It is complete. Both the web API and queue processors for #LAHistoricalMarkers have been moved from #AzureFunctions over to #AzureContainerApps!

Next up is probably attempting to automate my #Expo build with #EAS.

Check out the code on #github!

https://github.com/awebre/la-historical-markers

GitHub - awebre/la-historical-markers: LA Historical Markers is an iOS and Android app for exploring Louisiana's Historical Markers. The mobile app is built in Expo and the back-end is a combination of Azure Functions, MSSQL, and Azure Storage.

LA Historical Markers is an iOS and Android app for exploring Louisiana's Historical Markers. The mobile app is built in Expo and the back-end is a combination of Azure Functions, MSSQL, and Az...

GitHub