共用方式為


IISWebAppDeployment@1 - IIS Web 應用程式部署 (已淘汰) v1 工作

使用此工作來使用 MSDeploy 部署 IIS Web 應用程式,然後建立或更新網站和應用程式集區。

這很重要

此工作已被取代,且將於 2024 年 1 月 31 日淘汰。 使用 winRM 使用 IIS Web 應用程式部署 - Viual Studio Marketplace

使用此工作來使用 MSDeploy 部署 IIS Web 應用程式,然後建立或更新網站和應用程式集區。

這很重要

此工作已被取代。 使用 winRM 使用 IIS Web 應用程式部署 - Viual Studio Marketplace

語法

# IIS Web App deployment (Deprecated) v1
# Deploy using MSDeploy, then create/update websites and app pools.
- task: IISWebAppDeployment@1
  inputs:
    EnvironmentName: # string. Required. Machines. 
    #AdminUserName: # string. Admin Login. 
    #AdminPassword: # string. Password. 
    #WinRMProtocol: # 'Http' | 'Https'. Protocol. 
    #TestCertificate: true # boolean. Optional. Use when WinRMProtocol = Https. Test Certificate. Default: true.
  # Deployment
    WebDeployPackage: # string. Required. Web Deploy Package. 
    #WebDeployParamFile: # string. Web Deploy Parameter File. 
    #OverRideParams: # string. Override Parameters. 
  # Website
    #CreateWebSite: false # boolean. Create or Update Website. Default: false.
    #WebSiteName: # string. Required when CreateWebSite = true. Website Name. 
    #WebSitePhysicalPath: '%SystemDrive%\inetpub\wwwroot' # string. Required when CreateWebSite = true. Physical Path. Default: %SystemDrive%\inetpub\wwwroot.
    #WebSitePhysicalPathAuth: 'Application User (Pass-through)' # 'WebSiteUserPassThrough' | 'WebSiteWindowsAuth'. Required when CreateWebSite = true. Physical Path Authentication. Default: Application User (Pass-through).
    #WebSiteAuthUserName: # string. Required when WebSitePhysicalPathAuth = WebSiteWindowsAuth. User Name. 
    #WebSiteAuthUserPassword: # string. Optional. Use when WebSitePhysicalPathAuth = WebSiteWindowsAuth. Password. 
    #AddBinding: true # boolean. Optional. Use when CreateWebSite = true. Add Binding. Default: true.
    #AssignDuplicateBinding: false # boolean. Optional. Use when AddBinding = true. Assign Duplicate Binding. Default: false.
    Protocol: 'http' # 'https' | 'http'. Required when AddBinding = true. Protocol. Default: http.
    IPAddress: 'All Unassigned' # string. Required when AddBinding = true. IP Address. Default: All Unassigned.
    Port: '80' # string. Required when AddBinding = true. Port. Default: 80.
    #ServerNameIndication: false # boolean. Optional. Use when Protocol = https. Server Name Indication Required. Default: false.
    #HostNameWithOutSNI: # string. Optional. Use when ServerNameIndication = false. Host Name. 
    #HostNameWithHttp: # string. Optional. Use when Protocol = http. Host Name. 
    #HostNameWithSNI: # string. Required when ServerNameIndication = true. Host Name. 
    #SSLCertThumbPrint: # string. Required when Protocol = https. SSL Certificate Thumb Print. 
  # Application Pool
    #CreateAppPool: false # boolean. Create or Update Application Pool. Default: false.
    #AppPoolName: # string. Required when CreateAppPool = true. Name. 
    #DotNetVersion: 'v4.0' # 'v4.0' | 'v2.0' | 'No Managed Code'. Required when CreateAppPool = true. .NET Version. Default: v4.0.
    #PipeLineMode: 'Integrated' # 'Integrated' | 'Classic'. Required when CreateAppPool = true. Managed Pipeline Mode. Default: Integrated.
    #AppPoolIdentity: 'ApplicationPoolIdentity' # 'ApplicationPoolIdentity' | 'LocalService' | 'LocalSystem' | 'NetworkService' | 'SpecificUser'. Required when CreateAppPool = true. Identity. Default: ApplicationPoolIdentity.
    #AppPoolUsername: # string. Required when AppPoolIdentity = SpecificUser. Username. 
    #AppPoolPassword: # string. Optional. Use when AppPoolIdentity = SpecificUser. Password. 
  # Advanced
    #AppCmdCommands: # string. Additional AppCmd.exe Commands. 
    #DeployInParallel: true # boolean. Deploy in Parallel. Default: true.
    #ResourceFilteringMethod: 'machineNames' # 'machineNames' | 'tags'. Select Machines By. Default: machineNames.
    #MachineFilter: # string. Deploy to Machines.

輸入

EnvironmentName - 電腦
string。 必須的。

指定以逗號分隔的電腦IP位址或 FQDN 清單,以及埠。 預設埠是以選取的通訊協定為基礎,例如 dbserver.fabrikam.comdbserver_int.fabrikam.com:5986,192.168.12.34:5986。 您也可以提供其他工作的輸出變數,例如 $(variableName)


AdminUserName - 系統管理員登入
string

指定目標計算機的系統管理員登入。


AdminPassword - 密碼
string

指定目標計算機的系統管理員密碼。 它可以接受建置/發行定義中定義的變數,例如 $(passwordVariable)。 您可以將變數類型標示為 secret 來保護它。


WinRMProtocol - 通訊協定
string。 允許的值:HttpHttps

指定用於與機器之 WinRM 連線的通訊協定。 預設值為 HTTPS


TestCertificate - 測試憑證
boolean。 選擇性。 WinRMProtocol = Https時使用 。 預設值:true

選取選項,以略過受信任的證書頒發機構單位驗證機器憑證的真實性。 WinRM HTTPS 通訊協定需要 參數。


WebDeployPackage - Web Deploy 套件
string。 必須的。

指定目標電腦上或 UNC 路徑上 Web Deploy (MSDeploy) zip 檔案的位置,例如 \\BudgetIT\WebDeploy\WebDeployPackage.zip。 計算機系統管理員帳戶應該可以存取 UNC 路徑。 也支援環境變數,例如 $env:windir$env:systemroot$env:windir\FabrikamFibre\Web


WebDeployParamFile - Web Deploy 參數檔案
string

指定目標電腦上或 UNC 路徑上參數檔案的位置。 參數檔案可用來覆寫 Web 應用程式組態設定,例如 IIS Web 應用程式名稱或資料庫連接字串。


OverRideParams - 覆寫參數
string

此處指定的參數會覆寫 MSDeploy zip 檔案和參數檔案中的參數。 若要覆寫多個參數,請使用行分隔符。
例如,"IIS Web Application Name"="Fabrikam""ConnectionString"="Server=localhost;Database=Fabrikam;"


CreateWebSite - 建立或更新網站
boolean。 預設值:false

指定建立網站或更新現有網站的選項。


WebSiteName - 網站名稱
stringCreateWebSite = true時為必要項。

指定 IIS 網站的名稱,如果不存在,則會建立,或者如果 IIS 伺服器上已經存在,則會更新它。 網站的名稱應該與 Web deploy zip 套件檔案中指定的名稱相同。 如果同時指定參數檔案和覆寫參數設定,則網站的名稱應該與覆寫參數設定中的名稱相同。


WebSitePhysicalPath - 實體路徑
stringCreateWebSite = true時為必要項。 預設值:%SystemDrive%\inetpub\wwwroot

指定儲存網站內容的實體路徑。 內容可以位於本機電腦或遠端目錄或共用上,例如 C:\Fabrikam\\ContentShare\Fabrikam


WebSitePhysicalPathAuth - 實體路徑驗證
stringCreateWebSite = true時為必要項。 允許的值:WebSiteUserPassThrough(應用程式使用者(傳遞))、WebSiteWindowsAuth(Windows 驗證)。 預設值:Application User (Pass-through)

指定存取網站實體路徑的驗證機制。


WebSiteAuthUserName - 用戶名稱
stringWebSitePhysicalPathAuth = WebSiteWindowsAuth時為必要項。

指定存取網站實體路徑的用戶名稱。


WebSiteAuthUserPassword - 密碼
string。 選擇性。 WebSitePhysicalPathAuth = WebSiteWindowsAuth時使用 。

指定存取網站實體路徑的密碼。 如果您使用 gMSA,則不需要這樣做。


AddBinding - 新增系結
boolean。 選擇性。 CreateWebSite = true時使用 。 預設值:true

指定為網站新增埠系結的選項。


AssignDuplicateBinding - 指派重複系結
boolean。 選擇性。 AddBinding = true時使用 。 預設值:false

指定新增此處指定的系結的選項(即使有另一個具有相同系結的網站也一樣)。 如果有系結衝突,則只會啟動其中一個網站。


Protocol - 通訊協定
stringAddBinding = true時為必要項。 允許的值:httpshttp。 預設值:http

指定網站的 HTTP 具有 HTTP 系結,或為網站指定具有安全套接字層 (SSL) 系結的 HTTPS。


IPAddress - IP 位址
stringAddBinding = true時為必要項。 預設值:All Unassigned

指定用戶可用來存取網站的IP位址。 如果選取 [所有未指派 ,月臺會回應埠上所有IP位址的要求,以及為月臺指定的選擇性主機名。 如果伺服器上的另一個月臺在相同埠上具有系結,但具有特定IP位址,月臺將不會回應要求。


Port -
stringAddBinding = true時為必要項。 預設值:80

指定超文本傳輸通訊協定堆疊 (HTTP.sys) 必須監視對此網站提出要求的埠。


需要 ServerNameIndication - 伺服器名稱指示
boolean。 選擇性。 Protocol = https時使用 。 預設值:false

判斷網站是否需要伺服器名稱指示 (SNI)。 SNI 會擴充 SSL 和 TLS 通訊協定,以指出用戶端嘗試連線的主機名。 它允許具有不同憑證的多個安全網站使用相同的IP位址。


HostNameWithOutSNI - 主機名
string。 選擇性。 ServerNameIndication = false時使用 。

將一或多個主機名(或功能變數名稱)指派給使用單一IP位址的計算機。 如果指定主機名,則客戶端必須使用主機名,而不是IP位址來存取網站。


HostNameWithHttp - 主機名
string。 選擇性。 Protocol = http時使用 。

將一或多個主機名(或功能變數名稱)指派給使用單一IP位址的計算機。 如果指定主機名,則客戶端必須使用主機名,而不是IP位址來存取網站。


HostNameWithSNI - 主機名
stringServerNameIndication = true時為必要項。

將一或多個主機名(或功能變數名稱)指派給使用單一IP位址的計算機。 如果指定主機名,則客戶端必須使用主機名,而不是IP位址來存取網站。


SSLCertThumbPrint - SSL 憑證指紋列印
stringProtocol = https時為必要項。

指定網站將使用的安全套接字層憑證指紋。 憑證應該已安裝在機器上,並存在於本機計算機個人存放區底下。


CreateAppPool - 建立或更新應用程式集區
boolean。 預設值:false

指定建立應用程式集區或更新現有應用程式集區的選項。


AppPoolName - 名稱
stringCreateAppPool = true時為必要項。

指定要建立或更新的 IIS 應用程式集區名稱。 現有的應用程式集區將會使用指定的設定來更新。


DotNetVersion - .NET 版本
stringCreateAppPool = true時為必要項。 允許的值:v4.0v2.0No Managed Code。 預設值:v4.0

指定這個應用程式集區所載入的 .NET Framework 版本。 如果指派給此應用程式集區的應用程式不包含 Managed 程式代碼,請從清單中選取 [無 Managed 程式代碼 ] 選項


PipeLineMode - 受控管線模式
stringCreateAppPool = true時為必要項。 允許的值:IntegratedClassic。 預設值:Integrated

受控管線模式會指定 IIS 如何處理受控內容的要求。 只有在應用程式集區中的應用程式無法以整合模式執行時,才使用傳統模式。


AppPoolIdentity - 身分識別
stringCreateAppPool = true時為必要項。 允許的值:ApplicationPoolIdentityLocalServiceLocalSystemNetworkServiceSpecificUser(自定義帳戶)。 預設值:ApplicationPoolIdentity

設定應用程式集區背景工作進程執行所在的帳戶。 指定其中一個預先定義的安全性帳戶,或設定自定義帳戶。


AppPoolUsername - Username
stringAppPoolIdentity = SpecificUser時為必要項。


AppPoolPassword - 密碼
string。 選擇性。 AppPoolIdentity = SpecificUser時使用 。

如果您使用 gMSA,則不需要這樣做。


AppCmdCommands - 其他 AppCmd.exe 命令
string

指定要設定網站或應用程式集區屬性的其他 AppCmd.exe 命令。 針對多個命令,請使用行分隔符。
例如:
<清單應用程式集區>
<清單網站>


DeployInParallel - 平行部署
boolean。 預設值:true

如果設定為 true,則會在目標電腦上平行部署 Web 應用程式。


ResourceFilteringMethod - 選取機器
string。 允許的值:machineNames (機器名稱),tags。 預設值:machineNames

選擇性。 藉由提供計算機名稱或標籤來指定機器的子集。


MachineFilter - 部署至電腦
string

此輸入僅適用於計算機群組,但尚未支援機器或輸出變數的一般清單。

指定電腦清單,例如 dbserver.fabrikam.com, webserver.fabrikam.com, 192.168.12.34 或標籤,例如 Role:DB; OS:Win8.1。 如果提供多個標記,工作將會在具有指定標籤的所有機器中執行。 針對 Azure 資源群組,指定虛擬機的名稱,例如 ffweb, ffdb。 預設會在所有機器中執行工作。


工作控制選項

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

輸出變數

沒有。

備註

這很重要

此工作已被取代。 使用 winRM 使用 IIS Web 應用程式部署 - Viual Studio Marketplace

需求

要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 沒有
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 1.91.0 或更新
工作類別 部署