In this tutorial we will learn how to set up Visual Studio for a Windows Azure (cloud) project. On completing this tutorial, you'll have a simple web application up and running in the cloud. We are assuming that you are familiar with the Azure Portal. The following are the steps described in this tutorial:
SETTING UP AZURE PROJECTProcedure1. For setting up the project, first for the Webrole project you need to sign in to the Azure Portal.2. In the portal create a cloud service with a unique URL (Here it is example1.cloudapp.net) and a specified server location (here it is in Southeast Asia).3. Now for using Visual Studio, in the file menu select "New project" and then in the cloud pane of the window edit the name of the project to example1 (it is not necessary that both the project name and cloud service name will be the same) and click "Ok".4. After clicking "Ok" a small window is shown from which we need to select a type of Webrole project, here we will select ASP.NET web role and give a name to it. Let's name it "firstwebrole" then click "Ok" to continue.5. You will see the following files in your Solution Explorer. DESIGNING WEBROLE PROJECT1. We will create a web form that will display the text entered into the TextBox after clicking the "Submit" button.2. A wire frame of the form is: DEVELOPING WEBROLE PROJECTProcedure
1. Now in Visual Studio go to the Solution Explorer tab and right-click the Webrole (here it is firstwebrole) then seelct "Add" > "Add new item". A window will appear for selecting the web form (top of the window) name; nme it "firstform.aspx" and click "Add" to continue:2. Then open the "firstform.aspx" file in design mode and drag & drop the following ASP.NET controls to the form and when you run the project in the local environment you will see the form as:3. Open the "firstfom.aspx.cs" file and write the business logic for displaying the name entered in the testbox on a button click event:
protected void Button1_Click(object sender, EventArgs e)
{
label1.Text = TextBox1.Text;
} 4. Run the project using Ctrl+f5 and test the application. You are now ready to deploy to the Windows Azure Portal DEPLOYMENT TO WINDOWS AZUREProcedure1. Now login to the Windows Azure Portal and click on pane cloud services, you can see here the service we created earlier named "example1".2. Click on "example1 cloud service". We can see the deployment settings under which two options will exist:
3. Now come to Visual Studio and right-click the project then seelct "example1" -> "Package", then a small window will appear, in this window click on the package button. After some time a folder with following two files will appear: These files will be upload on the portal.4. Now on the portal click NEW PRODUCTION DEPLOYMENT a window will appear then pick the corresponding file by browsing to the same folder in which published file was created in previous step and select files. also we need to provide a deployment label name (can be any name depends on requirement). 5. Now upload the files. It will take 5 to 10 minutes depending on your internet speed. The upload progress will appear in the bottom pane of the portal.9. Congratulations! We have successfully deployed a Webrole project in a cloud environment, in other words Windows Azure.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: