Publish Azure Function using Visual Studio 2017 – Part 2

Ahamed Fazil Buhari
 
Senior Developer
October 31, 2018
 
Rate this article
 
Views
1948

Hi,

This is the continuation of my previous article – Create and Debug Azure Function using Visual Studio 2017 – Part 1 in this article we will concentrate more on publishing azure function which we created in previous article and how to handle it from azure portal.

Step 1: Still our Azure function (which we created in previous article) is available in local and to publish into Azure, right click on the project and click on Publish.

clip_image001

Step 2: It automatically connects to your Azure account (if not, Sign In using your azure account from Server Explorer or Cloud Explorer available under View option in menu bar) and it asks for Azure App Service to publish your azure function. In my case I already created my Azure App service; you can create new app service if required.

Consider Function App Service as a parent of Azure function. We can have multiple azure functions inside app service and it shares the configuration.

clip_image003

When we create azure function from the portal then this will be the first step. We need to create at least one Azure App Service before creating Azure Function.

clip_image005

Step 3: Before we publish from VS, it is better to check on one of the important option called “Remove additional files at destination”. This is checked by default and this will delete existing files before publishing your function which is created in VS.

If you don’t want to delete existing functions in your Azure App Service then please uncheck this option before publishing.

clip_image007

And click on Publish, make sure you are connected to Azure in your VS, you can easily check by going to Server Explorer window.

clip_image009

Step 4: Once it’s published, we can see the published Function in our Azure Portal. And it will be in read only mode.

clip_image011

Step 5: Now it’s easy to test your function because it gives you real URL and no need to depend on localhost anymore.

After publish from VS, app will become read-only mode. To overcome this, go to Function app settings

clip_image012

In Function app settings window, change the mode from Read Only to Read/Write mode.

clip_image014

It will make your function read/write. If we create Azure Function from the portal it’s easy to integrate and we can change the integration (Input, Output) through UI.

I hope this article is helpful to understand How to work on Azure Function from VS2017. Thank you for reading.

Happy Coding

Ahamed

Author Info

Ahamed Fazil Buhari
 
Senior Developer
 
Rate this article
 
Ahamed is a Senior Developer and he has very good experience in the field of Microsoft Technologies, especially SharePoint, Azure, M365, SPFx, .NET and client side scripting - JavaScript, TypeScript, ...read more
 

Leave a comment