Microsoft.Web/sites template reference

API Version: 2016-08-01

Template format

To create a Microsoft.Web/sites resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.Web/sites",
  "apiVersion": "2016-08-01",
  "kind": "string",
  "location": "string",
  "tags": {},
  "properties": {
    "enabled": boolean,
    "hostNameSslStates": [
      {
        "name": "string",
        "sslState": "string",
        "virtualIP": "string",
        "thumbprint": "string",
        "toUpdate": boolean,
        "hostType": "string"
      }
    ],
    "serverFarmId": "string",
    "reserved": boolean,
    "siteConfig": {
      "numberOfWorkers": "integer",
      "defaultDocuments": [
        "string"
      ],
      "netFrameworkVersion": "string",
      "phpVersion": "string",
      "pythonVersion": "string",
      "nodeVersion": "string",
      "linuxFxVersion": "string",
      "requestTracingEnabled": boolean,
      "requestTracingExpirationTime": "string",
      "remoteDebuggingEnabled": boolean,
      "remoteDebuggingVersion": "string",
      "httpLoggingEnabled": boolean,
      "logsDirectorySizeLimit": "integer",
      "detailedErrorLoggingEnabled": boolean,
      "publishingUsername": "string",
      "appSettings": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "connectionStrings": [
        {
          "name": "string",
          "connectionString": "string",
          "type": "string"
        }
      ],
      "handlerMappings": [
        {
          "extension": "string",
          "scriptProcessor": "string",
          "arguments": "string"
        }
      ],
      "documentRoot": "string",
      "scmType": "string",
      "use32BitWorkerProcess": boolean,
      "webSocketsEnabled": boolean,
      "alwaysOn": boolean,
      "javaVersion": "string",
      "javaContainer": "string",
      "javaContainerVersion": "string",
      "appCommandLine": "string",
      "managedPipelineMode": "string",
      "virtualApplications": [
        {
          "virtualPath": "string",
          "physicalPath": "string",
          "preloadEnabled": boolean,
          "virtualDirectories": [
            {
              "virtualPath": "string",
              "physicalPath": "string"
            }
          ]
        }
      ],
      "loadBalancing": "string",
      "experiments": {
        "rampUpRules": [
          {
            "actionHostName": "string",
            "reroutePercentage": "number",
            "changeStep": "number",
            "changeIntervalInMinutes": "integer",
            "minReroutePercentage": "number",
            "maxReroutePercentage": "number",
            "changeDecisionCallbackUrl": "string",
            "name": "string"
          }
        ]
      },
      "limits": {
        "maxPercentageCpu": "number",
        "maxMemoryInMb": "integer",
        "maxDiskSizeInMb": "integer"
      },
      "autoHealEnabled": boolean,
      "autoHealRules": {
        "triggers": {
          "requests": {
            "count": "integer",
            "timeInterval": "string"
          },
          "privateBytesInKB": "integer",
          "statusCodes": [
            {
              "status": "integer",
              "subStatus": "integer",
              "win32Status": "integer",
              "count": "integer",
              "timeInterval": "string"
            }
          ],
          "slowRequests": {
            "timeTaken": "string",
            "count": "integer",
            "timeInterval": "string"
          }
        },
        "actions": {
          "actionType": "string",
          "customAction": {
            "exe": "string",
            "parameters": "string"
          },
          "minProcessExecutionTime": "string"
        }
      },
      "tracingOptions": "string",
      "vnetName": "string",
      "cors": {
        "allowedOrigins": [
          "string"
        ]
      },
      "push": {
        "kind": "string",
        "properties": {
          "isPushEnabled": boolean,
          "tagWhitelistJson": "string",
          "tagsRequiringAuth": "string",
          "dynamicTagsJson": "string"
        }
      },
      "apiDefinition": {
        "url": "string"
      },
      "autoSwapSlotName": "string",
      "localMySqlEnabled": boolean,
      "ipSecurityRestrictions": [
        {
          "ipAddress": "string",
          "subnetMask": "string"
        }
      ],
      "http20Enabled": boolean,
      "minTlsVersion": "string"
    },
    "scmSiteAlsoStopped": boolean,
    "hostingEnvironmentProfile": {
      "id": "string"
    },
    "clientAffinityEnabled": boolean,
    "clientCertEnabled": boolean,
    "hostNamesDisabled": boolean,
    "containerSize": "integer",
    "dailyMemoryTimeQuota": "integer",
    "cloningInfo": {
      "correlationId": "string",
      "overwrite": boolean,
      "cloneCustomHostNames": boolean,
      "cloneSourceControl": boolean,
      "sourceWebAppId": "string",
      "hostingEnvironment": "string",
      "appSettingsOverrides": {},
      "configureLoadBalancing": boolean,
      "trafficManagerProfileId": "string",
      "trafficManagerProfileName": "string",
      "ignoreQuotas": boolean
    },
    "snapshotInfo": {
      "kind": "string",
      "properties": {
        "snapshotTime": "string",
        "recoveryTarget": {
          "location": "string",
          "id": "string"
        },
        "overwrite": boolean,
        "recoverConfiguration": boolean,
        "ignoreConflictingHostNames": boolean
      }
    },
    "httpsOnly": boolean
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "resources": []
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Web/sites object

Name Type Required Value
name string Yes
type enum Yes Microsoft.Web/sites
apiVersion enum Yes 2016-08-01
kind string No Kind of resource.
location string Yes Resource Location.
tags object No Resource tags.
properties object Yes Site resource specific properties - SiteProperties object
identity object No ManagedServiceIdentity object
resources array No virtualNetworkConnections slots siteextensions publicCertificates premieraddons hybridconnection hostNameBindings functions domainOwnershipIdentifiers deployments

SiteProperties object

Name Type Required Value
enabled boolean No true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline).
hostNameSslStates array No Hostname SSL states are used to manage the SSL bindings for app's hostnames. - HostNameSslState object
serverFarmId string No Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
reserved boolean No true if reserved; otherwise, false.
siteConfig object No Configuration of the app. - SiteConfig object
scmSiteAlsoStopped boolean No true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false.
hostingEnvironmentProfile object No App Service Environment to use for the app. - HostingEnvironmentProfile object
clientAffinityEnabled boolean No true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true.
clientCertEnabled boolean No true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false.
hostNamesDisabled boolean No true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management process.
containerSize integer No Size of the function container.
dailyMemoryTimeQuota integer No Maximum allowed daily memory-time quota (applicable on dynamic apps only).
cloningInfo object No If specified during app creation, the app is cloned from a source app. - CloningInfo object
snapshotInfo object No If specified during app creation, the app is created from a previous snapshot. - SnapshotRecoveryRequest object
httpsOnly boolean No HttpsOnly: configures a web site to accept only https requests. Issues redirect forhttp requests

ManagedServiceIdentity object

Name Type Required Value
type enum No Type of managed service identity. - SystemAssigned

HostNameSslState object

Name Type Required Value
name string No Hostname.
sslState enum No SSL type. - Disabled, SniEnabled, IpBasedEnabled
virtualIP string No Virtual IP address assigned to the hostname if IP based SSL is enabled.
thumbprint string No SSL certificate thumbprint.
toUpdate boolean No Set to true to update existing hostname.
hostType enum No Indicates whether the hostname is a standard or repository hostname. - Standard or Repository

SiteConfig object

Name Type Required Value
numberOfWorkers integer No Number of workers.
defaultDocuments array No Default documents. - string
netFrameworkVersion string No .NET Framework version.
phpVersion string No Version of PHP.
pythonVersion string No Version of Python.
nodeVersion string No Version of Node.js.
linuxFxVersion string No Linux App Framework and version
requestTracingEnabled boolean No true if request tracing is enabled; otherwise, false.
requestTracingExpirationTime string No Request tracing expiration time.
remoteDebuggingEnabled boolean No true if remote debugging is enabled; otherwise, false.
remoteDebuggingVersion string No Remote debugging version.
httpLoggingEnabled boolean No true if HTTP logging is enabled; otherwise, false.
logsDirectorySizeLimit integer No HTTP logs directory size limit.
detailedErrorLoggingEnabled boolean No true if detailed error logging is enabled; otherwise, false.
publishingUsername string No Publishing user name.
appSettings array No Application settings. - NameValuePair object
connectionStrings array No Connection strings. - ConnStringInfo object
handlerMappings array No Handler mappings. - HandlerMapping object
documentRoot string No Document root.
scmType enum No SCM type. - None, Dropbox, Tfs, LocalGit, GitHub, CodePlexGit, CodePlexHg, BitbucketGit, BitbucketHg, ExternalGit, ExternalHg, OneDrive, VSO
use32BitWorkerProcess boolean No true to use 32-bit worker process; otherwise, false.
webSocketsEnabled boolean No true if WebSocket is enabled; otherwise, false.
alwaysOn boolean No true if Always On is enabled; otherwise, false.
javaVersion string No Java version.
javaContainer string No Java container.
javaContainerVersion string No Java container version.
appCommandLine string No App command line to launch.
managedPipelineMode enum No Managed pipeline mode. - Integrated or Classic
virtualApplications array No Virtual applications. - VirtualApplication object
loadBalancing enum No Site load balancing. - WeightedRoundRobin, LeastRequests, LeastResponseTime, WeightedTotalTraffic, RequestHash
experiments object No This is work around for polymophic types. - Experiments object
limits object No Site limits. - SiteLimits object
autoHealEnabled boolean No true if Auto Heal is enabled; otherwise, false.
autoHealRules object No Auto Heal rules. - AutoHealRules object
tracingOptions string No Tracing options.
vnetName string No Virtual Network name.
cors object No Cross-Origin Resource Sharing (CORS) settings. - CorsSettings object
push object No Push endpoint settings. - PushSettings object
apiDefinition object No Information about the formal API definition for the app. - ApiDefinitionInfo object
autoSwapSlotName string No Auto-swap slot name.
localMySqlEnabled boolean No true to enable local MySQL; otherwise, false.
ipSecurityRestrictions array No IP security restrictions. - IpSecurityRestriction object
http20Enabled boolean No Http20Enabled: configures a web site to allow clients to connect over http2.0
minTlsVersion enum No MinTlsVersion: configures the minimum version of TLS required for SSL requests. - 1.0, 1.1, 1.2

HostingEnvironmentProfile object

Name Type Required Value
id string No Resource ID of the App Service Environment.

CloningInfo object

Name Type Required Value
correlationId string No Correlation ID of cloning operation. This ID ties multiple cloning operationstogether to use the same snapshot. - globally unique identifier
overwrite boolean No true to overwrite destination app; otherwise, false.
cloneCustomHostNames boolean No true to clone custom hostnames from source app; otherwise, false.
cloneSourceControl boolean No true to clone source control from source app; otherwise, false.
sourceWebAppId string Yes ARM resource ID of the source app. App resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots.
hostingEnvironment string No App Service Environment.
appSettingsOverrides object No Application setting overrides for cloned app. If specified, these settings override the settings cloned from source app. Otherwise, application settings from source app are retained.
configureLoadBalancing boolean No true to configure load balancing for source and destination app.
trafficManagerProfileId string No ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}.
trafficManagerProfileName string No Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist.
ignoreQuotas boolean No true if quotas should be ignored; otherwise, false.

SnapshotRecoveryRequest object

Name Type Required Value
kind string No Kind of resource.
properties object No SnapshotRecoveryRequest resource specific properties - SnapshotRecoveryRequestProperties object

NameValuePair object

Name Type Required Value
name string No Pair name.
value string No Pair value.

ConnStringInfo object

Name Type Required Value
name string No Name of connection string.
connectionString string No Connection string value.
type enum No Type of database. - MySql, SQLServer, SQLAzure, Custom, NotificationHub, ServiceBus, EventHub, ApiHub, DocDb, RedisCache, PostgreSQL

HandlerMapping object

Name Type Required Value
extension string No Requests with this extension will be handled using the specified FastCGI application.
scriptProcessor string No The absolute path to the FastCGI application.
arguments string No Command-line arguments to be passed to the script processor.

VirtualApplication object

Name Type Required Value
virtualPath string No Virtual path.
physicalPath string No Physical path.
preloadEnabled boolean No true if preloading is enabled; otherwise, false.
virtualDirectories array No Virtual directories for virtual application. - VirtualDirectory object

Experiments object

Name Type Required Value
rampUpRules array No List of ramp-up rules. - RampUpRule object

SiteLimits object

Name Type Required Value
maxPercentageCpu number No Maximum allowed CPU usage percentage.
maxMemoryInMb integer No Maximum allowed memory usage in MB.
maxDiskSizeInMb integer No Maximum allowed disk size usage in MB.

AutoHealRules object

Name Type Required Value
triggers object No Conditions that describe when to execute the auto-heal actions. - AutoHealTriggers object
actions object No Actions to be executed when a rule is triggered. - AutoHealActions object

CorsSettings object

Name Type Required Value
allowedOrigins array No Gets or sets the list of origins that should be allowed to make cross-origincalls (for example: http://example.com:12345). Use "*" to allow all. - string

PushSettings object

Name Type Required Value
kind string No Kind of resource.
properties object No PushSettings resource specific properties - PushSettingsProperties object

ApiDefinitionInfo object

Name Type Required Value
url string No The URL of the API definition.

IpSecurityRestriction object

Name Type Required Value
ipAddress string Yes IP address the security restriction is valid for.
subnetMask string No Subnet mask for the range of IP addresses the restriction is valid for.

SnapshotRecoveryRequestProperties object

Name Type Required Value
snapshotTime string No Point in time in which the app recovery should be attempted, formatted as a DateTime string.
recoveryTarget object No Specifies the web app that snapshot contents will be written to. - SnapshotRecoveryTarget object
overwrite boolean Yes If true the recovery operation can overwrite source app; otherwise, false.
recoverConfiguration boolean No If true, site configuration, in addition to content, will be reverted.
ignoreConflictingHostNames boolean No If true, custom hostname conflicts will be ignored when recovering to a target web app.This setting is only necessary when RecoverConfiguration is enabled.

VirtualDirectory object

Name Type Required Value
virtualPath string No Path to virtual application.
physicalPath string No Physical path.

RampUpRule object

Name Type Required Value
actionHostName string No Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net.
reroutePercentage number No Percentage of the traffic which will be redirected to ActionHostName.
changeStep number No In auto ramp up scenario this is the step to to add/remove from ReroutePercentage until it reaches MinReroutePercentage or MaxReroutePercentage. Site metrics are checked every N minutes specificed in ChangeIntervalInMinutes.Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl.
changeIntervalInMinutes integer No Specifies interval in mimuntes to reevaluate ReroutePercentage.
minReroutePercentage number No Specifies lower boundary above which ReroutePercentage will stay.
maxReroutePercentage number No Specifies upper boundary below which ReroutePercentage will stay.
changeDecisionCallbackUrl string No Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts.https://www.siteextensions.net/packages/TiPCallback/
name string No Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment.

AutoHealTriggers object

Name Type Required Value
requests object No A rule based on total requests. - RequestsBasedTrigger object
privateBytesInKB integer No A rule based on private bytes.
statusCodes array No A rule based on status codes. - StatusCodesBasedTrigger object
slowRequests object No A rule based on request execution time. - SlowRequestsBasedTrigger object

AutoHealActions object

Name Type Required Value
actionType enum No Predefined action to be taken. - Recycle, LogEvent, CustomAction
customAction object No Custom action to be taken. - AutoHealCustomAction object
minProcessExecutionTime string No Minimum time the process must executebefore taking the action

PushSettingsProperties object

Name Type Required Value
isPushEnabled boolean Yes Gets or sets a flag indicating whether the Push endpoint is enabled.
tagWhitelistJson string No Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint.
tagsRequiringAuth string No Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint.Tags can consist of alphanumeric characters and the following:'_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler.
dynamicTagsJson string No Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint.

SnapshotRecoveryTarget object

Name Type Required Value
location string No Geographical location of the target web app, e.g. SouthEastAsia, SouthCentralUS
id string No ARM resource ID of the target app. /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots.

RequestsBasedTrigger object

Name Type Required Value
count integer No Request Count.
timeInterval string No Time interval.

StatusCodesBasedTrigger object

Name Type Required Value
status integer No HTTP status code.
subStatus integer No Request Sub Status.
win32Status integer No Win32 error code.
count integer No Request Count.
timeInterval string No Time interval.

SlowRequestsBasedTrigger object

Name Type Required Value
timeTaken string No Time taken.
count integer No Request Count.
timeInterval string No Time interval.

AutoHealCustomAction object

Name Type Required Value
exe string No Executable to be run.
parameters string No Parameters for the executable.

Quickstart templates

For example templates, see Web templates.