TABLE OF CONTENT
|3. Steps to create a Function App|
|4. Steps to create a Pipeline into the Function App|
|6. About CloudThat|
Serverless computing has answered many requirements like reducing administration of production workloads, refactoring an application into different individual independent functionalities, massively scaling with minimal downtime, and delivering quick services without the need to manage servers. Azure Function is a serverless offering from Azure, which supports different programming languages and various sources for the trigger.
Azure pipelines are used to automate the deployment process to accomplish your CI and CD needs.
- An active Azure subscription for creating a function app
- A GitHub repository with the code to deploy
- An Azure DevOps Organization, if you do not have any, you can create one for free
Steps to create a Function App
- Login to your Azure portal and Search for Function Apps. Click on create new.
- Give required fields like subscription, resource group, Function app name, runtime stack, and storage accounts.
- Wait till the deployment process is completed, once done click on Go to resource
Steps to create a Pipeline to build and deploy your code into the Function App
3. Go to project settings at the bottom of the navigation bar. Select service connection under pipelines. Click on new service connection → Azure resource manager → Service Principle(auto) → Under subscription scope gives your details and save it.
4. You can add the variables with the variable group in the library under pipelines which can be referenced inside the pipeline YAML file. You can add your Function App name as a variable and reference it while adding the deployment stage.
5. Go inside the project and navigate to pipelines and click on create a pipeline. Select GitHub and select repository, then it will ask you to authenticate your GitHub account. Select configure as starter pipeline.
6. You can add the different stages for build, test, and deployment. For each stage, you can define a job to run on a specific agent with steps required according to your application. Use the assistant showing on the right side for adding tasks like building the application, archiving the files, publishing the artifact to the pipeline, downloading the artifact from the building, deploying the application to the function app, etc.
7. You can use the Azure Functions template in the assistant to add your target function deployment step as a task
8. Once the YAML is ready click on Save and run, give a commit message, and run the pipeline. It will push the YAML file into the specified repository and trigger the pipeline to run
9. Verify that the pipeline job ran successfully and go inside and click on jobs to trace the tasks as it runs
10. Verify the deployment from the function app or get the function URL and verify through the browser
If you want to know more about Infrastructure-as-Code Pipelines in Azure here.
Based on your application and the DevOps tools you use, you can select among the wide variety of deployment strategies available in Azure DevOps. Azure DevOps can be extended to different target resources, and you can leverage the templates in your YAML. A proper Service Connection is required for the pipeline to authenticate to Azure.
CloudThat is the official AWS (Amazon Web Services) Advanced Consulting Partner, Microsoft Gold Partner, Google Cloud Partner, and Training Partner helping people develop knowledge of the cloud and help their businesses aim for higher goals using best-in-industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Explore our consulting here.
If you have any queries regarding Azure and Azure Functions drop a line below the comments section. I will get back to you at the earliest.
Q1. What is an agent in Azure DevOps?
A. An agent is an Infrastructure for computational needs for running the jobs during pipeline execution. You can use Microsoft-hosted agents to reduce your management workload or Self-hosted agents to gain more control over the agent.
Q2. What is a parallel Job?
A. A Pipeline can contain any number of jobs. Each job runs as a parallel job on separate agents, and if all parallel jobs are consumed, then the remaining jobs will queue up and run one after the other.