The Azure function runs automatically by listening to message queues.
After then It will ask you to select Function type and Storage account. Select the browse in a storage account and connect with your Azure Subscription. Azure function needs storage account as it places its default file in the azure blob.
We have 3 plans available.
Consumption Plan
Azure Functions host is dynamically added and removed based on the number of incoming events. When your function runs, Azure provides all of the necessary computational resources. You don't have to worry about resource management, and you only pay for the time that your code runs.
Premium Plan
When you're using the Premium plan, instances of the Azure Functions host are added and removed based on the number of incoming events just like the Consumption plan.
App Service plan
Run your functions just like your web apps. When you are already using App Service for your other applications, you can run your functions on the same plan at no additional cost.
In my example, I'm selecting a consumption plan. You need to specify your
Function app - Name of your function app.
Subscription - Your azure subscription.
Resource group - Resource groups in Azure is a new approach to group a collection of assets.
Location - Select the global region where you want to create the Azure function.
Azure Storage - Storage to save the files.
Once the published is complete, you can see new App Service and Service plan is being created in the Azure Portal.
When you expand the "
demoazurefn", you can see your function there.
Once you run the azure function, you see the log in the screenshot below. It means function ran successfully.
You can also create the azure function in the Azure Portal itself. Please follow below to create the azure function in the portal
Create Azure Function in the Azure portal.
Step 1: Click on the "Create a resource" button and search "function app"
Step 2: Click on the create button on the next page.
Step 3: Select the Function App Name, Resource Group, Storage etc as shown in the snapshot below and click create.
Step 4: Once you press the create, the system will validate all the details and create the function app in the Azure portal.
Step 5: Function app is ready now, and it's empty. You can now add your function in the function app by clicking the + button as shown below.
This is all about the azure function, hope you like it.