Creating the Service Model


Here 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.

    Model1.jpg

  2. Now Click OK, without selecting any role.

    Model2.jpg

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

    Model3.jpg

    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.

    Model4.jpg

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

    Model5.jpg

  6. Now select a certificate

    Model6.jpg

  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.

    Model7.jpg

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

    Model8.jpg

  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"

    Model9.jpg

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

    Model10.jpg

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


    Model11.jpg

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

    Model12.jpg

  14. Now select the account and click Close.

    Model13.jpg

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

    Model14.jpg

  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.

    Model15.jpg

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

    Model16.jpg

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

    Model17.jpg

  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.

    Model18.jpg

  20. Now click on the Package.

    Model19.jpg

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

Up Next
    Ebook Download
    View all
    Learn
    View all