CalSync — Automate Outlook Calendar Colors

Auto-color-code events for your team using rules. Faster visibility, less admin. 10-user minimum · 12-month term.

CalSync Colors is a service by CPI Consulting

This post walks through the steps of reading JSON files from Azure App Configuration, complete with explanations and code samples.

Modern cloud applications often rely on configuration management systems to centralize and secure application settings. Azure App Configuration is one such service that allows developers to store and manage configurations separately from code. A common use case is reading JSON files—such as feature flags, settings, or structured data—from App Configuration into your application.

Why Use Azure App Configuration for JSON?

JSON is widely used for structured data in applications. Storing JSON in Azure App Configuration provides:

  • Centralized Management – Manage configuration in one place across multiple environments.
  • Dynamic Refresh – Update configurations without redeploying applications.
  • Security – Integrates with Azure security controls, including role-based access.
  • Versioning and Labels – Maintain different versions of your configuration files.

Store JSON in Azure App Configuration

You can store a JSON file in Azure App Configuration as a key-value pair. Typically, the key represents the configuration name, and the value holds the JSON content.

Example:

Value:

You can add this via the Azure Portal, Azure CLI, or an ARM/Bicep template.

Azure CLI Example:

Connect Application to Azure App Configuration

First, install the necessary NuGet packages in your .NET application:

Update your Program.cs or Startup.cs to connect to Azure App Configuration.

Program.cs Example:

Deserialize JSON Configuration

When retrieving JSON values from App Configuration, you’ll often want to deserialize them into strongly typed objects.

Here is the missing code to deserialize:

This approach gives you a strongly typed object that you can use throughout your application.

Enable Dynamic Refresh (Optional)

One of the biggest advantages of Azure App Configuration is dynamic refresh. It allows your application to pick up configuration changes without redeployment.

Program.cs Example with Refresh:

In addition, register middleware:

This ensures your application automatically reloads configuration updates.

Use Labels for Environment-Specific JSON

Labels in Azure App Configuration allow you to differentiate settings for environments like dev, test, and prod.

Example:

When connecting, specify the label:

Best Practices

  • Keep JSON Compact – Avoid overly large JSON objects to reduce latency.
  • Use Strongly Typed Objects – Deserialize JSON into C# objects for safer usage.
  • Secure Access – Use managed identity instead of connection strings for production.
  • Version with Labels – Always tag configurations with labels to avoid confusion across environments.

Conclusion

Reading JSON files from Azure App Configuration streamlines how you manage structured data across applications. By centralizing configuration, enabling dynamic refresh, and leveraging labels for environment-specific settings, you gain both flexibility and control. Using strongly typed deserialization ensures your app handles configurations safely and predictably.

With this approach, your applications are more maintainable, secure, and responsive to configuration changes without requiring redeployment.


Discover more from CPI Consulting

Subscribe to get the latest posts sent to your email.