How to do it...

Perform the following steps:

  1. Right-click on the project and then click on the Publish button to open the publish window.
  2. In the Publish window, choose the Create New option and click on the Publish button, as shown in the following screenshot:
  1. In the Create App Service window, you can choose from existing resources, or click on the New button to choose the new Resource Group, the App Service plan, and the Storage Account, as shown in the following screenshot:
  1. In most of the cases, you are best off going with the Consumption plan for hosting the Azure Functions, unless you have a strong reason not to, and would prefer to utilize one of your existing App Services. To choose the Consumption plan, you need to click on the New button that is available for the App Service plan, as shown in the preceding screenshot. Select Consumption in the Size drop-down menu, then click on the OK button, as shown in the following screenshot:
  1. After reviewing all the information, click on the Create button of the Create App Service window. This should start deploying the services to Azure, as shown in the following screenshot:

  1. If everything goes fine, you can view the newly created function app in the Azure Management Portal, as shown in the following screenshot:
  1. Hold on! Our job in Visual Studio is not yet done. We have just created the required services in Azure right from the Visual Studio IDE. Our next job is to publish the code from the local workstation to the Azure cloud. As soon as the deployment is complete, you will be taken to the web deploy step, as shown in the screenshot. Click on the Publish button to start the process of publishing the code:
  1. After a few seconds, you should see something similar to the following screenshot in the Output window of your Visual Studio instance:
  1. That's it. We have completed the deployment of your function app and its functions to Azure right from your favorite development IDE, Visual Studio. You can review the function deployment in the Azure Management Portal. Both Azure Functions were created successfully, as shown in the following screenshot: