title: Deploy Code from GitLab Repository to Azure Web App using PowerShell and Azure CLI
body: <p>I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script and the Azure CLI. There is already an answer for doing this using <a href="https://stackoverflow.com/a/53729332/35483">the Azure RM module and Windows PowerShell</a>, but as these are <a href="https://docs.microsoft.com/en-us/powershell/azure/overview?view=azurermps-6.13.0" rel="nofollow noreferrer">now deprecated</a>, I am looking specifically for a solution that uses the new <a href="https://azure.microsoft.com/en-us/blog/azure-powershell-cross-platform-az-module-replacing-azurerm/" rel="nofollow noreferrer">Az module</a> and <a href="https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6" rel="nofollow noreferrer">PowerShelll Core</a>.</p>
  
  <p>The solution should give a a PowerShell (Core) script to setup a Continuous Deployment directly from GitLab to Azure. It must make use of the <a href="https://github.com/Azure/azure-powershell" rel="nofollow noreferrer">Az module</a>.  Once the setup script is run, each subsequent commit/merge to the GitLab repository should then automatically be deployed to Azure. Preferably, this PowerShell script should work for both public and private repositories that are hosted on GitLab, but I'm willing to accept solutions that only work on public repositories. </p>