<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mickaël Mottet</title>
    <description>The latest articles on Forem by Mickaël Mottet (@mcklmt).</description>
    <link>https://forem.com/mcklmt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F403241%2F42aabaf3-b638-45ab-9e13-8fef348a9b8d.jpg</url>
      <title>Forem: Mickaël Mottet</title>
      <link>https://forem.com/mcklmt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mcklmt"/>
    <language>en</language>
    <item>
      <title>Build and deploy .NET 5 app with GitHub Actions</title>
      <dc:creator>Mickaël Mottet</dc:creator>
      <pubDate>Tue, 19 Jan 2021 09:47:18 +0000</pubDate>
      <link>https://forem.com/mcklmt/build-and-deploy-net-5-app-with-github-actions-1de</link>
      <guid>https://forem.com/mcklmt/build-and-deploy-net-5-app-with-github-actions-1de</guid>
      <description>&lt;p&gt;As a personal project, I'm learning about GitHub Actions and DevOps in general. I'm a former .NET developer so it's my prefered technology to work with. &lt;br&gt;
My goal on this post, is to deploy a sample .NET 5 application to Azure App Service as a container with GitHub Actions. I will author the ARM template using Bicep.&lt;br&gt;
I work on MacOS but the same process can be achieved on Windows or Linux.&lt;/p&gt;

&lt;p&gt;Let's start.&lt;/p&gt;
&lt;h1&gt;
  
  
  Tooling
&lt;/h1&gt;

&lt;p&gt;Few tools used on this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Azure Subscription to deploy resources&lt;/li&gt;
&lt;li&gt;A GitHub repository to store the source code and use GitHub Actions&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Azure/azure-cli" rel="noopener noreferrer"&gt;Azure CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Azure/bicep" rel="noopener noreferrer"&gt;Bicep&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I recommend &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dotnet.microsoft.com/download/dotnet/5.0" rel="noopener noreferrer"&gt;Dotnet 5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A terminal to execute commands&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Create new .NET 5 project
&lt;/h1&gt;

&lt;p&gt;First, we have to create a new project.&lt;br&gt;
In my case I created a repository called &lt;em&gt;demoaspnet5container&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The command to clone the repository to local folder is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/MCKLMT/demoaspnet5container.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We now have a copy of our repository locally.&lt;br&gt;
We will create a new .NET 5 project.&lt;br&gt;
Go in the cloned folder and execute the following command. In my case, my project will be called &lt;em&gt;WebApp&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new project WebApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Our new project has been created and you can run it locally using the command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And now, you can browse the web site locally using your browser at &lt;em&gt;&lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can create a .gitignore file to avoid to push build artetifacts to GitHub with the following command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h1&gt;
  
  
  Authoring the Docker image
&lt;/h1&gt;

&lt;p&gt;Now we have our application, we want to containerize it.&lt;br&gt;
To do so, we create a Dockerfile file in the same folder than the application.&lt;br&gt;
The Dockerfile looks like this one:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;mcr.microsoft.com/dotnet/sdk:5.0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;build-env&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;dotnet &lt;span class="nt"&gt;--version&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; *.csproj ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;dotnet restore

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;dotnet publish &lt;span class="nt"&gt;-c&lt;/span&gt; Release &lt;span class="nt"&gt;-o&lt;/span&gt; out

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; mcr.microsoft.com/dotnet/aspnet:5.0&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=build-env /app/out .&lt;/span&gt;
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt;&lt;span class="s"&gt; ["dotnet", "WebApp.dll"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This file is pretty simple.&lt;br&gt;
First, we use a build image to restore dependencies and publish the content of the web site and secondly, we copy the resulting of the build to a new image.&lt;/p&gt;
&lt;h1&gt;
  
  
  Using Bicep to author ARM template
&lt;/h1&gt;

&lt;p&gt;Bicep is a recent open source project which aims to simplify the authoring of Azure Resource Manager templates.&lt;br&gt;
Once the template is created, you have to run the following command to build the ARM file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bicep build main.bicep
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command will output the ARM file you can deploy using Azure CLI for instance.&lt;/p&gt;

&lt;p&gt;I would like to share few things about it.&lt;/p&gt;

&lt;p&gt;First, in my case, I want to use Azure App Service on Linux to host the container I built previously. The container image will be built and stored with Azure Container registry. To do so, Azure App Service will need to have the rights to pull the image from Azure Container Registry. To achieve this goal, I will create a user managed identity and affect this identity to App Service. Afterwards, I assign the permission to pull the registry to the identity. Voilà, our App Service can safely access the registry.&lt;/p&gt;

&lt;p&gt;The bicep code of user managed identity and the role assignment:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
  name: 'webAppIdentity'
  location: location
}

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
  name: roleAssignmentName
  scope: containerRegistry
  properties: {
    roleDefinitionId: roleDefinitionId
    principalId: managedIdentity.properties.principalId
    principalType: 'ServicePrincipal'
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The complete bicep file is &lt;a href="https://github.com/MCKLMT/demoaspnet5container/blob/master/Infrastructure/main.bicep" rel="noopener noreferrer"&gt;available on GitHub&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Create our GitHub workflow
&lt;/h1&gt;

&lt;p&gt;We have all the code to be deployed on Azure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The bicep file which will be converted to ARM template&lt;/li&gt;
&lt;li&gt;The Docker image to deploy to App Service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will create a &lt;em&gt;.github/workflows/dotnet-core.yaml&lt;/em&gt; file. This file will contain all the steps needed and will be executed at each commit push on the master branch.&lt;/p&gt;

&lt;p&gt;First, we will deploy the infrastructure. We have to build our bicep file, connect to Azure and deploy the resulting template:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Bicep build&lt;/span&gt;
&lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aliencube/bicep-build-actions@v0.1&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;files&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Infrastructure/main.bicep&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Login to Azure&lt;/span&gt;
&lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;azure/login@v1&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;creds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.AZURE_CREDENTIALS }}&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy Azure Resource Manager (ARM) Template&lt;/span&gt;
&lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;azure/arm-deploy@v1&lt;/span&gt;
&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deploy&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;scope&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;resourcegroup&lt;/span&gt;
    &lt;span class="na"&gt;subscriptionId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SUBSCRIPTION_ID }}&lt;/span&gt;
    &lt;span class="na"&gt;resourceGroupName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demoaspnet5container-rg&lt;/span&gt;
    &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./Infrastructure/main.json&lt;/span&gt;
    &lt;span class="na"&gt;deploymentMode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Incremental&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Secondly, we will build the container using Azure Container Registry:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build image with ACR&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;azure/CLI@v1&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;azcliversion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;latest&lt;/span&gt;
    &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;az acr build --registry ${{ steps.deploy.outputs.registryNameOutput }} --image aspnet5webapp:${{ env.COMMIT_REF }} ./WebApp/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The source code will be zipped, uploaded to Azure Container Registry and built in the cloud.&lt;/p&gt;

&lt;p&gt;The final step is to tell to App Service where to get the image:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy the image to App Service&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;azure/CLI@v1&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;azcliversion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;latest&lt;/span&gt;
    &lt;span class="na"&gt;inlineScript&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;az webapp config container set --name ${{ steps.deploy.outputs.webAppNameOutput }} --resource-group ${{ steps.deploy.outputs.resourceGroupOutput }} &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Congratulations, your website should be up and running!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv6acghi8dv137iimi554.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv6acghi8dv137iimi554.png" alt="Capture d’écran 2021-01-19 à 10.35.57" width="800" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you liked this post and feel free to contact me on Twitter if you want to discuss about it!&lt;/p&gt;
&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;p&gt;The complete source code is available on GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/MCKLMT" rel="noopener noreferrer"&gt;
        MCKLMT
      &lt;/a&gt; / &lt;a href="https://github.com/MCKLMT/demoaspnet5container" rel="noopener noreferrer"&gt;
        demoaspnet5container
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Sample ASP.NET 5 application deployed to App Service on Linux as a container with GitHub Actions
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Few resources to go deep on this topic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-tutorial-quick-task" rel="noopener noreferrer"&gt;Tutorial: Build and deploy container images in the cloud with Azure Container Registry Tasks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-linux" rel="noopener noreferrer"&gt;Migrate custom software to Azure App Service using a custom container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Azure/actions" rel="noopener noreferrer"&gt;GitHub Actions for deploying to Azure&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
      <category>dotnet</category>
      <category>docker</category>
      <category>bicep</category>
    </item>
    <item>
      <title>Build and deploy Angular app with Azure DevOps</title>
      <dc:creator>Mickaël Mottet</dc:creator>
      <pubDate>Sat, 09 Jan 2021 17:38:56 +0000</pubDate>
      <link>https://forem.com/mcklmt/build-and-deploy-angular-app-with-azure-devops-3nnf</link>
      <guid>https://forem.com/mcklmt/build-and-deploy-angular-app-with-azure-devops-3nnf</guid>
      <description>&lt;p&gt;One of my customers wanted to deploy an Angular application to Azure App Service. Azure DevOps was already used in another project so it was obvious to use it for this new one.&lt;/p&gt;

&lt;h1&gt;
  
  
  Install NodeJS
&lt;/h1&gt;

&lt;p&gt;I work on MacOS so homebrew can help to install packages. If you are on Windows or Linux, you can find &lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;the last files to install there&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;On MacOS when homebrew is already installed, you just have to run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Install Angular CLI
&lt;/h1&gt;

&lt;p&gt;Once node installed, you can get the last Angular CLI. This utility can help in various tasks. One of them is to create new Angular projects from scratch.&lt;br&gt;
To install Angular CLI globally, you can use this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI will be available anywhere on your system.&lt;/p&gt;

&lt;h1&gt;
  
  
  Create a new Angular project
&lt;/h1&gt;

&lt;p&gt;We can now create a new Angular project. The command is very simple :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng new HelloWorld &lt;span class="nt"&gt;--strict&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="nt"&gt;--routing&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="nt"&gt;--style&lt;/span&gt; css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will create a new project called &lt;em&gt;HelloWorld&lt;/em&gt; with default settings. It can take a little of time because of the number of modules to add.&lt;/p&gt;

&lt;h1&gt;
  
  
  Testing the application
&lt;/h1&gt;

&lt;p&gt;Go in the folder of the project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;HelloWorld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can try the application using the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will generate the application and create a node server on port 4200. Just launch your browser at &lt;a href="http://localhost:4200/" rel="noopener noreferrer"&gt;http://localhost:4200/&lt;/a&gt; to see the default page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F71iujlperqn017eutfz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F71iujlperqn017eutfz4.png" alt="Angular default page" width="800" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use Control C in the terminal to exit.&lt;/p&gt;

&lt;h1&gt;
  
  
  Create the Azure Pipeline
&lt;/h1&gt;

&lt;p&gt;Congratulations, our application is ready to be deployed! It's time to add the CI/CD part.&lt;/p&gt;

&lt;p&gt;I will not explain how to create an Azure DevOps project here. It's very simple and if you have doubts, you can &lt;a href="https://docs.microsoft.com/en-us/azure/devops/organizations/projects/create-project?view=azure-devops&amp;amp;tabs=preview-page" rel="noopener noreferrer"&gt;read the documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We have now to create a new pipeline.&lt;br&gt;
The first part is building the application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build stage&lt;/span&gt;
  &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;BuildJob&lt;/span&gt;
    &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;vmImage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ubuntu-20.04'&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodeTool@0&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;versionSpec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;10.x'&lt;/span&gt;
        &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Install&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Node.js'&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;cd '$(System.DefaultWorkingDirectory)/HelloWorld'&lt;/span&gt;
          &lt;span class="s"&gt;npm install -g @angular/cli&lt;/span&gt;
          &lt;span class="s"&gt;npm install&lt;/span&gt;
          &lt;span class="s"&gt;ng build --prod&lt;/span&gt;
        &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;install&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;and&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;build'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ArchiveFiles@2&lt;/span&gt;
        &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Archive&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;files'&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;rootFolderOrFile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(System.DefaultWorkingDirectory)/HelloWorld/dist/HelloWorld/'&lt;/span&gt;
          &lt;span class="na"&gt;includeRootFolder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
          &lt;span class="na"&gt;archiveType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;zip&lt;/span&gt;
          &lt;span class="na"&gt;archiveFile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip&lt;/span&gt;
          &lt;span class="na"&gt;replaceExistingArchive&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PublishBuildArtifacts@1&lt;/span&gt;
        &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;PathtoPublish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'&lt;/span&gt;
          &lt;span class="na"&gt;ArtifactName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;drop'&lt;/span&gt;
          &lt;span class="na"&gt;publishLocation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Container'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code is pretty simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We install node on the agent&lt;/li&gt;
&lt;li&gt;We install the Angular CLI&lt;/li&gt;
&lt;li&gt;We install the NPM packages&lt;/li&gt;
&lt;li&gt;We build the Angular application&lt;/li&gt;
&lt;li&gt;We zip the files&lt;/li&gt;
&lt;li&gt;We publish the zip as artifact&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The second part is deploying the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
  &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Deploy&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Web&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;App'&lt;/span&gt;
  &lt;span class="na"&gt;dependsOn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
  &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;succeeded()&lt;/span&gt;
  &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DeploymentJob&lt;/span&gt;
    &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;vmImage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ubuntu-20.04'&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$(environmentName)&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;runOnce&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AzureWebApp@1&lt;/span&gt;
            &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Deploy&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Azure&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Web&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;App&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;$(webAppName)'&lt;/span&gt;
            &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;azureSubscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$(azureSubscription)&lt;/span&gt;
              &lt;span class="na"&gt;appName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$(webAppName)&lt;/span&gt;
              &lt;span class="na"&gt;appType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webAppLinux&lt;/span&gt;
              &lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$(Pipeline.Workspace)/drop/$(Build.BuildId).zip&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this stage, we only have on action. We get the artifact as zip file and we publish it to Azure App Service with the zip deploy task.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complete code
&lt;/h1&gt;

&lt;p&gt;The complete code of the project is &lt;a href="https://github.com/MCKLMT/demoangular" rel="noopener noreferrer"&gt;hosted on GitHub&lt;/a&gt;. If you are only interested by the code of the Azure Pipeline, &lt;a href="https://github.com/MCKLMT/demoangular/blob/main/azure-pipelines.yml" rel="noopener noreferrer"&gt;you can read it there&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>angular</category>
      <category>node</category>
    </item>
    <item>
      <title>Build and deploy PHP Symfony with Azure DevOps</title>
      <dc:creator>Mickaël Mottet</dc:creator>
      <pubDate>Fri, 04 Dec 2020 17:20:53 +0000</pubDate>
      <link>https://forem.com/mcklmt/build-and-deploy-php-symphony-app-to-azure-19h7</link>
      <guid>https://forem.com/mcklmt/build-and-deploy-php-symphony-app-to-azure-19h7</guid>
      <description>&lt;p&gt;I had the opportunity to work on a PHP Symfony application with a new customer with Azure DevOps. &lt;br&gt;
The problematic was to build the application with several commands to pass on the source code and afterwards to push the application to an Azure App Service web application.&lt;br&gt;
I assume that you are familiar with Azure Pipelines and will only share the content of the pipeline itself and not the way to create it.&lt;/p&gt;

&lt;p&gt;So, once the pipeline is created, we have several tasks to accomplish.&lt;/p&gt;

&lt;p&gt;First, we need to select the correct version of PHP. In our case it will be PHP 7.4.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: |
    sudo update-alternatives --set php /usr/bin/php$(phpVersion)
    sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
    sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
    sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
    sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
    php -version
  workingDirectory: $(rootFolder)
  displayName: 'Use PHP version $(phpVersion)'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our case, we'll have to execute database migrations with Doctrine. The customer has chosen Azure SQL Database as provider. The problem is that this driver is not embedded in the hosted agent image. We have to install it using PECL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: |
    sudo pecl config-set php_ini /etc/php/7.4/cli/php.ini
    sudo pecl config-set ext_dir /usr/lib/php/20190902/
    sudo pecl config-set bin_dir /usr/bin/
    sudo pecl config-set php_bin /usr/bin/php7.4
    sudo pecl config-set php_suffix 7.4
    sudo pecl channel-update pecl.php.net
    sudo pecl install sqlsrv-5.8.1
    sudo pecl install pdo_sqlsrv-5.8.1
  displayName: PECL install sqlsrv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, we have to tell to PHP where to find the installed modules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: |
    sudo bash -c "echo extension=sqlsrv.so &amp;gt; /etc/php/7.4/cli/conf.d/99-sqlsrv.ini"
    sudo bash -c "echo extension=pdo_sqlsrv.so &amp;gt; /etc/php/7.4/cli/conf.d/99-sqlsrv.ini"
    displayName: 'SQLSRV modify ini files'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick check that all is good using PHPinfo()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: php -i
  workingDirectory: $(rootFolder)
  displayName: 'PHPinfo()'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that all is good, we can add dependencies with Composer and "compile" the web application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: |
  curl -sS https://getcomposer.org/installer | php
  php composer.phar install --no-dev --optimize-autoloader
  php composer.phar dump-env %APP_ENV%
  php bin/console cache:clear
  workingDirectory: $(rootFolder)
  displayName: 'Composer install'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can update execute the database migrations using Doctrine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- script: php bin/console doctrine:migrations:migrate --no-interaction
  workingDirectory: $(rootFolder)
  displayName: 'Update database'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, we can execute the "classic" steps, storing the build artifacts and deploying to Azure App Service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- task: ArchiveFiles@2
  displayName: 'Archive files'
  inputs:
    rootFolderOrFile: '$(rootFolder)'
    includeRootFolder: false
    archiveType: zip
    archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
    replaceExistingArchive: true

- upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
  displayName: 'Upload package'
  artifact: drop

- stage: Deploy
  displayName: 'Deploy Web App'
  dependsOn: Build
  condition: succeeded()
  jobs:
- deployment: DeploymentJob
  pool:
    vmImage: $(vmImageName)
  environment: $(environmentName)
  strategy:
    runOnce:
      deploy:
        steps:
        - task: AzureWebApp@1
          displayName: 'Deploy Azure Web App : $(webAppName)'
          inputs:
            azureSubscription: $(azureSubscription)
            appName: $(webAppName)
            appType: webAppLinux
            package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, our website is deployed! 👍🏻&lt;/p&gt;

&lt;p&gt;Full script is below:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# PHP as Linux Web App on Azure
# Build, package and deploy your PHP project to Azure Linux Web App.
# Add steps that run tests and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php

trigger:
- master

variables:
  # Azure Resource Manager connection created during pipeline creation
  azureSubscription: '##ID OF THE SERVICE CONNECTION##'

  # Environment name
  environmentName: '##NAME OF THE ENVIRONMENT##'

  # Web app name
  webAppName: '##NAME OF THE WEB APP##'

  # Agent VM image name
  vmImageName: 'Ubuntu-20.04'

  # Root folder under which your |
  rootFolder: $(System.DefaultWorkingDirectory)

stages:
- stage: Build
  displayName: Build stage
  variables:
    phpVersion: '7.4'
  jobs:
  - job: BuildJob
    pool:
      vmImage: $(vmImageName)
    steps:
- script: |
    sudo update-alternatives --set php /usr/bin/php$(phpVersion)
    sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
    sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
    sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
    sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
    php -version
  workingDirectory: $(rootFolder)
  displayName: 'Use PHP version $(phpVersion)'

- script: |
    sudo pecl config-set php_ini /etc/php/7.4/cli/php.ini
    sudo pecl config-set ext_dir /usr/lib/php/20190902/
    sudo pecl config-set bin_dir /usr/bin/
    sudo pecl config-set php_bin /usr/bin/php7.4
    sudo pecl config-set php_suffix 7.4
    sudo pecl channel-update pecl.php.net
    sudo pecl install sqlsrv-5.8.1
    sudo pecl install pdo_sqlsrv-5.8.1
  displayName: PECL install sqlsrv

- script: |
    sudo bash -c "echo extension=sqlsrv.so &amp;gt; /etc/php/7.4/cli/conf.d/99-sqlsrv.ini"
    sudo bash -c "echo extension=pdo_sqlsrv.so &amp;gt; /etc/php/7.4/cli/conf.d/99-sqlsrv.ini"
    displayName: 'SQLSRV modify ini files'

  - script: php -i
    workingDirectory: $(rootFolder)
    displayName: 'PHPinfo()'

  - script: |
    curl -sS https://getcomposer.org/installer | php
    php composer.phar install --no-dev --optimize-autoloader
    php composer.phar dump-env %APP_ENV%
    php bin/console cache:clear
    workingDirectory: $(rootFolder)
    displayName: 'Composer install'

  - script: curl -sS https://get.symfony.com/cli/installer | bash
    workingDirectory: $(rootFolder)
    displayName: 'Install SymfonyCLI'

  - script: /home/vsts/.symfony/bin/symfony check:requirements
    workingDirectory: $(rootFolder)
    displayName: 'Symfony check requirements'

  - script: php bin/console doctrine:migrations:migrate --no-interaction
    workingDirectory: $(rootFolder)
    displayName: 'Update database'

  - task: ArchiveFiles@2
    displayName: 'Archive files'
    inputs:
      rootFolderOrFile: '$(rootFolder)'
      includeRootFolder: false
      archiveType: zip
      archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
      replaceExistingArchive: true

  - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
    displayName: 'Upload package'
    artifact: drop

  - stage: Deploy
    displayName: 'Deploy Web App'
    dependsOn: Build
    condition: succeeded()
    jobs:
  - deployment: DeploymentJob
    pool:
      vmImage: $(vmImageName)
    environment: $(environmentName)
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            displayName: 'Deploy Azure Web App : $(webAppName)'
            inputs:
              azureSubscription: $(azureSubscription)
              appName: $(webAppName)
              appType: webAppLinux
              package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
``



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>azure</category>
      <category>devops</category>
      <category>symfony</category>
      <category>php</category>
    </item>
  </channel>
</rss>
