I was preparing a demo about IIS XML Transformation inside a CD pipeline with Azure DevOps.

It’s very likely that if you’re working with an ASP.Net project with default values the Azure App Service Deploy Task will fail. After some googling I found that this is documented here.
The trick is to remove the <DependendUpon> tag inside the csproj file.
By default, MSBuild applies the transformation as it generates the web package if the
File transforms and variable substitution reference, XML transformation notes, Microsoft Docs<DependentUpon>
element is already present in the transform file in the*.csproj
file. In such cases, the Azure App Service Deploy task will fail because there is no further transformation applied on theWeb.config
file. Therefore, it is recommended that the<DependentUpon>
element is removed from all the transform files to disable any build-time configuration when using XML transformation.