Sunday, June 30, 2019

Deploy Functional App to Azure Functional App Service - Part 2

This post explains how to create an azure function app service in Azure and deploy a .NET Azure function app, using Azure DevOps deployment pipeline to Azure. In the previous post Deploying Azure Function App with Azure DevOps - part 1 we have discussed how to create .NET function app and publish and generate the app package using Azure DevOps build. Let's discuss the steps to deploy the published function app package to the Azure function in this post.

Let's  get started.
  • Go to portal with Azure subscription credentials.
  • Select Create a resource then Azure market place pane will open
  • Find and click on Function App .


Function App service creation page will open.



1 - Give function app service name
2 - If you have multiple subscriptions, select the relevant subscription
3 - You can either create new resource group or use existing resource group
4 - Select OS. We are going to deploy a .NET function app.So select Windows as an OS
5 - Select Consumption plan which allows you to pay per execution and dynamically allocates resources based on the app's load.
6 - Select the Location of the data center you are planning to use
7 - We are going to deploy the .NET app. So select .NET as Runtime stack
8 - Let's move forward without changing Storage and App insights values
9 - Click on create button to create a Function App service


We have learned how to create an Azure Function App service.Now we can create an Azure DevOps deployment pipeline to deploy the functions app to Azure.

  • Go to Azure DevOps –>Releases
  • Create a release pipeline with Azure App Service Deploy task
  • We need to create a connection between published web app and deployment pipeline. So we add artifacts to the release pipeline.

1 – Click on add to add the new artifact
2 – We have published the function web app using a Azure DevOps build and added published web app as an artifact to build. So we select build as source type. Other than build, there are various source types available in Azure DevOps. You can integrate the Azure DevOps deployment pipeline with Azure Repos, Git hub, TFVC, Docker hub and more.
3 – Select the Azure DevOps project
4 – Select the build pipeline that we use to publish the function app
  • Next we can add values to each task and stages of the release definition

    Select Stage 1 of the release


1 - Select the Azure subscription and resource group
2 - Select App type from the drop down. we select function app on windows.
3 - Then you would be able to find App service names in the drop down .Select the relevant azure Functional app service name

Select Azure App Service Deploy task.


1 - Give the file path where compressed zip located
  • Save and trigger the release
  • Once release succeed, go to Azure portal Open the Function App service you have created.
  • Select the function we have deployed. You would be able to find all the deployed function apps under functions section.
  • Select the function app you want to access and click on Get function URL link to get the app URL.
  • Pass the function parameter values with URL and You can access the app
    .

In previous post we have learned how to create a published package for a function web app and this post explained how to deploy the web app to azure function app service using Azure DevOps pipelines.

No comments:

Post a Comment