{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-functions/json-schema/microsoft-azure-functions-app-service-plan-schema.json",
  "title": "AppServicePlan",
  "description": "App Service plan.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-functions-appserviceplans-api-openapi.yml#/components/schemas/AppServicePlan",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/AppServicePlanProperties",
      "description": "AppServicePlan resource specific properties",
      "x-ms-client-flatten": true
    },
    "sku": {
      "$ref": "#/$defs/SkuDescription",
      "description": "Description of a SKU for a scalable resource."
    },
    "extendedLocation": {
      "$ref": "#/$defs/ExtendedLocation",
      "description": "Extended Location."
    },
    "kind": {
      "type": "string",
      "description": "Kind of resource. If the resource is an app, you can refer to https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference for details supported values for kind."
    },
    "identity": {
      "$ref": "#/$defs/ManagedServiceIdentity",
      "description": "Managed service identity."
    }
  },
  "allOf": [
    {
      "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/TrackedResource"
    }
  ],
  "$defs": {
    "AppServicePlanProperties": {
      "type": "object",
      "description": "AppServicePlan resource specific properties",
      "properties": {
        "workerTierName": {
          "type": "string",
          "description": "Target worker tier assigned to the App Service plan."
        },
        "status": {
          "$ref": "#/$defs/StatusOptions",
          "description": "App Service plan status.",
          "readOnly": true
        },
        "subscription": {
          "type": "string",
          "description": "App Service plan subscription.",
          "readOnly": true
        },
        "hostingEnvironmentProfile": {
          "$ref": "#/$defs/HostingEnvironmentProfile",
          "description": "Specification for the App Service Environment to use for the App Service plan.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "maximumNumberOfWorkers": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of instances that can be assigned to this App Service plan.",
          "readOnly": true
        },
        "numberOfWorkers": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances that are assigned to this App Service plan.",
          "readOnly": true
        },
        "geoRegion": {
          "type": "string",
          "description": "Geographical location for the App Service plan.",
          "readOnly": true
        },
        "perSiteScaling": {
          "type": "boolean",
          "description": "If <code>true</code>, apps assigned to this App Service plan can be scaled independently.\nIf <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan."
        },
        "elasticScaleEnabled": {
          "type": "boolean",
          "description": "ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku"
        },
        "maximumElasticWorkerCount": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan"
        },
        "numberOfSites": {
          "type": "integer",
          "format": "int32",
          "description": "Number of apps assigned to this App Service plan.",
          "readOnly": true
        },
        "isSpot": {
          "type": "boolean",
          "description": "If <code>true</code>, this App Service Plan owns spot instances."
        },
        "spotExpirationTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time when the server farm expires. Valid only if it is a spot server farm."
        },
        "freeOfferExpirationTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time when the server farm free offer expires."
        },
        "resourceGroup": {
          "type": "string",
          "description": "Resource group of the App Service plan.",
          "readOnly": true
        },
        "reserved": {
          "type": "boolean",
          "description": "If Linux app service plan <code>true</code>, <code>false</code> otherwise.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "isXenon": {
          "type": "boolean",
          "description": "Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "hyperV": {
          "type": "boolean",
          "description": "If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "targetWorkerCount": {
          "type": "integer",
          "format": "int32",
          "description": "Scaling worker count."
        },
        "targetWorkerSizeId": {
          "type": "integer",
          "format": "int32",
          "description": "Scaling worker size ID."
        },
        "provisioningState": {
          "$ref": "#/$defs/ProvisioningState",
          "description": "Provisioning state of the App Service Plan.",
          "readOnly": true
        },
        "kubeEnvironmentProfile": {
          "$ref": "#/$defs/KubeEnvironmentProfile",
          "description": "Specification for the Kubernetes Environment to use for the App Service plan."
        },
        "zoneRedundant": {
          "type": "boolean",
          "description": "If <code>true</code>, this App Service Plan will perform availability zone balancing.\nIf <code>false</code>, this App Service Plan will not perform availability zone balancing."
        },
        "asyncScalingEnabled": {
          "type": "boolean",
          "description": "If <code>true</code>, this App Service Plan will attempt to scale asynchronously if there are insufficient workers to scale synchronously.\nIf <code>false</code>, this App Service Plan will only attempt sync scaling."
        },
        "planDefaultIdentity": {
          "$ref": "#/$defs/DefaultIdentity",
          "description": "Identity to use by platform for various features and integrations using managed identity."
        },
        "isCustomMode": {
          "type": "boolean",
          "description": "Whether this server farm is in custom mode."
        },
        "registryAdapters": {
          "type": "array",
          "description": "Registry adapters associated with this App Service plan.",
          "items": {
            "$ref": "#/$defs/RegistryAdapter"
          },
          "x-ms-identifiers": []
        },
        "installScripts": {
          "type": "array",
          "description": "Install scripts associated with this App Service plan.",
          "items": {
            "$ref": "#/$defs/InstallScript"
          }
        },
        "network": {
          "$ref": "#/$defs/ServerFarmNetworkSettings",
          "description": "All network settings for the server farm."
        },
        "storageMounts": {
          "type": "array",
          "description": "Storage mounts associated with this App Service plan.",
          "items": {
            "$ref": "#/$defs/StorageMount"
          }
        },
        "rdpEnabled": {
          "type": "boolean",
          "description": "If <code>true</code>, RDP access is enabled for this App Service plan. Only applicable for IsCustomMode ASPs.\nIf <code>false</code>, RDP access is disabled."
        }
      }
    },
    "Capability": {
      "type": "object",
      "description": "Describes the capabilities/features allowed for a specific SKU.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the SKU capability."
        },
        "value": {
          "type": "string",
          "description": "Value of the SKU capability."
        },
        "reason": {
          "type": "string",
          "description": "Reason of the SKU capability."
        }
      }
    },
    "DefaultIdentity": {
      "type": "object",
      "properties": {
        "identityType": {
          "$ref": "#/$defs/ManagedServiceIdentityType"
        },
        "userAssignedIdentityResourceId": {
          "type": "string"
        }
      }
    },
    "ExtendedLocation": {
      "type": "object",
      "description": "Extended Location.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of extended location."
        },
        "type": {
          "type": "string",
          "description": "Type of extended location.",
          "readOnly": true
        }
      }
    },
    "HostingEnvironmentProfile": {
      "type": "object",
      "description": "Specification for an App Service Environment to use for this resource.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource ID of the App Service Environment."
        },
        "name": {
          "type": "string",
          "description": "Name of the App Service Environment.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "Resource type of the App Service Environment.",
          "readOnly": true
        }
      }
    },
    "InstallScript": {
      "type": "object",
      "description": "Server farm install script configuration.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the install script."
        },
        "source": {
          "$ref": "#/$defs/InstallScriptSource",
          "description": "Source of the install script."
        }
      }
    },
    "InstallScriptSource": {
      "type": "object",
      "description": "Object to hold install script reference.",
      "properties": {
        "sourceUri": {
          "type": "string",
          "description": "Install script source URI where the install script file will be fetched from."
        },
        "type": {
          "$ref": "#/$defs/InstallScriptType",
          "description": "Type of the install script."
        }
      }
    },
    "InstallScriptType": {
      "type": "string",
      "description": "Type of the install script.",
      "enum": [
        "RemoteAzureBlob",
        "PlatformStorage"
      ],
      "x-ms-enum": {
        "name": "InstallScriptType",
        "modelAsString": true,
        "values": [
          {
            "name": "RemoteAzureBlob",
            "value": "RemoteAzureBlob"
          },
          {
            "name": "PlatformStorage",
            "value": "PlatformStorage"
          }
        ]
      }
    },
    "KeyVaultReferenceWithStatus": {
      "type": "object",
      "description": "Object to hold key vault reference and the resolution status",
      "properties": {
        "secretUri": {
          "type": "string",
          "description": "Key vault secret URI."
        },
        "referenceStatus": {
          "type": "string",
          "description": "Reference status of the key vault secret."
        }
      }
    },
    "KubeEnvironmentProfile": {
      "type": "object",
      "description": "Specification for a Kubernetes Environment to use for this resource.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource ID of the Kubernetes Environment."
        },
        "name": {
          "type": "string",
          "description": "Name of the Kubernetes Environment.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "Resource type of the Kubernetes Environment.",
          "readOnly": true
        }
      }
    },
    "ManagedServiceIdentity": {
      "type": "object",
      "description": "Managed service identity.",
      "properties": {
        "type": {
          "$ref": "#/$defs/ManagedServiceIdentityType",
          "description": "Type of managed service identity."
        },
        "tenantId": {
          "type": "string",
          "description": "Tenant of managed service identity.",
          "readOnly": true
        },
        "principalId": {
          "type": "string",
          "description": "Principal Id of managed service identity.",
          "readOnly": true
        },
        "userAssignedIdentities": {
          "type": "object",
          "description": "The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}",
          "additionalProperties": {
            "$ref": "#/$defs/UserAssignedIdentity"
          }
        }
      }
    },
    "ManagedServiceIdentityType": {
      "type": "string",
      "description": "Type of managed service identity.",
      "enum": [
        "SystemAssigned",
        "UserAssigned",
        "SystemAssigned, UserAssigned",
        "None"
      ],
      "x-ms-enum": {
        "name": "ManagedServiceIdentityType",
        "modelAsString": false
      }
    },
    "ProvisioningState": {
      "type": "string",
      "description": "Provisioning state of the App Service Plan.",
      "enum": [
        "Succeeded",
        "Failed",
        "Canceled",
        "InProgress",
        "Deleting"
      ],
      "x-ms-enum": {
        "name": "ProvisioningState",
        "modelAsString": false
      }
    },
    "RegistryAdapter": {
      "type": "object",
      "description": "Server farm registry adapter configuration.",
      "properties": {
        "registryKey": {
          "type": "string",
          "description": "Registry key for the adapter."
        },
        "type": {
          "$ref": "#/$defs/RegistryAdapterType",
          "description": "Type of the registry adapter."
        },
        "keyVaultSecretReference": {
          "$ref": "#/$defs/KeyVaultReferenceWithStatus",
          "description": "Key vault reference to the value that will be placed in the registry location"
        }
      }
    },
    "RegistryAdapterType": {
      "type": "string",
      "description": "Type of the registry adapter.",
      "enum": [
        "Binary",
        "String",
        "Expand_String",
        "Multi_String",
        "DWord",
        "QWord"
      ],
      "x-ms-enum": {
        "name": "RegistryAdapterType",
        "modelAsString": true,
        "values": [
          {
            "name": "Binary",
            "value": "Binary"
          },
          {
            "name": "String",
            "value": "String"
          },
          {
            "name": "Expand_String",
            "value": "Expand_String"
          },
          {
            "name": "Multi_String",
            "value": "Multi_String"
          },
          {
            "name": "DWord",
            "value": "DWord"
          },
          {
            "name": "QWord",
            "value": "QWord"
          }
        ]
      }
    },
    "ServerFarmNetworkSettings": {
      "type": "object",
      "description": "Network settings for an app service plan.",
      "properties": {
        "virtualNetworkSubnetId": {
          "type": "string",
          "description": "Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}"
        }
      }
    },
    "SkuCapacity": {
      "type": "object",
      "description": "Description of the App Service plan scale options.",
      "properties": {
        "minimum": {
          "type": "integer",
          "format": "int32",
          "description": "Minimum number of workers for this App Service plan SKU."
        },
        "maximum": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of workers for this App Service plan SKU."
        },
        "elasticMaximum": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of Elastic workers for this App Service plan SKU."
        },
        "default": {
          "type": "integer",
          "format": "int32",
          "description": "Default number of workers for this App Service plan SKU."
        },
        "scaleType": {
          "type": "string",
          "description": "Available scale configurations for an App Service plan."
        }
      }
    },
    "SkuDescription": {
      "type": "object",
      "description": "Description of a SKU for a scalable resource.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the resource SKU."
        },
        "tier": {
          "type": "string",
          "description": "Service tier of the resource SKU."
        },
        "size": {
          "type": "string",
          "description": "Size specifier of the resource SKU."
        },
        "family": {
          "type": "string",
          "description": "Family code of the resource SKU."
        },
        "capacity": {
          "type": "integer",
          "format": "int32",
          "description": "Current number of instances assigned to the resource."
        },
        "skuCapacity": {
          "$ref": "#/$defs/SkuCapacity",
          "description": "Min, max, and default scale values of the SKU."
        },
        "locations": {
          "type": "array",
          "description": "Locations of the SKU.",
          "items": {
            "type": "string"
          }
        },
        "capabilities": {
          "type": "array",
          "description": "Capabilities of the SKU, e.g., is traffic manager enabled?",
          "items": {
            "$ref": "#/$defs/Capability"
          },
          "x-ms-identifiers": [
            "name"
          ]
        }
      }
    },
    "StatusOptions": {
      "type": "string",
      "description": "App Service plan status.",
      "enum": [
        "Ready",
        "Pending",
        "Creating"
      ],
      "x-ms-enum": {
        "name": "StatusOptions",
        "modelAsString": false
      }
    },
    "StorageMount": {
      "type": "object",
      "description": "Server farm storage mount configuration.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the storage mount."
        },
        "type": {
          "$ref": "#/$defs/StorageMountType",
          "description": "Type of the storage mount."
        },
        "source": {
          "type": "string",
          "description": "Source of the fileshare/storage."
        },
        "destinationPath": {
          "type": "string",
          "description": "Path on worker where storage will be mounted."
        },
        "credentialsKeyVaultReference": {
          "$ref": "#/$defs/KeyVaultReferenceWithStatus",
          "description": "KV reference to the credentials to connect to the share."
        }
      }
    },
    "StorageMountType": {
      "type": "string",
      "description": "Type of the storage mount.",
      "enum": [
        "AzureFiles",
        "LocalStorage",
        "FileShare"
      ],
      "x-ms-enum": {
        "name": "StorageMountType",
        "modelAsString": true,
        "values": [
          {
            "name": "AzureFiles",
            "value": "AzureFiles"
          },
          {
            "name": "LocalStorage",
            "value": "LocalStorage"
          },
          {
            "name": "FileShare",
            "value": "FileShare"
          }
        ]
      }
    },
    "UserAssignedIdentity": {
      "type": "object",
      "description": "User Assigned identity.",
      "properties": {
        "principalId": {
          "type": "string",
          "description": "Principal Id of user assigned identity",
          "readOnly": true
        },
        "clientId": {
          "type": "string",
          "description": "Client Id of user assigned identity",
          "readOnly": true
        }
      }
    }
  }
}