Skip to content

Data Source: azurermAppService

Use this data source to access information about an existing App Service.

!> Note: The azurermAppService data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the azurermLinuxWebApp and azurermWindowsWebApp data sources instead.

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermAppServiceExample =
  new azurerm.dataAzurermAppService.DataAzurermAppService(this, "example", {
    name: "search-app-service",
    resource_group_name: "search-service",
  });
new cdktf.TerraformOutput(this, "app_service_id", {
  value: dataAzurermAppServiceExample.id,
});

Argument Reference

  • name - The name of the App Service.

  • resourceGroupName - The Name of the Resource Group where the App Service exists.

Attributes Reference

  • id - The ID of the App Service.

  • location - The Azure location where the App Service exists.

  • appServicePlanId - The ID of the App Service Plan within which the App Service exists.

  • appSettings - A key-value pair of App Settings for the App Service.

  • connectionString - An connectionString block as defined below.

  • clientAffinityEnabled - Does the App Service send session affinity cookies, which route client requests in the same session to the same instance?

  • customDomainVerificationId - An identifier used by App Service to perform domain ownership verification via DNS TXT record.

  • enabled - Is the App Service Enabled?

  • httpsOnly - Can the App Service only be accessed via HTTPS?

  • clientCertEnabled - Does the App Service require client certificates for incoming requests?

  • siteConfig - A siteConfig block as defined below.

  • tags - A mapping of tags to assign to the resource.

  • defaultSiteHostname - The Default Hostname associated with the App Service - such as mysiteAzurewebsitesNet

  • outboundIpAddresses - A comma separated list of outbound IP addresses - such as 5223253,521434312

  • outboundIpAddressList - A list of outbound IP addresses - such as ["5223253", "521434312"]

  • possibleOutboundIpAddresses - A comma separated list of outbound IP addresses - such as 5223253,521434312,521434317 - not all of which are necessarily in use. Superset of outboundIpAddresses.

  • possibleOutboundIpAddressList - A list of outbound IP addresses - such as ["5223253", "521434312", "521434317"] - not all of which are necessarily in use. Superset of outboundIpAddressList.

  • sourceControl - A sourceControl block as defined below.


A connectionString block exports the following:

  • name - The name of the Connection String.

  • type - The type of the Connection String.

  • value - The value for the Connection String.


A cors block exports the following:

  • allowedOrigins - A list of origins which are able to make cross-origin calls.

  • supportCredentials - Are credentials supported?


An ipRestriction block exports the following:

  • ipAddress - The IP Address used for this IP Restriction.

  • serviceTag - The Service Tag used for this IP Restriction.

  • subnetMask - The Subnet mask used for this IP Restriction.

  • name - The name for this IP Restriction.

  • priority - The priority for this IP Restriction.

  • action - Does this restriction allow or deny access for this IP range?


An scmIpRestriction block exports the following:

  • ipAddress - The IP Address used for this IP Restriction in CIDR notation.

  • serviceTag - The Service Tag used for this IP Restriction.

  • virtualNetworkSubnetId - The Virtual Network Subnet ID used for this IP Restriction.

  • name - The name for this IP Restriction.

  • priority - The priority for this IP Restriction.

  • action - Allow or Deny access for this IP range. Defaults to Allow.


A siteConfig block exports the following:

  • acrUseManagedIdentityCredentials - Are Managed Identity Credentials used for Azure Container Registry pull.

  • acrUserManagedIdentityClientId - The User Managed Identity Client Id.

  • alwaysOn - Is the app loaded at all times?

  • appCommandLine - App command line to launch.

  • cors - A cors block as defined above.

  • defaultDocuments - The ordering of default documents to load, if an address isn't specified.

  • dotnetFrameworkVersion - The version of the .NET framework's CLR used in this App Service.

  • http2Enabled - Is HTTP2 Enabled on this App Service?

  • ftpsState - State of FTP / FTPS service for this AppService.

  • healthCheckPath - The health check path to be pinged by App Service.

  • numberOfWorkers - The scaled number of workers (for per site scaling) of this App Service.

  • ipRestriction - One or more ipRestriction blocks as defined above.

  • scmUseMainIpRestriction - IP security restrictions for scm to use main.

  • scmIpRestriction - One or more scmIpRestriction blocks as defined above.

  • javaVersion - The version of Java in use.

  • javaContainer - The Java Container in use.

  • javaContainerVersion - The version of the Java Container in use.

  • linuxFxVersion - Linux App Framework and version for the AppService.

  • windowsFxVersion - Windows Container Docker Image for the AppService.

  • localMysqlEnabled - Is "MySQL In App" Enabled? This runs a local MySQL instance with your app and shares resources from the App Service plan.

  • managedPipelineMode - The Managed Pipeline Mode used in this App Service.

  • minTlsVersion - The minimum supported TLS version for this App Service.

  • phpVersion - The version of PHP used in this App Service.

  • pythonVersion - The version of Python used in this App Service.

  • remoteDebuggingEnabled - Is Remote Debugging Enabled in this App Service?

  • remoteDebuggingVersion - Which version of Visual Studio is the Remote Debugger compatible with?

  • scmType - The type of Source Control enabled for this App Service.

  • use32BitWorkerProcess - Does the App Service run in 32 bit mode, rather than 64 bit mode?

  • vnetRouteAllEnabled - (Optional) Should all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied?

  • websocketsEnabled - Are WebSockets enabled for this App Service?


A sourceControl block exports the following:

  • repoUrl - The URL of the source code repository.

  • branch - The branch of the remote repository in use.

  • manualIntegration - Limits to manual integration.

  • rollbackEnabled - Is roll-back enabled for the repository.

  • useMercurial - Uses Mercurial if true, otherwise uses Git.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the App Service.