{"id":7302,"date":"2025-08-26T12:19:25","date_gmt":"2025-08-26T12:19:25","guid":{"rendered":"https:\/\/techhub.saworks.io\/docs\/tutoriel-github-intermediaire\/creer-des-applications-avec-azure-devops\/exercice-publier-le-resultat-dans-le-pipeline\/"},"modified":"2025-09-24T12:02:34","modified_gmt":"2025-09-24T12:02:34","slug":"exercice-publier-le-resultat-dans-le-pipeline","status":"publish","type":"docs","link":"https:\/\/techhub.saworks.io\/fr\/docs\/tutoriel-github-intermediaire\/creer-des-applications-avec-azure-devops\/exercice-publier-le-resultat-dans-le-pipeline\/","title":{"rendered":"Exercice \u2013 Publier le r\u00e9sultat dans le pipeline"},"content":{"rendered":"\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Choisissez votre environnement de d\u00e9veloppement pour le module de formation.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Environnement de d\u00e9veloppement local utilisant un agent h\u00e9berg\u00e9 par Microsoft<\/strong><\/li>\n\n\n\n<li><strong>Environnement de d\u00e9veloppement GitHub Codespaces utilisant un agent auto-h\u00e9berg\u00e9.<\/strong><\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u00c0 ce stade, vous pouvez compiler le projet web&nbsp;<strong>Space Game<\/strong>&nbsp;via le pipeline.<\/h3>\n\n\n\n<p>Mais o\u00f9 vont les&nbsp;<strong>r\u00e9sultats du build<\/strong>&nbsp;?<br>Actuellement, la sortie du build reste sur le&nbsp;<strong>serveur de build temporaire<\/strong>.<br>Mara a besoin d\u2019un moyen de&nbsp;<strong>transmettre ce build \u00e0 Amita<\/strong>&nbsp;pour qu\u2019elle puisse commencer les tests.<\/p>\n\n\n\n<p>Vous pouvez&nbsp;<strong>stocker les artefacts de build dans Azure Pipelines<\/strong>&nbsp;afin qu\u2019ils soient disponibles pour les autres membres de votre \u00e9quipe une fois le build termin\u00e9 \u2014 c\u2019est ce que vous allez faire ici.<br>En bonus, vous allez \u00e9galement&nbsp;<strong>r\u00e9organiser la configuration du build<\/strong>&nbsp;en utilisant des&nbsp;<strong>variables<\/strong>, ce qui rendra le fichier plus lisible et plus facile \u00e0 maintenir.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-background is-layout-constrained wp-block-group-is-layout-constrained\" style=\"border-width:1px;border-radius:15px;background-color:#9b51e04d\">\n<h3 class=\"wp-block-heading\"><strong>Remarque<\/strong><\/h3>\n\n\n\n<p>Azure Pipelines vous permet de\u00a0<strong>d\u00e9ployer automatiquement<\/strong>\u00a0l\u2019application compil\u00e9e vers un environnement de test ou de production, que ce soit dans le cloud ou dans votre centre de donn\u00e9es.<br>Pour l\u2019instant, l\u2019objectif de Mara est simplement de\u00a0<strong>produire des builds<\/strong>\u00a0qu\u2019elle peut transmettre \u00e0 l\u2019\u00e9quipe QA en utilisant leurs processus existants.<\/p>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Publier le build dans le pipeline<\/strong><\/h3>\n\n\n\n<p>Avec .NET, vous pouvez&nbsp;<strong>empaqueter votre application dans un fichier&nbsp;<code>.zip<\/code><\/strong>.<br>Vous pouvez ensuite utiliser la t\u00e2che int\u00e9gr\u00e9e&nbsp;<strong><code>PublishBuildArtifacts@1<\/code><\/strong>&nbsp;pour publier ce fichier&nbsp;<code>.zip<\/code>&nbsp;dans Azure Pipelines.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Dans&nbsp;<strong>Visual Studio Code<\/strong>, modifiez le fichier&nbsp;<code>azure-pipelines.yml<\/code>&nbsp;comme indiqu\u00e9 ici :<\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>trigger:\n- '*'\n\npool:\n  name: 'Default' #replace if needed with name of your agent pool\n\nsteps:\n- task: UseDotNet@2\n  displayName: 'Use .NET SDK 6.x'\n  inputs:\n    version: '6.x'\n\n- task: Npm@1\n  displayName: 'Run npm install'\n  inputs:\n    verbose: false\n\n- script: '.\/node_modules\/.bin\/node-sass Tailspin.SpaceGame.Web\/wwwroot --output Tailspin.SpaceGame.Web\/wwwroot'\n  displayName: 'Compile Sass assets'\n\n- task: gulp@1\n  displayName: 'Run gulp tasks'\n\n- script: 'echo \"$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)\" > buildinfo.txt'\n  displayName: 'Write build info'\n  workingDirectory: Tailspin.SpaceGame.Web\/wwwroot\n\n- task: DotNetCoreCLI@2\n  displayName: 'Restore project dependencies'\n  inputs:\n    command: 'restore'\n    projects: '**\/*.csproj'\n\n- task: DotNetCoreCLI@2\n  displayName: 'Build the project - Release'\n  inputs:\n    command: 'build'\n    arguments: '--no-restore --configuration Release'\n    projects: '**\/*.csproj'\n\n- task: DotNetCoreCLI@2\n  displayName: 'Publish the project - Release'\n  inputs:\n    command: 'publish'\n    projects: '**\/*.csproj'\n    publishWebProjects: false\n    arguments: '--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)\/Release'\n    zipAfterPublish: true\n\n- task: PublishBuildArtifacts@1\n  displayName: 'Publish Artifact: drop'\n  condition: succeeded()<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #22863A\">trigger<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #032F62\">&#39;*&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">pool<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Default&#39;<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6A737D\">#replace if needed with name of your agent pool<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">steps<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">UseDotNet@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Use .NET SDK 6.x&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">version<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;6.x&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">Npm@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Run npm install&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">verbose<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">false<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">script<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;.\/node_modules\/.bin\/node-sass Tailspin.SpaceGame.Web\/wwwroot --output Tailspin.SpaceGame.Web\/wwwroot&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Compile Sass assets&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">gulp@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Run gulp tasks&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">script<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;echo &quot;$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)&quot; &gt; buildinfo.txt&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Write build info&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">workingDirectory<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">Tailspin.SpaceGame.Web\/wwwroot<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Restore project dependencies&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;restore&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Build the project - Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;build&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">arguments<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;--no-restore --configuration Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Publish the project - Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;publish&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">publishWebProjects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">arguments<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)\/Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">zipAfterPublish<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">true<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">PublishBuildArtifacts@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Publish Artifact: drop&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">condition<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">succeeded()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Cette version du fichier&nbsp;<code>azure-pipelines.yml<\/code>&nbsp;ressemble \u00e0 la version pr\u00e9c\u00e9dente, mais elle ajoute&nbsp;<strong>deux t\u00e2ches suppl\u00e9mentaires<\/strong>.<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>La\u00a0<strong>premi\u00e8re t\u00e2che<\/strong>\u00a0utilise\u00a0<code>DotNetCoreCLI@2<\/code>\u00a0pour\u00a0<strong>publier<\/strong>\u00a0ou\u00a0<strong>empaqueter<\/strong>\u00a0les r\u00e9sultats du build de l\u2019application (y compris ses d\u00e9pendances) dans un dossier.<br>L\u2019argument\u00a0<code>zipAfterPublish<\/code>\u00a0indique qu\u2019il faut\u00a0<strong>ajouter les r\u00e9sultats compil\u00e9s dans un fichier\u00a0<code>.zip<\/code><\/strong>.<\/li>\n\n\n\n<li>La\u00a0<strong>deuxi\u00e8me t\u00e2che<\/strong>\u00a0utilise\u00a0<code>PublishBuildArtifacts@1<\/code>\u00a0pour\u00a0<strong>publier le fichier\u00a0<code>.zip<\/code>\u00a0dans Azure Pipelines<\/strong>.<br>L\u2019argument\u00a0<code>condition<\/code>\u00a0indique que cette t\u00e2che ne doit s\u2019ex\u00e9cuter\u00a0<strong>que si la t\u00e2che pr\u00e9c\u00e9dente r\u00e9ussit<\/strong>.<br><code>succeeded()<\/code>\u00a0est la condition par d\u00e9faut, donc vous n\u2019avez pas besoin de la sp\u00e9cifier, mais elle est montr\u00e9e ici \u00e0 titre d\u2019exemple.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Depuis le terminal int\u00e9gr\u00e9, ex\u00e9cutez les commandes Git suivantes pour :<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ajouter\u00a0<code>azure-pipelines.yml<\/code>\u00a0\u00e0 l\u2019index<\/li>\n\n\n\n<li>Valider la modification<\/li>\n\n\n\n<li>Pousser la modification sur GitHub<\/li>\n<\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-background is-layout-constrained wp-block-group-is-layout-constrained\" style=\"background-color:#fcb90054\">\n<h3 class=\"wp-block-heading\">\ud83d\udca1&nbsp;<strong>Astuce<\/strong><\/h3>\n\n\n\n<p>Avant d\u2019ex\u00e9cuter ces commandes Git,\u00a0<strong>n\u2019oubliez pas d\u2019enregistrer<\/strong>\u00a0le fichier\u00a0<code>azure-pipelines.yml<\/code>.<\/p>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">Bash<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>git add azure-pipelines.yml\ngit commit -m \"Add publish tasks\"\ngit push origin build-pipeline<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">add<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">azure-pipelines.yml<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">commit<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">-m<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">&quot;Add publish tasks&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">push<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">origin<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">build-pipeline<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Une fois le build termin\u00e9, comme pr\u00e9c\u00e9demment, suivez l\u2019ex\u00e9cution du pipeline \u00e9tape par \u00e9tape dans&nbsp;<strong>Azure Pipelines<\/strong>.<\/h4>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Lorsque le pipeline est termin\u00e9,&nbsp;<strong>revenez au r\u00e9sum\u00e9 du build<\/strong>.<\/p>\n\n\n\n<p>Sous la section&nbsp;<strong>\u00ab\u00a0Related\u00a0\u00bb<\/strong>&nbsp;(<em>Associ\u00e9<\/em>), vous verrez&nbsp;<strong>\u00ab\u00a01 publi\u00e9\u00a0\u00bb<\/strong>, indiquant qu\u2019un&nbsp;<strong>artefact de build<\/strong>&nbsp;a \u00e9t\u00e9 publi\u00e9.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"956\" height=\"368\" data-src=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts.png\" alt=\"\" class=\"wp-image-7305 lazyload\" data-srcset=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts.png 956w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts-300x115.png 300w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts-768x296.png 768w\" data-sizes=\"(max-width: 956px) 100vw, 956px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 956px; --smush-placeholder-aspect-ratio: 956\/368;\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">S\u00e9lectionnez l\u2019artefact.<\/h3>\n\n\n\n<p>D\u00e9pliez le dossier&nbsp;<strong><code>drop<\/code><\/strong>.<\/p>\n\n\n\n<p>Vous verrez un fichier&nbsp;<strong><code>.zip<\/code><\/strong>&nbsp;contenant votre application compil\u00e9e ainsi que ses&nbsp;<strong>d\u00e9pendances<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"406\" height=\"254\" data-src=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts-explorer.png\" alt=\"\" class=\"wp-image-7307 lazyload\" data-srcset=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts-explorer.png 406w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-artifacts-explorer-300x188.png 300w\" data-sizes=\"(max-width: 406px) 100vw, 406px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 406px; --smush-placeholder-aspect-ratio: 406\/254;\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Si vous souhaitez essayer un exercice facultatif<\/strong>, vous pouvez&nbsp;<strong>t\u00e9l\u00e9charger ce fichier&nbsp;<code>.zip<\/code><\/strong>&nbsp;sur votre ordinateur et&nbsp;<strong>explorer son contenu<\/strong>.<\/h4>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>D\u00e9finir des variables pour am\u00e9liorer la lisibilit\u00e9<\/strong><\/h3>\n\n\n\n<p>Mara prend du recul pour examiner son travail.<br>La configuration du build r\u00e9pond \u00e0 ses besoins, mais elle souhaite s\u2019assurer qu\u2019Andy et les autres pourront&nbsp;<strong>facilement la maintenir et l\u2019\u00e9tendre<\/strong>.<\/p>\n\n\n\n<p>Les&nbsp;<strong>variables<\/strong>&nbsp;permettent de&nbsp;<strong>d\u00e9finir une valeur une seule fois<\/strong>&nbsp;et de la&nbsp;<strong>r\u00e9utiliser<\/strong>&nbsp;dans tout le pipeline.<br>Azure Pipelines remplace chaque variable par sa valeur actuelle lors de l\u2019ex\u00e9cution du pipeline.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Comme dans d\u2019autres langages de programmation, les variables permettent de :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>D\u00e9finir des valeurs susceptibles de\u00a0<strong>changer entre les ex\u00e9cutions<\/strong>\u00a0du pipeline.<\/li>\n\n\n\n<li>Stocker des informations\u00a0<strong>r\u00e9p\u00e9t\u00e9es<\/strong>\u00a0dans le pipeline, comme un\u00a0<strong>num\u00e9ro de version<\/strong>\u00a0ou un\u00a0<strong>chemin de fichier<\/strong>, \u00e0 un seul endroit.<br>Ainsi, vous n\u2019avez pas besoin de mettre \u00e0 jour toutes les occurrences lorsque la valeur change.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Azure Pipelines fournit de nombreuses&nbsp;<strong>variables int\u00e9gr\u00e9es<\/strong>.<br>Ces variables d\u00e9crivent des aspects du processus de build, comme :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>L\u2019identifiant du build<\/li>\n\n\n\n<li>Les noms de r\u00e9pertoires o\u00f9 votre logiciel est compil\u00e9 et pr\u00e9par\u00e9<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Vous pouvez \u00e9galement&nbsp;<strong>d\u00e9finir vos propres variables<\/strong>.<br>Voici un exemple qui montre une variable nomm\u00e9e&nbsp;<code>buildConfiguration<\/code>&nbsp;d\u00e9finissant la configuration de build&nbsp;<strong>Release<\/strong>&nbsp;:<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>variables:\n  buildConfiguration: 'Release'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #22863A\">variables<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">buildConfiguration<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Release&#39;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Utilisez des variables lorsque vous r\u00e9p\u00e9tez la m\u00eame valeur plusieurs fois ou lorsqu\u2019une valeur, comme une version de d\u00e9pendance, est susceptible de changer.<\/h4>\n\n\n\n<p>Vous n\u2019avez pas besoin de cr\u00e9er une variable pour chaque \u00e9l\u00e9ment de votre configuration de build.<br>En fait,&nbsp;<strong>trop de variables peuvent rendre le code du pipeline plus difficile \u00e0 lire et \u00e0 comprendre<\/strong>&nbsp;pour les autres.<\/p>\n\n\n\n<p>Prenez un moment pour examiner le fichier&nbsp;<code>azure-pipelines.yml<\/code>.<br>Remarquez que les valeurs suivantes sont&nbsp;<strong>r\u00e9p\u00e9t\u00e9es<\/strong>&nbsp;:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Configuration de build<\/strong>\u00a0:\u00a0<code>Release<\/code><\/li>\n\n\n\n<li><strong>Emplacement du r\u00e9pertoire\u00a0<code>wwwroot<\/code><\/strong>\u00a0:\u00a0<code>Tailspin.SpaceGame.Web\/wwwroot<\/code><\/li>\n\n\n\n<li><strong>Version du SDK .NET<\/strong>\u00a0:\u00a0<code>6.x<\/code><\/li>\n<\/ul>\n\n\n\n<p>Vous allez maintenant utiliser des&nbsp;<strong>variables<\/strong>&nbsp;pour d\u00e9finir ces valeurs&nbsp;<strong>une seule fois<\/strong>, puis les&nbsp;<strong>r\u00e9f\u00e9rencer<\/strong>&nbsp;dans tout le pipeline.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Dans&nbsp;<strong>Visual Studio Code<\/strong>, modifiez le fichier&nbsp;<code>azure-pipelines.yml<\/code>&nbsp;comme indiqu\u00e9 ici :<\/h4>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>trigger:\n- '*'\n\npool:\n  name: 'Default' #replace if needed with name of your agent pool\n\nvariables:\n  buildConfiguration: 'Release'\n  wwwrootDir: 'Tailspin.SpaceGame.Web\/wwwroot'\n  dotnetSdkVersion: '6.x'\n\nsteps:\n- task: UseDotNet@2\n  displayName: 'Use .NET SDK $(dotnetSdkVersion)'\n  inputs:\n    version: '$(dotnetSdkVersion)'\n\n- task: Npm@1\n  displayName: 'Run npm install'\n  inputs:\n    verbose: false\n\n- script: '.\/node_modules\/.bin\/node-sass $(wwwrootDir) --output $(wwwrootDir)'\n  displayName: 'Compile Sass assets'\n\n- task: gulp@1\n  displayName: 'Run gulp tasks'\n\n- script: 'echo \"$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)\" > buildinfo.txt'\n  displayName: 'Write build info'\n  workingDirectory: $(wwwrootDir)\n\n- task: DotNetCoreCLI@2\n  displayName: 'Restore project dependencies'\n  inputs:\n    command: 'restore'\n    projects: '**\/*.csproj'\n\n- task: DotNetCoreCLI@2\n  displayName: 'Build the project - $(buildConfiguration)'\n  inputs:\n    command: 'build'\n    arguments: '--no-restore --configuration $(buildConfiguration)'\n    projects: '**\/*.csproj'\n\n- task: DotNetCoreCLI@2\n  displayName: 'Publish the project - $(buildConfiguration)'\n  inputs:\n    command: 'publish'\n    projects: '**\/*.csproj'\n    publishWebProjects: false\n    arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)\/$(buildConfiguration)'\n    zipAfterPublish: true\n\n- task: PublishBuildArtifacts@1\n  displayName: 'Publish Artifact: drop'\n  condition: succeeded()<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #22863A\">trigger<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #032F62\">&#39;*&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">pool<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Default&#39;<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6A737D\">#replace if needed with name of your agent pool<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">variables<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">buildConfiguration<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">wwwrootDir<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Tailspin.SpaceGame.Web\/wwwroot&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">dotnetSdkVersion<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;6.x&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">steps<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">UseDotNet@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Use .NET SDK $(dotnetSdkVersion)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">version<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;$(dotnetSdkVersion)&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">Npm@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Run npm install&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">verbose<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">false<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">script<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;.\/node_modules\/.bin\/node-sass $(wwwrootDir) --output $(wwwrootDir)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Compile Sass assets&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">gulp@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Run gulp tasks&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">script<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;echo &quot;$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)&quot; &gt; buildinfo.txt&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Write build info&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">workingDirectory<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">$(wwwrootDir)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Restore project dependencies&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;restore&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Build the project - $(buildConfiguration)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;build&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">arguments<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;--no-restore --configuration $(buildConfiguration)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Publish the project - $(buildConfiguration)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;publish&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">publishWebProjects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">arguments<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)\/$(buildConfiguration)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">zipAfterPublish<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #005CC5\">true<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">PublishBuildArtifacts@1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Publish Artifact: drop&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">condition<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">succeeded()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Remarquez la section&nbsp;<code>variables<\/code>, qui d\u00e9finit les variables suivantes :<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>buildConfiguration<\/code><\/strong>\u00a0: Sp\u00e9cifie la\u00a0<strong>configuration de build<\/strong>.<\/li>\n\n\n\n<li><strong><code>wwwrootDir<\/code><\/strong>\u00a0: Sp\u00e9cifie le\u00a0<strong>chemin vers le r\u00e9pertoire\u00a0<code>wwwroot<\/code><\/strong>.<\/li>\n\n\n\n<li><strong><code>dotnetSdkVersion<\/code><\/strong>\u00a0: Sp\u00e9cifie la\u00a0<strong>version du SDK .NET<\/strong>\u00a0\u00e0 utiliser.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Pour&nbsp;<strong>r\u00e9f\u00e9rencer ces variables<\/strong>, utilisez la&nbsp;<strong>syntaxe&nbsp;<code>$()<\/code><\/strong>, comme vous le feriez pour les variables int\u00e9gr\u00e9es.<\/p>\n\n\n\n<p>Voici un exemple d\u2019\u00e9tape qui ex\u00e9cute&nbsp;<strong>node-sass<\/strong>&nbsp;pour convertir les fichiers Sass en CSS.<br>Pour obtenir le chemin vers le r\u00e9pertoire&nbsp;<code>wwwroot<\/code>, elle&nbsp;<strong>r\u00e9f\u00e9rence la variable&nbsp;<code>wwwrootDir<\/code><\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>- script: '.\/node_modules\/.bin\/node-sass $(wwwrootDir) --output $(wwwrootDir)'\n  displayName: 'Compile Sass assets'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">- <\/span><span style=\"color: #22863A\">script<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;.\/node_modules\/.bin\/node-sass $(wwwrootDir) --output $(wwwrootDir)&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Compile Sass assets&#39;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>La commande de script utilise la variable pour d\u00e9finir \u00e0 la fois le r\u00e9pertoire source des fichiers Sass et le r\u00e9pertoire dans lequel \u00e9crire les fichiers CSS. Elle utilise \u00e9galement la variable pour d\u00e9finir le nom de la t\u00e2che affich\u00e9 dans l\u2019interface utilisateur.<\/p>\n\n\n\n<p>Depuis le terminal int\u00e9gr\u00e9, ajoutez le fichier&nbsp;<code>azure-pipelines.yml<\/code>&nbsp;\u00e0 l\u2019index, validez la modification (commit) et poussez-la sur GitHub.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">Bash<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>git add azure-pipelines.yml\ngit commit -m \"Refactor common variables\"\ngit push origin build-pipeline<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">add<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">azure-pipelines.yml<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">commit<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">-m<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">&quot;Refactor common variables&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">git<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">push<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">origin<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">build-pipeline<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Depuis Azure Pipelines, suivez la construction (build) \u00e0 travers chacune des \u00e9tapes.<\/p>\n\n\n\n<p>Vous verrez que les variables sont remplac\u00e9es par leurs valeurs lorsque la construction s\u2019ex\u00e9cute. Par exemple, voici la t\u00e2che&nbsp;<code>UseDotNet@2<\/code>&nbsp;qui d\u00e9finit la version du SDK .NET \u00e0 utiliser.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"607\" height=\"281\" data-src=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-dotnet-core-sdk-task.png\" alt=\"\" class=\"wp-image-7309 lazyload\" data-srcset=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-dotnet-core-sdk-task.png 607w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/7-dotnet-core-sdk-task-300x139.png 300w\" data-sizes=\"(max-width: 607px) 100vw, 607px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 607px; --smush-placeholder-aspect-ratio: 607\/281;\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Comme pr\u00e9c\u00e9demment, pour voir l\u2019art\u00e9fact une fois la construction termin\u00e9e, vous pouvez naviguer vers le r\u00e9sum\u00e9 de la build.<\/p>\n\n\n\n<p>F\u00e9licitations ! Vous avez utilis\u00e9 Azure Pipelines avec succ\u00e8s et cr\u00e9\u00e9 votre premier art\u00e9fact de build.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Choisissez votre environnement de d\u00e9veloppement pour le module de formation. \u00c0 ce stade, vous pouvez compiler le projet web&nbsp;Space Game&nbsp;via le pipeline. Mais [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":7024,"menu_order":38,"template":"","doc_tag":[],"doc_badge":[],"class_list":["post-7302","docs","type-docs","status-publish","hentry"],"author_avatar":"https:\/\/secure.gravatar.com\/avatar\/6a70e7c73db9f245e650948d09d74f61?s=96&d=mm&r=g","author_name":"Annick N'dri","_links":{"self":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7302"}],"collection":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7302\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7024"}],"wp:attachment":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/media?parent=7302"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_tag?post=7302"},{"taxonomy":"doc_badge","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_badge?post=7302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}