Configuring Deployment Settings

The next-to-last step in the Publish Wizard captures the build configuration that you want to deploy (for example, Release or Debug). Also, for each database connection used by the web application, it configures the corresponding connection string to use on the target server.

In the Contoso University sample application, two database connections are used: one called SchoolContext, and the other called ApplicationServices. If you look at Figure 11.7, you can see that the wizard shows us a section for each of these connections. Use the drop-down box to enter the connection string that the application should use on the target server (that is, the server on the receiving end of the publish operation).

Image

FIGURE 11.7 Configuring deployment/publish settings.

Deploying the Database

Under each Connection String drop-down, you’ll find an Update Database check box. Placing a check here tells the Web Deploy engine to also package up your physical database (in this case, a SQL Express database) and deploy it to the target server. The publishing engine automatically updates or creates the destination database schema as needed.

You can also provide custom SQL scripts to be used as part of the deployment process. To do this, click the Configure Database Updates link located to the right of the Update Database check box. In the dialog, click the Add SQL Script link at the top (see Figure 11.8).

Image

FIGURE 11.8 Deploying referenced databases with custom SQL script.

From there, click the Add Script button, and then navigate to the script file. Notice that there is already a script entry in the list; this is the script that the deployment tool generates based on the settings you have provided. Custom scripts that are added are executed in the order they are listed. For instance, if you need a script to execute before the general schema and data script that the tool generates, you add the script to the list and then use the arrow keys to the right of the list to move it above the default script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset