Time-Saving Tips for Commercial & Government Azure Function Deployment

John E. Huschka, April 14, 2018

Target Audience:
Azure Developer
Technology:

Azure Functions — Internet cloud based custom web-accessible code.

Azure Resource Manager Templates — Files in which you can group your Azure resources for deployment.

Azure functions give you the ability to deploy specific, targeted cloud-hosted web functionality without having to concern yourself with infrastructure.

But there are important differences between Azure’s Commercial and Government function environments—especially the resource plans available in each and the key parameters required to configure them. The purpose of this three-part blog series is to help you understand those differences and take them into account when deploying to each environment.

This series assumes some basic knowledge of the core concepts of Azure and Azure functions. A good place to start with Azure functions is Go Serverless with Azure Functions and C#.

The Azure Function Components You Must Deploy

There are three major Azure components (“resources”) that you must deploy in support of your function:

  1. Storage account: Defines the storage in which Azure places files for your function. This includes execution logs (in Azure tables) and files required to run and manage your function (in Azure blob storage).
  2. App Service Plan: Defines your function's Azure cloud-computing resources—similar to how you would define server resources if you were implementing in your own data center. These parameters include:
    • The Azure region (data center) in which the function will be hosted (e.g., West US, East US).
    • The pricing tier (e.g., free, shared, basic, standard, premium, premiumv2, isolated, consumption) defines the resources that are available to your function, including if it will run on dedicated virtual machines or shared compute resources.

    See Azure App Service plan overview for additional information.

  3. App Service: The Azure component that hosts your function. An app service is a web hosting environment that you can use without having to concern yourself with most infrastructure details such as security, scaling, and load balancing—things you would have to worry about if you were implementing in your own data center. See Web Apps overview for more details.

App Service Plan Drives Deployment Differences

An Azure function runs in one of two modes related to the function's app service plan:

Consumption: In this mode—called a Consumption plan—Azure dynamically adds to and removes resources from the function based on demand. You do not pay for idle compute resources (such as virtual machines) that you are not using. This mode has several benefits, but it is not currently available in Azure Government.

App Service: In this mode—called an App Service Plan—the function runs on dedicated virtual machines.

You see the difference between the Azure Commercial and Government mode availability when you create a new function. In Commercial, you choose between Consumption Plan and App Service Plan, whereas in Government, you do not:

For a comparison of the consumption and app service modes, see Azure Functions scale and hosting.

The remainder of this series will focus on the differences between deploying a function to a Commercial consumption plan and a Government app service plan.

Deployment Using Azure Resource Manager Templates

You deploy your function to Azure using Azure Resource Manager (ARM) templates. ARM allows you to manage Azure resources as a package that defines your solution. The JSON file by which you define and deploy your Azure resources is called a template.

You may be familiar with ARM templates if you have ever selected the Automation Script option for one of your Azure resources. Here, for example, is the template generated by Automation Script for a sample storage account:

ARM templates is a complex and powerful technology. If you would like to learn more, Azure Resource Manager overview is a good place to start.

Collaboration Foundry’s Function Deployment Example

Throughout this blog series, we are going to reference Collaboration Foundry’s Azure webhook function example at https://github.com/FoundryFounder/WebhookDemo. We will focus on Azure Government and Commercial ARM template differences. If you would like to deploy the example, instructions are provided with it.

Tips for Handling Azure Commercial/Government ARM Template Differences

There are five Azure function deployment differences that you must consider in ARM templates:

  1. App Service plan: Your function's app service plan—including consumption versus app service.
  2. Always On configuration: A setting that indicates to Azure that your function is to always remain active. See Always On.
  3. Azure File connection string and content share name: For consumption plans, you must provide a storage location at which your function assets will be stored because the plan provides no permanent, server-based resources for your function.
  4. Storage address: Your function’s Azure storage endpoint address (URL).
  5. App Service address: Your function’s Azure endpoint address (URL).

In part 2, we will discuss the template differences that arise from your app service plan selection.

 

More in our "Azure Deployment Tips" series:

 


We at Collaboration Foundry are experts in Azure, including integration with SharePoint and Office 365. If you need assistance, we can help. Contact us.


Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHAThis question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
4 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.