Create Windows Azure remote desktop configuration | créer une configuration Azure pour le bureau d’accès à distance

English Français

In this post, the goal is to have the configuration lines to set remote desktop in a Windows Azure Package.

14-DEC-2011 UPDATE: an alternative way is available at https://www.windowsazure.com/en-us/develop/other/common-tasks/enable-remote-desktop/

Dans ce billet, le but est d’obtenir les lignes de configuration pour mettre en place l’accès au bureau à distance Windows Azure.

MAJ du 14-DEC-2011: une autre façon de faire est disponible à https://www.windowsazure.com/en-us/develop/other/common-tasks/enable-remote-desktop/

Whether you need to use this from Visual Studio or other Windows packaging mechanism such as scaffolding, leveraging the new Windows Azure SDK 1.6 tools to avoid managing certificates might be a good choice. This is the easiest way now. Que vous ayez besoin d’utiliser cela depuis Visual Studio ou depuis un autre mode d’empaquetage tel que l’échaffaudage, utiliser les capacités du nouveau SDK Windows Azure 1.6 de façon à ne pas avoir à gérer les certificats peut être un bon choix. C’est a priori le plus simple aujourd’hui.
In this post, I assume you have no knowledge on Visual Studio, and you didn’t install it on your development machine. Dans ce billet, je pars du principe qu’on n’a aucune connaissance de Visual Studio, et qu’il n’est pas installé sur la machine de développement.
So let’s get started Démarrons donc sans plus attendre
First, install the Windows Azure SDK as explained in this post: Download and install Windows Azure SDK Premièrement, installer le SDK Windows Azure comme expliqué dans ce billet: Télécharger et installer Windows Azure SDK 1.6
Then start a Visual Studio Project and add a worker role only in it (the goal is to have the simplest Windows Azure project and use the tools inside Visual Studio which abstract away certificate management). Puis, démarrer un projet Visual Studio et y ajouter uniquement un worker role (le but est d’avoir le project Windows Azure le plus simple et utiliser les outils Visual Studio qui masquent la gestion sous-jacente des certificats).

image_thumb12

image_thumb15

image

image

image

Choose a username and password and enter them in the dialog box. In this example, username=RDAdmin, password=ULzikjcd81 (NB: not the actual one, no use trying to use it to connect to my assets!). Choisir un nom d’utilisateur et un mot de passe et les saisir dans la boîte de dialogue. Dans cet exemple, nom d’utilisateur=RDAdmin, mot de passe=ULzikjcd81 (NB: ce n’est pas le mot de passe réel, inutil d’essayer de vous connecter à mes ressources!).

image

This populated the .csfg and the .csdef files Cela a rempli les fichiers .csfg et .csdef

image

Here is the content of the two files (I ignore the ServiceConfiguration.Local.cscfg which is used only with the Emulator): Voici le contenu des deux fichiers (j’ignore ici le fichier ServiceConfiguration.Local.cscfg qui est utilisé avec l’émulateur uniquement)
 <?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzureProject1" xmlns="https://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
  <WorkerRole name="WorkerRole1" vmsize="Small">
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
  </WorkerRole>
</ServiceDefinition>

 

 <?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzureProject1" xmlns="https://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*">
  <Role name="WorkerRole1">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="RDAdmin" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEFmUr8LcQTGbRpiY5c+XiyowDQYJKoZIhvcNAQEBBQAEggEAOXUkCgGgaT/q6QET/mIc3vBm26kuKjGuRt6uYG4LTDXRORXqalBSGN3KMq3LcZu839h9fFoud9SwsHBeTRZJZUspn2aCg46oZRbUGXULZwfmy9DrXdWuNfUUf2pTZ9W8b4ycXuDwEhiMn2h7WUl6b7Wr/855Ig8zMgOEROVObjYSH4Y7cnAcN8LZBpCE5AhdoiB6+UX6gOMO9tB3vxEgF1O12MilpC0uceMtVvdMQKreBz4zFWlDtMOcx0snQ0LrHy67Lg5akyarkoarmV34yYmnW8zeC4tQI/Y2AJgO62JB69wcqOKcFUyLdWr4RcJ/qd1TFFPrbk1uxA8O8ZNWrDAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECPTuBPW9liu/gBD//feGUjpCq4d09Uvvf2QV" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2012-12-07T23:59:59.0000000+01:00" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
    </ConfigurationSettings>
    <Certificates>
      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="224E9C052400EA028D0E9E369F3895437C71DC75" thumbprintAlgorithm="sha1" />
    </Certificates>
  </Role>
</ServiceConfiguration>
The lines containing RemoteAccess or RemoteForwarder in the configuration files may be merged into .csdef and .cscfg files generated outside Visual Studio in order to have Remote Desktop setup. Les lignes avec RemoteAccess ou RemoteForwarder dans les fichiers de configuration peuvent être incluses dans les fichiers .csdef et .cscfg générées en dehors de Visual Studio de façon à avoir l’accès au bureau à distance.

 

Important: an additional step is necessary to prepare your Windows Azure environment. This consists in starting a deployment and stop it, in order to upload a certificate (cf below). Important: une étape complémentaire est nécessaire pour préparer son environnement Windows Azure. Cela consiste à démarrer un déploiement et l’arrêter immédiatement, de façon à charger un certificat (voir plus bas).

image

image

image

Sign in with a Windows Live ID that has access to a valid Windows Azure Subscription. If you don’t have one, you can go to https://windowsazure.fr where you will be explained how to get one. Se connecter avec un compte Live ID qui a accès à un abonnement Windows Azure en cours de validité. Si vous n’en n’avez pas, vous pouvez aller à https://windowsazure.fr où on vous expliquera comment procéder.

image

Save the file locally Sauvegarder le fichier localement

image

image

go back to Visual Studio 2010, Click import and choose the file you just downloaded retourner à Visual Studio 2010, cliquer sur Import et choisir le fichier qui avait été téléchargé

image

image

make sure you choose the right hosted service (the one where the final app will eventually be deployed) Vérifier que le service hébergé est bien le bon (celui vers lequel on déploiera l’application au final)

image

image

image

image

image

That’s it. If you don’t need to change development machine or don’t want to have further explanations about the certificates, you can skip the rest of this post. Voilà. Si vous n’avez pas besoin de changer de machine de développement ou que vous ne souhaiter pas avoir les explications sur les certificats, vous pouvez terminer ici la lecture de ce billet.
NB: Under the hood, this created a certificate that will be used to encrypt the password (ULzikjcd81). If you change machines, you may have to copy the certificate with its private key thru a .pfx file. More details can be found here and here. Here is the certificate that was used in the above example: NB: En coulisses, tout cela a créé un certificat qui est utilisé pour chiffrer le mot de passe (ULzikjcd81). Si on doit changer de machine, il peut être nécessaire de copier le certificat avec sa clef privée via un fichier .pfx. On trouvera plus d’infos sur le sujet ici et ici. Voici le certificat qui a été utilisé dans l’exemple ci-dessus:

image

Starting a publish to Windows Azure uploaded that certificate to Windows Azure: Le démarrage de la publication vers Windows Azure et eu pour effet (recherché) de charger ce certificat:

image

Smile

Benjamin


(the goal of this post is to be referenced by others in order to avoid repeating how to do) (le but de ce billet est d’être référencé par d’autres de façon à ne pas répéter comment faire)