An Azure Function allows you to deploy scalable code to the cloud without worrying about the server or other infrastructure issues.

Azure Functions are contained within a Function App, so you need to create a Function App first.  To create a Function App, navigate to the Azure Portal, sign in and click the [Create a resource] button, as shown in Fig. 1.

FA01-CreateAResource
Fig. 1

From the menu, select Compute | Function App, as shown in Fig. 2.

FA02-ComputeFunctionApp
Fig. 2

The "Create Function App" blade displays as shown in Fig. 3

FA03-CreateFunctionAppBlade
Fig. 3

At the "App Name" field, enter a unique name for your Function App.

At the "Subscription" field, select the Azure subscription with which to associate this Function App. Most people will have only one subscription.

At the "Resource Group" field, select "Create new" and enter the name of a Resource Group to create or select "Use existing" and select an existing resource group in which to store your Function App. A Resource Group is an organizational grouping of related assets in Azure.

At the "OS" radio button, select the operating system (Windows or Linux) on which you wish to host your Function App.

At the Hosting plan, select either "Consumption Plan" or "App Service Plan". With the Consumption Plan, you only pay for the time that your functions are running. Since most functions do not run 24 hours a day / 7 days a week, this can be a real cost savings. With the App Service Plan, you pay as long as your functions are available. This is appropriate if you expect clients to be constantly calling your functions.

At the "Location" field, enter a region in which you want your Functions to run. In order to minimize latency, you should select a region close to any resources with which the Functions will interact.

At the "Runtime Stack" dropdown, select one of the platforms. Select ".NET" if you plan to write your code in C# or F#. Select "JavaScript" if you plan to create a node function. Select "Java" if you plan to write your code in Java. As of this writing, Java is in Preview, so performance is not guaranteed.

If you selected "Consumption Plan" hosting plan, you will be prompted for a storage account. Function definitions will be stored in this account. Select an existing storage account or create a new one. I prefer to use a storage account for all my Function Apps in a given Resource Group.

For extra monitoring, turn on Application Insights and select the same region in which your Function App is located. If this region is not available, select a nearby region.

Click the [Create] button to create your Function App.

After your Function App is created, you will want to add a Function to it. I will show how to do this in the next article.