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?

  1. 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
  2. B.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()).ConfigureRefresh(refresh => refresh.Register("Settings:Sentinel", refreshAll: false)); }); app.UseAzureAppConfiguration();
  3. C.builder.Configuration.AddAzureAppConfiguration(options => { options.Connect(new Uri(endpoint), new DefaultAzureCredential()).ConfigureRefresh(refresh => refresh.Register("Settings:Sentinel", refreshAll: true).SetRefreshInterval(TimeSpan.Zero)); });
  4. 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

All of Azure App Configuration

Practise more Implement Azure Security

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed