This post was written by Sander Rodenhuis and Posted on 4 november 2017

Recently I was asked to host a web application in Azure Web App (PaaS). While configuring the Web App including using a custom Docker image, I ran into some issues. In this post I will share the problems issues I faced and the solutions to work around them.

Turn on Application insights after creating the Web App

I first tried to configure Web App using a Linux OS (then in preview). When wanted to do some diagnostics I couldn’t find any Available metrics. Strange? No, because I didn’t turn on application insights. When you create a Linux based Web App, you have to turn on application insights after the Web App is created. But when you create a Windows based Web App you can turn on application insights during creation. So be aware.

Configure a private registry for custom images

Docker images on Linux with only support specific versions, such as PHP 7.0 and Node.js 4.5. Web App for Containers uses the Docker container technology to host both built-in images and custom images. Custom images are useful when the built-in images don’t include your language of choice, or when your application requires a specific configuration that isn’t provided within the built-in images.

Because the vendor who developed the application used a Node.js version that isn’t supported, we used a custom image. We were going to use a private repository. There’s however currently a known issue with settings validation for certain registry providers and the overall UX is undergoing review.

The workaround is to create app settings keys (on the Application settings blade) called DOCKER_CUSTOM_IMAGE_NAME, with a value of the full image name. When you use a private repository you will also need to create the following settings:

DOCKER_REGISTRY_SERVER_URL

DOCKER_REGISTRY_SERVER_USERNAME

DOCKER_REGISTRY_SERVER_PASSWORD

Once you save the app setting, you should see your site update within a minute or two, depending on how large the image is.

There is also another way to do this: by using the Azure Resource Manager. Probably the easiest way is with Resource Explorer, which is also a great way to explore Azure resources in general.

  • Go to https://resources.azure.com and log in.
  • Using the search bar at the top, search for your site name, and select it to jump straight to it in the resource tree.
  • Under your site’s entry, drill down into “config”, then “web”.
  • At the top of the page, click “Read/Write” to allow changes.
  • Click the “Edit” button.
  • Add the required application settings
  • Click “Patch” or “Put” to save the changes.

A big thanks to Nick Walker from Microsoft for providing the workaround.