One approach you could consider is using Global Parameters in Azure Data Factory and referencing these in your linked services instead of hardcoded values, you may be able to resolve the issue. When publishing, these should be exported as parameters in the ARM template, potentially solving your problem.
Another option is to implement a post-processing script that runs after the ARM template is generated. This script, which could be written in PowerShell or Python, would automatically replace the hardcoded UAMI names with parameters. You could integrate this script into your CI/CD pipeline to automate the process.
You might also consider using linked templates. This involves creating a separate ARM template for your linked services with parameters for UAMI names, and then referencing this template in your main ADF ARM template. This approach allows you to manage the linked services separately and might provide more flexibility in handling environment-specific configurations.
A potentially simpler solution could be to use dynamic linked services. Instead of creating separate linked services for each environment, you could create a single linked service that uses expressions to determine the correct UAMI at runtime. This approach leverages ADF system variables like @pipeline().globalParameters.Environment
to switch between UAMIs dynamically.
If you prefer to address this at the deployment level, you could use the ARM template deployment task in your Azure DevOps pipeline. This allows you to override the UAMI parameters during deployment. While this approach doesn't solve the ARM template issue directly, it provides a workaround for successful deployments across environments.
I would recommend trying either the Global Parameters approach or the Dynamic Linked Services method first. These are native ADF features that should solve your problem without requiring external scripts or manual interventions. However, the best solution may depend on your specific setup and requirements.