Practice Exam

Question 44 of 75

Apply Feature Gate Attribute to Controller Action

You work as a Full Stack Developer for MDFT Pro, a well-known training agency that delivers certification courses to students worldwide. Claire, the Product Manager, has asked you to implement a new data export feature in the Student Learning Portal that allows trainers to export student progress reports and quiz results to Excel files. To enable progressive rollout and testing, the feature will be controlled by an Azure App Configuration feature flag named “Export”. You’ve created the App Configuration store with the feature flag currently set to “Off” state for initial testing. The ASP.NET Core application includes a navigation menu with an “Export Data” link that should only be visible when the feature is enabled. Now you need to protect the controller action method that handles export requests so that it only executes when the feature flag is enabled.

PropertyValue
KeyExport
LabelExport
StateOff
DescriptionAbility to export data
Last modified11/30/2025 16:50:10

The view markup uses the feature tag helper:

<feature name="export">
	<li class="nav-item">
		<a class="nav-link text-dark" asp-area="" asp-controller="home" asp-action="export">Export Data</a>
	</li>
</feature>

Which controller attribute should you use to conditionally enable the export action based on the feature flag?

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about Feature Flags:
App Configuration Feature Flags
Next Question
Discuss this question on social media: