Create a websocket server in Azure
Written by Bruce LANE on December 08, 2020
After being in training for Azure Administrator (AZ-104) and Azure Developing solutions (AZ-204), I want to have more experience for the exams which I failed, so I deploy my nodejs websocket server in the cloud.
I only need it running for a limited time within a month, so I tryed the most cost effective possibilities
First try: App Service
Using Visual Studio Code with the Azure App Service extension, I managed to deploy the app, with some fixes: I first used the Free App Service plan, which I had to upgrade to a Basic App Service Plan to be able to have a proper SSL certificate. I had to put on the Websockets and AAR parameters to make it work.
Unfortunately, my C++ app doesn’t connect in wss (like https but for websockets), but it connects using insecure ws.
Basic App Service Plan with B1 linux.
Second try: Virtual machine
In parallel, I setup a D2s v3 linux VM, which I can stop to lower the costs (consumption pricing option). Still uses an App Service Plan, Standard this time.
This time I started on the VM blade, choosing Continuous Deployment option. It uses the Azure DevOps CI/CD pipeline, which reacts to each git push event.
I will evaluate the costs after a month.
So far, the virtual machine experience is much better, more control on the process, ci/cd pipeline is done for you.