Thursday, 20 December 2018

Publish Azure Function with Visual Studio 2017


In my last post, I demonstrated how to create a new .NET Core Azure Function. In this post, I’ll demo how to publish your Azure Function using Visual Studio.

This post assumes that you’ve created your Azure Function already. If you need to go back over how to do that, click here.

Publish Azure Function with Visual Studio 2017

1) Right click your project and click Publish


2) If you have an existing Azure Function App already deployed in Azure then you can choose Select Existing to use an existing one however I’m creating one from scratch so I’ll choose Create New


3) Log into Azure and fill out all the details then click Create


You’ll be prompted to upgrade the version of Azure Function as we need V2, not V1 for .NET Core. If so, click Yes.


4) After a few seconds, Visual Studio completes the deployment and you can now see your new Azure Function in the Azure Portal


5) On the overview tab, copy the URL into PostMan


5) Click on Manage and copy down your function key. You can create a new key if you want.


6) In PostMan, add the key and the path to the HttpTrigger function as below

You can now click Send and see your output


There you have it! .NET Core Azure Function published to Azure in very little time. You can find the project code on GitHub here.