Recently I was working on deploying infrastructure in Azure using an Shared Agent Pool running on Red Hat Enterprise Linux (RHEL) 7.9 images. From one day to another my pipelines were failing with errors which were not there before:
ERROR: /var/adoagent/_work/_temp/.azclitask/bin/bicep: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /var/adoagent/_work/_temp/.azclitask/bin/bicep)
After analysis it turned out that this has to be related with the fact that since the introduction of Bicep version 0.25 implicitly the dependency of GLIBC library has been upgraded. As RHEL 7.9 doesn’t support GLIBC 3.4.20 this causes deployments to fail.
This behavior demonstrates with existing pipelines to occur without recent changes to the pipeline, when relying on AZ CLI tasks in your pipelines in combination with the az deployment command. This command implicitly downloads Bicep CLI to parse Bicep templates. This logic uses by default the latest version, so in case new versions with different dependencies are launched they can suddenly break your pipeline and prevent it from working.
Short term fix
As short term fix, there is an easy way to overcome this issue. Make sure to adjust your pipeline scrips to first download the latest Bicep version. Before executing in your script az deployment, add the following line:
az bicep install --version v0.24.24
This small adjustment is however not a permanent fix as you now not receive new updates to the Bicep and this might introduce other issues in future.
Long term fix
Long term fix is to make sure your agents are running a version of Linux which supports newer GLIBC libraries. This allows you to keep up to date with new features of Bicep and stay aligned with new Azure technology that is being launched over time.