是否有可能在Powershell部署时更改WCF UPN(身份)?
本文关键字:UPN WCF 身份 有可能 Powershell 部署 是否 | 更新日期: 2023-09-27 18:03:29
我有一个在域帐户下运行的WCF web服务。我使用powershell来部署一个web应用程序,它在4个不同的平台(开发、系统测试、用户测试、生产)上托管服务。在每个平台上,我们都有一个域帐户,我们使用它来运行wcf web服务UPN和appool。在我的部署脚本中,我删除并创建了web应用程序和appool。我可以通过powershell更改appool帐户,具体取决于平台,但如何更改或覆盖web中的身份。配置吗?是否有一个powershell命令可以覆盖WCF身份?
通常您会对这些特定于环境的操作使用配置转换。
在你的情况下,你的转换网页。配置(例如web.usertest.config
)可能如下所示:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.serviceModel>
<client>
<endpoint>
<identity>
<userPrincipalName value="foo@bar.com" xdt:Transform="Replace" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>