Creating Azure Function app is very Simple if you follow the below steps in order.
- Make sure you have a subscription in your account.
- Goto Portal.azure.com
- Click on New and search for “Function App” and select the Function App in the search results.
- Click on Create and Enter the details as Shown in the image below.
- Few points to be noted here are.
- Consumption Plan: When you chose this plan, your account will be billed only for the time till your application is running or processing the requests.
- App Service Plan: This is the traditional plan where a set of resources are reserved (for plans Basic and above.) and billing will be done till the time you application is there on this plan, no matter if it is in running /started state or now.
- Storage Account: You can select an existing storage account or can create a new one. With this option we just need to mention the storage account name and it will be created automatically. The storage account created this way is a General-Purpose Storage account with Redundancy type as LRS.
If you chose an existing storage plan, please make sure you chose a “General Purpose Storage” account. Storage account of type “Blob” will not work here as Function app needs services like Queues and files for internal monitoring and logging purpose.
- Once you click on Create and all the details entered are fine the function app gets created. Go to all the app services and find this newly created function app and click on it. Below is what you see then.
- Your function app is ready now. Click on “+” mark in front of “Functions” and you will see the screen as shown in the image below.
- For now, Select Timer (centre) option and click on “Create this function” button below. This will create a timer trigger function for you.
- We will discuss about all the type of Functions we can create in a later blog as this one is focussing on the basics of Function apps.
- Now let’s make the change in the timer trigger code as shown in the image below.
- Click on Save Button and then on Run. In the bottom half of the window, you will see some logs. If you carefully read them they are the logs which we are writing in the function code using log.info.
- If you function code is having any compilation issues they are again shown in the console log window in the bottom half.
- One point to be noted here is the moment you change the code and click on Save button the code gets compiled and you can see the output of that compilation in the log window in the bottom half.
Above steps were just to demonstrate how we can create a Function App.
A lot of details needs to be discussed for the options we see on the screen, the different type of functions we can create under the Function App and much more. We will discuss about all these details in future blogs. Once those blogs are ready I will add the links to them here.
Thank you for reading. 🙂