I have a web application and I am trying to deploy it on a webserver using MSDeploy.exe (Web Deploy 2)
I have tried 4 scenarios:
1. Through VS2010 Publish method with following settings:
Publish Method: Web Deploy
Service Url: https://<<MyServerName>>:8172/MsDeploy.axd
Site/application: <<MyWebSiteName>>
Allow untrusted: checked
Username: <<MyUsername>>
Password: <<MyPassword>>
This method works just fine. On <<MyServerName>> machine I have Web Management Service running; I have a website <<MyWebSiteName>> and <<MyUserName>> is an IIS Manager for it.
2. Through VS2010 Publish method with following settings:
Publish Method: Web Deploy
Service Url: https://<<MyServerName>>:8172/MsDeploy.axd
Site/application: <<MyWebSiteName>>/<<MyWebAppName>>
Allow untrusted: checked
Username: <<MyUsername>>
Password: <<MyPassword>>
This method works just fine.
3. Through MSDeploy.exe command line (within a Powershell script)
$Source = "contentPath='....\_PublishedWebsites\MyWebApp'"
$Destination = "contentPath=MyWebSiteName,computerName='https://fc-wapps-trial:8172/MsDeploy.axd?Site=WebSiteTest',Username=MyUsername,Password=MyPassword,AuthType=basic,IncludeAcls=False"
MSDeploy -verb:sync -source:$Source -dest:$Destination -allowUntrusted
This method also works fine.
4. Through MSDeploy.exe command line (within a Powershell script)
$Source = "contentPath='....\_PublishedWebsites\MyWebApp'"
$Destination = "iisApp=MyWebSiteName/MyWebAppName,computerName='https://fc-wapps-trial:8172/MsDeploy.axd?Site=WebSiteTest/MyWebAppName',Username=MyUsername,Password=MyPassword,AuthType=basic,IncludeAcls=False"
MSDeploy -verb:sync -source:$Source -dest:$Destination -allowUntrusted
This method doesn't work. I am getting the following error.
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the destination computer ("MyServerName") 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.
Error: The remote server returned an error: (401) Unauthorized.
I was looking at what is the actuall MSDeploy command that the method 2 uses and I got something like:
msdeploy.exe
-source:manifest='...\MyWebApp.SourceManifest.xml'
-dest:auto,ComputerName='https://MyServerName:8172/MsDeploy.axd?site=WebSiteTest',UserName='MyUsername',Password='MyPassword',IncludeAcls='False',AuthType='Basic'
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-skip:objectname='dirPath',absolutepath='...\App_Data$'
-setParam:kind='ProviderPath',scope='IisApp',match='^...\\PackageTmp$',value=WebSiteTest/WebAppTest
-setParam:kind='ProviderPath',scope='setAcl',match='^..\\PackageTmp$',value=WebSiteTest/WebAppTest
-allowUntrusted
-retryAttempts=2
Now this doesn't seem to be anything close to what I am using in method 4.
So my questions are:
- What I am doing wrong?
- How can I deploy a web application as a website application in IIS7 using MSDeploy.exe command
Thanks in advance for your help
Iulian