last sync: 2021-Jul-23 16:37:57 UTC

Azure Policy definition

Function apps should use an Azure file share for its content directory

Name Function apps should use an Azure file share for its content directory
Azure Portal
Id 4d0bc837-6eff-477e-9ecd-33bf8d4212a5
Version 1.0.0
details on versioning
Category App Service
Microsoft docs
Description The content directory of a function app should be located on an Azure file share. The storage account information for the file share must be provided before any publishing activity. To learn more about using Azure Files for hosting app service content refer to https://go.microsoft.com/fwlink/?linkid=2151594.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: Audit
Allowed: (Audit, Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-03-02 15:11:40 add 4d0bc837-6eff-477e-9ecd-33bf8d4212a5
Used in Initiatives none
JSON
{
  "properties": {
    "displayName": "Function apps should use an Azure file share for its content directory",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "The content directory of a function app should be located on an Azure file share. The storage account information for the file share must be provided before any publishing activity. To learn more about using Azure Files for hosting app service content refer to https://go.microsoft.com/fwlink/?linkid=2151594.",
    "metadata": {
      "version": "1.0.0",
      "category": "App Service"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Web/sites"
          },
          {
            "field": "kind",
            "like": "functionapp*"
          },
          {
            "field": "Microsoft.Web/sites/storageAccountRequired",
            "equals": "true"
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/4d0bc837-6eff-477e-9ecd-33bf8d4212a5",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "4d0bc837-6eff-477e-9ecd-33bf8d4212a5"
}