This post lets us learn how we can set up an end-to-end Azure DevOps CI/CD Pipeline for Python applications running on Azure Function App. This could be one of the simplest and fastest ways to set up your complete Azure DevOps Project. It will set up CI/CD Pipeline, Provision all Azure Resource, and deploying a simple python code to Azure Function. We will set this up using Azure DevOps Starter Project.
Azure DevOps CI/CD for Python on Azure Function
To get started, Sign in to your Azure Subscription and select DevOps Starter, and Create a New Starter Project. By default, “GitHub” will be set as the default connection. . Change the Connection Settings to “Azure DevOps” from “GitHub“.
Related Tip: Switch DevOps Starter between Azure DevOps and GitHub Action – Daily .NET Tips (dailydotnettips.com)
Firstly, Select Python application.
Secondly, choose “Simple Python App“, as application framework.
Thirdly, choose Azure Function App for deploying the application.
Finally, provide all the required information in the create service step, including Azure DevOps Project Name, Your Azure Subscription Name, and Function App Name. Then, Create the Project.
Honestly, that’s it. It’s as quick as it is.
The DevOps Starter Project will provision the Azure Function, Create the Azure DevOps Project, and set up the end-to-end CI/CD Pipeline. Following is the dashboard for Azure DevOps Starter Project.
Well, this dashboard speaks the volume of the heavy lifting work done in the backend. you can see, starting from creating Azure DevOps Project, CI/CD, Setting up Application Insights for Azure Function everything has been taken care of.
Review The Dashboard and Resources
Navigate through the dashboard, and start from the project dashboard. The DevOps Project, with all the services configured for you.
When you move to the “Repos” you will find the source code for a basic python http trigger pushed to Git.
The CI/CD Pipeline is completely configured, and it create a Stage called “Dev“. You can now extend it for other Stage.
If you dig into the build definition, you can see exactly what has been configured as Build Task to deploy the code into Azure Function.
Open the Azure Function App, to view the deployed Code.
Run the function and test it.
You can now configure your git source code to any of your favorite IDE, including Visual Studio Code, Visual Studio, and update and push the code. You don’t need to worry about anything else.
To summarize, the DevOps Starter project is beneficial to get started with setting up end to end CI/CD pipeline. For a complex project where deployment and build are more complex, this may not scale, but it will help you set up the complete project’s blueprint.
Pingback: Dew Drop – May 10, 2021 (#3439) – Morning Dew by Alvin Ashcraft
Pingback: La semaine dernière sur Microsoft Azure : semaine du 17 mai - Webhosting Review