Using MS Deploy to deploy only the databases - msdeploy

Can I use MS Deploy to deploy only the databases and not the web applications in the deploy package?
And if so, how?
The website is running on a different server than the databases (web server vs db server) so I'd rather not have it deploy the package in its entirety to the database server.

MSDeploy does not deploy the entire package to MsDeploy.axd, so the deploying the lot just to deploy the database doesn't really have that much overheard.
If you really don't want the website to even be checked for the purposes of synchronization, you have two choices:
Deploy the package and skip the iisApp by adding -skip:objectName=iisApp,setAcl
Split the dbFullSql into another package
Either way, I'd recommend continuing to deploy via the application server rather than directly to the database server.

Related

Can i deploy Azure project on IIS?

I have solution with startup project that have .ccproj format. This is an Azure project that require Azure SDK installed. By default i am able to run it using IIS Express with Azure storage emulator & Azure compute emulator. But when i make some changes i need to recompile entire solution and re-run it. How can i deploy it in IIS server ? Could you advise me alternative deploy method how to run it in simplest way ?
I want to re-compile and attach to process after make some changes in project without restarting IIS Express & Azure emulators, it takes a lot of time.
#DotNetGoose,
should be able to run on IIS but you will need to abstract all the calls that your code read content from RoleEnvironmental and direct them to read from Web.config, and have a copy of corresponding settings in your web.config.
once the abstraction is done, set your web app as default startup project, you should be able to run them as normal web app on iis or iisexpress.

Web Deploy Package containing output from Web Application and Database Project

In my organization the main product is a web application and an associated database. Both the web application and database is source controlled in TFS. We are running this product in various versions across hundres of IIS web site instances. When having that many web site instances on IIS deployment is atm. a problem.
What I want to do is to package my web application together with the output from my database project. I've been looking into creating a Web Deploy Package which makes it easy to deploy a web application remotely, locally or programitically to IIS if i want to.
What I want to achieve is to have one package but I want to know if it's possible to embed a Database project into a Web Deploy Package taking advantages of dacpac incremental database deployment?
If this is not possible is there any good alternatives to Web Deploy Package that suit my needs?
Another method is to create an MSI package to deploy both the Web Deploy Package and also update the DBs. For example, with Advanced Installer you can use the built-in support for Web Deploy Packages.
To perform dacpac incremental database deployment you can call SqlPackage.exe from the same MSI, as a custom action. The linked example shows a simple EXE running, but you can change that to run any desired EXE, passing your required command line parameters.
If you perform frequent upgrades of the websites, or the settings are usually changed after the installation/deployment, then you should take a look at the next thread too, it talks about persisting website installations during upgrades.

Deploy to an Azure WebRole without Visual Studio

Is there a way I can deploy my entire website/webapp to an Azure WebRole without the need of Visual Studio?
Context: We have a test environment where there's an IIS hosted web app where our testers test (of course). The thing is, we want to grab that exact tested web app folder and deploy it "as is" to a WebRole.
Please avoid commenting on our procedure, we have been looking at it and we will eventually change it if we have to, I just need a 'simple' yes(how)/no answer.
IIS Web Deploy can be used to package/migrate/restore IIS applications. It can be enabled while deploying a web role as described in this article and allows to update the web role with the application as deployed in your test environment.
Be aware that only single instance cloud services are supported and that in case of a maintenance operation by the fabric controller, your service will be rolled back to the state created by the initial azure package deployment. (There once was a tool for syncing between multi-instance web deployments but sadly that did not work out too well and is no longer supported. Do not attempt to use or rebuild it.)
Installing and Configuring Web Deploy shows the steps to get web deploy for your local testing IIS while articles on using web deploy like this one show examples for calling the tool.
Another option to evaluate are azure websites and git deployment. This could provide you with a documented and reproducible form of deployment that is not prone to unwanted rollbacks while allowing the service to scale to multiple instances. This option might not work out if the application it too tied to the web roles infrastructure or contains code not suitable for the more restricted web sites environment.
A third option to look at is using CSPack as presented in this article. You basically create a service definition and package up the webapp manually without building it in Visual Studio or TFS.
Yes - make sure you have enabled Remote Access on your webrole. Then copy your web app from your local IIS folder to F:\sitesroot\0 (NOTE - may be E:\sitesroot\0 on same web roles).
Yes, you can write a programmatic interface against Web Deploy from your C# code. If you're deploying to Azure Web Sites, you could also use the Windows Azure Management Libraries to spin up new web sites or clouand deploy them.

ALM - Application Lifecycle Management - Build and deployment challenge

I am stuck with a problem that I could use some feedback on to solve it in the best possible way.
The issue revolves around source control -> automated builds -> deployment. Basically ALM (Application Lifecycle Management).
We have a product – an ASP.NET Web application with a MS SQL database. This product is running on hundreds of websites with associated databases across multiple virtual machines in our production environment. At the moment the web applications and database are running on servers with IIS 7 and SQL Database Server 2008 R2. The product itself is source controlled in Team Foundation 2012.
For years the release of new versions of the product has been once or twice a year for years. Now we are going to focus on releasing more frequently and hence we need a strategy for the ALM for the product.
The deployment strategy now:
In the development period between the releases, the SQL update scripts has been created manually – each time a database change was made a script was updated. When the application is ready to be deployed it gets compiled on a developer machine. The database with all the changes used would be backed up into a .BAK file. The web application, the .BAK file and the update SQL script would be packaged (.zip) and uploaded to the production environment ready for deployment.
Update existing running products:
Copy/paste the web application in the target website physical folder.
Update the web.config file – connectionstring and application
variables. Run the update script via SQL Management Studio
This would be done for each and every customer – hundreds of times.
This is a very tedious and error prone task and I don’t like it at all!
What I would like to do instead is;
Source control the database as a Database Project in Team Foundation
Automatically build the web application with Team Foundation 2012
Build Server.
Deploy the output from the Build Server to the multiple websites of
the production environment along with automatically generated SQL
update scripts run against the SQL Server.
I have been googling my ass off - only finding bits and pieces regarding builds, deployment, automatic SQL update script etc.
What I think is partly the right direction is to source control the database and use the TFS Build Server. I am very confused on how to do the deployment itself in an easy and controlled way using the output from the TFS Build server.
Ideally I would want to the TFS Build server to create a package with the latest version of the Web application, the latest version of the database, post deployment script including an auto generated SQL Update script from the previous build to the current build. This could be contained in e.g. a nuget package. Then I would want to be able to create an additional web application which should manage the deployment – target, version, iis website, sql server, web.config connectionstrings etc.
Does anyone have any advice on how to achieve this? How do you do this?
You can use a release management tool to do this, no need to create an additional web application.
One such example is Deployment Manager, from Red Gate. (Disclaimer: I work there.) It has built-in deployment actions for ASP.NET apps and SQL Server databases. The command line tool RgPublish.exe can be used to create a package for the web app as you describe from TFS Build. The same can be done for the database using the sqlCI.exe command line and associated NANT/MSBuild scripts.
The same packages can then be deployed to each of your servers. You may run into scalability issues with 100s of websites though.
The database deployment works by generating the upgrade script automatically, though you can change the behaviour to put the upgrade script in the package, when the package is first built. These are called "dynamic" and "static" upgrade methods respectively.

How can I deploy my ready website?

I have well developed an ASP.NET website with SQL Server 2000. How can I drop it on a server?
You might find these resources helpful:
ASP.NET Web Site Project Deployment Overview
Deploying a Database by Using the Database Publishing Wizard
How to: Deploy a Database With a Web Application Project
Depends on a number of things (e.g. if you have direct access to the server(s)). I tend to export my database structure as a SQL script and execute that against the production database. I then "publish" the site using VS and copy it across to a virtual directory on the web server.
If I am passing the application to a customer, I tend to use WiX or a VS deployment project to wrap the application up in an installer.
You can use SQL Server Publisher (free) wizard for moving database from development machine to the server. Or you can use SQL Server database schema synchronization tool by Red-gate.com
And SitePubisher for deploying files over FTP (and VPN)
There are many ways to do this.
Read this - http://www.beansoftware.com/ASP.NET-Tutorials/Deploy-ASP.NET.aspx

Resources