« Previous Next »

Thread: Deleting a single file from the web site.

Last post 11-22-2008 2:09 AM by yaminij. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 11-20-2008, 7:09 PM

    • bmukes
    • Not Ranked
    • Joined on 11-21-2008, 12:04 AM
    • Posts 5

    Deleting a single file from the web site.

    Assume the following on a machine hosting my web site and another machine hosting SQL Server.

    I use MSDeploy to send App_Offline.htm to the root to shut down the web site indicating that I do not want to delete files.

    I use MSDeploy to update the web site while its down again indicating that I do not want to delete App_Offline.htm 

    I use MSDeploy to update the database while the site is down.

    How could i use MSDeploy to remove the App_Offline.htm?

    Thanks

  • 11-20-2008, 8:06 PM In reply to

    Re: Deleting a single file from the web site.

    What was your command for the second step? You can probably use the same command without the -skip switch

     Currently, we do not have support for a delete verb in msdeploy.

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
  • 11-21-2008, 11:12 AM In reply to

    • bmukes
    • Not Ranked
    • Joined on 11-21-2008, 12:04 AM
    • Posts 5

    Re: Deleting a single file from the web site.

     

    I am assuming that the following would work on the command line to prevent the AppOffline.htm file from being deleted.

    -skip:objectName=filepath,skipAction=delete,absolutePath="App_Offline.htm"

    I think a delete verb would work or a provider that allows you to specify what you want deleted.

     

  • 11-21-2008, 11:30 AM In reply to

    • bmukes
    • Not Ranked
    • Joined on 11-21-2008, 12:04 AM
    • Posts 5

    Re: Deleting a single file from the web site.

    Discussed this with some other folks do you think the following would work.  Assume I have a IIS6 virtual directory ClientVD that has a root directory ClientVD_1_0_0_0.

    1.  Use MSDeploy to send down a new directory ClientVD_1_0_0_1.

    2.  Use MSDeploy to send down file App.Offline.html to ClientVD_1_0_0_0 shutting down ClientVD.

    3.  Use MSDeploy to send TSQL to backup/update the database server.

    4.  Use MSDeploy to change the directory of ClientVD to ClientVD_1_0_0_1.

    This would not only update the web site but give me a rollback because I can always manually

    a.  restore the database

    b. remap the web site back to the ClientVD_1_0_0_0 directory.

    Any suggestions or improvements on this plan?

     

  • 11-21-2008, 2:38 PM In reply to

    Re: Deleting a single file from the web site.

    That sounds like it should work, although it is involves a little work, since you will have to write replace rules to change the path the VDIR points to in order to restore.

    Please let us know if the following would work for you.

    1) Use MSDeploy to sync the VDIR on 2 boxes using the following command
    msdeploy.exe -verb:sync -source:metaKey=/LM/W3SVC/1/ROOT/VDIR1 -dest:metaKey=/LM/W3SVC/1/ROOT/VDIR1,computername=msdeploy28

    2) Copy App_Offline.htm to the root of the VDIR on the source and run the sync again. This will bring the destination VDIR offline

    4) Make changes to the source and do the sync, so the destination gets updated accordingly.

    5) Delete App_Offline.htm from the root of the VDIR on the source machine and run sync again. App_Offline.htm will be deleted from the destination.

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
  • 11-21-2008, 6:42 PM In reply to

    • bmukes
    • Not Ranked
    • Joined on 11-21-2008, 12:04 AM
    • Posts 5

    Re: Deleting a single file from the web site.

    This works between my XP PC and my XP Virtual Machine.  My questions.

    1.  Do you see any issues that may occur using this approach in a production environment? 

    2.  Because this works I am now concerned about security do you think that the encryptPassword, userName, and password provider modifiers are enough to secure the MSDeployAgentService?

    Thanks

     Step 1.  copy the App_Offline.htm to shutdown the web site.

    msdeploy.exe -verb:sync -source:contentPath="c:\App_Offline.htm" -dest:contentPath=C:\TestWeb\App_Offline.htm,computerName=http://COMPUTER-VPC1:81/MsDeployAgentService/

     Step 2.  Perform a simple database update for proof of concept.

    msdeploy.exe -verb:sync -source:dbFullSql="c:\TestSQL.sql" -dest:dbFullSql="Data Source=COMPUTER-VPC1;Initial Catalog=msdeployTEST;User Id=sa;password=Password#9",computerName=http://COMPUTER-VPC1:81/MsDeployAgentService/

     Step 3.  Bring the web site back up by downloading an entire new version of the web site changing the directory in the process.

    msdeploy -verb:sync -source:metaKey=lm/w3svc/1/ROOT/TestWeb -dest:metaKey=lm/w3svc/1/ROOT/TestWeb,computerName=http://COMPUTER-VPC1:81/MsDeployAgentService/

    On my source machine the virtual directory of the web site is  C:\TestWeb_1_0_0_0.  On the destination machine the the virtual directory of the web site was  C:\TestWeb.  After Step 3 the destination machine has all new files under C:\TestWeb_1_0_0_0.

  • 11-22-2008, 2:09 AM In reply to

    Re: Deleting a single file from the web site.

    1) Before we answer question (1), could you please explain to us what your production environment looks like? Do non-admins need to have access to the msdeploy agent service? This agent service runs under “NETWORK SERVICE” user account and is accessible over the network by an administrator.

    2) encryptPassword is a modifier you can use only when syncing to an archive from a metaKey. It is not useful in live sync scenarios.

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
Page 1 of 1 (7 items)
Microsoft Communities