AzureRmWebAppDeployment@3 - Azure App 服務 部署 v3 工作

使用此工作部署至使用 Docker、Java、.NET、.NET Core、Node.js、PHP、Python 或 Ruby Azure App 服務 Web、行動裝置或 API 應用程式。

注意

使用AzureFunctionApp@1來部署 Azure Functions 應用程式。

使用 Web Deploy/Kudu REST API 更新 Windows 上的 Azure App Services、Linux 上的 Web 應用程式、內建映像或 Docker 容器、ASP.NET、.NET Core、PHP、Python 或 Node.js 型 Web 應用程式、函式應用程式、Mobile Apps、API 應用程式和 Web 作業。

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.

輸入

azureSubscription - Azure 訂用帳戶
輸入別名: ConnectedServiceNamestring. 必要。

指定部署的 Azure Resource Manager 訂用帳戶。


appType - 應用程式類型
輸入別名: WebAppKindstring. 必要。 允許的值: app (Web 應用程式) 、 applinux (Linux Web 應用程式) 、 functionapp (函數應用程式 (不建議 Azure Functions、使用工作) ) api 、 (API 應用程式) 、 mobileapp (行動應用程式) 。 預設值:app

指定要部署的 Web 應用程式類型。

注意:針對內建平臺映像或自定義容器映像部署指定Linux Web應用程式。


appType - 應用程式類型
輸入別名: WebAppKindstring. 必要。 允許的值: app (Web 應用程式) 、 applinux (Linux Web 應用程式) 、 functionapp (函式應用程式) 、 api (API 應用程式) 、 mobileapp (Mobile App) 。 預設值:app

指定要部署的 Web 應用程式類型。

注意:針對內建平臺映像或自定義容器映像部署指定Linux Web應用程式。


WebAppName - App Service 名稱
string. 必要。

指定現有 Azure App 服務 的名稱。 只有在使用工作 助理 時,才會列出以所選應用程式類型為基礎的應用程式服務。


DeployToSlotFlag - 部署至位置
boolean. 選擇性。 使用 時 WebAppKind != ""。 預設值:false

使用此選項可部署到生產位置以外的現有位置。 如果未選取此選項,則會將 Azure App 服務 部署到生產位置。


ResourceGroupName - 資源群組
string. 當 DeployToSlotFlag = true 時為必要。

指定包含上述 Azure App 服務 的 Azure 資源群組。


SlotName -
string. 當 DeployToSlotFlag = true 時為必要。

指定生產位置以外的現有位置。


ImageSource - 影像來源
string. 選擇性。 使用 時 WebAppKind = applinux || WebAppKind = linux。 允許的值: Registry (Container Registry) , Builtin (內建映射) 。 預設值:Registry

Linux 上的 App Service 提供兩個不同的選項來發佈您的應用程式:

使用內建平臺映像的自定義映射部署或應用程式部署。


AzureContainerRegistry - 註冊 表
string. 當 ImageSource = AzureContainerRegistry 時為必要。

特定登錄的全域唯一最上層功能變數名稱。

注意:完整映像名稱的格式為::<registry><repository>/<tag>。 例如:myregistry.azurecr.io/nginx:latest


AzureContainerRegistryLoginServer - 登錄登入伺服器名稱
string. 選擇性。 使用 時 ImageSource = invalidimagesource

指定 Azure Container Registry 登入伺服器名稱。


AzureContainerRegistryImage - 圖像
string. 當 ImageSource = AzureContainerRegistry 時為必要。

儲存容器映像的存放庫名稱。

注意:完整映像名稱的格式為::<registry><repository>/<tag>。 例如:myregistry.azurecr.ionginx/latest


AzureContainerRegistryTag - 標記
string. 選擇性。 使用 時 ImageSource = AzureContainerRegistry

這是登錄用來提供 Docker 映像版本的機制。

注意:完整映像名稱的格式為::<registry><repository>/<tag>。 例如:myregistry.azurecr.ionginx/latest


DockerRepositoryAccess - 存放庫存取
string. 當 ImageSource = invalidImage 時為必要。 允許值:privatepublic。 預設值:public

指定 Docker 存放庫存取權。


dockerRegistryConnection - 登錄連線
輸入別名: RegistryConnectedServiceNamestring. 當 DockerRepositoryAccess = private || ImageSource = PrivateRegistry 時為必要。

指定登錄連接。


PrivateRegistryImage - 圖像
string. 當 ImageSource = PrivateRegistry 時為必要。

儲存容器映像的存放庫名稱。

注意:完整映像名稱的格式為::<registry><repository><tag>。 例如:myregistry.azurecr.ionginx/latest


PrivateRegistryTag - 標記
string. 選擇性。 使用 時 ImageSource = PrivateRegistry

標籤是登錄用來提供 Docker 映像版本的機制。

注意:完整映像名稱的格式為:『<registry>/<repository><tag>』。 例如:myregistry.azurecr.ionginx/latest


DockerNamespace - 登錄或命名空間
string. 當 WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry 時為必要。

您特定登錄或命名空間的全域唯一最上層功能變數名稱。

注意:完整映像名稱的格式為::<registry or namespace><repository>/<tag>。 例如:myregistry.azurecr.ionginx/latest


DockerRepository - 圖像
string. 當 WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry 時為必要。

儲存容器映像的存放庫名稱。

注意:完整映像名稱的格式為:『<registry or namespace>/<repository>:。<tag> 例如:myregistry.azurecr.ionginx/latest


DockerImageTag - 標記
string. 選擇性。 使用 時 WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Registry

這是登錄用來提供 Docker 映像版本的機制。

注意:完整映像名稱的格式為:『<registry or namespace>/<repository><tag>』。 例如:myregistry.azurecr.ionginx/latest


VirtualApplication - 虛擬應用程式
string. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""

指定已在 Azure 入口網站 中設定的虛擬應用程式名稱。 部署至 App Service 根目錄時,不需要此選項。


Package - 封裝或資料夾
string. 當 WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" 時為必要。 預設值:$(System.DefaultWorkingDirectory)/**/*.zip

封裝或資料夾的檔案路徑,其中包含 MSBuild 或壓縮的 zip 或 war 檔案所產生的 App Service 內容。

變數為 組建發行。 支援通配符

例如,$(System.DefaultWorkingDirectory)/\*\*/\*.zip$(System.DefaultWorkingDirectory)/\*\*/\*.war


packageForLinux - 封裝或資料夾
輸入別名: BuiltinLinuxPackagestring. 當 WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin 時為必要。 預設值:$(System.DefaultWorkingDirectory)/**/*.zip

封裝或資料夾的檔案路徑,其中包含 MSBuild 或壓縮的 zip 或 war 檔案所產生的 App Service 內容。

變數為 組建發行。 支援通配符

例如,$(System.DefaultWorkingDirectory)/\*\*/\*.zip$(System.DefaultWorkingDirectory)/\*\*/\*.war


RuntimeStack - 運行時間堆疊
string. 當 WebAppKind != app && WebAppKind != functionapp && WebAppKind != api && WebAppKind != mobileapp && ImageSource = Builtin 時為必要。

指定架構和版本。


StartupCommand - 啟動命令
string. 選擇性。 使用 時 WebAppKind = applinux || WebAppKind = linux

指定啟動命令。


WebAppUri - App Service URL
string. 選擇性。 使用 時 WebAppKind != ""

為 Azure App 服務 URL 產生的輸出變數指定名稱。 變數可用於後續工作。


ScriptType - 部署腳本類型
string. 選擇性。 使用 時 WebAppKind != ""。 允許的值: Inline ScriptFile Path (腳本檔案路徑) 。

藉由提供在工作成功完成部署之後,在 Azure App 服務上執行的腳本來自定義部署。 例如,這可以還原 Node、PHP 和 Python 應用程式的套件。 深入瞭解 Azure App 服務 部署


InlineScript - 內嵌腳本
string. 當 ScriptType == Inline Script && WebAppKind != "" 時為必要。 預設值::: You can provide your deployment commands here. One command per line.


ScriptPath - 部署腳本路徑
string. 當 ScriptType == File Path && WebAppKind != "" 時為必要。


GenerateWebConfig - 產生 Web.config
boolean. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war。 預設值:false

Web.config如果應用程式沒有標準,則會產生並部署至 Azure App 服務。 中的 web.config 值可以編輯,並根據應用程式架構而有所不同。 例如,針對 node.js 應用程式, web.config 將會有啟動檔案和 iis_node 模組值。 深入瞭解 Azure App 服務 部署


WebConfigParameters - Web.config 參數
string. 當 GenerateWebConfig == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war 時為必要。

編輯產生的 web.config 檔案中的啟動檔案等值。 這個編輯功能僅適用於產生的 web.config。 深入瞭解 Azure App 服務 部署


AppSettings - 應用程式設定
string.

遵循語法 -key 值 編輯 Web 應用程式設定。 包含空格的值應該以雙引號括住。 範例: -Port 5000-RequestTimeout 5000-WEBSITE_TIME_ZONE"Eastern Standard Time"


ConfigurationSettings - 組態設定
string.

遵循語法 -key 值編輯 Web 應用程式組態設定。 包含空格的值應該以雙引號括住。

範例: -phpVersion 5.6-linuxFxVersion: node|6.11


TakeAppOfflineFlag - 讓應用程式離線
boolean. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""。 預設值:false

使用此選項,在同步作業開始之前,將檔案放在 app_offline.htm App Service 的根目錄中,讓 Azure App 服務 離線。 同步作業成功完成之後,將會移除檔案。


UseWebDeploy - 使用 Web Deploy 發佈
boolean. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""。 預設值:false

Publish using Web Deploy 只有在使用 Windows 代理程式時,才支持選項。 在其他平臺上,工作依賴 Kudu REST API 來部署 Azure App 服務,而且不支援下列選項。


SetParametersFile - SetParameters 檔案
string. 選擇性。 使用 時 UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""

要使用的檔案位置 SetParameters.xml


RemoveAdditionalFilesFlag - 拿掉目的地的其他檔案
boolean. 選擇性。 使用 時 UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""。 預設值:false

使用此選項可刪除 App Service 套件或資料夾中沒有相符檔案之 Azure App 服務 上的檔案。

注意:這也會移除與此 Azure App 服務 上安裝之任何擴充功能相關的所有檔案。 若要避免這種情況,請選取 Exclude files from App_Data folder 複選框。


ExcludeFilesFromAppDataFlag - 從App_Data資料夾中排除檔案
boolean. 選擇性。 使用 時 UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""。 預設值:false

使用此選項可防止資料夾中的檔案App_Data從 Azure App 服務 部署/刪除。


AdditionalArguments - 其他自變數
string. 選擇性。 使用 時 UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""

遵循語法 -key:value的其他Web Deploy自變數。

部署 Azure App 服務 時,將會套用這些專案。 範例: -disableLink:AppPoolExtension-disableLink:ContentExtension

查看更多 Web 部署作業設定的範例。


RenameFilesFlag - 重新命名鎖定的檔案
boolean. 選擇性。 使用 時 UseWebDeploy == true && WebAppKind != linux && WebAppKind != applinux && WebAppKind != ""。 預設值:false

使用此選項可在 Azure App 服務 應用程式設定中啟用 msdeploy 旗標MSDEPLOY_RENAME_LOCKED_FILES=1。 這個選項可讓 msdeploy 重新命名在應用程式部署期間鎖定的鎖定檔案。


enableXmlTransform - XML 轉換
輸入別名: XmlTransformationboolean. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war。 預設值:false

設定轉換將會針對 *.Release.config*.<EnvironmentName>.config*.config file執行。

設定轉換會在變數替代之前執行。

只有 Windows 平臺才支援 XML 轉換。


enableXmlVariableSubstitution - XML 變數替代
輸入別名: XmlVariableSubstitutionboolean. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war。 預設值:false

在組建或發行管線中定義的變數會與key任何組態檔和parameters.xmlappSettingsapplicationSettingsconnectionStrings 區段中的 或 name 項目進行比對。 變數替代會在設定轉換之後執行。

注意:如果在發行管線和環境中定義相同的變數,則環境變數將會取代發行管線變數。


JSONFiles - JSON 變數替代
string. 選擇性。 使用 時 WebAppKind != linux && WebAppKind != applinux && WebAppKind != "" && Package NotEndsWith .war

提供新的以行分隔的 JSON 檔案清單,以取代變數值。 系統會提供相對於根資料夾的檔名。

若要取代巢狀或階層式的 JSON 變數,請使用 JSONPath 表示式來指定它們。

例如,若要取代下列範例中的 值 ConnectionString ,您必須將變數 Data.DefaultConnection.ConnectionString 定義為組建/發行管線 (或發行管線的環境) 。

{
  "Data": {
    "DefaultConnection": {
      "ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True"
    }
  }
}

變數替代會在組態轉換之後執行。

注意:管線變數會排除在替代中。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制選項和一般工作屬性

輸出變數

無。

備註

此工作有較新版本可供使用。 如需詳細資訊,請參閱 AzureRmWebAppDeployment@4

疑難排解

我無法使用 Windows 代理程式的 Microsoft Entra ID 驗證,將 Web 部署至我的 Azure App 服務

Azure App 服務 部署工作支援使用 Microsoft Entra ID 連線到 Microsoft Azure 與 ARM 服務連線,除非有下列三個條件:

  • 您在 Windows 代理程式上使用 Web Deploy 套件格式
  • 您的代理程式是以舊版 的msdeploy.exe( 執行,例如使用 windows-2019 裝載的代理程式映射時,)
  • 您的 Azure App 服務 已停用基本身份驗證

如果存在這三個條件,您會收到類似的錯誤 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.

若要解決此問題,您可以依喜好設定順序,從下列選項中選擇。

  1. 更新代理程式映像。 如果您使用託管的代理程式,請從 windows-2019 移至 windows-2022 (或 windows-latest) 。 如果您使用自我載入的代理程式,請在代理程式上安裝 Visual Studio 2022,以取得較新版本 的msdeploy.exe
  2. 如果您相依於較舊的代理程式映像,且無法更新管線的代理程式,請考慮分割作業,讓 Azure App 服務 部署工作在 windows-2022 (或 windows 最新) 上執行。
  3. 如果這兩個選項都無法執行,您可以啟用 Azure App 服務 的基本身份驗證

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
在上執行 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
可設定變數 任何
代理程式版本 2.104.1 或更新版本
工作類別 部署