2015-07-19 64 views
1

我有一個WCF web服務在域帳戶 下運行。我使用powershell來部署一個在4個不同平臺(開發,系統測試,usertest,生產)上託管服務的web應用程序。在每個平臺上,我們都有一個域帳戶,我們用它來運行wcf webservice UPN和apppool。在我的部署腳本中,我刪除並創建了web應用程序和apppool。我可以通過PowerShell更改apppool帳戶依賴於平臺,但如何更改或覆蓋web.config中的身份?有沒有可覆蓋wcf身份的powershell命令? 任何幫助將不勝感激。是否有可能通過Powershell更改部署WCF UPN(標識)

回答

0

通常你會使用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> 
相關問題