IISWebAppDeployment@1 - IIS Web 应用部署 (弃用的) v1 任务
使用此任务通过 MSDeploy 部署 IIS Web 应用,然后创建或更新网站和应用池。
重要
此任务已弃用,将于 2024 年 1 月 31 日停用。 使用 WinRM 的 IIS Web 应用部署 - Viual Studio Marketplace。
使用此任务通过 MSDeploy 部署 IIS Web 应用,然后创建或更新网站和应用池。
语法
# 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.
# IIS Web App deployment (Deprecated) v1
# Deploy by MSDeploy, create/update website & 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.com
或 dbserver_int.fabrikam.com:5986,192.168.12.34:5986
。 还可以提供其他任务的输出变量,例如 $(variableName)
。
AdminUserName
- 管理员登录名
string
.
指定目标计算机的管理员登录名。
AdminPassword
- 密码
string
.
指定目标计算机的管理员密码。 它可以接受生成/发布定义中定义的变量,例如 $(passwordVariable)
。 可以将变量类型 secret
标记为 来保护它。
WinRMProtocol
-
协议
string
. 允许的值:Http
、Https
。
指定用于与计算机建立 WinRM 连接的协议 () 。 默认为 HTTPS
。
TestCertificate
- 测试证书
boolean
. 可选。 在 时 WinRMProtocol = Https
使用 。 默认值:true
。
选择选项以跳过由受信任的证书颁发机构验证计算机证书的真实性。 WinRM HTTPS
协议需要 参数。
WebDeployPackage
-
Web 部署包
string
. 必需。
指定 Web 部署 (MSDeploy) zip 文件在目标计算机或 UNC 路径上的位置, \\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
-
网站名称
string
. 当 CreateWebSite = true
时,需要此选项。
指定将创建的 IIS 网站的名称(如果不存在),如果 IIS 服务器上已存在,则将对其进行更新。 网站的名称应与 Web 部署 zip 包文件中指定的名称相同。 如果还指定了参数文件和替代参数设置,则网站的名称应与替代参数设置中的名称相同。
WebSitePhysicalPath
-
物理路径
string
. 当 CreateWebSite = true
时,需要此选项。 默认值:%SystemDrive%\inetpub\wwwroot
。
指定存储网站内容的物理路径。 内容可以驻留在本地计算机或远程目录或共享上,如 C:\Fabrikam
或 \\ContentShare\Fabrikam
。
WebSitePhysicalPathAuth
-
物理路径身份验证
string
. 当 CreateWebSite = true
时,需要此选项。 允许的值: WebSiteUserPassThrough
(Application User (Pass-through) ) 、 WebSiteWindowsAuth
(Windows 身份验证) 。 默认值:Application User (Pass-through)
。
指定用于访问网站物理路径的身份验证机制。
WebSiteAuthUserName
-
用户名
string
. 当 WebSitePhysicalPathAuth = WebSiteWindowsAuth
时,需要此选项。
指定用于访问网站的物理路径的用户名。
WebSiteAuthUserPassword
- 密码
string
. 可选。 在 时 WebSitePhysicalPathAuth = WebSiteWindowsAuth
使用 。
指定用于访问网站的物理路径的密码。 如果使用 gMSA,则不需要这样做。
AddBinding
-
添加绑定
boolean
. 可选。 在 时 CreateWebSite = true
使用 。 默认值:true
。
指定为网站添加端口绑定的选项。
AssignDuplicateBinding
-
分配重复绑定
boolean
. 可选。 在 时 AddBinding = true
使用 。 默认值:false
。
指定用于添加此处指定的绑定的选项, (即使有另一个网站) 具有相同绑定也是如此。 如果存在绑定冲突,则只会启动其中一个网站。
Protocol
-
协议
string
. 当 AddBinding = true
时,需要此选项。 允许的值:https
、http
。 默认值:http
。
为网站指定 HTTP 以具有 HTTP 绑定,或为网站指定 HTTPS 以具有安全套接字层 (SSL) 绑定。
IPAddress
-
IP 地址
string
. 当 AddBinding = true
时,需要此选项。 默认值:All Unassigned
。
指定用户可用于访问网站的 IP 地址。 如果选择了“ 所有未分配 ”,则站点将响应端口上所有 IP 地址的请求,以及为站点指定的可选主机名。 如果服务器上的另一个站点在同一端口上具有绑定,但具有特定 IP 地址,则站点不会响应请求。
Port
-
港口
string
. 当 AddBinding = 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
-
主机名
string
. 当 ServerNameIndication = true
时,需要此选项。
将一个或多个主机名 (或域名) 分配给使用单个 IP 地址的计算机。 如果指定了主机名,则客户端必须使用主机名而不是 IP 地址来访问网站。
SSLCertThumbPrint
-
SSL 证书指纹
string
. 当 Protocol = https
时,需要此选项。
指定网站要使用的安全套接字层证书的指纹。 证书应已安装在计算机上,并存在于“本地计算机个人”存储下。
CreateAppPool
-
创建或更新应用程序池
boolean
. 默认值:false
。
指定用于创建应用程序池或更新现有应用程序池的选项。
AppPoolName
-
名字
string
. 当 CreateAppPool = true
时,需要此选项。
指定要创建或更新的 IIS 应用程序池的名称。 现有应用程序池将使用指定的设置进行更新。
DotNetVersion
-
.NET 版本
string
. 当 CreateAppPool = true
时,需要此选项。 允许的值:v4.0
、v2.0
、No Managed Code
。 默认值:v4.0
。
指定此应用程序池加载的.NET Framework的版本。 如果分配给此应用程序池的应用程序不包含托管代码,请从列表中选择 “无托管代码 ”选项。
PipeLineMode
-
托管管道模式
string
. 当 CreateAppPool = true
时,需要此选项。 允许的值:Integrated
、Classic
。 默认值:Integrated
。
托管管道模式指定 IIS 如何处理托管内容的请求。 仅当应用程序池中的应用程序无法在集成模式下运行时,才使用经典模式。
AppPoolIdentity
-
身份
string
. 当 CreateAppPool = true
时,需要此选项。 允许的值:ApplicationPoolIdentity
、LocalService
、、LocalSystem
NetworkService
、 SpecificUser
(自定义帐户) 。 默认值:ApplicationPoolIdentity
。
配置应用程序池的工作进程运行所依据的帐户。 指定一个预定义的安全帐户,或配置自定义帐户。
AppPoolUsername
-
用户
string
. 当 AppPoolIdentity = 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
。 默认在所有计算机上运行任务。
任务控制选项
除了任务输入,所有任务都有控制选项。 有关详细信息,请参阅 控制选项和常见任务属性。
输出变量
无。
备注
重要