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 部署包
string。 必填。

指定目标计算机上或 UNC 路径上的 Web 部署 (MSDeploy) zip 文件的位置,例如,\\BudgetIT\WebDeploy\WebDeployPackage.zip。 UNC 路径应可供计算机的管理员帐户访问。 还支持环境变量,例如 $env:windir$env:systemroot$env:windir\FabrikamFibre\Web


WebDeployParamFile - Web 部署参数文件
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 部署 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 绑定,或者为网站指定具有安全套接字层 (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 的版本。 如果分配给此应用程序池的应用程序不包含托管代码,请从列表中选择 “无托管代码” 选项。


PipeLineMode - 托管管道模式
stringCreateAppPool = true时是必需的。 允许的值:IntegratedClassic。 默认值:Integrated

托管管道模式指定 IIS 如何处理托管内容的请求。 仅当应用程序池中的应用程序无法在集成模式下运行时,才使用经典模式。


AppPoolIdentity - 标识
stringCreateAppPool = true时是必需的。 允许的值:ApplicationPoolIdentityLocalServiceLocalSystemNetworkServiceSpecificUser(自定义帐户)。 默认值:ApplicationPoolIdentity

配置运行应用程序池工作进程时所依据的帐户。 指定一个预定义的安全帐户,或配置自定义帐户。


AppPoolUsername - 用户名
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,经典版本,经典版本
运行时间 代理,DeploymentGroup
需求 没有
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任何
Settable 变量 任何
代理版本 1.91.0 或更高版本
任务类别 部署