Publishing Azure Functions to Azure using Visual Studio 2019

Krishna Kanhaiya
4 min readMay 3, 2020

Objective

In this blog we will be publishing a sample Azure Function to Azure using Visual Studio 2019. After completing the steps your function will be available globally and can be accessed using an URL.

Audience

I am considering that you have basic knowledge about Azure Functions and you have developed Azure Functions in past. If you have not please read how to create an Azure Function here.

Prerequisite

  • You should have Visual Studio 2019 installed on you machine
  • You should have an Azure Subscription

Publishing Azure Function

  • First, create an Azure Function by following the steps in this blog.
  • Right click on the project you want to publish to Azure and then click on Publish option in the menu
  • Click on Start button to open the following window, then select Create New option and click on Create Profile as given in the following image
  • Sign in or create a new account using the next window, I will be signing in as I already have an account with Azure
  • After Sign in it will take you to a window which will look like following image
  • Click on New link next to Resource Group Input box and give it a name. This will create a new Resource Group for us which will hold our Azure Function, if you don’t want to create a new Resource Group for Azure Function you can select one from the existing groups in the drop down
  • Select the Azure Region which is closest to you or to the user
  • Click on New link present next to the Azure Storage Input Box, this storage account will hold all our Azure Function code and additional files needed for Azure Function. Name of the storage should be unique in Azure, for more details on how to name storage account go to this link. After giving an appropriate name storage account click on OK button
  • Verify all the details on the following windows and click on Create button. This will create a publish profile for the Azure Function which we will be using for publishing our Azure Function to Azure
  • Once Visual Studio has completed creating a profile it will redirect to Publish window. The URL marked in the image will be used for triggering the Azure Function. Once you have verified all the details are correct on the following image click on Publish button to publish the azure function to Azure
  • Now you can open Azure portal at https://portal.azure.com/ and navigate to the Azure Function, the Function should look like following image. Verify the status of the Function, it should be Running

Test the Azure Function

Conclusion

We learnt how to publish an Azure Function to Azure using Visual Studio 2019. In the next blog I will demonstrating how to debug locally an Azure Function which is deployed to Azure.

--

--

Krishna Kanhaiya

Azure | .Net Core | C# | Javascript | Typscript | Angular | React Native | Docker | CI | CD| Learning and writing about Terraform