Create & publish Web App from Webmatrix

Overview of Web App in Webmatrix

Microsoft WebMatrix provides a seamless development and deployment experience with built-in support for your Microsoft Account credentials. This means that it is aware of your Azure account and the Web App that you have provisioned, and has the ability to create and stage new websites for you. It’s not a traditional tool in a .NET developer’s toolkit, but it does have deep integration, support for open-source projects, an active community of developers who are building extensions, and an overall pleasant experience to experiment with.

Webmatrix 3

Deploying Your Site in Webmatrix 3

Here’s how simple is to create a example web app and publish it using WebMatrix:

  1. Open WebMatrix and log in using your Windows Azure credentials. The login link is in the top-right corner. If you have previously logged in, WebMatrix will remember your credentials.
Azure Log in - Webmatrix 3
  1. Choose Open ➪ Folder from the welcome screen and select the folder containing the basic site publishing files. This is the root folder located in Basic Site Publishing Files, which is in your code download.
  2. Click the Publish command in the Home ribbon. This will open the Publish Your Site dialog.
  3. Select Create - New Site and fill in the required information. Azure needs you to name the site, choose a region, and associate the site with a new or existing database. You can create a new database if you like, but you won’t be using this resource for the purpose of this exercise. Click OK to continue , and WebMatrix will download the related publishing profile for your site.
Publish from Webmatrix 3
  1. Complete the test deployment by clicking Continue, and Continue again once the tests are complete. WebMatrix will ensure that the basic components of the site are compatible with the Azure Web Site and display the results. You are not required to do this step and can skip it if you like, but I recommend trying it out at least once to familiarize yourself with the process. This simple step can help catch deployment problems before they occur!
  2. Review the Publish Preview screen. This contains the type of information that WebMatrix presents to you as you begin the publish process on each iteration. In future sessions you will usually see far fewer files; the initial deployment has to upload all the assets of the project, while subsequent deployments perform a differential upload, so only those files that have changed will be shown in the screen (and sent to the Web Site).
  3. Click Continue to complete your deployment. The dialog will close and you’ll see a yellow alert panel at the bottom of the screen. This panel reports on progress as WebMatrix processes changes on your site.

Publishing Changes to the Site

Now that the site is associated with a Windows Azure Web Site instance, changes that you make can easily be identifi ed, and synchronizing the site goes more quickly. Try it out by following these steps:

  1. In the project structure, navigate to the Home directory under Views and open the Index.cshtml file.
  2. Change the H2 title tag of the page to something of your liking. The tag is located near the top of the fi le and looks like this: <h2>Index>/h2>
  3. Click Publish on the Home ribbon.
  4. Review the changes that will be published. Note that this time around, only one fi le has changed and needs to be uploaded to the site.
  5. Click Continue to complete the deployment. The alert panel is displayed again and shows the progress of deployment.
Change content and Publish - Webmatrix 3