Azure App Service (Web Apps) App Service
This page shows how to write Terraform and Azure Resource Manager for App Service (Web Apps) App Service and write them securely.
azurerm_app_service (Terraform)
The App Service in App Service (Web Apps) can be configured in Terraform with the resource name azurerm_app_service. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_app_service" "app_service_catalog_staging" {
name = "pp-catalogSta"
location = azurerm_resource_group.PlayPadel-Sta.location
resource_group_name = azurerm_resource_group.PlayPadel-Sta.name
app_service_plan_id = azurerm_app_service_plan.PlayPadelASP-Sta.id
resource "azurerm_app_service" "example" {
name = "Nsama-Frontend-App"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
app_service_plan_id = azurerm_app_service_plan.example.id
app_settings = {
resource "azurerm_app_service" "good_example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}
resource "azurerm_app_service" "webapp1" {
# creating web app
name = var.s1_name
resource_group_name=azurerm_resource_group.main.name
location=azurerm_resource_group.main.location
app_service_plan_id=azurerm_app_service_plan.sp.id
resource "azurerm_app_service" "SPJTestWebApp" {
name = "SPJTestWebApp"
location = "East Us"
resource_group_name = "POC_DevOps_RG"
app_service_plan_id = azurerm_app_service_plan.appserviceplan.id
resource "azurerm_app_service" "good_example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
resource "azurerm_app_service" "good_example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
https_only = true
resource "azurerm_app_service" "good_example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
resource "azurerm_app_service" "good_example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
client_cert_enabled = true
resource "azurerm_app_service" "webapp" {
name="wamdahhassan-frontend-service"
resource_group_name=azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
app_service_plan_id = azurerm_app_service_plan.sp.id
}
Security Best Practices for azurerm_app_service
There are 12 settings in azurerm_app_service that should be taken care of for security reasons. The following section explain an overview and example code.
Ensure your App Service is accessible via HTTPS only
It is better to configure the App Service to be accessible via HTTPS only. By default, both HTTP and HTTPS are available.
Ensure to use the latest version of TLS protocols
It is better to use the latest SSL/TLS version to protect connections for App Services.
Ensure to enable authentication
It is better to enable authentication not to accept anonymous requests and make sure that all communications in the application are authenticated.
Ensure to disable FTP deployment
It is better to disable FTP deployment. This is a traditional way and FTPS complies with industry standards and regulations. However, for enhanced security, both FTP and FTPS should be disabled.
Ensure to register the app identity with AD
It is better to register the app identity with AD to avoid the utilization of a username and password. It is used by an app with the AD that allows it to interact with the other services.
Ensure to enable to indicate the details of error messages
It is better to enable to indicate the details of error messages. App Service can save the error page when application errors such as HTTP code 400 or greater occur. It would help determine why the server returns the error code.
Ensure to select the latest version of the .NET framework
It is better to select the latest version of the .NET framework for the utilization of the latest security fixes.
Ensure to enable the logging of failed request tracing
It is better to enable the logging of failed request tracing including the request and the time taken in each IIS component. It is beneficial when we face site performance issues and specific HTTP errors.
Ensure to enable HTTP logging
It is better to enable HTTP logging. This includes the fundamental HTTP communication details such as the HTTP method, resource URI, client IP, client port, user agent, etc.
Ensure to select the latest PHP Version
It is better to select the latest PHP version to adapt the latest security fixes.
Ensure to select the latest Python Version
It is better to select the latest Python version to adapt the latest security fixes.
Ensure to enable incoming certificates for clients
It is better to enable incoming certificates for clients. If this is enabled, only the authenticated clients with valid certificates are able to access the app.
Parameters
-
app_service_plan_idrequired - string -
app_settingsoptional computed - map from string to string -
client_affinity_enabledoptional - bool -
client_cert_enabledoptional - bool -
custom_domain_verification_idoptional computed - string -
default_site_hostnameoptional computed - string -
enabledoptional - bool -
https_onlyoptional - bool -
idoptional computed - string -
locationrequired - string -
namerequired - string -
outbound_ip_address_listoptional computed - list of string -
outbound_ip_addressesoptional computed - string -
possible_outbound_ip_address_listoptional computed - list of string -
possible_outbound_ip_addressesoptional computed - string -
resource_group_namerequired - string -
site_credentialoptional computed - list of object -
tagsoptional - map from string to string -
auth_settingslist block-
additional_login_paramsoptional - map from string to string -
allowed_external_redirect_urlsoptional - list of string -
default_provideroptional - string -
enabledrequired - bool -
issueroptional - string -
runtime_versionoptional - string -
token_refresh_extension_hoursoptional - number -
token_store_enabledoptional - bool -
unauthenticated_client_actionoptional - string -
active_directorylist block-
allowed_audiencesoptional - list of string -
client_idrequired - string -
client_secretoptional - string
-
-
facebooklist block-
app_idrequired - string -
app_secretrequired - string -
oauth_scopesoptional - list of string
-
-
googlelist block-
client_idrequired - string -
client_secretrequired - string -
oauth_scopesoptional - list of string
-
-
microsoftlist block-
client_idrequired - string -
client_secretrequired - string -
oauth_scopesoptional - list of string
-
-
twitterlist block-
consumer_keyrequired - string -
consumer_secretrequired - string
-
-
-
backuplist block-
enabledoptional - bool -
namerequired - string -
storage_account_urlrequired - string -
schedulelist block-
frequency_intervalrequired - number -
frequency_unitrequired - string -
keep_at_least_one_backupoptional - bool -
retention_period_in_daysoptional - number -
start_timeoptional - string
-
-
-
connection_stringset block -
identitylist block-
identity_idsoptional - list of string -
principal_idoptional computed - string -
tenant_idoptional computed - string -
typerequired - string
-
-
logslist block-
detailed_error_messages_enabledoptional - bool -
failed_request_tracing_enabledoptional - bool -
application_logslist block-
file_system_leveloptional - string -
azure_blob_storagelist block-
levelrequired - string -
retention_in_daysrequired - number -
sas_urlrequired - string
-
-
-
http_logslist block-
azure_blob_storagelist block-
retention_in_daysrequired - number -
sas_urlrequired - string
-
-
file_systemlist block-
retention_in_daysrequired - number -
retention_in_mbrequired - number
-
-
-
-
site_configlist block-
always_onoptional - bool -
app_command_lineoptional - string -
auto_swap_slot_nameoptional - string -
default_documentsoptional - list of string -
dotnet_framework_versionoptional - string -
ftps_stateoptional computed - string -
health_check_pathoptional - string -
http2_enabledoptional - bool -
ip_restrictionoptional computed - list of object-
action- string -
ip_address- string -
name- string -
priority- number -
service_tag- string -
virtual_network_subnet_id- string
-
-
java_containeroptional - string -
java_container_versionoptional - string -
java_versionoptional - string -
linux_fx_versionoptional computed - string -
local_mysql_enabledoptional computed - bool -
managed_pipeline_modeoptional computed - string -
min_tls_versionoptional computed - string -
number_of_workersoptional computed - number -
php_versionoptional - string -
python_versionoptional - string -
remote_debugging_enabledoptional - bool -
remote_debugging_versionoptional computed - string -
scm_ip_restrictionoptional computed - list of object-
action- string -
ip_address- string -
name- string -
priority- number -
service_tag- string -
virtual_network_subnet_id- string
-
-
scm_typeoptional computed - string -
scm_use_main_ip_restrictionoptional - bool -
use_32_bit_worker_processoptional - bool -
websockets_enabledoptional computed - bool -
windows_fx_versionoptional computed - string -
corslist block-
allowed_originsrequired - set of string -
support_credentialsoptional - bool
-
-
-
source_controllist block-
branchoptional computed - string -
manual_integrationoptional computed - bool -
repo_urloptional computed - string -
rollback_enabledoptional computed - bool -
use_mercurialoptional computed - bool
-
-
storage_accountset block-
access_keyrequired - string -
account_namerequired - string -
mount_pathoptional - string -
namerequired - string -
share_namerequired - string -
typerequired - string
-
-
timeoutssingle block
Explanation in Terraform Registry
Manages an App Service (within an App Service Plan). -> Note: When using Slots - the
app_settings,connection_stringandsite_configblocks on theazurerm_app_serviceresource will be overwritten when promoting a Slot using theazurerm_app_service_active_slotresource.
Tips: Best Practices for The Other Azure App Service (Web Apps) Resources
In addition to the azurerm_function_app, Azure App Service (Web Apps) has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_function_app
Ensure to enable authentication to prevent anonymous request being accepted
It is better to enable authentication to prevent anonymous requests and ensure all communications in the application are authenticated.
Microsoft.Web/sites (Azure Resource Manager)
The sites in Microsoft.Web can be configured in Azure Resource Manager with the resource name Microsoft.Web/sites. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"ResourceType": "Microsoft.Web/sites",
"MetricName": "Http5xx",
"Operator": "GreaterThanOrEqual",
"Threshold": "50",
"TimeWindow": "PT5M",
"Aggregation": "Total"
"resourceType": "Microsoft.Web/sites",
"allOf": [
{
"path": "kind",
"regex": "api$"
},
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('FunctionAppName')]",
"location": "UK South",
"kind": "functionapp",
"properties": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"deploymentId": {
"type": "Microsoft.Web/sites",
"name": "[parameters('site_name')]",
"apiVersion": "2016-08-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('sites_chapter4_iac_dockerimage_name')]",
"location": "Central US",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_ASP_Chapter4RG_ac17_name'))]"
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"infrastructure": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"infrastructure": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"infrastructure": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"infrastructure": {
Parameters
apiVersionrequired - stringextendedLocationoptionalnameoptional - stringName of extended location.
identityoptionaltypeoptional - stringType of managed service identity.
userAssignedIdentitiesoptional - undefinedThe 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}
kindoptional - stringKind of resource.
locationrequired - stringResource Location.
namerequired - stringUnique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter.
propertiesrequiredclientAffinityEnabledoptional - boolean<code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>.
clientCertEnabledoptional - boolean<code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>.
clientCertExclusionPathsoptional - stringclient certificate authentication comma-separated exclusion paths
clientCertModeoptional - stringThis composes with ClientCertEnabled setting.
- ClientCertEnabled: false means ClientCert is ignored.
- ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required.
- ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted.
cloningInfooptionalappSettingsOverridesoptional - stringApplication setting overrides for cloned app. If specified, these settings override the settings cloned from source app. Otherwise, application settings from source app are retained.
cloneCustomHostNamesoptional - boolean<code>true</code> to clone custom hostnames from source app; otherwise, <code>false</code>.
cloneSourceControloptional - boolean<code>true</code> to clone source control from source app; otherwise, <code>false</code>.
configureLoadBalancingoptional - boolean<code>true</code> to configure load balancing for source and destination app.
correlationIdoptional - stringCorrelation ID of cloning operation. This ID ties multiple cloning operations together to use the same snapshot.
hostingEnvironmentoptional - stringApp Service Environment.
overwriteoptional - boolean<code>true</code> to overwrite destination app; otherwise, <code>false</code>.
sourceWebAppIdrequired - stringARM 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.
sourceWebAppLocationoptional - stringLocation of source app ex: West US or North Europe
trafficManagerProfileIdoptional - stringARM 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}.
trafficManagerProfileNameoptional - stringName of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist.
containerSizeoptional - integerSize of the function container.
customDomainVerificationIdoptional - stringUnique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification.
dailyMemoryTimeQuotaoptional - integerMaximum allowed daily memory-time quota (applicable on dynamic apps only).
enabledoptional - boolean<code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline).
hostingEnvironmentProfileoptionalidoptional - stringResource ID of the App Service Environment.
hostNamesDisabledoptional - boolean<code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. If <code>true</code>, the app is only accessible via API management process.
hostNameSslStatesoptional arrayhostTypeoptional - stringIndicates whether the hostname is a standard or repository hostname.
nameoptional - stringHostname.
sslStateoptional - stringSSL type.
thumbprintoptional - stringSSL certificate thumbprint.
toUpdateoptional - booleanSet to <code>true</code> to update existing hostname.
virtualIPoptional - stringVirtual IP address assigned to the hostname if IP based SSL is enabled.
httpsOnlyoptional - booleanHttpsOnly: configures a web site to accept only https requests. Issues redirect for http requests
hyperVoptional - booleanHyper-V sandbox.
isXenonoptional - booleanObsolete: Hyper-V sandbox.
keyVaultReferenceIdentityoptional - stringIdentity to use for Key Vault Reference authentication.
redundancyModeoptional - stringSite redundancy mode.
reservedoptional - boolean<code>true</code> if reserved; otherwise, <code>false</code>.
scmSiteAlsoStoppedoptional - boolean<code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>.
serverFarmIdoptional - stringResource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
siteConfigoptionalacrUseManagedIdentityCredsoptional - booleanFlag to use Managed Identity Creds for ACR pull
acrUserManagedIdentityIDoptional - stringIf using user managed identity, the user managed identity ClientId
alwaysOnoptional - boolean<code>true</code> if Always On is enabled; otherwise, <code>false</code>.
apiDefinitionoptionalurloptional - stringThe URL of the API definition.
apiManagementConfigoptionalidoptional - stringAPIM-Api Identifier.
appCommandLineoptional - stringApp command line to launch.
appSettingsoptional arraynameoptional - stringPair name.
valueoptional - stringPair value.
autoHealEnabledoptional - boolean<code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>.
autoHealRulesoptionalactionsoptionalactionTypeoptional - stringPredefined action to be taken.
customActionoptionalexeoptional - stringExecutable to be run.
parametersoptional - stringParameters for the executable.
minProcessExecutionTimeoptional - stringMinimum time the process must execute before taking the action
triggersoptionalprivateBytesInKBoptional - integerA rule based on private bytes.
requestsoptionalcountoptional - integerRequest Count.
timeIntervaloptional - stringTime interval.
slowRequestsoptionalcountoptional - integerRequest Count.
pathoptional - stringRequest Path.
timeIntervaloptional - stringTime interval.
timeTakenoptional - stringTime taken.
slowRequestsWithPathoptional arraycountoptional - integerRequest Count.
pathoptional - stringRequest Path.
timeIntervaloptional - stringTime interval.
timeTakenoptional - stringTime taken.
statusCodesoptional arraycountoptional - integerRequest Count.
pathoptional - stringRequest Path
statusoptional - integerHTTP status code.
subStatusoptional - integerRequest Sub Status.
timeIntervaloptional - stringTime interval.
win32Statusoptional - integerWin32 error code.
statusCodesRangeoptional arraycountoptional - integerRequest Count.
pathoptional - stringstatusCodesoptional - stringHTTP status code.
timeIntervaloptional - stringTime interval.
autoSwapSlotNameoptional - stringAuto-swap slot name.
azureStorageAccountsoptional - undefinedList of Azure Storage Accounts.
connectionStringsoptional arrayconnectionStringoptional - stringConnection string value.
nameoptional - stringName of connection string.
typeoptional - stringType of database.
corsoptionalallowedOriginsoptional - arrayGets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.
supportCredentialsoptional - booleanGets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details.
defaultDocumentsoptional - arrayDefault documents.
detailedErrorLoggingEnabledoptional - boolean<code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>.
documentRootoptional - stringDocument root.
experimentsoptionalrampUpRulesoptional arrayactionHostNameoptional - stringHostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net.
changeDecisionCallbackUrloptional - stringCustom 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/
changeIntervalInMinutesoptional - integerSpecifies interval in minutes to reevaluate ReroutePercentage.
changeStepoptional - numberIn auto ramp up scenario this is the step to add/remove from <code>ReroutePercentage</code> until it reaches \n<code>MinReroutePercentage</code> or <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in <code>ChangeIntervalInMinutes</code>.\nCustom decision algorithm can be provided in TiPCallback site extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>.
maxReroutePercentageoptional - numberSpecifies upper boundary below which ReroutePercentage will stay.
minReroutePercentageoptional - numberSpecifies lower boundary above which ReroutePercentage will stay.
nameoptional - stringName of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment.
reroutePercentageoptional - numberPercentage of the traffic which will be redirected to <code>ActionHostName</code>.
ftpsStateoptional - stringState of FTP / FTPS service.
functionAppScaleLimitoptional - integerMaximum number of workers that a site can scale out to. This setting only applies to the Consumption and Elastic Premium Plans
functionsRuntimeScaleMonitoringEnabledoptional - booleanGets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, the ScaleController will not monitor event sources directly, but will instead call to the runtime to get scale status.
handlerMappingsoptional arrayargumentsoptional - stringCommand-line arguments to be passed to the script processor.
extensionoptional - stringRequests with this extension will be handled using the specified FastCGI application.
scriptProcessoroptional - stringThe absolute path to the FastCGI application.
healthCheckPathoptional - stringHealth check path
http20Enabledoptional - booleanHttp20Enabled: configures a web site to allow clients to connect over http2.0
httpLoggingEnabledoptional - boolean<code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>.
ipSecurityRestrictionsoptional arrayactionoptional - stringAllow or Deny access for this IP range.
descriptionoptional - stringIP restriction rule description.
headersoptional - arrayIP restriction rule headers. X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic is ..
- If the property is null or empty (default), all hosts(or lack of) are allowed.
- A value is compared using ordinal-ignore-case (excluding port number).
- Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com but not the root domain contoso.com or multi-level foo.bar.contoso.com
- Unicode host names are allowed but are converted to Punycode for matching. X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). The matching logic is ..
- If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed.
- If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. X-Azure-FDID and X-FD-HealthProbe. The matching logic is exact match.
ipAddressoptional - stringIP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified.
nameoptional - stringIP restriction rule name.
priorityoptional - integerPriority of IP restriction rule.
subnetMaskoptional - stringSubnet mask for the range of IP addresses the restriction is valid for.
subnetTrafficTagoptional - integer(internal) Subnet traffic tag
tagoptional - stringDefines what this IP filter will be used for. This is to support IP filtering on proxies.
vnetSubnetResourceIdoptional - stringVirtual network resource id
vnetTrafficTagoptional - integer(internal) Vnet traffic tag
javaContaineroptional - stringJava container.
javaContainerVersionoptional - stringJava container version.
javaVersionoptional - stringJava version.
keyVaultReferenceIdentityoptional - stringIdentity to use for Key Vault Reference authentication.
limitsoptionalmaxDiskSizeInMboptional - integerMaximum allowed disk size usage in MB.
maxMemoryInMboptional - integerMaximum allowed memory usage in MB.
maxPercentageCpuoptional - numberMaximum allowed CPU usage percentage.
linuxFxVersionoptional - stringLinux App Framework and version
loadBalancingoptional - stringSite load balancing.
localMySqlEnabledoptional - boolean<code>true</code> to enable local MySQL; otherwise, <code>false</code>.
logsDirectorySizeLimitoptional - integerHTTP logs directory size limit.
managedPipelineModeoptional - stringManaged pipeline mode.
managedServiceIdentityIdoptional - integerManaged Service Identity Id
minimumElasticInstanceCountoptional - integerNumber of minimum instance count for a site This setting only applies to the Elastic Plans
minTlsVersionoptional - stringMinTlsVersion: configures the minimum version of TLS required for SSL requests.
netFrameworkVersionoptional - string.NET Framework version.
nodeVersionoptional - stringVersion of Node.js.
numberOfWorkersoptional - integerNumber of workers.
phpVersionoptional - stringVersion of PHP.
powerShellVersionoptional - stringVersion of PowerShell.
preWarmedInstanceCountoptional - integerNumber of preWarmed instances. This setting only applies to the Consumption and Elastic Plans
publicNetworkAccessoptional - stringProperty to allow or block all public traffic.
publishingUsernameoptional - stringPublishing user name.
pushoptionalkindoptional - stringKind of resource.
propertiesoptionaldynamicTagsJsonoptional - stringGets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint.
isPushEnabledrequired - booleanGets or sets a flag indicating whether the Push endpoint is enabled.
tagsRequiringAuthoptional - stringGets 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.
tagWhitelistJsonoptional - stringGets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint.
pythonVersionoptional - stringVersion of Python.
remoteDebuggingEnabledoptional - boolean<code>true</code> if remote debugging is enabled; otherwise, <code>false</code>.
remoteDebuggingVersionoptional - stringRemote debugging version.
requestTracingEnabledoptional - boolean<code>true</code> if request tracing is enabled; otherwise, <code>false</code>.
requestTracingExpirationTimeoptional - stringRequest tracing expiration time.
scmIpSecurityRestrictionsoptional arrayactionoptional - stringAllow or Deny access for this IP range.
descriptionoptional - stringIP restriction rule description.
headersoptional - arrayIP restriction rule headers. X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic is ..
- If the property is null or empty (default), all hosts(or lack of) are allowed.
- A value is compared using ordinal-ignore-case (excluding port number).
- Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com but not the root domain contoso.com or multi-level foo.bar.contoso.com
- Unicode host names are allowed but are converted to Punycode for matching. X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). The matching logic is ..
- If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed.
- If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. X-Azure-FDID and X-FD-HealthProbe. The matching logic is exact match.
ipAddressoptional - stringIP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified.
nameoptional - stringIP restriction rule name.
priorityoptional - integerPriority of IP restriction rule.
subnetMaskoptional - stringSubnet mask for the range of IP addresses the restriction is valid for.
subnetTrafficTagoptional - integer(internal) Subnet traffic tag
tagoptional - stringDefines what this IP filter will be used for. This is to support IP filtering on proxies.
vnetSubnetResourceIdoptional - stringVirtual network resource id
vnetTrafficTagoptional - integer(internal) Vnet traffic tag
scmIpSecurityRestrictionsUseMainoptional - booleanIP security restrictions for scm to use main.
scmMinTlsVersionoptional - stringScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site.
scmTypeoptional - stringSCM type.
tracingOptionsoptional - stringTracing options.
use32BitWorkerProcessoptional - boolean<code>true</code> to use 32-bit worker process; otherwise, <code>false</code>.
virtualApplicationsoptional arrayphysicalPathoptional - stringPhysical path.
preloadEnabledoptional - boolean<code>true</code> if preloading is enabled; otherwise, <code>false</code>.
virtualDirectoriesoptional arrayphysicalPathoptional - stringPhysical path.
virtualPathoptional - stringPath to virtual application.
virtualPathoptional - stringVirtual path.
vnetNameoptional - stringVirtual Network name.
vnetPrivatePortsCountoptional - integerThe number of private ports assigned to this app. These will be assigned dynamically on runtime.
vnetRouteAllEnabledoptional - booleanVirtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied.
websiteTimeZoneoptional - stringSets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
webSocketsEnabledoptional - boolean<code>true</code> if WebSocket is enabled; otherwise, <code>false</code>.
windowsFxVersionoptional - stringXenon App Framework and version
xManagedServiceIdentityIdoptional - integerExplicit Managed Service Identity Id
storageAccountRequiredoptional - booleanChecks if Customer provided storage account is required
virtualNetworkSubnetIdoptional - stringAzure 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}
tagsoptional - stringResource tags.
typerequired - string
Frequently asked questions
What is Azure App Service (Web Apps) App Service?
Azure App Service (Web Apps) App Service is a resource for App Service (Web Apps) of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure App Service (Web Apps) App Service?
For Terraform, the miguelsierramartin/PlayPadel, NsamaChibulu/Project2Services and returntocorp/semgrep-rules source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the SkillsFundingAgency/dfc-providerportal-monitoring, ajf214/personal-arm-templates and mrpaulandrew/procfwk source code examples are useful. See the Azure Resource Manager Example section for further details.