Tuesday, December 27, 2011

Creating the Service Model for VM role in Windows Azure


Now in this article we will create a service model for the image uploaded in azure.

1)      Start Visual Studio 2010. Create new project. From the Visual C# template, click Cloud. Give a name to the project and click OK.

2)      Now Click OK, without selecting any role.

3)      Now add a new VM role. For this right click the Roles select Add and then select New Virtual Machine Role.


In case if didn’t find the “New Virtual Machine Role”, you have to run the scripts below to add new registry key or just change the following [dword] registry key: 
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Windows Azure Tools for Microsoft Visual Studio 2010\1.0\VirtualMachineRoleEnabled​=1
4)      Now in properties of the VMRole, select Virtual Hard Disk tab, and select an account for the VHD. If you are using it for first time then you will not find any account there, and either you have to import or manage it.

5)      Now click on manage, It opens a window and then click New.

6)      Now select a certificate

7)      You can either choose an existing certificate, or can create a new one. To create a new certificate click “Create”. It asks for a friendly name. Give name and click OK.
8)      You can view the certificate. Just select the certificate and click View.

9)      You can install the certificate and create a .pfx for it. Just click on the Install.

10)   Now you have to upload the newly created certificate to the management portal. For this click “Copy the full path”. Now click on the “Window Azure Portal”

11)   On the portal, click on the Add Certificate.

12)   Now select the certificate, by pasting the path of the certificate. And click OK.


13)   Now enter the subscription Id on which certificate is uploaded and click OK.

14)   Now select the account and click Close.

15)   Now it will try to get the vhd’s of the account. Then select the VHD uploaded.

16)   Now configure endpoints to allow external connection. For this click on the Endpoints tab, and then click Add Endpoint. Now define Http as the protocol and port 80 for both public and private ports.

17)   Now configure the remote desktop connection for the role. Right click the VM role solution and click Package…


18)   Now click the enable Remote desktop for all roles.


19)   Now here select an existing certificate or you can create a new one. And enter username and password for remote desktop connection. Also select the expiration date. And then click OK.

20)   Now click on the Package.

21)   It creates the .cspkg and .cscfg file for deployment. And open the location in windows explorer.

No comments:

Post a Comment