Chendrayan Venkatesan


Deploy multi-container apps in Azure web app

Pode | PowerShell | PSHTML | Azure Web App

Chendrayan Venkatesan

4-Minute Read



Cooking is my hobby, and I am interested in learning technologies. I am a great fan of Azure, PowerShell, Web-Framework, Serverless, DevOps, and Cloud Automation. Yes, I have no experience in developing web apps / glossy web pages for production use. But, nothing stopped me from building one for my learning. This blog post walks you through the steps to deploy a multi-container apps in the Azure web app. Yes, let’s make a static site for cooking. (Just a simple demo with no features / functional site)

In my future blogs, I continue to write about multi-container and enhance the site with additional features like

  1. Improvise the look & feel
  2. Adding database
  3. Improve the performance
  4. Follow Docker’s best practices.

And much more…


  1. Build two applications (REST API & Web Application)
  2. Dockerize the REST API & Web App.
  3. Deploy the multi-containers in the Azure web application using Docker-Compose

We build a site with a drop-down field, and its values are the output of the REST API (another container).

Why multi-container apps?

In my previous blog posts, a single container is in use for the demo. Using a multi-container, we can solve a few challenges. We build an API for the food menu and consume that in a web application for our demo. So, API and APP reside in two different containers. The advantages of it are as follows

  1. Scale the containers independently.
  2. Provide API for other teams with no higher loads on applications.
  3. Update the versions and maintain isolation.
  4. For a while, let’s don’t think about the networking core concepts. Docker-Compose handles it. If two containers are in the same network, they can communicate with each other.

Project Folder Structure

┣ 📂application
┃ ┣ 📂views
┃ ┃ ┗ 📜index.ps1
┃ ┣ 📜app.ps1
┃ ┗ 📜Dockerfile
┣ 📂products
┃ ┣ 📂routes
┃ ┃ ┗ 📜food-menu.ps1
┃ ┣ 📜Dockerfile
┃ ┗ 📜server.ps1
┣ 📜docker-compose.yml
┗ 📜readme.md

Application (Web Server)


Home Page (application/views/index.ps1)


function CustomCard {
    Param (

    Div -Class 'cell-lg-4' -Content {
        Div -Class 'price-item text-center bg-white win-shadow' -Content {
            Div -Class 'price-item-header p-6' -Content {
                Div -Class 'img-container rounded' -Content {
                    img -src $($ImageSrc)
                    Div -Class 'image-overlay op-green' 
return html -Content {
    head -Content {
        Title -Content "Az Container Apps | Home"
        Link -href "https://cdn.metroui.org.ua/v4.3.2/css/metro-all.min.css" -rel "stylesheet"
        script -src "https://cdn.metroui.org.ua/v4/js/metro.min.js"
    body -Content {
        (1..3).ForEach({ br })
        Div -Class 'container' -Content {
            h3 -Class 'Secondary fg-lightRed' -Content 'Colors of Cuisine...' -Style 'text-align:center'
            Div -Class 'row flex-align-center rounded' -Content {
                        CustomCard -ImageSrc $($_)  
            h3 -Class 'Secondary fg-lightRed' -Content $('Food Menu') -Style 'text-align:center'
            $items = Invoke-RestMethod -Uri 'http://colors-of-cuisine:3000/food-menu'
            selecttag -Content {
                foreach($Item in $Items.items) {
                    option -Content $Item.name
            } -name 'reason'

Application (application/app.ps1)

Start-PodeServer {
    Add-PodeEndpoint -Address * -Port 80 -Protocol Http
    Set-PodeViewEngine -Type PSHTML -Extension PS1 -ScriptBlock {
        param($path, $data)
        return (. $path $data)
    Add-PodeRoute -Method Get -Path '/index' -ScriptBlock {
        Write-PodeViewResponse -Path "index.ps1"

Dockerize (Dockerfile)

FROM mcr.microsoft.com/powershell:latest

WORKDIR /usr/src/app/

COPY . .    

RUN pwsh -c "Install-Module 'Pode' , 'PSHTML' -Force -AllowClobber"

CMD [ "pwsh", "-c", "cd /usr/src/app; ./app.ps1" ]

REST Application (REST API Server)


Route (products/routes/food-menu.ps1)

    items = @(
            name = 'Idly + Chutney'
            name = 'Dosae + Chicken Curry'
            name = 'Idly + Lamb Curry'

App (products/app.ps1)

Start-PodeServer  {
    Add-PodeEndpoint -Address * -Port 3000 -Protocol Http
    Add-PodeRoute -Method Get -Path '/food-menu' -ScriptBlock {
        Write-PodeJsonResponse -Value $( & .\routes\food-menu.ps1)

Dockerize (Dockerfile)

FROM mcr.microsoft.com/powershell:latest

WORKDIR /usr/src/server/

COPY . .    

RUN pwsh -c "Install-Module 'Pode' -Force -AllowClobber"

CMD [ "pwsh", "-c", "cd /usr/src/server; ./server.ps1" ]

Get on Action


  1. Multi-Container-Apps
  2. Using Docker Compose


Awesome, you have a PowerShell web-application up & running in Azure webn app as a Docker container. There are lot more coming up in future, please feel free to subscribe to my YouTube channel - iAutomate and follow me on twitter ChendrayanV

Say Something


Nothing yet.

Recent Posts



Dedicated IT professional with a history of meeting company goals utilizing consistent and organized practices, skilled in working under pressure....