You are upgrading to Composer 2 and are finding that it works fine locally, but fails in Pipelines.
You can select which version of composer pipelines uses by adding the following snippet to the project pipelines.yaml file. Note that the minimum schema version required when using the composer service key is 1.3.0.
version: 1.3.0 services: - composer: version: 2
Please see Resources for containers and pipelines jobs for more details