Skip to content

An Azure Resource Manager template to setup several Azure Functions in Azure Government.

License

Notifications You must be signed in to change notification settings

gsacavdm/gov-arm-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Functions Resource Manager Template

This template sets up an Azure Function using the code in this same repo. It pull everything in this repo (including README.MD and template.json) but Azure Functions, given the appSettings in the template, will only look at root level folders that contain a function.json file.

Note: You can export all the code in an existing Azure Function setup using the Download app content button. This template was tested using Site Content and leaving unchecked Include app settings in the download.

Naming Convention

This template only has 1 parameter: namingPrefix. This parameter is used to autogenerate the names of all resources. For example, for namingPrefix of contoso_, the site will be named contoso-site and the storage account contososa.

Assumptions

All resources are created in the same location as the resource group they are contained i

Instructions

  1. Create the resource group

    az group create -n contoso -l usgovvirginia
  2. Deploy the template to the newly created group

    az group deployment create -g contoso -n $(date +%Y%m%d_%H%M%S) --template-file template.json
  3. If you use your own GitHub repo and make changes to it after deploying the template, you can trigger a sync using the Azure CLI:

    az webapp deployment source sync -g contoso-func -n contoso-site

Outstanding Items

  • Add hostNameSslStates.thumbprint
  • Document isManualIntegration(see link)
  • Document Project appSetting
    {
      "name": "Project",
      "value": "src"
    },
  • Decide on Blob connection string (EndpointSuffix vs BlobEndpoint)
      "value": "[concat('DefaultEndpointsProtocol=https;BlobEndpoint=', reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2016-01-01').primaryEndpoints.blob,';AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName')),'2016-01-01').keys[0].value)]"
      "value": "[concat('DefaultEndpointsProtocol=https;EndpointSuffix=', replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2016-01-01').primaryEndpoints.blob, concat('https://', variables('storageAccountName'), '.blob.'),''),'/',''),';AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName')),'2016-01-01').keys[0].value)]"
  • Add notes on how to use REST API (update app settings in particular)
  • Add the other Website SKUs
  • Add note that consumption-based functions aren't available in Gov yet.

References

https://docs.microsoft.com/azure/azure-functions/functions-infrastructure-as-code https://docs.microsoft.com/rest/api/appservice/webapps/updateapplicationsettings#Request_Body

About

An Azure Resource Manager template to setup several Azure Functions in Azure Government.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published