Deployment of Applications on Azure VM with CI/CD using github workflows
In this article, we’ll walk through the process of deploying applications to the Azure cloud using a Virtual Machine (VM) and a GitHub workflow for Continuous Integration and Continuous Deployment (CI/CD). This setup is a popular method for automating deployments, ensuring code quality, and reducing manual intervention during the release process. The diagram above illustrates the overall flow, from development to deployment
Here we will focus on deploying the application to an Azure VM. The VM acts as a server where the application is hosted. Once the deployment is completed through the GitHub workflow, the VM pulls the latest code, builds the application, and runs it. This can be done using tools like Docker to containerize the application
Steps to be Followed:
Note: While this guide assumes that you’ve already created an Ubuntu VM on Azure and set up SSH access using PuTTY, we won't cover those steps here, as there are many tutorials available on platforms like YouTube that explain the process in detail
With this automated process in place, any time new code is pushed to the specified branch, the workflow will automatically deploy the updated version of your Streamlit application to the Azure VM.
Note: for this use case I am going to deploy a streamlit application which will be accessible on port 8501
Conclusion
Deploying applications to the Azure cloud using a GitHub workflow and Azure VMs is a powerful combination for automating and managing your deployment pipeline. This is also a cost effective option when compared with the Azure web app services
This setup ensures that your code is consistently tested, deployed, and updated, reducing the effort involved in manual deployments and improving the overall reliability of your system.
With Continuous Integration and Continuous Deployment (CI/CD) in place, developers can focus more on building features while the pipeline takes care of the testing and deployment, making it easier to ship high-quality applications faster.