Welcome to my latest project adventure! Inspired by Gwyneth Pena-Siguenza’s video titled “4 projects to get Azure AZ-204 skills (cloud engineer)”, I embarked on a journey to develop practical knowledge for the AZ-204 exam. This project revolves around creating a custom Dockerized weather application. Using Node.js, Express, Docker, and Azure CLI, I delved into the intricacies of deploying containerized applications on Azure.

Project Overview:

The heart of this project is a simple weather app, designed to fetch weather data for a specific UK postcode using the OpenWeather API. While the app’s functionality may seem straightforward, its purpose lies in exploring the deployment of custom Docker images in Azure, serving as a hands-on learning experience for cloud engineers aspiring to master Azure technologies.

Development Process:

Following the footsteps outlined in GPS’s tutorial, I navigated through the development process. However, I deviated from integrating function apps and setting up a CI/CD pipeline, focusing solely on containerization and deployment. Challenges arose when implementing the Pug view engine in Express, prompting me to seek assistance from AI and online forums to grasp the intricacies of this templating language.

Technologies Used:

  • Node.js: JavaScript runtime for server-side development.
  • Express: Web application framework for Node.js.
  • Pug: Templating engine for generating HTML markup.
  • Docker CLI: Command-line tool for building and managing Docker containers.
  • Azure CLI: Command-line interface for Azure services.
  • Azure Container Registry: Private Docker container registry service.
  • Azure Container Instances: Azure service for running containerized applications.
  • Azure Web Apps: Platform-as-a-Service for hosting web applications.

Demo:

Webapp

https://personalporfoliostorage.blob.core.windows.net/personalportfolio-images/Weatherapp3.gif

Deployed in container Instance

https://personalporfoliostorage.blob.core.windows.net/personalportfolio-images/Weatherapp1.PNG

Deployed as an Azure webapp

https://personalporfoliostorage.blob.core.windows.net/personalportfolio-images/Weatherapp2.PNG

You can explore the code and configurations in my GitHub repository.

Code Highlights:

#Build and test image locally
docker build -t weatherapp . 
#I set node server to run on port 80 for this demo
docker run -p 80:80 weatherapp

#sign into azure container registry
docker login ryans1registry.azurecr.io

#tag container registery image
docker tag weatherapp ryans1registry.azurecr.io/weatherapp

#push image to container registry
docker push ryans1registry.azurecr.io/weatherapp

#deploy container instance
az container create -g rg-ContainerApps --name myweatherapp --image ryans1registry.azurecr.io/weatherapp --cpu 1 --memory 1 --ports 80 --dns-name-label "rali21weatherapptesting"

#deploy webapp from container image
az webapp create -g "rg-ContainerApps" -n "weatherapptestdeployv2" -p myweatherapp-asp  -i ryans1registry.azurecr.io/weatherapp

Conclusion:

This project has been an enriching experience, allowing me to deepen my understanding of Azure technologies and Docker containerization. While challenges were encountered along the way, overcoming them has only strengthened my skills and knowledge in cloud engineering. I invite you to explore the project, tinker with the code, and embark on your own journey of learning and discovery in the world of Azure. Thank you for joining me on this adventure! If you have any questions or feedback, feel free to reach out.

Resources:

projects/az-204 at main · madebygps/projects

Docker with Nodejs in 5 mins // Docker Tutorial

AZ-204: Implement Azure App Service web apps - Training

AZ-204: Implement containerized solutions - Training