AzureRmWebAppDeployment@3 - Azure App Service deploy v3 task
Use this task to deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby.
This version of the task is deprecated; use AzureRmWebAppDeployment@4 to take advantage of the latest features like Workload identity federation.
Note
Use AzureFunctionApp@1 to deploy Azure Functions apps.
Use this task to deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby.
Note
Use AzureFunctionApp@1 to deploy Azure Functions apps.
Update Azure App Services on Windows, Web App on Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node.js based Web applications, Function Apps, Mobile Apps, API applications, and Web Jobs using Web Deploy/Kudu REST APIs.
Syntax
# Azure App Service deploy v3
# Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby.
- task: AzureRmWebAppDeployment@3
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
appType: 'app' # 'app' | 'applinux' | 'functionapp' | 'api' | 'mobileapp'. Alias: WebAppKind. Required. App type. Default: app.
WebAppName: # string. Required. App Service name.
#DeployToSlotFlag: false # boolean. Optional. Use when WebAppKind != "". Deploy to slot. Default: false.
#ResourceGroupName: # string. Required when DeployToSlotFlag = true. Resource group.
#SlotName: # string. Required when DeployToSlotFlag = true. Slot.
#ImageSource: 'Registry' # 'Registry' | 'Builtin'. Optional. Use when WebAppKind = applinux || WebAppKind = linux. Image Source. Default: Registry.
#AzureContainerRegistry: # string. Required when ImageSource = AzureContainerRegistry. Registry.
#AzureContainerRegistryLoginServer: # string. Optional. Use when ImageSource = invalidimagesource. Registry Login Server Name.
#AzureContainerRegistryImage: # string. Required when ImageSource = AzureContainerRegistry. Image.
#AzureContainerRegistryTag: # string. Optional. Use when ImageSource = AzureContainerRegistry. Tag.
#DockerRepositoryAccess: 'public' # 'private' | 'public'. Required when ImageSource = invalidImage. Repository Access. Default: public.
#dockerRegistryConnection: # string. Alias: RegistryConnectedServiceName. Required when DockerRepositoryAccess = private || ImageSource = PrivateRegistry. Registry Connection.
#PrivateRegistryImage: # string. Required when ImageSource = PrivateRegistry. Image.
#PrivateRegistryTag: # string. Optional. Use when ImageSource = PrivateRegistry. Tag.
#DockerNamespace: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Registry or Namespace.
#DockerRepository: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Image.
#DockerImageTag: # string. Optional. Use when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Tag.
#VirtualApplication: # string. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Virtual application.
#Package: '$(System.DefaultWorkingDirectory)/**/*.zip' # string. Required when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.zip.
#packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip' # string. Alias: BuiltinLinuxPackage. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.zip.
#RuntimeStack: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin. Runtime Stack.
#StartupCommand: # string. Optional. Use when WebAppKind = applinux || WebAppKind = linux. Startup command.
# Output
#WebAppUri: # string. Optional. Use when WebAppKind != "". App Service URL.
# Post Deployment Action
#ScriptType: # 'Inline Script' | 'File Path'. Optional. Use when WebAppKind != "". Deployment script type.
#InlineScript: ':: You can provide your deployment commands here. One command per line.' # string. Required when ScriptType == Inline Script && WebAppKind != "". Inline Script. Default: :: You can provide your deployment commands here. One command per line..
#ScriptPath: # string. Required when ScriptType == File Path && WebAppKind != "". Deployment script path.
# File Transforms & Variable Substitution Options
#GenerateWebConfig: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. Generate Web.config. Default: false.
#WebConfigParameters: # string. Required when GenerateWebConfig == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. Web.config parameters.
#enableXmlTransform: false # boolean. Alias: XmlTransformation. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. XML transformation. Default: false.
#enableXmlVariableSubstitution: false # boolean. Alias: XmlVariableSubstitution. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. XML variable substitution. Default: false.
#JSONFiles: # string. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. JSON variable substitution.
# Application and Configuration Settings
#AppSettings: # string. App settings.
#ConfigurationSettings: # string. Configuration settings.
# Additional Deployment Options
#TakeAppOfflineFlag: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Take App Offline. Default: false.
#UseWebDeploy: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Publish using Web Deploy. Default: false.
#SetParametersFile: # string. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". SetParameters file.
#RemoveAdditionalFilesFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Remove additional files at destination. Default: false.
#ExcludeFilesFromAppDataFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Exclude files from the App_Data folder. Default: false.
#AdditionalArguments: # string. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Additional arguments.
#RenameFilesFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Rename locked files. Default: false.
# Azure App Service Deploy v3
# Update Azure App Services on Windows, Web App on Linux with built-in images or Docker containers, ASP.NET, .NET Core, PHP, Python or Node.js based Web applications, Function Apps, Mobile Apps, API applications, Web Jobs using Web Deploy / Kudu REST APIs.
- task: AzureRmWebAppDeployment@3
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
appType: 'app' # 'app' | 'applinux' | 'functionapp' | 'api' | 'mobileapp'. Alias: WebAppKind. Required. App type. Default: app.
WebAppName: # string. Required. App Service name.
#DeployToSlotFlag: false # boolean. Optional. Use when WebAppKind != "". Deploy to slot. Default: false.
#ResourceGroupName: # string. Required when DeployToSlotFlag = true. Resource group.
#SlotName: # string. Required when DeployToSlotFlag = true. Slot.
#ImageSource: 'Registry' # 'Registry' | 'Builtin'. Optional. Use when WebAppKind = applinux || WebAppKind = linux. Image Source. Default: Registry.
#AzureContainerRegistry: # string. Required when ImageSource = AzureContainerRegistry. Registry.
#AzureContainerRegistryLoginServer: # string. Optional. Use when ImageSource = invalidimagesource. Registry Login Server Name.
#AzureContainerRegistryImage: # string. Required when ImageSource = AzureContainerRegistry. Image.
#AzureContainerRegistryTag: # string. Optional. Use when ImageSource = AzureContainerRegistry. Tag.
#DockerRepositoryAccess: 'public' # 'private' | 'public'. Required when ImageSource = invalidImage. Repository Access. Default: public.
#dockerRegistryConnection: # string. Alias: RegistryConnectedServiceName. Required when DockerRepositoryAccess = private || ImageSource = PrivateRegistry. Registry Connection.
#PrivateRegistryImage: # string. Required when ImageSource = PrivateRegistry. Image.
#PrivateRegistryTag: # string. Optional. Use when ImageSource = PrivateRegistry. Tag.
#DockerNamespace: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Registry or Namespace.
#DockerRepository: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Image.
#DockerImageTag: # string. Optional. Use when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry. Tag.
#VirtualApplication: # string. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Virtual application.
#Package: '$(System.DefaultWorkingDirectory)/**/*.zip' # string. Required when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.zip.
#packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip' # string. Alias: BuiltinLinuxPackage. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.zip.
#RuntimeStack: # string. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin. Runtime Stack.
#StartupCommand: # string. Optional. Use when WebAppKind = applinux || WebAppKind = linux. Startup command.
# Output
#WebAppUri: # string. Optional. Use when WebAppKind != "". App Service URL.
# Post Deployment Action
#ScriptType: # 'Inline Script' | 'File Path'. Optional. Use when WebAppKind != "". Deployment script type.
#InlineScript: ':: You can provide your deployment commands here. One command per line.' # string. Required when ScriptType == Inline Script && WebAppKind != "". Inline Script. Default: :: You can provide your deployment commands here. One command per line..
#ScriptPath: # string. Required when ScriptType == File Path && WebAppKind != "". Deployment script path.
# File Transforms & Variable Substitution Options
#GenerateWebConfig: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. Generate Web.config. Default: false.
#WebConfigParameters: # string. Required when GenerateWebConfig == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. Web.config parameters.
#enableXmlTransform: false # boolean. Alias: XmlTransformation. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. XML transformation. Default: false.
#enableXmlVariableSubstitution: false # boolean. Alias: XmlVariableSubstitution. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. XML variable substitution. Default: false.
#JSONFiles: # string. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war. JSON variable substitution.
# Application and Configuration Settings
#AppSettings: # string. App settings.
#ConfigurationSettings: # string. Configuration settings.
# Additional Deployment Options
#TakeAppOfflineFlag: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Take App Offline. Default: false.
#UseWebDeploy: false # boolean. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Publish using Web Deploy. Default: false.
#SetParametersFile: # string. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". SetParameters file.
#RemoveAdditionalFilesFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Remove additional files at destination. Default: false.
#ExcludeFilesFromAppDataFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Exclude files from the App_Data folder. Default: false.
#AdditionalArguments: # string. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Additional arguments.
#RenameFilesFlag: false # boolean. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "". Rename locked files. Default: false.
Inputs
azureSubscription
- Azure subscription
Input alias: ConnectedServiceName
. string
. Required.
Specify the Azure Resource Manager subscription for the deployment.
appType
- App type
Input alias: WebAppKind
. string
. Required. Allowed values: app
(Web App), applinux
(Linux Web App), functionapp
(Function App (Not Recommended, Use Azure Functions Task)), api
(API App), mobileapp
(Mobile App). Default value: app
.
Specify the type of web app to deploy.
Note: Specify Linux Web App for built-in platform images or custom container image deployments.
appType
- App type
Input alias: WebAppKind
. string
. Required. Allowed values: app
(Web App), applinux
(Linux Web App), functionapp
(Function App), api
(API App), mobileapp
(Mobile App). Default value: app
.
Specify the type of web app to deploy.
Note: Specify Linux Web App for built-in platform images or custom container image deployments.
WebAppName
- App Service name
string
. Required.
Specify the name of an existing Azure App Service. App services based on the selected app type will only be listed when using the task assistant.
DeployToSlotFlag
- Deploy to slot
boolean
. Optional. Use when WebAppKind != ""
. Default value: false
.
Use this option to deploy to an existing slot other than the Production slot. If this option is not selected, then the Azure App Service will be deployed to the Production slot.
ResourceGroupName
- Resource group
string
. Required when DeployToSlotFlag = true
.
Specify the Azure Resource group that contains the Azure App Service specified above.
SlotName
- Slot
string
. Required when DeployToSlotFlag = true
.
Specify an existing slot other than the Production slot.
ImageSource
- Image Source
string
. Optional. Use when WebAppKind = applinux || WebAppKind = linux
. Allowed values: Registry
(Container Registry), Builtin
(Built-in Image). Default value: Registry
.
App Service on Linux offers two different options to publish your application:
Custom image deployment or app deployment with a built-in platform image.
AzureContainerRegistry
- Registry
string
. Required when ImageSource = AzureContainerRegistry
.
A globally unique top-level domain name for your specific registry.
Note: A fully qualified image name will be of the format: <registry>
/<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx:latest
.
AzureContainerRegistryLoginServer
- Registry Login Server Name
string
. Optional. Use when ImageSource = invalidimagesource
.
Specify an Azure container registry login server name.
AzureContainerRegistryImage
- Image
string
. Required when ImageSource = AzureContainerRegistry
.
The name of the repository where the container images are stored.
Note: A fully qualified image name will be of the format: <registry>
/<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx
:latest
.
AzureContainerRegistryTag
- Tag
string
. Optional. Use when ImageSource = AzureContainerRegistry
.
This is the mechanism that registries use to give Docker images a version.
Note: A fully qualified image name will be of the format: <registry>
/<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx
:latest
.
DockerRepositoryAccess
- Repository Access
string
. Required when ImageSource = invalidImage
. Allowed values: private
, public
. Default value: public
.
Specify the Docker repository access.
dockerRegistryConnection
- Registry Connection
Input alias: RegistryConnectedServiceName
. string
. Required when DockerRepositoryAccess = private || ImageSource = PrivateRegistry
.
Specify the registry connection.
PrivateRegistryImage
- Image
string
. Required when ImageSource = PrivateRegistry
.
The name of the repository where the container images are stored.
Note: A fully qualified image name will be of the format: <registry>
<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx
:latest
.
PrivateRegistryTag
- Tag
string
. Optional. Use when ImageSource = PrivateRegistry
.
Tags are the mechanism that registries use to give Docker images a version.
Note: A fully qualified image name will be of the format: '<registry>
/<repository>
:<tag>
'. For example, myregistry.azurecr.io
/nginx
:latest
.
DockerNamespace
- Registry or Namespace
string
. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry
.
A globally unique top-level domain name for your specific registry or namespace.
Note: A fully qualified image name will be of the format: <registry or namespace>
/<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx
:latest
.
DockerRepository
- Image
string
. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry
.
The name of the repository where the container images are stored.
Note: A fully qualified image name will be of the format: '<registry or namespace>
/<repository>
:<tag>
. For example, myregistry.azurecr.io
/nginx
:latest
.
DockerImageTag
- Tag
string
. Optional. Use when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry
.
This is the mechanism that registries use to give Docker images a version.
Note: A fully qualified image name will be of the format: '<registry or namespace>
/<repository>
:<tag>
'. For example, myregistry.azurecr.io
/nginx
:latest
.
VirtualApplication
- Virtual application
string
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
.
Specify the name of the Virtual Application that has been configured in the Azure portal. The option is not required for deployments to the App Service root.
Package
- Package or folder
string
. Required when WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: $(System.DefaultWorkingDirectory)/**/*.zip
.
The file path to the package or a folder containing app service contents generated by MSBuild or a compressed zip or war file.
Variables are Build and Release. Wildcards are supported.
For example, $(System.DefaultWorkingDirectory)/\*\*/\*.zip
or $(System.DefaultWorkingDirectory)/\*\*/\*.war
.
packageForLinux
- Package or folder
Input alias: BuiltinLinuxPackage
. string
. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin
. Default value: $(System.DefaultWorkingDirectory)/**/*.zip
.
The file path to the package or a folder containing app service contents generated by MSBuild or a compressed zip or war file.
Variables are Build and Release. Wildcards are supported.
For example, $(System.DefaultWorkingDirectory)/\*\*/\*.zip
or $(System.DefaultWorkingDirectory)/\*\*/\*.war
.
RuntimeStack
- Runtime Stack
string
. Required when WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin
.
Specify the framework and version.
StartupCommand
- Startup command
string
. Optional. Use when WebAppKind = applinux || WebAppKind = linux
.
Specify the startup command.
WebAppUri
- App Service URL
string
. Optional. Use when WebAppKind != ""
.
Specify a name for the output variable that is generated for the URL of the Azure App Service. The variable can be used in subsequent tasks.
ScriptType
- Deployment script type
string
. Optional. Use when WebAppKind != ""
. Allowed values: Inline Script
, File Path
(Script File Path).
Customizes the deployment by providing a script that will run on the Azure App service once the task has completed the deployment successfully . For example, this can restore packages for Node, PHP, and Python applications. Learn more about Azure App Service Deployment.
InlineScript
- Inline Script
string
. Required when ScriptType == Inline Script && WebAppKind != ""
. Default value: :: You can provide your deployment commands here. One command per line.
.
ScriptPath
- Deployment script path
string
. Required when ScriptType == File Path && WebAppKind != ""
.
GenerateWebConfig
- Generate Web.config
boolean
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war
. Default value: false
.
A standard Web.config
will be generated and deployed to Azure App Service if the application does not have one. The values in web.config
can be edited and vary based on the application framework. For example, for the node.js
application, web.config
will have startup file and iis_node
module values. Learn more about Azure App Service Deployment.
WebConfigParameters
- Web.config parameters
string
. Required when GenerateWebConfig == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war
.
Edits values like startup files in the generated web.config
file. This edit feature is only for the generated web.config
. Learn more about Azure App Service Deployment.
AppSettings
- App settings
string
.
Edits web app application settings following the syntax -key value . Values containing spaces should be enclosed in double quotes.
Examples: -Port 5000
-RequestTimeout 5000
-WEBSITE_TIME_ZONE
"Eastern Standard Time"
.
ConfigurationSettings
- Configuration settings
string
.
Edits web app configuration settings following the syntax -key
value. Values containing spaces should be enclosed in double quotes.
Examples: -phpVersion 5.6
-linuxFxVersion: node|6.11
.
TakeAppOfflineFlag
- Take App Offline
boolean
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: false
.
Use this option to take the Azure App Service offline by placing an app_offline.htm
file in the root directory of the App Service before the sync operation begins. The file will be removed after the sync operation completes successfully.
UseWebDeploy
- Publish using Web Deploy
boolean
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: false
.
Publish using Web Deploy
options are supported only when using Windows agent. On other platforms, the task relies on Kudu REST APIs to deploy the Azure App Service, and following options are not supported.
SetParametersFile
- SetParameters file
string
. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
.
The location of the SetParameters.xml
file to use.
RemoveAdditionalFilesFlag
- Remove additional files at destination
boolean
. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: false
.
Use this option to delete files on the Azure App Service that have no matching files in the App Service package or folder.
Note: This will also remove all files related to any extension installed on this Azure App Service. To prevent this, select the Exclude files from App_Data folder
checkbox.
ExcludeFilesFromAppDataFlag
- Exclude files from the App_Data folder
boolean
. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: false
.
Use this option to prevent files in the App_Data
folder from being deployed to/deleted from the Azure App Service.
AdditionalArguments
- Additional arguments
string
. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
.
The additional Web Deploy arguments following the syntax -key:value
.
These will be applied when deploying the Azure App Service. Examples: -disableLink:AppPoolExtension
-disableLink:ContentExtension
.
See more examples of Web Deploy Operation Settings.
RenameFilesFlag
- Rename locked files
boolean
. Optional. Use when UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""
. Default value: false
.
Use this option to enable msdeploy flag MSDEPLOY_RENAME_LOCKED_FILES=1
in Azure App Service application settings. The option enables msdeploy to rename locked files that are locked during app deployment.
enableXmlTransform
- XML transformation
Input alias: XmlTransformation
. boolean
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war
. Default value: false
.
The config transforms will be run for *.Release.config
and *.<EnvironmentName>.config
on the *.config file
.
Config transforms will be run prior to the Variable Substitution.
XML transformations are supported only for Windows platform.
enableXmlVariableSubstitution
- XML variable substitution
Input alias: XmlVariableSubstitution
. boolean
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war
. Default value: false
.
Variables defined in the build or release pipeline will be matched against the key
or name
entries in the appSettings
, applicationSettings
, and connectionStrings
sections of any config file and parameters.xml
. Variable Substitution is run after config transforms.
Note: If the same variables are defined in the release pipeline and in the environment, then the environment variables will supersede the release pipeline variables.
JSONFiles
- JSON variable substitution
string
. Optional. Use when WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war
.
Provides a new lines-separated list of JSON files to substitute the variable values. Files names are to be provided relative to the root folder.
To substitute JSON variables that are nested or hierarchical, specify them using JSONPath
expressions.
For example, to replace the value of ConnectionString
in the sample below, you need to define a variable as Data.DefaultConnection.ConnectionString
in the build/release pipeline (or the release pipeline’s environment).
{
"Data": {
"DefaultConnection": {
"ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True"
}
}
}
Variable Substitution is run after configuration transforms.
Note: pipeline variables are excluded in substitution.
Task control options
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
Output variables
None.
Remarks
There is a newer version of this task available. For more information, see AzureRmWebAppDeployment@4.
Troubleshooting
I can't Web Deploy to my Azure App Service using Microsoft Entra ID authentication from my Windows agent
The Azure App Service deploy task supports connecting to Microsoft Azure with an ARM service connection using Microsoft Entra ID, unless the following three conditions are present:
- You are using Web Deploy package format on a Windows agent
- Your agent is running with an older version of msdeploy.exe (for example when using the windows-2019 hosted agent image)
- Basic authentication is disabled for your Azure App Service
If these three conditions are present, you will receive an error like App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225.2108 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy.
To resolve this issue, you can choose from the following options, in order of preference.
- Update the agent image. If you are using hosted agents, move from windows-2019 to windows-2022 (or windows-latest). If you are using self-hosted agents, install Visual Studio 2022 on the agent to get a newer version of msdeploy.exe.
- If you are dependent on an older agent image and can't update the agent for your pipeline, consider splitting the job so that the Azure App Service deploy task runs on windows-2022 (or windows-latest).
- If neither of these options is possible, you can enable basic authentication for your Azure App Service.
Requirements
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 2.104.1 or greater |
Task category | Deploy |