Quantcast
Channel: Web Deployment Tool (MS Deploy)
Viewing all 565 articles
Browse latest View live

command-line webdeploy to one server from several with parametrization

$
0
0

Hello,

looked over forum threads and msdn articles but didn't found one clear solution to for my task.

I got 3 web server:

- Server Web1

- Server Web2

- and backup server WebBackup

All 3 server are running IIS7.5 with a set of different sites.

I want to fully syncronize Web1 and Web2 sites to WebBackup on a daily basis. It is also needed to alter connection strings hardcoded in every site's web.config with own values(as the server name is changed) and to change the user used to authorize every website in IIS.

MSSQL databases are mirrored so there is no need to transfer them every sync iteration.

And now i'm stuck with keeping the backup of 2 servers simultaneously. I mean after every sync process WebBackup's IIS contain only the sites from last syncronization and deleting the other sites.

Is it possible at all to backup two different IISes onto one?

As the sites' list is varying from time to time i'm not enumeration all the websites and doing a full copy like:

msdeploy.exe -verb:sync -dest:appPoolconfig -source:appPoolConfig,computerName={IP},username={username},password={pass},authType=NTLM > pool.syncing.log
C:\"Program Files\IIS\Microsoft Web Deploy V3"\msdeploy.exe -verb:sync -dest:appHostconfig -source:appHostConfig,computerName={IP},username={username},password={pass} > host.syncing.log

After this i didn't found a suitable cmd-line webdeploy manual to perform connection string alteration inside the transferred file. Is this also possible to do?

p.s. If it is not best way to backup web server please advice me a better way. Your help is very appreciated, thank you in advance!


msdeploy change site name when running the {project}.deploy.cmd

$
0
0

when deploying with batch file, is there an easy way to pass the sitename to the script? I mean when deploying to multiple sites with some sites having different name. we try to use one package for all sites. currently I am using a batch file to replace the site name in the parameters xml file.

force update for certain files

$
0
0

with msdeploy, it only update the files that are changed (base on the modification date or something), I have some crystal report files in a project that are not getting updated. any flag to force the update?

 ok, here's a question for the forum moderator, is there a way to take the question back? seriously.

IIS backup not working

$
0
0

Im using Teamcity to build and deploy a website, all works very well, as soon as teamcity detects a commit, its built and deployed via webdeploy to my qa website. What I need to do now is to backup the existing site before the new site is deployed. Ive setup the configuration editor in IIS

continueSyncOnBackupFailure True

enabled True

turnedOn True

I also publish as a package which creates a .zip file in the apprporiate directory. The deployment and package creation process works perfectly, but no backup is ever created. Do I need to add a parameter to the MSBuild step in Teamcity ? Isnt is supposed to backup automatically if its activated on the webserver ? I cant see why its not happening


ive run this command

msdeploy -verb:dump -source:backupSettings="Default Web Site/mywebsite",computerName="computername",userName="user",password="password"

and it shows the correct flags set (enabled and turnedon)

and this command

msdeploy -verb:dump -source:backupManager="Default Web Site/mywebsite",computerName="computername",userName="user",password="password"

but I get no zip file listed, are there any steps im missing ? can anyone see where Im going wrong ?

Future of MS Deploy

$
0
0

The current version of MS Deploy is about a year old.  What is the future of this tool is it going to be?  We currently use it at my company and I am curious if it is going to be discontinued or will continue to be updated.

Thanks
Joshua

How to remove "Info:" and stop line splitting from command (stdout) output

$
0
0

When you run commands using for example preSync and postSync, the stdout output of the remote command execution gets redirected back to the client where msdeploy.exe is being run.

Unfortunately output lines seem to be prefixed with Info: and also the lines get split, seemingly at random points.

How do I stop this?

Using WebDeploy in PowerShell

$
0
0

I'm trying to build up a command line and fire it into MSDeploy.exe as part of a PowerShell module. It seems PowerShell continues to struggle when it comes to native processes and dynamic command lines (as of Windows PowerShell 4).  In this case it wraps the source and dest attributes in double quotes which MSDeploy can't handle. Here is my function:

function Set-WebSiteOffline {
param(
    [Parameter(Mandatory=$true)][string]$ServerName,
    [Parameter(Mandatory=$true)][string]$SiteName,
    [string]$UserName,
    [string]$Password
    )
    $EncodedSiteName = [System.Web.HttpUtility]::UrlEncode($SiteName);
    $SiteManagementEndpoint = "https://$ServerName.contoso.com:8172/MSDeploy.axd?Site=$EncodedSiteName";
    $Verb = "-verb:sync";
    $Source = "-source:contentPath='`"$SiteName/App_Offline.htm.deploy`"',computername='$SiteManagementEndPoint'"
    $Destination = "-dest:contentPath='`"$SiteName/App_Offline.htm`"',computername='$SiteManagementEndPoint'"
    $Verbose = "-verbose";
    $DoNotDeleteRule = "-enableRule:DoNotDeleteRule";
    if($UserName -ne "")
    {
        $Source = $Source + ",username='$ENV:UserDomain\$UserName',password='$Password'";
      $Destination = $Destination + ",username='$ENV:UserDomain\$UserName',password='$Password'";
    }
    $MSDeployArguments =  $Verb, $Source, $Destination, $Verbose, $DoNotDeleteRule;& $MSDeploy $MSDeployArguments
}

I've looked at the new cmdlets but I don't see a great plan B.  The best option it appears is to dump the actions I want to do to a manifest file then invoke Sync-WDManifest.  Feels like a bit of a pain if you ask me when there could have just been a cmdlet that accepts verb, source, dest and the other command line parameters.

Are there any other options that the team is aware of for calling MSDeploy via PSH?  If I have to go the manifest route then how would I pass in the DoNotDeleteRule?

MS deploy Full reference

$
0
0

Hi all msdeployers,

I am wondering how and where to get the full reference for powershell deploy cmdlets.

Actually the chm installed with the application doesn't display content (W2K8R2) , so I can't use it .

I'm looking for the ways to define the equivalent to -enableRule, -enableLink and other things I used to with the msdeploy.exe command.

EDIT : the equivalent for powershell cmdlets

Thank you for any help.

JJ


Web Deploy 3.0 service crash

$
0
0

Hi,

I've been fighting WebDeploy 3.0 for a few days because Web Deploy Service (MsDepSvc.exe) randomly crashes. I've managed to recreate this behavior by executing the following run command 10-15 times on a row:

msdeploy.exe -verb:sync -source:runCommand="ipconfig" -dest:auto,computerName="remoteServer",userName="domain\user",password="password"

By duplicating this command in a .bat file about 20 times, I've managed to consistently replicate this crash. In addition we've seen this behaviour very frequently in our continuous deployment process, where this issue was originally discovered, but at different intervals and times.

Note: By adding back Web Deploy 2.0 on the servers, the problem goes away.

On the server running MsDepSvc the follwing relevant entries are found in the event log:

1) Entry from WebDeploy: 

System.ArgumentException: Invalid token for impersonation - it cannot be duplicated.
at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr userToken)
at System.Security.Principal.WindowsIdentity..ctor(IntPtr userToken, String authType, Int32 isAuthenticated)
at System.Security.SecurityContext.CreateCopy()
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

2) Entry from .NET runtime:

Application: MsDepSvc.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr)
at System.Security.Principal.WindowsIdentity..ctor(IntPtr, System.String, Int32)
at System.Security.SecurityContext.CreateCopy()
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)

Note: We use WebDeploy 3.0 from the source/client. The command works perfectly with WebDeploy 2.0 on the server, so for now we've been forced to use 2.0 until this problem is solved in 3.0. 

Would be very interested to hear if others are able to replicate this, cause we have these errors on 10s of servers in 2 different environments/domains.

Thanks,

Jon Arild Tørresdal

Help with msdeploy

$
0
0

Hi,

I'm reasonably new to msdeploy and I don't seem to be able to get past a hurdle... :(

The story so far...

I have a test site I want to be able to deploy remotely,

I have the testsite running on both my box and a remote box.

I have tested using MS Deploy to deploy to the localhost both on my box and the remote box with:

msdeploy.exe -verb:sync - source:package=c:\testsite.zip -dest:auto

This works fine.

I am now trying to deploy remotely.

I initially tried with:

msdeploy.exe -verb:sync -source:package=c:\testsite.zip -dest:auto,computerName=192.168.1.120,Username=Administrator,Password=Password,AuthType=Basic

This resulted in ERROR_USER_NOT_ADMIN

I read that I shouldnt be addressing the computername like that so I changed it to:

msdeploy.exe -verb:sync -source:package=c:\testsite.zip -dest:auto,computerName=https://192.168.1.120:8192/msdeploy.axd,Username=Administrator,Password=Password,AuthType=Basic

This now results in ERROR_DESTINATION_NOT_REACHABLE with the note that the target machine actively refused the connection.

And finally I found I should be using -allowUntrusted

msdeploy.exe -verb:sync -source:package=c:\testsite.zip -dest:auto,computerName=https://192.168.1.120:8192/msdeploy.axd,authType=Basic,username=Administrator,password=Password, -allowUnstrusted

But Still same result - machine actively refusing the connection.

The remote box is Server 2012 with IIS8, my box is Win 7 with IIS 7.5

I found that the remote box did not have Microsoft Web Deploy V3 in C:\Program Files\IIS (Only had up to V2) so I installed that...

Ive added the port 8172 to the firewall and then proceeded to turn it off instead.

What have I missed?

Your help is most appreciated!

Thanks!






msdeploy postsync / runCommand unable to access SQL LocalDb automatic instance

$
0
0

I am using msdeploy to deploy some NUnit tests and the NUnit framework to a remote computer, then I am executing the tests using the nunit-console runner. The tests do database integration tests using SQL Express 2012 LocalDB.

The problem is the tests fail to run with an error:

Warning: Start of LocalDB instance "v11.0" failed because of the following error: Error occurred during LocalDB instance startup: SQL Server process failed to start.

On the remote server Event Viewer I get:

Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3621.

If I remote desktop to the server and run the same script by hand (with same credentials) it works just fine. I can stop and start LocalDB etc no problems.

I have googled LocalDB requirements and one thing that catches my eye is the need for the User Profile to be loaded. Does MSDeploy load the user profile for the user that it impersonates when it runs the commands? Is there a way to tell MSDeploy to do so?

Any clues on this?

UPDATE:

I have confirmed by running a combination of the WHOAMI and SET commands in my postsync script that msdeploy agent is definitely running using the right login credentials, but it is using the environment of the LocalSystem account (e.g. USERDOMAIN=NT AUTHORITY USERNAME=LOCAL SERVICE USERPROFILE=C:\Windows\ServiceProfiles\LocalService). Which I suspect LocalDb doesn't like.

I need to find a way to force it to load the user profile for the local user.

Creating Website from Web Deploy zip file

$
0
0

Hello,

I've done a Web Deploy export of a website using IIS Management Console.  It created the resulting .zip file.

I've manually recreated the site on another machine by importing it with IIS Management Console.

I want to know if there is a way to create the site outside of using IIS MC.  Is there a batch file, or power shell script that can be used to push the site to another server, (using the .zip file)?  I would like to combine that activity with using a .msi to install the related application that is the back end of that website.  The .msi will also install related windows services.

I would use this process to create a totally new website on a server and then use the .msi to run updates to the code as requested by the development team.  Once the site is created I would then jsut run any new .msi's as needed to update code.

Note:  I do know that the web deploy export and import process will also include the content code that make up the virtual directories and any directories that the web apps require, and also create the related app pools.  I'm trying to avoid having to manually import and create these through IIS Management Console.

Just looking for a way that will push the website and run the .msi in one powershell script or batch file - for intitial deployment.

 

Thanks!  

Ken V.

Copy Empty Source File

$
0
0

I am trying to use msdeploy to sync two web servers but the source server has empty files. They were not created by myself but if they are referenced the old server returns a 0 byte file but the new server throws a 404 error which is obiously not the same and might cause issues.

Is is possible to set a rule that enables web deply to just create a 0 byte file on the destination when it encounters a 0 byte file on the source?

Change port number for 'Web Deployment Agent Service'

$
0
0
Am using apache and iis server for development purpose in my Win7 PC. IIS is listening to port:81 and apache port:80. recently i tried running PHP in IIS for that, i installed web platform installer when 'Web Deployment Agent Service' was installed. Then MsDepSvc.exe service also started running in 80 conflicting with Apache. I tried reinstalling the service using the command line by... msiexec /i /passive ADDLOCAL=ALL LISTENURL=http://+:8080/MSDEPLOY2/ the installer starts and then disappears, but the service still runs in the same port. Is there any GUI configuration method in IIS Manager. thanks in advance.

Que. regarding web deploy 3.0 for checking Prerequisites while deployment in IIS‏

$
0
0

when we deploy website using Web deploy 3.0 on web server Using import manager ,my questions is
Can we check below prequesites as a Validation in Web deploy wizard by writing some custom actions so that User can understand that below checks are missing on web server for example

  • Install .NET Framework 4.5
  • Install IIS 7.5 and ASP.NET
  • Register ASP.NET with IIS
  • Connection to Database server and weather database is Present on database serevr and Proper permission for select User for that database.

Is it possible in Web deploy to make such customization ?

if yes then please help me to find any document or link regarding this.

Regards,
Rohit


Web Deploy sync questions...

$
0
0

Hello everyone. This seems to be a regular topic here, and sadly all the posts I've read direct me to a solution that works for most folks but has not worked for me. I also could be doing this completely wrong or have the wrong idea, and am open to suggestions. I am fairly new to all of this.

The Situation

I am trying to use Web Deploy to sync from one IIS server to another over a secure connection. The source machine has its firewall disabled completely and access restricted by IP and port via AWS EC2 Security Groups. With Web Deploy installed on the source and the target, initiating the sync from the target machine, and with port 80 open to the target machine, everything works fine.

Here is the successful command string:

"C:\Program Files\IIS\Microsoft Web Deploy v3\msdeploy.exe" -allowUntrusted -verb:sync -
source:iisApp="<appName>",computername=<url.pointingToIP.ofserver>,UserName='<username>',Password='<password>' -
dest:iisApp="<targetApp>" > c:\www\sync.log

The source URL only works if I leave off https:// - if I use just the url by itself it works fine. Just to be sure I jsut tested it again after clearing out the target destination:

Total changes: 2431 (2431 added, 0 deleted, 0 updated, 0 parameters changed, 27676670 bytes copied)

Questions

  1. Is this secure? I've done this via VPN 'locally' as well but would prefer not to have to connect the vpn each time we need to sync.
  2. If this is not secure, what would I need to do to use https to provide a secure transfer?

Thanks for your time and any insight you may have to offer.

Can we Use Paging to Show parameters in import manager wizard in web deoploy 3.0

$
0
0

I want to deploy web application using web deploy 3.0 using import manager wizard in IIS7,

Here i have to specify multiple parameter to configure my web app so my Question is,

Can we show parameters in paging depending on differnt section instead of showing all paramerts on single page.

Is this possible in Web deploy wizard, i am not getting write doc or link regarding this.

Please help me to acheive this.

Regards,

Rohit

 

Different deploy.cmd for the same project in different machines.

$
0
0

I got an issue today related to the MSDeploy version installed in the server. 

The same project build in machine 1 generates this section (I took this from the Web Deployment Package generated by VS2010):

@rem ---------------------------------------------------------------------------------
@rem if user does not set MsDeployPath environment variable, we will try to retrieve it from registry.
@rem ---------------------------------------------------------------------------------
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=1,2,*" %%h  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy" /s  ^| findstr -i "InstallPath"`) do (
if /I "%%h" == "InstallPath" (
if /I "%%i" == "REG_SZ" (
if not "%%j" == "" (
if "%%~dpj" == "%%j" (
set MSDeployPath=%%j
))))))

And in machine 2:

@rem ---------------------------------------------------------------------------------
@rem if user does not set MsDeployPath environment variable, we will try to retrieve it from registry.
@rem ---------------------------------------------------------------------------------
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=2*" %%i  in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do (
if "%%~dpj" == "%%j" ( 
set MSDeployPath=%%j
)))

if not exist "%MSDeployPath%\msdeploy.exe" (
echo. msdeploy.exe is not found on this machine. Please install Web Deploy before execute the script. 
echo. Please visit http://go.microsoft.com/?linkid=9278654
goto :usage
)


Machine 1: "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy"

Machine 2: "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" 

If I try to install the package in a server wich contains only MSDeploy v2, Machine 1's package works and Machine 2's package doesn't.

BTW: Machine 1 and 2 are build controllers.

I compared the software in both machines, and they have almost the same setup:
VS2010 ultimate
Same service packs
Web Deployment Tool (1.0)

I want to understand why there is this difference, if anyone know what could be the real difference in the servers.

 

Visual Studio 2012 Web Deploy to Windows Server 2008 R2 with IIS 7 and /msdeploy.axd 404 error

$
0
0
<div class="post-text" itemprop="description">

In Visual Studio 2012 RC when I try to validate a Web Deploy connection I get this error message:

ERROR_DESTINATION_NOT_REACHABLE

enter image description here

The required Web Management Service is started on the server and Web Deploy 3.0 RC is installed.

Then using Remote Desktop Connection I log on the server and go check

IIS

 logs located at C:\inetpub\logs\LogFiles\W3SVC1
. There I can see my attempts to validate the connection because they contain my IP address:
2012-07-13 20:58:49 185.201.117.17 HEAD /msdeploy.axd site=Default%20Web%20Site 8172 - 189.10.32.194 - 404 0 2 78

It's giving me a 404.

After trying to get this working for almost 6 hours now (reading a lot of material including this great Troubleshooting guide by IIS team titled Troubleshooting Web Deploy problems with Visual Studio and this related question Visual Studio 2010 Web deployment task failed) I decided to ask for help here and see if anyone has a clue about what can be the problem... Do you know what's causing this 404 error?

If you need any more info, just ask me and I'll provide it... :)

Edit

Yesterday I also tried the following

msdeploy
command on my local machine to list the the contents of a folder called
test
on the server [ and it worked as expected ]:
C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy -verb:dump -source:content
path=c:\test,computerName=xxxxxxxxxx.publiccloud.com.br,username=User,password=Password
Info: Using ID 'a246a13c-7777-4226-964c-fe9934c60b77' for connections to the rem
ote server.
MSDeploy.contentPath
c:\test
c:\test
c:\test\test.txt

Windows Server 2008 Firewall is disabled and I can access IIS on the server from my local machine with these URLs:

http://xxxxxxxxxx.publiccloud.com.br/SISPEC

https://xxxxxxxxxx.publiccloud.com.br:8172
</div>
                       

backup and restore IIS config with msdeploy

$
0
0

I think my needs are relatively simple so I hope someone should easily be able to help. I need to back up the entire IIS configuration so that IIS can be restored on another computer.

My first backup strategy was to use this command:

AppCmd.exe Add Backup

I soon abandoned that because it only works when restoring to the same computer where the backup was made. You can't copy the files and restore on another computer because the backup does not include the server encryption keys.

My current backup strategy is to use Shared Configuration. I'm not actually sharing the IIS configuration between 2 servers. I'm just using this feature to store the IIS config, including encryption keys, in one folder that I can include in my daily backup. I have been doing this for several years and it works really well. I have been able to restore the entire IIS configuration when migrating the entire web server to another machine many times.

But now there is a problem. We want to start using Application Request Routing and that is not compatible with Shared Configuration.Frown So I'm looking for another way to back up the IIS config and I'm considering MSDeploy. I'm able to successfully generate the config to a folder (I think) but not restore.

I'm using this command to backup on Windows Server 2008:

msdeploy.exe -verb:sync -source:webserver -dest:archiveDir=c:\archive,encryptPassword=secret_password -disableLink:ContentExtension

I'm using this command to restore on a new Windows Server 2012 server:

msdeploy.exe -verb:sync -source:archiveDir=c:\temp\deploy,encryptPassword=secret_password -dest:webserver

When I try to restore, the output terminates with these errors:

Error: Value cannot be null.
Parameter name: value

The output fails to say what value is null that should not be.

Can anyone help me write the msdeploy command so that I can backup the entire IIS configuration and restore on another machine? Note that I want to back up only the IIS configuration; I don't need to back up other data like web site content files. I am already backing up other critical files.

Or if you can recommend another backup method, please do.

Cam

Viewing all 565 articles
Browse latest View live