All posts by Joe Cummins

Founder of qrap.io?

Another long weekend, wrapping up a public project on GitHub. As part of my “trying new stuff” effort, I decided to add a small React application to the QR Azure Function I released a few weeks ago.

Azure has a Static Web Application that is designed to work with their Function APIs. My goals were to create a simple application that can create both Url and WiFi QR codes. This application had to be fully automated from GitHub and be cheap to host. The outcome is available at https://qrap.io/

I didn’t get everything right. I didn’t include the service as a Managed API so I had to sort out the CORS issue. I was trying to keep the download package small so I used HTML validation and it’s pretty “meh”. I also skimped on the graphics and the “menu” is questionable at best. That said, it works fairly well and someone may find the app or the project helpful.

Failing on Purpose

I failed a test in public today.  Technically, my build on a public repository was set up to fail.  I wanted to see what happens when non-passing code ends up getting checked in.

Failed GitHub Action

One of the many cool things about hosting a project on GitHub is that they have a simple process for setting up automated builds.  One step of building should be running the tests included in the solution.  For the QR project I posted on GitHub to test actions (https://github.com/zimjoe/QRAzureFunctions/wiki) I added tests to check all the validation.

Setting up this step on a GitHub action is very simple.  With one line of YAML, you can kick off the tests. Full source located here: https://github.com/zimjoe/QRAzureFunctions/blob/main/.github/workflows/main_joesazurefunction(integration).yml

- name: Test
run: dotnet test --no-restore --verbosity normal

Now, I don’t have to worry about breaking something I thought to write a test for.  Now I just have to worry about all the stuff I didn’t think of.

QR Code Generator on Azure Functions

At my new position they are moving to a micro services infrastructure using Azure Functions.  I figured I had better get up to speed on all things Azure Functions.  I built a few sample projects on my computer, but that doesn’t show me what is looks like in “real life”.

This project started as a simple Azure function to test deployment processes from GitHub Actions and kind took off from there. There are still places in the namespace that refer to AzureFunction and I may go back and refactor that at some point. Since this started as a test, I just jammed all the code in a single project for simplicity’s sake.  That said, it seems like Microsoft wants functions to be small instead of big “Clean” multi projects affairs.

The rest of the project just sort of happened like in the book “If you give a Pig a Pancake”. (Once he had a pancake, he wanted syrup and it keeps going from there)

The generator lives on my development account on Azure. You can test it below. Feel free to make some QR codes until my budget for the month runs out.

WiFi Generator


GET
https://joesazurefunction.azurewebsites.net/api/WifiQR?wifiname=GuestsAndRandos&passcode=DontStealMyWifi

POST
// post to https://joesazurefunction.azurewebsites.net/api/WifiQR
// body
{
WifiName: "GuestsAndRandos",
Passcode: "DontStealMyWifi"
}

Url Generator


GET
https://joesazurefunction.azurewebsites.net/api/UrlQR?Url=https://github.com/zimjoe/QRAzureFunctions/wiki

POST
// post to https://joesazurefunction.azurewebsites.net/api/UrlQR
// body
{
Url: "https://github.com/zimjoe/QRAzureFunctions/wiki"
}

Read more at the wiki for the project: https://github.com/zimjoe/QRAzureFunctions/wiki

Font Awesome is Awesome!

I recently received news that Font Awesome version 6 is on it’s way.  I pay for the Pro version of the library despite the fact that I am not a visual designer.  In fact, most of my design work has been described as “not offensive” and sometimes I hit “looks alright”.  Font Awesome makes it possible for me to stretch some custom elements up to the “better than alright” level.

Years ago, I designed a farmer’s market application for a company called Lulu’s Local Food.  Part of setting up a farm is the ability to pick the colors and upload the header graphics.  Since I have no control of the color scheme it was always difficult to make custom buttons and icons.

Color Chooser
Choose your color and kill my dreams

In the first version of the platform, I used graphics with partial transparencies and would flip the graphic from light to dark based on the numerical value of the background color.  It didn’t “look terrible”, but it was always a challenge to make the sites look good.

Then I discovered Font Awesome and it literally changed my life… or at least the site.  Now it was possible to create icons and menu items that could track all the color changes made by the users.  These icons have the added benefit of being awesome!

Color Header
The header with the chosen colors

 

Visual Studio on Azure Part Deux

The Visual Studio 2019 virtual machine install could not have been easier. I took the easy route and installed it from the packages available in the market place. This article was a good read to point me in the right direction: https://buildazure.com/2017/03/07/visual-studio-2017-development-using-a-vm-in-azure/

Once the VM was installed, I added a rule to the firewall that allows access over port 3389.  This setting is located in the Network Security Group; if you let Azure name everything it will be the name of the server with “-nsg” at the end.  Look for Inbound Security Rules.  I locked this access to the static IP address at my house.  I also set it to the highest priority.

Open Port 3389
Firewall Settings – Open Port 3389

Since I only have the MSDN Professional subscription, I installed the Community version of the VM.  Using the Visual Studio installer, I installed Pro and uninstalled Community, since I only need one version of Visual Studio.

Changing Visual Studio version
Changing Visual Studio version

After everything installed correctly, I connected to my Azure Dev-OPs instance and started getting busy.  I have a few ideas for products I want to make.

Starting a new project
Starting a new project

The entire process took a bit over an hour.  Most of that was waiting for installs of servers and software.  Now that the machine is set up, I probably won’t need anything new for a while.  From an installation time perspective, this was much faster than setting up a Linux server and building Virtual Machines from install media.

Over the next few weeks, I’ll report back on performance and price compared to using a server here at the house.

Visual Studio on Azure

small server and parts collection
small server and parts collection

For years I have maintained my own Linux servers at home running Fedora with KVM. Each server is a pretty beefy AMD machine with as many processor cores and as much memory as I could afford. On each, I set up a few development servers for both .net development and running MS SQL Server. I still have all of them. Only two (the black gaming cases) are currently running, but If I want to go back and do some development on Windows 2003. I can just fire up that pink box and I’m off to the races.

There are tons of advantages to running your own servers. The first is that you know how to set-up servers and you can use all those licenses in your MSDN subscription. The second is that you can say things like KVM, network bridge, QEMU and not sound like a doofus. I can go on about the cool factor of running your own virtual host, but most of it doesn’t really matter. The main reason to have servers is that you are not developing on your desktop.

Your work lives in a protected environment away from your email and video gaming. Windows 10 now likes to reboot quite a bit and I hate being interrupted. You can tell a server to never reboot and it will listen to you. I could leave Visual Studio up for weeks at a time and always come right back to where I was last working.

The downside to all this is the growing junk collection and having to maintain it all.  I would love it if I could set up a server on Azure and just do my work there.  I already use their source control and production hosting services.  Having it all there would be nice as long as it doesn’t cost me an arm and a leg.

Over the course of the next few weeks, I am going to be exploring what it takes to use Visual Studio on Azure, how well it works for web development and how expensive it can be.