You are using the Python SDK to develop a containerized AI application that retrieves the value of a runtime
setting stored in an Azure App Configuration resource. The application will run in Azure in the security
context of a managed identity.
The application must work in a local development environment without any code changes.
You need to complete the code that implements the retrieval.
How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

The application must work in a local development environment without any code changes.
You need to complete the code that implements the retrieval.
How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Show answerHide answer
Explanation

Explanation
DefaultAzureCredential: The application must work both in a local development environment and in Azure using a managed identity, all without code changes. DefaultAzureCredential is designed specifically for this scenario. It automatically attempts a chain of authentication methods: locally, it will use your developer credentials (like Azure CLI or Visual Studio), and when deployed to Azure, it will automatically detect and use the assigned Managed Identity.
get_configuration_setting: The goal is to retrieve the value of a specific runtime setting ("FeatureX" with the label "production"). The get_configuration_setting method is the correct SDK method to fetch a single key-value pair. It takes the key and optional keyword arguments (like label) and returns the specific configuration setting.
Why the Other Options Are Incorrect
ClientSecretCredential / ManagedIdentityCredential:
ClientSecretCredential: Requires hardcoding or passing a client secret, which breaks the requirement to run locally without code changes (since local wouldn't have the Azure Managed Identity) and is less secure.
ManagedIdentityCredential: Strictly enforces managed identity authentication. It will fail in a local development environment because managed identities only exist within Azure resources.
list_labels / list_configuration_settings: These methods are used to list multiple items. list_labels returns the available labels in the App Configuration store, and list_configuration_settings returns a collection of settings. Neither is used to retrieve the value of a single specific key like "FeatureX".
References
Microsoft Learn: DefaultAzureCredential overview

