web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Help building a azure devops pipeline to check breaking changes

(1) ShareShare
ReportReport
Posted on by
Hello,
 
I will need your help to create an azure devops pipeline that will automatically check for any breaking changes, 
 
My actual YAML file looks like this: - unfortunately I am stuck during download symbols step
 
triggernone
pr:
  branches:
    include:
      - feature/*
 
pool:
  name'BCLocalizareExtensii'
 
variables:
  ContainerName'BLDAg'
  BcUser'mihai'
  BcPassword'mihai'
 
steps:
 
# Cache AL symbols
taskCache@2
  displayName'Cache AL symbols (.alpackages)'
  inputs:
    key'alpackages | $(Agent.OS) | $(Build.SourcesDirectory)/app.json'
    path'$(Build.SourcesDirectory)/.alpackages'
    restoreKeys: |
      alpackages | $(Agent.OS)
      alpackages
  continueOnErrortrue
 
# Install PowerShell modules
taskPowerShell@2
  displayName'Install PowerShell modules'
  inputs:
    targetType'inline'
    script: |
      Set-StrictMode -Off
      $ExecutionContext.SessionState.PSVariable.Set('StrictModePreference','Off')
      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
      Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted -ErrorAction SilentlyContinue
 
      if (-not (Get-Module -ListAvailable -Name 'BcContainerHelper')) {
        Install-Module BcContainerHelper -Scope CurrentUser -Force -AllowClobber
      } else {
        Update-Module BcContainerHelper -Force -ErrorAction SilentlyContinue
      }
      if (-not (Get-Module -ListAvailable -Name 'BC.HelperFunctions')) {
        Install-Module BC.HelperFunctions -Scope CurrentUser -Force -AllowClobber
      } else {
        Update-Module BC.HelperFunctions -Force -ErrorAction SilentlyContinue
      }
 
      $global:bcContainerHelperConfig = [ordered]@{
        MicrosoftTelemetryConnectionString  = ''
        PartnerTelemetryConnectionString    = ''
        ApplicationInsightsConnectionString = ''
      }
      
      Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
      Install-Module BcContainerHelper -Force -AllowClobber
      #Import-Module BcContainerHelper -Force
 
      #Import-Module BC.HelperFunctions -Force
      
 
      #Write-Host "BcContainerHelper version: $((Get-Module BcContainerHelper).Version)"
      #Write-Host "BC.HelperFunctions version: $((Get-Module BC.HelperFunctions).Version)"
 
# Validate existing BC container
taskPowerShell@2
  displayName'Validate existing BC container'
  inputs:
    targetType'inline'
    script: |
      Set-StrictMode -Off
      $ExecutionContext.SessionState.PSVariable.Set('StrictModePreference','Off')
 
      $containerName = '$(ContainerName)'
 
      if (docker ps --format "{{.Names}}" | Select-String -SimpleMatch $containerName) {
        Write-Host "Container $containerName is running."
      } elseif (docker ps -a --format "{{.Names}}" | Select-String -SimpleMatch $containerName) {
        Write-Host "Container $containerName exists but is stopped. Starting it..."
        docker start $containerName
      } else {
        throw "Container $containerName does not exist. Please create it manually before running this pipeline."
      }
 
# Download Symbols
taskPowerShell@2
  displayName'Download Symbols (from container)'
  inputs:
    targetType'inline'
    script: |
      Set-StrictMode -Off
      $ExecutionContext.SessionState.PSVariable.Set('StrictModePreference','Off')
 
      $global:bcContainerHelperConfig = [ordered]@{
        MicrosoftTelemetryConnectionString  = ''
        PartnerTelemetryConnectionString    = ''
        ApplicationInsightsConnectionString = ''
      }
      Import-Module BcContainerHelper -Force
      Import-Module BC.HelperFunctions -Force
 
      $projectPath = "$(Build.SourcesDirectory)"
      $alCachePath = Join-Path $projectPath ".alpackages"
      New-Item -ItemType Directory -Force -Path $alCachePath | Out-Null
 
      $containerName = '$(ContainerName)'
 
      Download-BcAppSymbols `
        -containerName $containerName `
        -projectPath $projectPath `
        -alCachePath $alCachePath
 
      Write-Host "Symbols downloaded to$alCachePath"
 
# Compile AL Project
taskPowerShell@2
  displayName'Compile AL Project (container)'
  inputs:
    targetType'inline'
    script: |
      Set-StrictMode -Off
      $ExecutionContext.SessionState.PSVariable.Set('StrictModePreference','Off')
 
      $global:bcContainerHelperConfig = [ordered]@{
        MicrosoftTelemetryConnectionString  = ''
        PartnerTelemetryConnectionString    = ''
        ApplicationInsightsConnectionString = ''
      }
      Import-Module BcContainerHelper -Force
      Import-Module BC.HelperFunctions -Force
 
      $projectPath = "$(Build.SourcesDirectory)"
      $containerName = '$(ContainerName)'
 
      $ruleset = Join-Path $projectPath "ruleset.json"
      $rulesetParam = @()
      if (Test-Path $ruleset) { $rulesetParam = @('-rulesetFile', $ruleset) }
 
      Compile-App `
        -containerName $containerName `
        -projectPath $projectPath `
        @rulesetParam `
        -enableCodeCop `
        -enableAppSourceCop `
        -enablePerTenantExtensionCop `
        -enableUICop
 
# Analyze Breaking Changes
taskPowerShell@2
  displayName'Analyze Breaking Changes'
  inputs:
    targetType'inline'
    script: |
      Set-StrictMode -Off
      $ExecutionContext.SessionState.PSVariable.Set('StrictModePreference','Off')
 
      Import-Module BC.HelperFunctions -Force
 
      $previousApp = "$(Build.SourcesDirectory)\PreviousVersion.app"
      if (Test-Path $previousApp) {
        Analyze-AppSourceCop `
          -previousApp $previousApp `
          -currentApp "$(Build.SourcesDirectory)\app.json"
      } else {
        Write-Host "No previous app found, skipping breaking change analysis."
      }
 
# Publish .app artifact
taskPublishBuildArtifacts@1
  displayName'Publish .app artifact'
  inputs:
    pathtoPublish'$(Build.SourcesDirectory)'
    artifactName'AL-Output'
    publishLocation'Container'
 
# Cleanup container (optional)
taskPowerShell@2
  displayName'Leave container running'
  conditionalways()
  inputs:
    targetType'inline'
    script: |
      Write-Host "Container $(ContainerName) will remain running."
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    1,142 on at
    Help building a azure devops pipeline to check breaking changes
    Hello,
     
    Your pipeline fails on the “Download Symbols” step because it doesn’t pass credentials to the container. Fix it by adding:
     
    $cred = New-Object PSCredential('$(BcUser)', (ConvertTo-SecureString '$(BcPassword)' -AsPlainText -Force))
    Download-BcAppSymbols -containerName $(ContainerName) -projectPath $(Build.SourcesDirectory) -alCachePath "$(Build.SourcesDirectory)/.alpackages" -credential $cred -includeSystemApp -force
     
    Also, in your breaking-change check, compare .app to .app, not app.json.
    These two fixes usually solve the problem completely.
     
    Regards,
    Oussama Sabbouh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,204

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,933

#3
YUN ZHU Profile Picture

YUN ZHU 1,885 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans