AZ-400 Practice Question: Design and implement build and release pipelines
Your team is using Azure Pipelines to deploy a web application to Azure App Service. The application uses a configuration file (appsettings.json) that contains environment-specific settings. You need to manage these settings across development, staging, and production environments without exposing secrets in the source code. The pipeline should automatically replace the settings during deployment. What should you configure?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the 'File Transform' task in the release pipeline to replace tokens in the configuration file with variables defined in pipeline variable groups.
Use the 'File Transform' task to substitute variables from pipeline variables or variable groups. Option B is incorrect because build configuration transforms are for .NET projects and require specific setup. Option C is incorrect because environment variables are not directly used for file transforms. Option D is incorrect because Azure App Service application settings are for the runtime, not for transforming configuration files during deployment.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use the 'File Transform' task in the release pipeline to replace tokens in the configuration file with variables defined in pipeline variable groups.
Why this is correct
The File Transform task is the correct choice because it directly performs token replacement in configuration files like appsettings.json, using variable values from pipeline variable groups. It supports both standard and secret variables, so connection strings and API keys can be injected at release time without exposing them in the repository.
- ✗
Create separate build configurations for each environment and use the 'Transform Web.config' task.
Why it's wrong here
This option is incorrect because the Transform Web.config task is specifically designed for .NET Framework web.config files, not for appsettings.json used by .NET Core/ASP.NET Core applications. Additionally, creating separate build configurations per environment is a compile-time strategy that mixes build and release concerns, whereas runtime configuration should be handled during deployment.
- ✗
Use the 'Azure App Service Deploy' task with the 'Use Web Deploy' option and configure parameterization.
Why it's wrong here
The Azure App Service Deploy task's 'Use Web Deploy' option and parameterization feature rely on Web Deploy's parameters.xml and are intended for web.config or other deploy-time parameters of .NET applications; it does not provide a generic mechanism to transform JSON files like appsettings.json. This task focuses on deployment, not on post-build configuration file tokenization.
- ✗
Set environment variables in the Azure App Service and read them in the application code.
Why it's wrong here
Setting environment variables in the Azure App Service and reading them in code is a valid deployment configuration approach, but it requires modifying the application code to read those variables, which changes the solution design. The question specifically asks about transforming the configuration file within the pipeline, so this option does not meet the requirement of file transformation.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Azure Pipelines
Azure Pipelines is a cloud-based CI/CD service from Microsoft that automatically builds, tests, and deploys code to any platform or cloud.
Key term
Variables
A variable is a named storage location in a computer program that holds a value which can change during execution.
About these practice questions
Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.