<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Stéphanie Hertrich</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/stephe/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/stephe/feed.xml</link>
    <description>Technical Evangelist @Microsoft France</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:31:10 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Tutoriel : Premiers pas de développeur avec Docker, Azure et Visual Studio 3/3</title>
      <link>https://docs.microsoft.com/archive/blogs/stephe/tutoriel-premiers-pas-de-dveloppeur-avec-docker-azure-et-visual-studio-33</link>
      <pubDate>Fri, 04 Mar 2016 02:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Hertrich]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/stephe/2016/03/04/tutoriel-premiers-pas-de-dveloppeur-avec-docker-azure-et-visual-studio-33/</guid>
      <description><![CDATA[Dans la partie 2 de ce tutoriel, nous avons déployé une application console ASP.Net 5 dans un...]]></description>
      <content:encoded><![CDATA[Dans la <a href="https://blogs.msdn.com/b/stephe/archive/2015/12/10/tutoriel-premiers-pas-de-d-233-veloppeur-avec-docker-azure-et-visual-studio-2-2.aspx">partie 2</a> de ce tutoriel, nous avons déployé une application console ASP.Net 5 dans un conteneur linux sur Azure. Pour réaliser cela, il nous fallait une VM linux avec l’agent Docker, que nous avons créé depuis le portail Azure.

Cette fois, nous allons déployer la même application mais dans un <strong>conteneur Windows</strong>, tout cela – de la création de la VM au déploiement de l’app - <strong>directement depuis Visual Studio</strong>.

Il faudra prendre quelques précautions dans le projet Visual Studio, pour bien dissocier les paramètres spécifiques à la cible du déploiement linux/windows: nous verrons cela en temps voulu dans la suite de l’article.

Voici les grandes étapes de ce tutoriel:
<ul>
	<li>Créer la VM supportant les conteneurs Windows, depuis Visual Studio</li>
	<li>Retrouver la VM sur le portail Azure (ce n’est pas nécessaire, mais ça peut toujours servir !)</li>
	<li>Déployer l’application (et constater que le déploiement échoue)</li>
	<li>Modifier le fichier dockerfile</li>
	<li>Déployer l’application à nouveau</li>
	<li>Et si chez moi ça ne marche pas ?</li>
</ul>
&nbsp;

Entre temps, une nouvelle version du package des <a href="https://visualstudiogallery.msdn.microsoft.com/0f5b2caa-ea00-41c8-b8a2-058c7da0b3e4">outils Docker pour Visual Studio</a> est sortie. N’hésitez pas à la mettre à jour avec la dernière en date si besoin. (voir la partie 2 de ce tutoriel pour les détails d’installation)

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1641.image_5F00_4.png" target="_blank"><img class="alignnone" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3513.clip_5F00_image001_5B00_4_5D005F00_187d79b5_2D00_350e_2D00_4fad_2D00_9e0b_2D00_ec8fef8d84b4.png" alt="" width="533" height="332" border="0" /></a>
<h1>Créer la VM supportant les conteneurs Windows, depuis Visual Studio</h1>
Placez-vous dans Visual Studio, sur votre projet

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5381.image_5F00_2.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image002[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5707.clip_5F00_image002_5B00_4_5D005F00_8cfd0ef8_2D00_4492_2D00_40c6_2D00_a36f_2D00_96082b0d04f0.png" alt="clip_image002[4]" width="721" height="271" border="0" /></a>

Cliquez sur le bouton droit et sélectionnez “Publish”

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8715.image_5F00_6.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image003[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5466.clip_5F00_image003_5B00_4_5D005F00_22924c8c_2D00_39f1_2D00_45da_2D00_ab5c_2D00_8394f475c475.png" alt="clip_image003[4]" width="561" height="371" border="0" /></a>

Après avoir sélectionné “Docker Containers”, cliquez sur le bouton “New”

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3301.image_5F00_10.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image004[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3487.clip_5F00_image004_5B00_4_5D005F00_caba95bd_2D00_f4e9_2D00_4001_2D00_bd31_2D00_e7600994cda6.png" alt="clip_image004[4]" width="721" height="571" border="0" /></a>

Remplissez les champs, avec notamment l’image de l’OS qui sera Windows Server 2016 Technical Preview with Containers.

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7268.image_5F00_12.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image005[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3515.clip_5F00_image005_5B00_4_5D005F00_68e82575_2D00_ec18_2D00_4633_2D00_8145_2D00_c8be5f573bbf.png" alt="clip_image005[4]" width="558" height="469" border="0" /></a>

Les certificats Docker seront générés automatiquement si besoin, dans le répertoire .docker du profil de l’utilisateur.

Lorsque vous validez, le script PowerShell suivant est lancé.

<span style="font-family: consolas">Deploy-DockerAzureResourceGroup.ps1' -ResourceGroupName 'stephetutodockerwin' -ResourceGroupLocation 'westeurope' -TemplateFile 'C:\stepheWin8\Projets\DockerConsoleApp\PublishScripts\Templates\DockerConsoleAppDockerVM.json' -TemplateParametersFile 'C:\stepheWin8\Projets\DockerConsoleApp\PublishScripts\Templates\DockerConsoleAppDockerVM.param.dev.json' -DockerCertsDirectory 'C:\Users\stephe\.docker' -AdminPassword 'XXXXXX'</span>

Il utilise un template ARM nommé DockerConsoleAppDockerVM.json que vous retrouverez dans votre projet, tout comme le script PowerShell d’ailleurs:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2451.image_5F00_16.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image006[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3034.clip_5F00_image006_5B00_4_5D005F00_23b128f2_2D00_e0bd_2D00_49f2_2D00_90f6_2D00_28a2a3a06d4f.png" alt="clip_image006[4]" width="399" height="197" border="0" /></a>
<h1>Retrouver la VM sur le portail Azure</h1>
Si vous jetez un œil à votre portail Azure, vous verrez que la VM (de type ARM : Azure Resource Manager qui est le nouveau modèle de VM) est en cours en provisionnement

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5852.image_5F00_14.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image007[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5023.clip_5F00_image007_5B00_4_5D005F00_52010c86_2D00_c978_2D00_4c90_2D00_92d5_2D00_1982d1949196.png" alt="clip_image007[4]" width="780" height="394" border="0" /></a>

Si tout se passe bien, VS vous prévient dans la fenêtre d’Output que le déploiement du template s’est bien passé.

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6866.image_5F00_18.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image008[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4278.clip_5F00_image008_5B00_4_5D005F00_df106639_2D00_3109_2D00_40dc_2D00_86a5_2D00_390b3f06d810.png" alt="clip_image008[4]" width="816" height="42" border="0" /></a>
<h1>Déployer l’application</h1>
Refaites un clic droit sur le projet pour déployer à nouveau le projet

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7444.image_5F00_20.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image009[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3542.clip_5F00_image009_5B00_4_5D005F00_1cc0f75f_2D00_28e2_2D00_4602_2D00_bd88_2D00_6a4d9c9b0e2f.png" alt="clip_image009[4]" width="706" height="558" border="0" /></a>

Si vous cliquez sur “Validate Connection”, vous verrez apparaitre le petit icône check vert qui indique que la connexion au Docker host a réussi.

Cliquez maintenant sur le bouton “Publish” : aïe, le déploiement se passe mal’

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8054.image_5F00_43.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image010[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3073.clip_5F00_image010_5B00_4_5D005F00_74d777cf_2D00_246a_2D00_4a85_2D00_9676_2D00_045d5304fdd9.png" alt="clip_image010[4]" width="602" height="353" border="0" /></a>

Impossible de trouver l’image docker/aspnet ? Je parie que vous voyez où je veux en venir.
<h1>Modifier le fichier dockerfile</h1>
En effet, le fichier dockerfile présent dans notre projet est resté le même depuis le déploiement sous linux. Or les images docker permettant de faire tourner l’application sur Windows sont différentes. Pour rappel, notre dockerfile part de l’image microsoft/aspnet qui se base sur Mono. Vous trouverez plus de détails sur le sujet dans le <a href="https://blogs.msdn.com/b/stephe/archive/2015/12/10/tutoriel-premiers-pas-de-d-233-veloppeur-avec-docker-azure-et-visual-studio-2-2.aspx">2ème volet de cet article</a>.

Visual Studio est capable de générer le dockerfile qui va bien en fonction de la cible du déploiement, mais pour cela, le fichier ne doit pas encore exister. Donc nous allons renommer le .dockerfile existant en .dockerfile.linux:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6646.image_5F00_46.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image011[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3247.clip_5F00_image011_5B00_4_5D005F00_de8e7533_2D00_81d6_2D00_454c_2D00_a39f_2D00_72cdab8e047a.png" alt="clip_image011[4]" width="193" height="152" border="0" /></a>

Redéployer l’application

On relance le déploiement et on remarque que VS nous informe qu’il va regénérer le fichier puisqu’il mentionne “autogenerate” (c’est grisé, il faut de bons yeux !)

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2061.image_5F00_26.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image013[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7384.clip_5F00_image013_5B00_4_5D005F00_3389821f_2D00_0d9a_2D00_4f87_2D00_b172_2D00_a70353eec6ad.png" alt="clip_image013[4]" width="519" height="270" border="0" /></a>

Remarquez que le Dockerfile contient maintenant:

<span style="font-family: consolas">FROM windowsservercore
ADD . /app
WORKDIR /app/approot
ENTRYPOINT DockerConsoleApp.cmd</span>

Cette fois on part de WindowsServerCore qui correspond à l’image d’un conteneur de  Windows Server 2016 (Tech preview).

Au démarrage du conteneur, c’est le paramètre ENTRYPOINT qui sera utilisé pour démarrer l’application, à savoir le fichier de commande DockerConsoleApp.cmd.

Vous trouverez ce fichier dans un répertoire temporaire du profil de l’utilisateur : C:\Users\stephe\AppData\Local\Temp\PublishTemp\DockerConsoleApp82\approot

Si vous mettez le compilateur en mode verbose dans Visual Studio

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4527.image_5F00_44.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image014[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5657.clip_5F00_image014_5B00_4_5D005F00_8a839ebb_2D00_6251_2D00_4853_2D00_9aab_2D00_2008895a381e.png" alt="clip_image014[4]" width="507" height="337" border="0" /></a>

Vous verrez apparaître le chemin utilisé pour la génération du package de déploiement et du .cmd (Menu Tools/Options):

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0160.image_5F00_38.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image015[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8231.clip_5F00_image015_5B00_4_5D005F00_732ed18a_2D00_f782_2D00_469e_2D00_b58c_2D00_673bc7e4ab6d.png" alt="clip_image015[4]" width="614" height="152" border="0" /></a>

Voici son contenu:

<span style="font-family: consolas">@echo off
SET DNX_FOLDER=dnx-coreclr-win-x64.1.0.0-rc1-final
SET "LOCAL_DNX=%~dp0runtimes\%DNX_FOLDER%\bin\dnx.exe"
IF EXIST %LOCAL_DNX% (
SET "DNX_PATH=%LOCAL_DNX%"
)
for %%a in (%DNX_HOME%) do (
IF EXIST %%a\runtimes\%DNX_FOLDER%\bin\dnx.exe (
SET "HOME_DNX=%%a\runtimes\%DNX_FOLDER%\bin\dnx.exe"
goto :continue
)
)</span>

<span style="font-family: consolas">:continue
IF "%HOME_DNX%" NEQ "" (
SET "DNX_PATH=%HOME_DNX%"
)
IF "%DNX_PATH%" == "" (
SET <strong>"DNX_PATH=dnx.exe"</strong>
)
@"%DNX_PATH%" --project "%~dp0src\DockerConsoleApp" --configuration Debug DockerConsoleApp %*</span>

On voit que l’on utilise en fait dnx.exe qui est le host natif capable de prendre en charge l’exécution notre application console. Pour comprendre comment cela fonctionne, je vous suggère la <a href="https://github.com/aspnet/Home/wiki/DNX-structure">lecture suivante</a>, et notamment l’architecture ci-dessous:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5023.dnxDiagram_5F00_2.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image016[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0334.clip_5F00_image016_5B00_4_5D005F00_7c41d3b2_2D00_c087_2D00_4a66_2D00_b13e_2D00_b787fc00b4b7.png" alt="clip_image016[4]" width="750" height="359" border="0" /></a>

Une fois le déploiement terminé, Visual Studio vous indique comment accéder à l’output de l’application:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2627.image_5F00_34.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image017[4]" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1351.clip_5F00_image017_5B00_4_5D005F00_cd4bff7f_2D00_d1c4_2D00_46fa_2D00_a666_2D00_0a20cd3dcef0.png" alt="clip_image017[4]" width="881" height="219" border="0" /></a>

Si vous copiez-collez cette ligne de commande dans un prompt, vous devriez voir le résultat suivant:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/40847.image_5F00_36.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image018" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5050.clip_5F00_image018_5F00_56025c01_2D00_d679_2D00_45f3_2D00_966a_2D00_72b90fb008bf.png" alt="clip_image018" width="536" height="274" border="0" /></a>

Et voilà….

Pour terminer, il vous suffit de renommer le dockerfile en dockerfile.Windows et de bien spécifier celui-ci dans le boite de dialogue servant au déploiement de l’application sur Windows. Il faudra faire de même avec le profil permettant de déployer sur Linux.

<img class="wlEmoticon wlEmoticon-lightbulb" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1323.wlEmoticon_2D00_lightbulb_5F00_2.png" alt="Ampoule" />Visual Studio est aussi capable de suffixer le dockerfile tout seul lorsqu’il le génère : notamment si vous avez déjà un autre dockerfile suffixé dans votre projet : dans mon cas, à la génération du dockerfile, il l’a directement nommé dockerfile.Windows !
<h1>Et si chez moi ça marche pas ?</h1>
Si vous rencontrez ce genre de souci lors du déploiement de l’application:

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2133.image_5F00_22.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image020" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5875.clip_5F00_image020_5F00_ef0135dc_2D00_e3c6_2D00_49a0_2D00_a80b_2D00_2d6b1acb5e9b.png" alt="clip_image020" width="700" height="178" border="0" /></a>

Cela signifie qu’il vous manque certaines versions du runtime sur votre machine cliente. Pour les installer, il vous suffit d’utiliser l’outil dnvm en ligne de commande:

Pour voir les runtimes installés :

<span style="font-family: consolas">&gt; dnvm –list</span>

Pour installer dnx-coreclr version 1.0.0-rc1-final pour Windows avec l’architecture x64:

<span style="font-family: consolas">&gt; dnvm install 1.0.0-rc1-final –r coreclr –arch x64</span>

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2313.image_5F00_28.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image021" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8737.clip_5F00_image021_5F00_1c10476a_2D00_fb7b_2D00_47f7_2D00_8ceb_2D00_5c41bc45b972.png" alt="clip_image021" width="786" height="392" border="0" /></a>

Veillez également à installer les dernières versions du SDK Azure et des outils Web pour Visual Studio, accessibles via le menu “Tools/Extensions &amp; Updates”

<a href="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4118.image_5F00_30.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="clip_image022" src="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5556.clip_5F00_image022_5F00_47e9c700_2D00_0795_2D00_4161_2D00_adbe_2D00_0f4f62099198.png" alt="clip_image022" width="709" height="492" border="0" /></a>
<h1>Et après ?</h1>
Nous venons de découvrir comment déployer une application dans un conteneur Linux ou Windows, sur Azure, ce qui vous a permis de comprendre comment fonctionne Docker et comment il s’interface avec Azure et les outils de développement..

Mais se pose rapidement la question de la scalabilité et de l’orchestration, nécessaires dans la vraie vie c’est à dire dans un contexte de mise en production. Pour cela, il existe Azure Container Service qui est un service de plus haut niveau, qui vous permettra notamment de piloter des clusters, à travers des technologies comme Swarm ou Mesos.

N’hésitez pas à suivre les explications et le tutoriel de Julien <a href="https://blogs.msdn.microsoft.com/jcorioland/2016/01/14/create-a-docker-swarm-cluster-using-azure-container-service/">Create a Docker Swarm cluster using Azure Container Service</a>.]]></content:encoded>
    </item>
    <item>
      <title>Crée ton premier plugin Minecraft avec Skript</title>
      <link>https://docs.microsoft.com/archive/blogs/stephe/cre-ton-premier-plugin-minecraft-avec-skript</link>
      <pubDate>Tue, 16 Feb 2016 04:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Hertrich]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/stephe/2016/02/16/cre-ton-premier-plugin-minecraft-avec-skript/</guid>
      <description><![CDATA[Bonjour, je m’appelle Timothé et je suis actuellement en stage de 3ème chez Microsoft France d’où...]]></description>
      <content:encoded><![CDATA[<p>Bonjour, je m’appelle Timothé et je suis actuellement en stage de 3<sup>ème</sup> chez Microsoft France d’où j’écris ce texte. Cela va maintenant faire 3 ans que je crée des serveurs Minecraft en tout genre et je vous fais aujourd’hui profiter d’une des innombrables choses que j’ai apprises au cours de ces 3 ans. </p>  <h1></h1>  <h1>Sommaire</h1>  <p>I. Description </p>  <p>II. Installer Skript </p>  <p>III. Création et test du Skript</p>  <p>IV. Aller plus loin</p>  <h1>I. Description</h1>  <p>J’ai choisi de vous parler de <a href="https://dev.bukkit.org/bukkit-plugins/skript/">Skript </a>: un langage de développement spécifique à <a href="https://minecraft.net/">Minecraft</a> </a>. </p>  <p>Je trouve que c’est un magnifique langage car il est réellement simple et pourtant peu connu à mon grand regret.</p>  <p>Il vous permettra de créer des plugins qu’on appellera Skript. Les fichiers Skript se finissent en .sk. Ils ne nécessitent aucun éditeur spécifique. Un bloc-notes suffit. Je vais pour ma part utiliser le logiciel <a href="https://notepad-plus-plus.org/download/v6.8.8.html">NotePad++</a>. Dans ce tutoriel nous allons créer un Skript qui aura pour but de nous afficher la vie du joueur que nous venons d’attaquer dans le chat du jeu.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0160.clip_image001_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0160.clip_5F00_image001_5F00_2.png"><img title="clip_image001" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4341.clip_image001_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4341.clip_5F00_image001_5F00_thumb.png" width="710" height="471" /></a></p>  <h1>II. Installer Skript</h1>  <p>Pour utiliser Skript, il faut avoir installé le plugin Skript. Il existe beaucoup d’addons à Skript pour faire des choses plus complexes comme par exemple <a></a><a href="https://www.skunity.com/RandomSK">RandomSK</a> qui vous donne accès à 30 fonctionnalités en plus que par défaut (3 évents, 6 conditions, …). Un site anglais vous référence tous les évènements, addons, etc… il s’appelle <a href="https://www.skunity.com">SkUnity</a>. Un forum français est aussi disponible : <a href="https://skript-mc.fr/">https://skript-mc.fr/</a>     <br /></p>  <h1>III. Création et test du skript</h1>  <p>Pour commencer, nous allons créer un document texte dans le dossier &lt;Dossier de votre serveur&gt;\plugins\Skript\scripts. Si vous ne les avez pas déjà supprimés, vous pouvez voir plusieurs fichiers déjà présents dans ce dossier avec un préfixe ‘-‘, cela veut dire qu’ils sont désactivés. En enlevant ce ‘–‘ et en faisant une reload de votre serveur, ils seront activés. Vous pouvez les visualiser pour voir leur code. Nous allons appeler notre document texte « tutoriel.sk » comme ceci : </p>  <p>   <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2781.image_4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2781.image_5F00_4.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/8446.image_thumb_1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8446.image_5F00_thumb_5F00_1.png" width="776" height="395" /></a></p>  <p>Maintenant nous allons l’ouvrir et taper la première ligne de code :</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/1727.clip_image005_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1727.clip_5F00_image005_5F00_2.png"><img title="clip_image005" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/6215.clip_image005_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6215.clip_5F00_image005_5F00_thumb.png" width="458" height="227" /></a></p>  <p><b>on damage :</b> veut dire « dès qu’il y a un dommage alors : » cela permet de réagir sur l’évènement on damage pour y déclencher une suite d’actions.     <br />Pour continuer, nous allons utiliser des termes techniques comme :     <br /><b>%victim%</b> qui définit le pseudo de celui qui a reçu le dommage     <br /><b>%attacker%</b> qui définit le pseudo de celui qui a frappé la victime</p>  <p><b>{_health.%victim%}</b> qui définit l’appellation pour faire référence à la vie de la victime.     <br /></p>  <p>Pour commencer la deuxième ligne de code nous allons écrire :    <br /><b>wait 1 tick</b></p>  <p>Le tick est la plus petite unité de mesure de Minecraft (20 ticks = 1 seconde). Nous marquons cela pour que la vie de la victime ait le temps de s’actualiser.</p>  <p>Cela donne ceci :    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4807.clip_image007_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4807.clip_5F00_image007_5F00_2.png"><img title="clip_image007" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4274.clip_image007_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4274.clip_5F00_image007_5F00_thumb.png" width="505" height="154" /></a> </p>  <p>   <br />Ensuite, nous allons nous attaquer à la troisième ligne :     <br />Nous allons marquer :     <br /><b>set {_health.%victim%} to health of victim      <br /></b>qui va faire en sorte que <b>{_health.%victim%}</b> soit égal à la vie de la victime.     <br />Voilà ce que ça donne :     <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0652.clip_image009_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0652.clip_5F00_image009_5F00_2.png"><img title="clip_image009" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0243.clip_image009_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0243.clip_5F00_image009_5F00_thumb.png" width="691" height="213" /></a> </p>  <p>   <br />Et pour finir, nous allons nous attaquer à la dernière ligne :     <br /><b>send &quot;&amp;3%victim% &amp;7à maintenant &amp;4%{_health.%victim%}% ♥&quot; to attacker</b></p>  <p>Nous utilisons:</p>  <ul>   <li><strong>send </strong>qui veut dire envoyer un message </li>    <li><b>to attacker</b> qui veut dire à l’attaquant </li> </ul>  <p>&#160;</p>  <p>Donc on envoie un message à l’attaquant    <br />et <b>&quot;&amp;3%victim% &amp;7à maintenant &amp;4%{_health.%victim%}% ♥&quot;</b></p>  <p>qui envoie donc :    <br />&lt;pseudo de la victime&gt; a maintenant &lt;nombre de cœur&gt; ♥</p>  <p>Tout cela avec des couleurs car &amp;3 correspond à la couleur bleu sombre, &amp;7 à la couleur grise et &amp;4 à la couleur rouge sombre.</p>  <p>Voilà ce que cela donne en jeu :    <br />Ce test est effectué sur un animal donc le nom est celui de l’animal :</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/3162.clip_image011_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3162.clip_5F00_image011_5F00_2.png"><img title="clip_image011" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4846.clip_image011_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4846.clip_5F00_image011_5F00_thumb.png" width="612" height="127" /></a></p>  <p>&#160;</p>  <h1>IV. Aller plus loin</h1>  <p>J’espère que cela vous donne envie d’aller plus loin et pour cela je vais vous donner quelques liens :    <br /><a href="https://skript-mc.fr/">Skript-MC </a>: Un forum Français avec des membres qui vous aideront     <br /><a href="https://www.skunity.com/">Sk-Unity </a>: Bibliothèques ou sont répertoriés tous les addons avec de la documentation sur les events, les arguments etc </p>]]></content:encoded>
    </item>
    <item>
      <title>Tutoriel : Premiers pas de développeur avec Docker, Azure et Visual Studio 2/3</title>
      <link>https://docs.microsoft.com/archive/blogs/stephe/tutoriel-premiers-pas-de-dveloppeur-avec-docker-azure-et-visual-studio-23</link>
      <pubDate>Thu, 10 Dec 2015 05:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Hertrich]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/stephe/2015/12/10/tutoriel-premiers-pas-de-dveloppeur-avec-docker-azure-et-visual-studio-23/</guid>
      <description><![CDATA[Dans ce tutoriel, nous allons créer une petite application console avec Visual Studio, la déployer...]]></description>
      <content:encoded><![CDATA[<p align="justify">Dans ce tutoriel, nous allons créer une petite <strong>application console </strong>avec <strong>Visual Studio, </strong>la déployer d’abord dans un <strong>conteneur Linux</strong>, puis dans un <strong>conteneur Windows</strong>, sur <strong>Azure</strong>. </p>  <p align="justify">Les concepts généraux de Docker ont été rappelés sur la <a href="https://blogs.msdn.com/b/stephe/archive/2015/12/10/tutoriel-premiers-pas-de-d-233-veloppeur-avec-docker-azure-et-visual-studio-1-2.aspx">page 1/3 de cet article</a>.</p>  <p align="justify">Nous utiliserons 2 manières différentes de déployer l’application: </p>  <p align="justify">- d’<strong>abord vers un conteneur Linux</strong> (cette page): en créant les différents composants de manière “manuelle” pour bien comprendre comment fonctionne Docker</p>  <p align="justify">- <strong>ensuite vers un conteneur Windows</strong> (dans la <a href="https://blogs.msdn.com/b/stephe/archive/2016/03/04/vos-premiers-pas-de-d-233-veloppeur-avec-docker-azure-et-visual-studio-3-3.aspx">page 3/3 de l’article</a>): en se reposant entièrement sur l’assistant dans Visual Studio qui prendra en charge intégralement les opérations, y compris la création de la VM dans Azure.</p>  <p align="justify">Notez que les&#160; 2 procédures (manuelle ou auto) fonctionnent aussi bien sur Linux que sur Windows.</p>  <h1>Pré-requis</h1>  <p>De manière générale pour déployer une application dans un conteneur Docker, il faut:</p>  <div>   <table cellspacing="0" cellpadding="2" width="816" border="1"><tbody>       <tr>         <td valign="top" width="400"><strong>Il faut</strong></td>          <td valign="top" width="414"><strong>On utilisera</strong></td>       </tr>        <tr>         <td valign="top" width="400">Une machine serveur avec un <strong>OS</strong> proposant une technologie de <strong>conteneurs</strong>, compatible avec <strong>Docker</strong></td>          <td valign="top" width="414">Une <strong>VM Linux avec extension Docker</strong> ou une <strong>VM Windows Server 2016 </strong>dans <strong>Azure</strong></td>       </tr>        <tr>         <td valign="top" width="400">Une machine cliente sur laquelle un <strong>client Docker</strong> est installé </td>          <td valign="top" width="414">- Notre PC de dev avec <strong>Visual Studio +</strong> <strong>l’extension Docker pour Visual Studio</strong>&#160; <br />- le client Docker en ligne de commande, pratique pour les tests (package Chocolatey)</td>       </tr>        <tr>         <td valign="top" width="400">Des <strong>certificats OpenSSL</strong> qui permettront au client Docker de se connecter au host Docker </td>          <td valign="top" width="414">- openSSL (pour la partie manuelle du tuto)            <br />et/ou             <br />- l’extension Docker pour Visual Studio qui les créera pour nous si on part de 0</td>       </tr>        <tr>         <td valign="top" width="400">Le <strong>code</strong> de votre application ainsi qu’un fichier <strong>DockerFile</strong> </td>          <td valign="top" width="414">Visual Sudio avec l’extension Docker pour VS qui créera un dockerfile adapté au type de conteneur (c’est à dire l’OS sur lequel il tourne)</td>       </tr>     </tbody></table> </div>  <p>&#160;</p>  <p align="justify">Nous verrons tout cela étape par étape : <strong>à ce stade du tutoriel il vous faut simplement</strong>:</p>  <ul>   <li>     <div align="justify">un compte Azure </div>   </li>    <li>     <div align="justify">Visual Studio 2015 RTM (ce tuto a été créé sur la version Enterprise mais cela devrait fonctionner aussi sur la version Community) </div>   </li>    <li>     <div align="justify"><a href="https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1447422052&amp;rver=6.6.6576.0&amp;wp=MCMBI&amp;wreply=https%3a%2f%2fprofile.microsoft.com%2fRegSysProfileCenter%2fwizard.aspx%3fwizid%3df4502d34-3b8f-4a04-b741-289e08aa1782%26wp%3dMCLBI%26lcid%3d1033%26fu%3dhttps%253a%252f%252fwww.microsoft.com%252fweb%252fhandlers%252fwebpi.ashx%252fgetinstaller%252fVWDOrVs2015AzurePack.appids&amp;lc=1033&amp;cb=LCID%3d1033%26WizID%3df4502d34-3b8f-4a04-b741-289e08aa1782%26brand%3dmicrosoft%26subbrand%3dprofile%2bcenter&amp;id=74335&amp;cbid=50861&amp;mkt=en-us&amp;bk=1447422053&amp;uaid=8b559a77a0c04fb38c8c4f5e18d6b6ca&amp;pid=0&amp;fsui=1">SDK Azure disponible via le Web Platform Installer</a></div>   </li> </ul>  <p align="justify">&#160;</p>  <p align="justify">Je suis partie d’un Visual Studio vierge en terme d’extensions, ce qui me permettra de vous montrer au fur et à mesure les différents composants à installer pour faire fonctionner ce petit monde-là.</p>  <p>&#160;</p>  <h1>Les étapes</h1>  <p align="justify">Pour publier une application dans un conteneur Docker sur Azure, vous pouvez très bien n’utiliser qu’un seul outil : Visual Studio. En effet, l’extension Docker pour Visual Studio vous fournit un assistant qui va s’occuper de provisionner la VM, créer et uploader les certificats et y déployer le code sous la forme d’une image Docker.</p>  <p align="justify">Soit. Vous aurez votre application qui tourne dans Docker.</p>  <p align="justify">Mais vous n’aurez pas compris comment ça marche en dehors de Visual Studio...et ne saurez pas prendre la main dessus avec les outils Docker. </p>  <p align="justify">Donc dans ce tutoriel, on va se retrousser les manches et réaliser les différentes étapes nous-même, jusqu’à arriver à la publication du code où nous passerons effectivement la main à l’extension Docker pour le télécharger et démarrer le conteneur.</p>  <p align="justify">Nous allons donc:</p>  <ol>   <li>     <div align="justify">Créer une VM Linux avec l’extension Docker dans <strong>Azure</strong> </div>      <ul>       <li>Créer des <strong>certificats SSL</strong> à ajouter dans la configuration de l’extension Docker </li>        <li>Ajouter des <strong>point de terminaison/endpoints </strong>sur la VM pour pouvoir se connecter au docker host depuis le client Docker </li>     </ul> <!--EndFragment--></li>    <li>     <div align="justify">Installer <strong>l’extension Docker pour Visual Studio</strong> </div>   </li>    <li>     <div align="justify">Créer une application <strong>console ASP.Net 5</strong></div>   </li>    <li>     <div align="justify">Déployer l’application dans un <strong>conteneur linux</strong> sur notre VM Linux </div>   </li>    <li>Déployer la même application dans un <strong>conteneur Windows</strong> d’une nouvelle VM Windows Server 2016 <strong>créée cette fois par Visual Studio</strong> </li>    <li>     <div align="justify">Constater que cela ne fonctionne pas </div>   </li>    <li>     <div align="justify">Modifier le dockerfile </div>   </li>    <li>     <div align="justify">Re-déployer l’application dans un conteneur Windows </div>   </li>    <li>     <div align="justify">Constater que cela fonctionne </div>   </li> </ol>  <p align="justify">&#160;</p>  <h1 align="justify"></h1>  <h1 align="justify">1. Création de la VM Linux dans Azure</h1>  <p align="justify">Depuis le portail, sur la marketplace, choisissez la VM Docker on Ubuntu Server:</p>  <p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/1754.image_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1754.image_5F00_2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7282.image_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7282.image_5F00_thumb.png" width="640" height="180" /></a></p>  <p align="justify">C’est en fait une VM Ubuntu classique, avec l’extension docker pré-installée : elle nous permet d’avoir un docker engine sur notre VM.</p>  <p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2678.image18.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2678.image18.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4265.image18_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4265.image18_5F00_thumb.png" width="640" height="204" /></a></p>  <p align="justify">Cliquez sur “Créer”, puis renseignez le nom de la machine hôte (de préférence,&#160; utilisez le rappel “linux” dans le nom pour ne pas confondre les VMs Windows et Linux lors du déploiement à partir de Visual Studio), l’utilisateur et le mot de passe.</p>  <p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7215.image_10.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7215.image_5F00_10.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2161.image_thumb_4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2161.image_5F00_thumb_5F00_4.png" width="389" height="863" /></a></p>  <h3>Ajout des points de terminaison</h3>  <p>Ajoutez un point de terminaison 2376 sur votre VM pour pouvoir vous connecter au Docker host de la manière suivante</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/1018.image17.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1018.image17.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7723.image17_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7723.image17_5F00_thumb.png" width="831" height="348" /></a></p>  <p>Faites de même avec le port 80 pour obtenir</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4760.image_29.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4760.image_5F00_29.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/3632.image_thumb_12.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3632.image_5F00_thumb_5F00_12.png" width="532" height="437" /></a></p>  <p>Ouvrir les ports c’est nécessaire mais cela ne suffit pas pour se connecter au docker host.</p>  <p>En effet, Docker est configuré pour fonctionner avec une clé de sécurité SSL. Bon ça va se compliquer un peu car il va falloir générer les certificats SSL. Cette étape est prise en charge par Visual Studio si vous créez la VM depuis l’assistant : c’est ce que l’on verra dans la 2ème partie du tuto où nous laisserons VS prendre tout en charge pour déployer l’application dans un conteneur Windows.</p>  <h3 align="justify">Création des certificats SSL</h3>  <p align="justify">Le démon Docker sur le serveur est configuré pour utiliser la sécurité TLS. Le client Docker recherche la clé du client (key.pem) et le certificat (cert.pem) par défaut dans le dossier &lt;%userprofile%&gt;\.docker. Si ces éléments ne sont pas présents, il convient de les générer à l'aide d'OpenSSL.</p>  <p align="justify">C’est ce que nous allons faire à présent.</p>  <p>Installez OpenSSL depuis un des sites recommandés ici <a title="https://wiki.openssl.org/index.php/Binaries" href="https://wiki.openssl.org/index.php/Binaries">https://wiki.openssl.org/index.php/Binaries</a></p>  <p>Générez vos certificats ainsi:</p>  <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:db9ec42e-a85e-486b-8b28-71fb68d4ded9" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 832px; height: 415px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: hidden;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000;">echo </span><span style="color: #800080;">01</span><span style="color: #000000;"> </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> ca.srl

openssl genrsa </span><span style="color: #000000;">-</span><span style="color: #000000;">des3 </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> ca</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem
openssl req </span><span style="color: #000000;">-</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">x509 </span><span style="color: #000000;">-</span><span style="color: #000000;">days </span><span style="color: #800080;">3650</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">key ca</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> ca.pem
openssl genrsa </span><span style="color: #000000;">-</span><span style="color: #000000;">des3 </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> server</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem
openssl req </span><span style="color: #000000;">-</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">key server</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> server.csr
openssl x509 </span><span style="color: #000000;">-</span><span style="color: #000000;">req </span><span style="color: #000000;">-</span><span style="color: #000000;">days </span><span style="color: #800080;">365</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #0000FF;">in</span><span style="color: #000000;"> server.csr </span><span style="color: #000000;">-</span><span style="color: #000000;">CA ca.pem </span><span style="color: #000000;">-</span><span style="color: #000000;">CAkey ca</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> server</span><span style="color: #000000;">-</span><span style="color: #000000;">cert.pem

echo </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Creating client keys...</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
openssl genrsa </span><span style="color: #000000;">-</span><span style="color: #000000;">des3 </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> client</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem
openssl req </span><span style="color: #000000;">-</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">key client</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> client.csr
echo extendedKeyUsage </span><span style="color: #000000;">=</span><span style="color: #000000;"> clientAuth </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> extfile.cnf
openssl x509 </span><span style="color: #000000;">-</span><span style="color: #000000;">req </span><span style="color: #000000;">-</span><span style="color: #000000;">days </span><span style="color: #800080;">365</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #0000FF;">in</span><span style="color: #000000;"> client.csr </span><span style="color: #000000;">-</span><span style="color: #000000;">CA ca.pem </span><span style="color: #000000;">-</span><span style="color: #000000;">CAkey ca</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> client</span><span style="color: #000000;">-</span><span style="color: #000000;">cert.pem </span><span style="color: #000000;">-</span><span style="color: #000000;">extfile extfile.cnf

echo </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Stripping passwords from keys...</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
openssl rsa </span><span style="color: #000000;">-</span><span style="color: #0000FF;">in</span><span style="color: #000000;"> server</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> server</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem
openssl rsa </span><span style="color: #000000;">-</span><span style="color: #0000FF;">in</span><span style="color: #000000;"> client</span><span style="color: #000000;">-</span><span style="color: #000000;">key.pem </span><span style="color: #000000;">-</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> key.pem</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p>ou selon la doc <a title="https://docs.docker.com/engine/articles/https/" href="https://docs.docker.com/engine/articles/https/">https://docs.docker.com/engine/articles/https/</a> et copiez-les dans le répertoire &lt;user&gt;/.docker. </p>

<p><em>(Oui c’est pénible : si vous préférez sauter cette étape, commencez par la partie 3/3 du tuto où VS génère automatiquement les certificats dans le répertoire adéquat lorsqu’il crée la VM <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Clignement d&#39;œil" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/5635.wlEmoticon-winkingsmile_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5635.wlEmoticon_2D00_winkingsmile_5F00_2.png" /> )</em></p>

<p>Si l’on était parti d’une VM Ubuntu simple, à laquelle on aurait ajouté l’extension docker, nous aurions pu spécifier les certificats dans la configuration de l’extension en précisant les 3 fichiers de certificats nécessaires. &lt;user&gt;/.docker. Les fichiers à utiliser sont ca.pem, server-cert.pem, server-key.pem. </p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/3603.image_35.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3603.image_5F00_35.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4188.image_thumb_13.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4188.image_5F00_thumb_5F00_13.png" width="359" height="484" /></a></p>

<p>Mais avec la VM incluant une extension déjà configurée, les fichiers sont pris dans le répertoire &lt;user&gt;/.docker.</p>

<p><em><font color="#0000ff">Si vous voulez modifier les certificats a posteriori, voici une méthode pas très jolie, mais simple et pratique : sélectionnez votre VM et ajoutez une nouvelle fois l’extension Docker en précisant les nouveaux certificats. Validez.</font></em></p>

<p><em><font color="#0000ff">L’installation réussit mais on trouve une erreur dans les détails de l’extension.</font></em></p>

<p><em><font color="#0000ff">Redémarrez la VM : cette fois ça fonctionne.</font></em></p>

<div align="justify">
  <table cellspacing="0" cellpadding="2" width="648" border="0"><tbody>
      <tr>
        <td valign="top" width="515">On a terminé de configurer notre VM avec Docker. 
          <p>Cliquez sur “Créer”</p>

          <p>Votre machine est en cours de provisionnement</p>
        </td>

        <td valign="top" width="131">&#160;&#160;&#160;&#160; </td>
      </tr>
    </tbody></table>
</div>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/8713.image_12.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8713.image_5F00_12.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 7px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/6545.image_thumb_5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6545.image_5F00_thumb_5F00_5.png" width="329" height="298" /></a></p>

<p align="justify">Vous pouvez y accéder facilement grâce à la zone de recherche du bandeau et l’épingler sur l’écran d’accueil pour y accéder facilement.</p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4643.image711.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4643.image711.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/3603.image711_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3603.image711_5F00_thumb.png" width="820" height="289" /></a></p>

<p align="justify">Passons maintenant sur la machine client : celle sur laquelle vous avez&#160; installé Visual Studio.</p>

<h1 align="left">2. Installation de l’extension Docker pour Visual Studio</h1>

<p align="justify">Installez tout d’abord <a title="Microsoft ASP.NET and Web Tools 2015 (Beta8) – Visual Studio 2015" href="https://www.microsoft.com/en-us/download/details.aspx?id=49442">Microsoft ASP.NET and Web Tools 2015 (Beta8) – Visual Studio 2015</a> ; choisissez les composants à installer selon les instructions ci-dessous:</p>

<p><b><em>Install Instructions</em></b></p>

<ol>
  <li>
    <div><em>Close all instances of Visual Studio. </em></div>
  </li>

  <li>
    <div><em>Install .NET Version Manager (Beta8) using DotNetVersionManager-x64.msi. For 32 bit machines use DotNetVersionManager-x86.msi. </em></div>
  </li>

  <li>
    <div><em>Update Visual Studio 2015 (Enterprise, Professional or Community) with ASP.NET and Web Tools 2015 (Beta8) by installing WebToolsExtensionsVS14.msi. If you are using Visual Studio 2015 Express for Web, then install WebToolsExtensionsVWD14.msi instead.</em> </div>
  </li>
</ol>

<p align="justify">&#160;</p>

<p align="justify">Dans Visual Studio, via le menu “Tools&gt;Extensions and Updates”, ajoutez l’extension Visual Studio Tools for Docker (ici en October Preview):</p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2783.image11.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2783.image11.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0815.image11_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0815.image11_5F00_thumb.png" width="674" height="112" /></a></p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0827.image_21.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0827.image_5F00_21.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0310.image_thumb_8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0310.image_5F00_thumb_5F00_8.png" width="494" height="304" /></a></p>

<h1 align="left">3. Création d’une application Console</h1>

<p align="justify">Puis créez un nouveau projet de type Web/Console Application. </p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7215.image111.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7215.image111.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/1205.image111_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/1205.image111_5F00_thumb.png" width="727" height="355" /></a></p>

<p>Ajoutez simplement les 2 lignes de code suivantes dans le Main du fichier Program.cs:</p>

<div>
  <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:8241e84f-35da-463b-984d-d8e7f1d1e992" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 714px; height: 361px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> DockerConsoleApp
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Program
    {
        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Main(</span><span style="color: #0000FF;">string</span><span style="color: #000000;">[] args)
        {
            Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">I'm running in a container :D</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
            Console.ReadLine();
        }
    }
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
</div>

<p>Si vous l’exécutez localement sur la machine, vous obtiendrez</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0121.image37.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0121.image37.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/5025.image37_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5025.image37_5F00_thumb.png" width="732" height="122" /></a></p>

<p>&#160;</p>

<h1>4. Déployer l’application dans un conteneur sur notre VM Linux</h1>

<p>Faites un click droit sur le projet dans l’explorateur de fichiers et choisissez “<strong>Publish</strong>”:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7484.image_23.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7484.image_5F00_23.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/6433.image_thumb_9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6433.image_5F00_thumb_5F00_9.png" width="392" height="394" /></a></p>

<p>Voici l’assistant de publication qui vous propose de publier votre application dans un conteneur docker. </p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4174.image_25.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4174.image_5F00_25.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/8780.image_thumb_10.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8780.image_5F00_thumb_5F00_10.png" width="707" height="559" /></a></p>

<p align="justify">Sélectionnez la cible Docker Containers</p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4571.image_17.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4571.image_5F00_17.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0285.image_thumb_6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0285.image_5F00_thumb_5F00_6.png" width="653" height="371" /></a></p>

<p align="justify">Choisissez la souscription Azure et le nom de la VM Linux avec Docker que vous venez de créer puis validez.</p>

<p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0160.image_33.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0160.image_5F00_33.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4073.image_thumb_14.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4073.image_5F00_thumb_5F00_14.png" width="751" height="594" /></a></p>

<p align="justify">Remarquez l’url de votre agent Docker qui utilise le port 2376.</p>

<p align="justify">Cliquez sur le bouton “Validate Connection”: normalement, ça devrait bien se passer.</p>

<p align="justify">Je vous encourage à installer le <a href="https://chocolatey.org/packages/docker">client Docker de base via Chocolatey</a> : cela vous permettra de communiquer avec votre Docker host sans Visual Studio et de vous familiariser avec les commandes Docker.</p>

<p align="justify"><em><font color="#0000ff">Si vous n’avez pas encore Chocolatey sur votre machine, vous pouvez suivre cette petite <a href="https://www.youtube.com/watch?v=l026hqjhLRU">vidéo</a> qui vous expliquera comment faire pour installer Chocolatey ainsi que le client Docker.</font></em></p>

<p>Vous pouvez tester la connexion à partir du client docker en copiant/collant la commande Preview dans les options avancées de la boite de dialogue. </p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0216.image_30.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0216.image_5F00_30.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7077.image_thumb_3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7077.image_5F00_thumb_5F00_3.png" width="607" height="480" /></a></p>

<p>Je vais utiliser la commande “info”, et vous pouvez utiliser les commandes docker depuis le Command Prompt.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/3681.image_36.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/3681.image_5F00_36.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7271.image_thumb_15.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7271.image_5F00_thumb_5F00_15.png" width="644" height="449" /></a></p>

<p>Pour l’instant, je n’ai pas d’image docker et a forciori, pas de conteneur en cours d’exécution.</p>

<p>A présent, cliquez sur le bouton Publish</p>

<p>Plusieurs choses se passent à ce moment (vous pouvez voir le détail dans la fenêtre Output de VS, notamment:</p>

<ul>
  <li>la création du fichier Dockerfile dans le projet Visual Studio </li>

  <li>la création de l’image correspondant à votre application, en partant du packaging décrit dans le dockerfile </li>

  <li>le transfert de votre app dans le docker host, via le docker engine </li>

  <li>la récupération des “couches du millefeuille” applicatif décrites dans le dockerfile et le point d’entrée du code utilisé pour l’exécution du conteneur </li>

  <li>le démarrage du conteneur </li>
</ul>

<p>&#160;</p>

<p>Normalement vous devriez vous retrouver avec ce genre de résultat, à la fin de l’output</p>

<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:3dbc5291-b2ce-43b4-ac2b-144f9f3c48fd" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 974px; height: 708px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: hidden;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000;">VERBOSE:  </span><span style="color: #000000;">---&gt;</span><span style="color: #000000;"> Running </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> 7bf52b2450c1
VERBOSE:  </span><span style="color: #000000;">---&gt;</span><span style="color: #000000;"> 191d76de7c39
VERBOSE: Removing intermediate container 7bf52b2450c1
VERBOSE: Successfully built 191d76de7c39
VERBOSE(</span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #800080;">0</span><span style="color: #000000;">): Warning : You are building a Docker image from Windows against a non</span><span style="color: #000000;">-</span><span style="color: #000000;">Windows Docker host. All files and directories added to build context will have </span><span style="color: #800000;">'</span><span style="color: #800000;">-rwxr-xr-x</span><span style="color: #800000;">'</span><span style="color: #000000;"> permissions. It </span><span style="color: #0000FF;">is</span><span style="color: #000000;"> recommended to </span><span style="color: #0000FF;">double</span><span style="color: #000000;"> check and reset permissions </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> sensitive files and directories.
The Docker image </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">dockerconsoleapp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> was created successfully.
VERBOSE: Starting Docker container: dockerconsoleapp
Executing command [docker </span><span style="color: #000000;">--</span><span style="color: #000000;">tlsverify </span><span style="color: #000000;">-</span><span style="color: #000000;">H tcp:</span><span style="color: #008000;">//</span><span style="color: #008000;">stephetutodockerlinux.cloudapp.net:2376 run -t -d dockerconsoleapp]</span><span style="color: #008000;">
</span><span style="color: #000000;">VERBOSE: cc80b00c123b7978695931afcaefe05165876f07a95edb54662513ec9d8a3902
Docker container started with ID: cc80b00c123b7978695931afcaefe05165876f07a95edb54662513ec9d8a3902
To see standard output from your application, open a command line window and execute the following command: 
    docker </span><span style="color: #000000;">--</span><span style="color: #000000;">tlsverify </span><span style="color: #000000;">-</span><span style="color: #000000;">H tcp:</span><span style="color: #008000;">//</span><span style="color: #008000;">stephetutodockerlinux.cloudapp.net:2376 logs --follow cc80b00c123b7978695931afcaefe05165876f07a95edb54662513ec9d8a3902</span><span style="color: #008000;">
</span><span style="color: #000000;">Publish completed successfully.
</span><span style="color: #000000;">==========</span><span style="color: #000000;"> Build: </span><span style="color: #800080;">1</span><span style="color: #000000;"> succeeded or up</span><span style="color: #000000;">-</span><span style="color: #000000;">to</span><span style="color: #000000;">-</span><span style="color: #000000;">date, </span><span style="color: #800080;">0</span><span style="color: #000000;"> failed, </span><span style="color: #800080;">0</span><span style="color: #000000;"> skipped </span><span style="color: #000000;">==========</span><span style="color: #000000;">
</span><span style="color: #000000;">==========</span><span style="color: #000000;"> Publish: </span><span style="color: #800080;">1</span><span style="color: #000000;"> succeeded, </span><span style="color: #800080;">0</span><span style="color: #000000;"> failed, </span><span style="color: #800080;">0</span><span style="color: #000000;"> skipped </span><span style="color: #000000;">==========</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<h3>Le fichier Dockerfile</h3>

<p>Le dockerfile est créé par Visual Studio en fonction de l’OS – Linux ou Windows - sur lequel est basé le conteneur qui va faire tourner l’app. Il permet à docker de savoir comment reconstituer le contexte : c’est à dire les couches d’images dont votre application a besoin pour s’exécuter. Vous allez comprendre en jetant un œil au dockerfile:</p>

<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:14c62799-fb20-4d8d-89cc-6fef759c43ec" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 747px; height: 237px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: hidden;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000;">FROM microsoft</span><span style="color: #000000;">/</span><span style="color: #000000;">aspnet:</span><span style="color: #800080;">1.0</span><span style="color: #000000;">.</span><span style="color: #800080;">0</span><span style="color: #000000;">-</span><span style="color: #000000;">beta8

ADD . </span><span style="color: #000000;">/</span><span style="color: #000000;">app

WORKDIR </span><span style="color: #000000;">/</span><span style="color: #000000;">app</span><span style="color: #000000;">/</span><span style="color: #000000;">approot

ENTRYPOINT [</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">./DockerConsoleApp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">]</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p>Sur une machine linux, on va partir de l’image <a href="https://hub.docker.com/r/microsoft/aspnet/">Microsoft/aspnet</a> avec la version 1.0.0-beta8, récupérée dans la <a href="https://hub.docker.com/explore/">registry officielle de Docker</a>. </p>

<p>La registry regroupe les images qui y sont poussées par les éditeurs et qui sont ensuite utilisées et notées par les utilisateurs.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4403.image_51.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4403.image_5F00_51.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4807.image_thumb_22.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4807.image_5F00_thumb_5F00_22.png" width="473" height="480" /></a></p>

<p>Cette image aspnet publiée par Microsoft est elle-même basée sur Mono, l’implémentation x-plat de .Net. </p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0216.image_49.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0216.image_5F00_49.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/4540.image_thumb_21.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/4540.image_5F00_thumb_5F00_21.png" width="554" height="480" /></a></p>

<p>Si vous jetez un œil au dockerfile cette image vous trouverez les couches qui permettent cette fois de retrouver le bon contexte de packaging pour ASP.NET pour linux.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0676.image_45.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0676.image_5F00_45.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0511.image_thumb_19.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0511.image_5F00_thumb_5F00_19.png" width="640" height="305" /></a></p>

<p>On continue comme ça jusqu’à l’OS (et sa version) : c’est l’illustration des couches du fameux millefeuille, qui permet de retrouver toujours un environnement de déploiement et d’exécution identique.</p>

<p>Dans notre dockerfile, il est précisé l’ajout du package de notre application, le répertoire courant ainsi que le point d’entrée pour l’exécution de l’application.</p>

<h3>Le conteneur</h3>

<p>Pour vérifier si votre conteneur a bien démarré, on va réexécuter la commande docker info: on y trouve bien 1 conteneur – c’est bon signe <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Sourire" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2021.wlEmoticon-smile_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2021.wlEmoticon_2D00_smile_5F00_2.png" /></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/6327.image_39.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/6327.image_5F00_39.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2541.image_thumb_16.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2541.image_5F00_thumb_5F00_16.png" width="644" height="449" /></a></p>

<p>Pour lister les images, on utilise la commande “images”</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/5633.image_41.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/5633.image_5F00_41.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7701.image_thumb_17.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7701.image_5F00_thumb_5F00_17.png" width="644" height="201" /></a></p>

<p>On retrouve bien l’image Microsoft/aspnet qui a été récupéree par docker dans la registry officielle Docker (celle-ci est fournie par Microsof) utilisée en sous-couche de notre image applicative dockerconsoleapp.</p>

<p>On trouve aussi l’image de notre application dockerconsoleapp qui est la dernière couche du millefeuille.</p>

<p>Pour lister les conteneurs, on utilise la commande “ps”&quot;</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/0564.image_55.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/0564.image_5F00_55.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/2308.image_thumb_20.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/2308.image_5F00_thumb_5F00_20.png" width="644" height="60" /></a></p>

<p>Pour voir la sortie standard de notre application, il suffit de copier/coller la commande suggérée par VS dans l’Output:</p>

<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:ab0b7a92-3f64-471a-bbc2-90797cb0ee4b" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 747px; height: 101px;background-color:White;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: hidden;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000;">docker </span><span style="color: #000000;">--</span><span style="color: #000000;">tlsverify </span><span style="color: #000000;">-</span><span style="color: #000000;">H tcp:</span><span style="color: #008000;">//</span><span style="color: #008000;">stephetutodockerlinux.cloudapp.net:2376 logs --follow cc80b00c123b7978695931afcaefe05165876f07a95edb54662513ec9d8a3902</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/7167.image_43.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/7167.image_5F00_43.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/52/metablogapi/8688.image_thumb_18.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-52-metablogapi/8688.image_5F00_thumb_5F00_18.png" width="644" height="170" /></a></p>

<p>Youpi !!</p>

<p>Dans la <a href="https://blogs.msdn.com/b/stephe/archive/2016/03/04/vos-premiers-pas-de-d-233-veloppeur-avec-docker-azure-et-visual-studio-3-3.aspx">dernière partie de l’article</a>, nous déploierons la même application dans un conteneur Windows, créé directement depuis Visual Studio et non plus depuis le portail Azure comme nous l’avons fait ici. Si l’on souhaite utiliser la même solution Visual Studio pour déployer l’application sur 2 types de conteneurs différents, nous verrons qu’il y a quelques petites subtilités, en particulier le dockerfile puisque l’application devra tourner sur 2 OS différents. </p>

<h3>Références</h3>

<p><a 