Friday, September 4, 2020

Create Azure Function using Visual Studio – Part 2

Previous Post - Create Azure Function using Azure Portal – Part 1

Step 1 – Go to Visual Studio, create a "New Project" and select "Azure Function" template.

Step 2 – Name Function App and click "Create" button.

Step 3 – Defined Framework and Trigger 

Select ".NET Framework" as a run time stack, select "Http trigger" and then click on "Create" button. 

Step 4 – Below is the code generated.


Step 5 – Right click on the Project Name and click "Publish" button.



Step 6 – Select Publish Target 

Choose the publish target where you want to publish your Azure Function. If you want to publish it in existing Function App then choose Select Existing. 

Here we will publish Azure Function in new Function App.



Step 7 - Click on the "Create" button.



Step 8 – Go to Azure Portal and click on the "Function App".



Step 9 – We will see recently created Function App in the list. Simply Click on it.

Step 10 – Click on the "Functions". But here we will find no Azure Function inside the app as its not yet deployed from Visual Studio.



Step 11 – Return to the Visual Studio and "Publish" it. By doing so Azure Function will be pushed in the Function App recently created.



Step 12 – If in case below popup occurs, Click on the "Yes" button.



Step 13 – Now go back to Azure Portal and refresh browser. We will find Azure Function successfully deployed.


Step 14 – Click on Azure Function and then Click "Code+Test".



Step 15 – In Test window we can not see code as it is deployed from Visual Studio.


Step 16 – Click on the "Get function URL" and copy the End Point URL of Azure Function.



Step 17 – It will look like the url shared below. We can test Azure Function by calling it from Post Man.


To test this, lets jump on to Part 3Call Azure Function using Postman.

Reference to MS Documentation - 

https://docs.microsoft.com/en-us/azure/azure-functions/

Happy Learning, LET'S SHARE !

No comments:

Post a Comment

Popular Posts