Skip to content

Instantly share code, notes, and snippets.

@eimajtrebor
Last active October 3, 2022 05:41
Show Gist options
  • Save eimajtrebor/8565078bfdc351acac89b3afb771e87b to your computer and use it in GitHub Desktop.
Save eimajtrebor/8565078bfdc351acac89b3afb771e87b to your computer and use it in GitHub Desktop.
Running Nightscout on Azure App Service

Running Nightscout on Azure App Service

These instructions assume the following:

Create an App Service Plan

  • Create a new App Service Plan resource
  • Choose your Subscription
  • Create a new Resource Group
  • Give the App Service Plan a name
  • Select Linux as the Operating System (Windows should also work)
  • Choose a Region close to you
  • For Pricing Tier select F1 the FREE tier
  • Click Review + create > Create
  • Wait for the App Service Plan to be deployed

Create the Web App

  • Create a new Web App resource
  • Choose your Subscription
  • Select the Resource Group you created in the previous step
  • Give the instance a name (unique across the Azure platform) - https://<your-webapp-name>.azurewebsites.net
  • For Publish, select Docker Container
  • For Operating System, select the OS you chose for the App Service Plan
  • For Region, select the region you chose for the App Service Plan
  • Select your App Service Plan from the list
  • Click Next

Configure Docker

  • Select Single Container
  • Select Docker Hub as the Image source
  • Select Public as the Access Type
  • For the Image and tag use the following: nightscout/cgm-remote-monitor:latest
  • Optionally enable Application Insights (useful for troubleshooting)
  • Click Review + create > Create
  • Wait for the Web App to be deployed

Configure Nightscout

  • Once the Web App is deployed, go to Settings > Configuration
  • Add the Nightscout variables that you need as Application Settings
  • When you have added the variables you need, click on Save.
  • Additionally add the variable WEBSITE_PORT and set it to 1337
  • The service will restart at this point.
  • You should now be able to access your site at https://<your-webapp-name>.azurewebsites.net
@zhygis
Copy link

zhygis commented Sep 28, 2022

Hello,
Tested with linux - works fine, however with windows container had some issues, not investigated.
Thanx a lot for the solution, I will try to do something similar with static apps service
Regards,
Zygimantas

@eimajtrebor
Copy link
Author

eimajtrebor commented Sep 28, 2022

Thanks for testing it out!
I don't think the F1 tier on the Windows Plan supports Docker containers. You would have to select one of the paid tiers if using Windows.
Static Web Apps won't run containers, so that's out.
The other options are Azure Container Apps, Azure Kubernetes Service and Azure Container Instances. But all of those will incur cost.
Azure Container Apps might be worth a look as there is a free grant which may be sufficient to run a NS site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment