次の方法で共有


Creating an On Premise Database and MVC Web Application and Migrating to Windows Azure and SQL Azure-Step 9 of 10

Previous Posts that you should review

bullet

Step 1
hyperlink[6]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/12/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-1-of-10.aspx

bullet

Step 2
hyperlink[6]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/11/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure.aspx

bullet

Step 3
hyperlink[6]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/27/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-3-of-10.aspx

bullet

Step 4
hyperlink322[2]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/28/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-4-of-10.aspx

bullet

Step 5
hyperlink312[2]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/28/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-5-of-10.aspx

bullet

Step 6
hyperlink3[2]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/06/30/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-6-of-10.aspx

bullet

Step 7
hyperlink[4][2]

https://blogs.msdn.com/b/brunoterkaly/archive/2010/07/01/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-7-of-10.aspx

bullet

Step 8
hyperlink

https://blogs.msdn.com/b/brunoterkaly/archive/2010/07/02/creating-an-on-premise-database-and-mvc-web-application-and-migrating-to-windows-azure-and-sql-azure-step-8-of-10.aspx

 

This Blog Post is about…

bullet

Publishing your MVC application as a hosted application in Windows Azure

bullet

Navigating to the Windows Azure Portal

bullet

Understanding your application "package" and "configuration" files

bullet

Creating a "hosted service"

bullet

Defining a "Public Service Name"

bullet

Defining a region where your application will run

bullet

Choosing between "production" and "staging"

bullet

Uploading the packaged application and configuration files to the portal

bullet

Running your application

 

 

How to publish your application

A simple right-mouse clickAs you know, your cloud-based MVC application is comprised of two projects:

bullet

The configuration project (MvcAzure)

bullet

The MVC Application project (MvcAzure_WebRole)

snap0182

What happens when you publish?  

2 things will occur

bullet

You will automatically be navigated to the Azure Web Portal (so you can upload your application)

bullet

Two files will be generated (the first is your packaged application and second file that is generated is the configuration file)

snap0183

The Azure Web Portal

The assumption is that you have obtained an Azure AccountBeing able to deploy your application to the cloud requires that you have a valid Azure account. You can sign up here:
hyperlink[4]

https://www.microsoft.com/windowsazure/offers/

image

snap0184

Publishing your project creates 2 files

snap0185

Creating a “new service”

snap0186snap0187

You will provide a label here 

This is for the developer, not the end userThis string will be used to identify the application within the Windows Azure web portal

snap0188

Check for Availability 

Mapping your own custom domainsYou can use CNAME record mapping to map your own domain name to your Windows Azure “Public Service Name.”
hyperlink[8]

https://blog.smarx.com/posts/custom-domain-names-in-windows-azure

 

CNAME creation

Create a CNAME

Essentially, you will need to create a CNAME record mapping the “www” subdomain (as in www.brunoterkaly.com) to my Windows Azure application (brunomvcapp.cloudapp.net).

snap0189

snap0190snap0191

Staging or Production?  

What is the difference between staging and production

bullet

The Azure Portal has two deployment environments, Staging and Production.

bullet

You will want to use Staging first to verify your application works correctly before deploying it in to Production

bullet

When you are ready to deploy in to Production, you can move or swap your Staging code by clicking the “arrow” icon in between the two environments

snap0192snap0193snap0194snap0195snap0196snap0197

Ready to “Run”  

Changing StatesAfter clicking “Run” your application will go through various states.

bullet

Initializing

bullet

Busy

bullet

Ready

snap0198

What happens when you click “Run”  

The Fabric ControllerThe Azure Fabric Controller (FC) is the service which monitors, maintains and provisions machines to host the applications that we (the developer) create and store in the Microsoft cloud.
hyperlink[10]

https://azure.snagy.name/blog/?p=89

Here is the just some of the steps

bullet

There is an agent on this OS that knows how to find and talk to the Azure Fabric Controller.

bullet

The FC then tells the agent to prepare a host partition.

bullet

The agent then downloads a Hyper-V enabled version of Windows Server 2008 Core (since the host OS should be as lightweight as possible).

bullet

This VHD is read-only and only contains the basics...
hyperlink[12]

https://azure.snagy.name/blog/?tag=fabric-controller

snap0199

Finally, we are done !  

Click on the “Web Site URL”

bullet

By now we have finished building and deploying our application.

bullet

Both the data and the MVC Application is running fully in the cloud.

bullet

If additional scale is needed, we can change the “Instance Count,” as described in one of my previous posts.

bullet

Although the database can grow to 50GB in size, you may want to devise some sort of sharding logic.

bullet

Sharding can be challenging and essentially involves the horizontal partitioning of data.

bullet

Database sharding is a technique for scaling out SQL databases and has started to gain mindshare amongst developers.
What is sharding?

bullet

Sharding is easily explained by a simple single table example.

bullet

Lets say you have a large customer table that you want to split into two shards.

bullet

You can create the shards by having all of the customers who’s names start with ‘A’ up to ‘L’ in one database and another for those from ‘M’ to ‘Z’.

snap0200snap0201