'No pool was specified Error shows up for the migrated builds

We have recently migrated few of our builds to a different Azure DevOps Environment using Azure DevOps migration tool. The build pipelines are pointing to the microsoft hosted agents but they are failing due to issue

No pool was specified

A newly created build works fine with the same build configuration. Attached screenshots contain sample yamls that are exactly the same, however the migrated build fails with the error and the newly created build works fine.

enter image description here

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source