Do you develop and deploy cloud-ready applications frequently? Then you encountered various challenges,
like version controlling, source code management, etc.
Today’s developers use open-source software like GitHub for source code management and Microsoft Azure DevOps to plan, build, test, and deploy cloud applications. Indeed, this is the perfect combination to help you go smoothly as an application developer.
“DevOps, Azure Pipelines, and GitHub – The three fundamental platforms most developers use to manage the application development lifecycle.”
Developing on Azure necessitates meticulous planning and accurate implementation. With the proliferation of GitHub integration and DevOps cloud development tools, it’s easy to streamline the development process.
Does all of it sound confusing?
Start exploring this article, describing suitable methods to build, test, and deploy web applications and app services using Azure and GitHub. Later, explore GitHub Codespaces, develop applications, run unit tests, use multi-stage Docker Images, use the Azure Container Registry (ACR), and deploy the application into an Azure App Service. Finally, get your hands on GitHub Actions to automate CI/CD delivery pipelines.
So let’s get started..!!
Azure DevOps Overview
DevOps is Microsoft’s latest cloud-based platform, providing various developer tools to help professionals manage the application development lifecycle. It includes impressive features such as code management, continuous integration, continuous delivery, project boards, work item management, collaboration dashboard, Azure Pipelines, Azure Repos, and many more.
As the primary component of DevOps, Azure Pipeline enables developers to automate various application build and test processes. The best part is; DevOps includes GitHub, which allows the developers to host multiple software development projects from a single place and perform version control with the help of collaboration tools.
Prerequisites To Get Started As An Azure Developer
- Register with a valid Microsoft email address to open an Azure account.
- Create a Gitbhubn GitHub account online
- Access to GitHub Codesspaces through your IDE
- You can run “Go” and “Docker” locally
- Use Azure CLI to use deployment tools on the cloud
Creating Customizable Workspace With GitHub Codespaces
GitHub Codespaces is a dedicated cloud-based development environment for registered GitHub users. It provides application developers with a fully configured and customizable cloud workspace. So no need to create a work environment on your local desktop.
Instead, you can log in to your GitHub account to access custom-created workspaces on GitHub Codespaces. Each workspace has a GitHub archive repository, so you don’t lose any critical development activities. You get a consistent development environment that the entire team can share!
Creating a Web App Server on Azure
Now, let’s create a simple Azure web app that returns a “Hello, World!” message to the viewers:
- Create a new project file directory.
- Use your IDE to create the “main.go” file in the project directory.
- Write the deployment code with func main() into the main.go file.
- Save the code file to start your unit testing.
- Run unit tests by putting necessary input parameters to create the Azure app for the web.
If you don’t know how to run unit tests on the web server application, follow the below steps:
- Create a new “main_test.go” file in the existing project directory.
- Create test cases with a function as func TestHandler(t) into the main_test.go file.
- Mention how to handle test case exceptions if the script fails to deploy the web app.
- Save the file with the freshly-written test cases.
- Execute the “go test” command to perform unit testing.
Build Applications into A Docker Image with Azure DevOps
Have you ever built the Azure web app into a multi-stage Docker Image? A multi-stage Docker Image has the accessibility of multiple Docker containers. So Docker Images can perform different stages of the web application build process. Here are the steps for you:
- Create the “Dockerfile” in your file directory.
- Write the code to build the stage file into the Docker file.
- Run the “go build -o server” code in the final stage.
- Save the code file to execute.
You can custom-build the Docker Image while using GitHub actions checkout in the project directory.
Storing Docker Images In Azure Container Registry (ACR)
Now you know that Azure DevOps can use various open-source software like GitHub, Docker, etc. So once you create a Docker Image, you can re-use the same image with the Azure Container Registry (ACR). ACR stores all your Docker Images and manages other Docker registry services. Try out this feature with these steps:
- Use your Azure account to access the Azure Portal.
- Navigate to the Azure Container Registry page.
- Create a new Container Registry using the correct prompts.
- After creating the Container Registry, navigate to the Access Keys page.
- Remember the Login Web Server, Username, and Password values.
You can easily log in to the Azure Container to access, modify, manage, and deploy Azure app service and other Azure resources using Docket Images.
Deploying Web Apps into Azure App Services
Azure App Services enable application developers to create web applications, mobile app backend links, and interactive RESTful APIs. You can follow the below steps:
- Use your Azure account to Log in to the Azure Portal.
- Navigate to the App Services page.
- Create a new App Service by following the prompts.
- Navigate to the Container settings page.
- Click on “Configure Container” and select “Azure Container Registry.”
- Enter the Login Web Server, Username, and Password values.
- Select the intended Docker Image to deploy.
- Click on “Review and Create” to deploy the Docker Image.
Automate Delivery Pipelines Utilizing GitHub Actions React Native
GitHub Actions is the best platform to automate various workflows related to cloud application builds. If you want to try out GitHub, follow the below steps:
- Log in to your GitHub account and navigate to your code repository.
- Create a new file called “.github/workflows/main.yml” in the repository.
- Create jobs into the main.yml file and save it.
- Push your changes to GitHub and wait for completion.
- Initiate the Gitbhubn workflow to trigger deployment.
Now you know how to use GitHub and Azure to build, test and deploy cloud applications and app services. You have a clear overview of Azure DevOps, Azure Pipelines, Docker Images, and GitHub. So get started with GitHub Codespaces to create and deploy web apps, function apps, and more. Custom-create Docker images for deployments, Also, use GitHub Actions to manage the delivery pipeline smoothly! By leveraging these tools, you can build cloud applications with ease and confidence.