Azure App Configuration · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
An ASP.NET Core application loads settings from Azure App Configuration. The team wants changes to take effect without restarting the application, bu…
Practice question from Azure App Configuration (AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security), with the correct answer and a step-by-step solution.
hard · MCQ · Q-5F6092
An ASP.NET Core application loads settings from Azure App Configuration. The team wants changes to take effect without restarting the application, but only after the key Settings:Sentinel changes. Refresh checks must occur at most once every five minutes during incoming requests. Which implementation satisfies these requirements?
- A.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()).ConfigureRefresh(refresh => refresh.Register("Settings:Sentinel", refreshAll: true).SetRefreshInterval(TimeSpan.FromMinutes(5))); }); app.UseAzureAppConfiguration();Correct answer
- B.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()).ConfigureRefresh(refresh => refresh.Register("Settings:Sentinel", refreshAll: false)); }); app.UseAzureAppConfiguration();
- C.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()).ConfigureRefresh(refresh => refresh.Register("Settings:Sentinel", refreshAll: true).SetRefreshInterval(TimeSpan.Zero)); });
- D.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()); }); app.UseAzureAppConfiguration();
Solution
Registering the sentinel with refreshAll: true causes all registered configuration values to refresh when the sentinel changes. SetRefreshInterval limits checks to once every five minutes, and UseAzureAppConfiguration enables request-driven refresh in ASP.NET Core.
More from Azure App Configuration
- An Azure App Service uses a system-assigned managed identity to read configuration values from Azure App Configuration. The application mus…
- An ASP.NET Core application uses Azure App Configuration for application settings. A database password must not be stored as a plain value…
- An ASP.NET Core application stores Api:BaseUrl in Azure App Configuration with separate Production and Staging labels. The production deplo…
- An ASP.NET Core application uses Azure App Configuration feature flags. The team wants to evaluate flags through IFeatureManager in applica…
Practise more Implement Azure Security
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed