當我傳入用戶憑據時,我有一個MSDeploy部署與TeamCity一起工作得非常好。命令行參數(使用某些值的env變量)爲:如何使用集成Windows身份驗證使用MSDeploy和TeamCity進行部署?
MSBuild.exe Web.csproj
/P:Configuration=%env.Configuration%
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl= https://%env.TargetServer%/MsDeploy.axd
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=WMsvc
/P:CreatePackageOnPublish=True
/P:UserName=%env.AdminUser%
/P:Password=%env.AdminPassword%
工作很好。但是現在我想使用集成身份驗證。我試着從Can MSBuild deploy using integrated authentication or only basic?以下特洛伊的建議,但它並沒有這樣做。我試圖傳遞一個空白的用戶名和指定
/p:AuthType=NTLM
我得到的最接近的是通過指定/ P的各種組合:=進行AuthType NTLM和傳遞一個空白的用戶名。但是,仍然會導致此錯誤:
Connected to the destination computer ("[my destination server name]") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. The remote server returned an error: (401) Unauthorized
我在本地和遠程服務器上都運行Web管理服務。我將兩個實例都更改爲以用戶身份運行,我知道該用戶具有對該站點的適當訪問權限 - 如果手動傳遞憑據,則可以使用該用戶。
我也嘗試在目標站點上手動授予該用戶IIS管理器權限(儘管不知道爲什麼這樣做是必要的,因爲用戶可以在手動傳遞憑據時發佈到站點)。
我注意到的一件事是,在WMsvc日誌中,它沒有記錄任何使用NTLM身份驗證進行嘗試的用戶名。
任何想法發生了什麼這裏。我真的不想在我的TeamCity配置中存儲用戶憑據。
謝謝。
查看以上評論。簡而言之,它具有。 – user1035941