Azure Function Using Portal

Introduction to Azure Function



•Azure Functions is one implementation of Server-less Architecture also known as 

Functions as a Service (FaaS).

In Azure Functions there are no virtual machines (VMs) to manage.

•In Azure function A number of discrete functions live inside a Function app.

It run either in a consumption plan or App Service plan.


Create Function App

Go to Create a Resources->Search for Function App->Create

Figure-1

Create-Function-App
Create Function App










Figure-2


Create-Function-App
Create Function App

Function App will be created with the name MyNewAzureFunApp as shown above.
Lets create a function Under the function app.

Select the function app called MyNewAzureFunApp  and then select In-Portal as shown in Figure-3.



Figure-3

Create-Function
Create Function

Select Timer or Select More template and select timer trigger and give a name to the timer and time interval when the timer will trigger.  as shown in Figure -4



Figure -4
Create-Function
Create Function


Function(TimerTrigger1) will be created under the function app.



Function and the files


Find the newly created function and file in below figure-5 and figure-6.




Figure-5


Function-details
Function details





                                                                        Figure-6



Function-Files
Function Files
Function Integration


In Figure-7 select the integration link.



                                                                    Figure-7


Function-Integration
Function Integration












  • Select the Outputs.
  • Select the Azure Blob Storage.
  • Install the template dependency if not installed.
  • Set the Blob Parameter name . In my case i set outputBlob.
  • Save the Details.
  • Go to TimeTrigger1 and add the below code.

using System;public static void Run(TimerInfo myTimer,string out outputBlob, ILogger log){ log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); outputBlob="test function";}

  • Save and Run the function.


Check the blob storage after every 1 min  as we given the execution time 1 minutes.
 Each minute a new blob will be created with the “Test function” printed.
Each execution Log will be generated which will be visible below the screen when we select the function created.


How to Disable Or Delete Function 

Select the Function App(MyNewAzureFunApp)-> Select Functions->Disable or Delete the function.


Things to Note


  • Azure function add advanced feature compared to Web Job.
  • It run max 5 min so used to run small piece of code.
  • Pay ₹13.220 per million execution.
  • It is called server-less as no charges will be there till there is no execution .



                                                                      



Share:

No comments:

Post a Comment

Contact for Azure Training

Name

Email *

Message *

Subscribe YouTube

Total Pageviews

Popular Posts

Labels

Recent Posts