written 8.5 years ago by | modified 2.8 years ago by |
Mumbai University >Information Technology>Sem7>Cloud Computing
Marks: 8 M
Year: May 2014, Dec 2014
written 8.5 years ago by | modified 2.8 years ago by |
Mumbai University >Information Technology>Sem7>Cloud Computing
Marks: 8 M
Year: May 2014, Dec 2014
written 8.5 years ago by |
The Azure Management Portal provides two ways for you to create and deploy a cloud service: Quick Create and Custom Create.
Three components are required in order to deploy an application as a cloud service in Azure:
Service Definition
The cloud service definition file (.csdef) defines the service model, including the number of roles.
Service Configuration
The cloud service configuration file (.cscfg) provides configuration settings for the cloud service and individual roles, including the number of role instances.
Service Package
The service package (.cspkg) contains the application code and the service definition file.
Create a cloud service using Quick Create
In the Management Portal, click New>Compute>Cloud Service>Quick Create.
In URL, enter a subdomain name to use in the public URL for accessing your cloud service in production deployments. The URL format for production deployments is:
https://myURL.cloudapp.net
In Region or Affinity Group, select the geographic region or affinity group to deploy the cloud service to. Select an affinity group if you want to deploy your cloud service to the same location as other Azure services within a region.
Click Create Cloud Service.
Upload a certificate for a cloud service
In the Management Portal, click Cloud Services, click the name of the cloud service, and then click Certificates.
Click either Upload a certificate or Upload.
In File, use Browse to select the certificate (.pfx file).
In Password, enter the private key for the certificate.
Click OK (checkmark).
Deploy a cloud service
The dashboard opens in the Production environment, you could at this point select Staging to deploy your application in the staging environment. For more information, see Manage Deployments in Azure.
Click either Upload a new production deployment or Upload.
In Deployment label, enter a name for the new deployment - for example, MyCloudServicev4.
In Package, use Browse to select the service package file (.cspkg) to use.
In Configuration, use Browse to select the service configure file (.cscfg) to use.
If the cloud service will include any roles with only one instance, select the Deploy even if one or more roles contain a single instance check box to enable the deployment to proceed.
Verify your deployment completed successfully
The status should show that the service is running.
Setup for Azure Project
Procedure
DESIGNING WEBROLE PROJECT
DEVELOPING WEBROLE PROJECT
Procedure
Now in Visual Studio go to the Solution Explorer tab and right-click the Webrole (here it is firstwebrole) then select "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:
Then open the "firstform.aspx" file in design mode and drag & drop the following ASP.NET controls to the form
Open the "firstfom.aspx.cs" file and write the business logic for displaying the name entered in the textbox on a button click event:
protected void Button1_Click(object sender, EventArgs e)
{
label1.Text = TextBox1.Text;
}
Run the project using Ctrl+f5 and test the application. You are now ready to deploy to the Windows Azure Portal
DEPLOYMENT TO WINDOWS AZURE
Procedure
New Production deployment (for running in a real environment)
Staging deployment (for testing the application)
Now come to Visual Studio and right-click the project then select "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.
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).
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.