是否有可能通过Powershell更改部署WCF UPN(标识)
问题描述:
我有一个WCF web服务在域帐户 下运行。我使用powershell来部署一个在4个不同平台(开发,系统测试,usertest,生产)上托管服务的web应用程序。在每个平台上,我们都有一个域帐户,我们用它来运行wcf webservice UPN和apppool。在我的部署脚本中,我删除并创建了web应用程序和apppool。我可以通过PowerShell更改apppool帐户依赖于平台,但如何更改或覆盖web.config中的身份?有没有可覆盖wcf身份的powershell命令? 任何帮助将不胜感激。是否有可能通过Powershell更改部署WCF UPN(标识)
答
通常你会使用config transformations来进行这些环境特定的操作。
在你的情况,你的web.config文件转化(例如web.usertest.config
)可能看起来像以下:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.serviceModel>
<client>
<endpoint>
<identity>
<userPrincipalName value="[email protected]" xdt:Transform="Replace" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>