{"id":56853,"date":"2025-12-22T15:17:08","date_gmt":"2025-12-22T05:17:08","guid":{"rendered":"https:\/\/www.cloudproinc.com.au\/?p=56853"},"modified":"2025-12-22T15:17:13","modified_gmt":"2025-12-22T05:17:13","slug":"how-to-use-net-appsettings-json","status":"publish","type":"post","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/","title":{"rendered":"How to Use .NET appsettings.json"},"content":{"rendered":"\n<p>In this blog post <strong>How to Use .NET appsettings.json for Cleaner Configuration<\/strong> we will explore how <code>appsettings.json<\/code> helps you manage configuration in modern .NET apps, without sprinkling values throughout your codebase. You will learn what it is, why it exists, and how to use it confidently in real-world projects.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>At a high level, <code>appsettings.json<\/code> is the default place to store configuration values your application needs at runtime. Think connection strings, API endpoints, feature flags, logging levels, and service settings. The big win is separation of concerns: your code stays focused on behaviour, while configuration stays flexible and changeable across environments.<\/p>\n\n\n\n<p>Under the hood, this is powered by the .NET configuration system and the generic host. .NET builds a <em>configuration pipeline<\/em> from one or more providers (JSON files, environment variables, command-line args, secret stores, and more). These providers are layered, so later sources can override earlier ones. That layering is what makes <code>appsettings.json<\/code> a good base configuration, while environment-specific or secret values can override it safely.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-appsettings-json-in-net\">What is appsettings.json in .NET<\/h2>\n\n\n\n<p><code>appsettings.json<\/code> is a JSON file typically located at the root of your project. By convention, it contains key-value pairs and nested sections. .NET loads it on startup and exposes values via <code>IConfiguration<\/code>. You can read config directly, or bind sections to typed options classes for safer, cleaner code.<\/p>\n\n\n\n<p>Common uses include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Application settings like <code>AppName<\/code> or <code>DefaultLanguage<\/code><\/li>\n\n\n\n<li>Service endpoints like <code>BaseUrl<\/code> or <code>TimeoutSeconds<\/code><\/li>\n\n\n\n<li>Logging configuration via the built-in logging providers<\/li>\n\n\n\n<li>Connection strings (often overridden in production)<\/li>\n\n\n\n<li>Feature toggles for controlled rollout<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-the-net-configuration-system-works\">How the .NET configuration system works<\/h2>\n\n\n\n<p>The core technology is the <strong>Microsoft.Extensions.Configuration<\/strong> stack. In practical terms, it gives you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Providers<\/strong> that load configuration from various sources (JSON, env vars, Azure Key Vault, etc.)<\/li>\n\n\n\n<li><strong>Binding<\/strong> that maps configuration sections to strongly typed classes<\/li>\n\n\n\n<li><strong>Reload support<\/strong> so changes can be detected (mostly useful in development or certain hosting scenarios)<\/li>\n<\/ul>\n\n\n\n<p>In most modern .NET templates (ASP.NET Core and worker services), the host is created for you and configuration is wired up automatically. The default order is roughly:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>appsettings.json<\/code><\/li>\n\n\n\n<li><code>appsettings.{Environment}.json<\/code> (for example, Development, Staging, Production)<\/li>\n\n\n\n<li>User secrets (development only, when enabled)<\/li>\n\n\n\n<li>Environment variables<\/li>\n\n\n\n<li>Command-line arguments<\/li>\n<\/ul>\n\n\n\n<p>The key takeaway is <strong>last one wins<\/strong>. If the same key exists in multiple sources, the value from the later source overrides earlier ones.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a-solid-starting-appsettings-json\">A solid starting appsettings.json<\/h2>\n\n\n\n<p>Here is a realistic example with a few common sections:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-72f17a056b624f5456cacae63fe5eef0\"><code>{\n  \"App\": {\n    \"Name\": \"CloudProinc Portal\",\n    \"SupportEmail\": \"support@example.com\"\n  },\n  \"ConnectionStrings\": {\n    \"Default\": \"Server=localhost;Database=MyDb;Trusted_Connection=True;\"\n  },\n  \"ExternalApis\": {\n    \"Payments\": {\n      \"BaseUrl\": \"https:\/\/api.payments.local\",\n      \"TimeoutSeconds\": 15\n    }\n  },\n  \"FeatureFlags\": {\n    \"EnableNewCheckout\": false\n  },\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft.AspNetCore\": \"Warning\"\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<p>Notice the structure. Group related settings into sections so they stay readable and are easy to bind.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-environment-specific-configuration-with-appsettings-development-json\">Environment-specific configuration with appsettings.Development.json<\/h2>\n\n\n\n<p>Most teams want different settings in development versus production. That is where environment-specific JSON files help.<\/p>\n\n\n\n<p>Create an <code>appsettings.Development.json<\/code> like this:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-746e223ac37dcefee6a2322a9b3a4edb\"><code>{\n  \"ExternalApis\": {\n    \"Payments\": {\n      \"BaseUrl\": \"https:\/\/sandbox.payments.example\"\n    }\n  },\n  \"FeatureFlags\": {\n    \"EnableNewCheckout\": true\n  },\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Debug\"\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<p>Only include what changes. You do not need to duplicate every setting. The configuration system merges sections and applies overrides.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-net-knows-the-environment\">How .NET knows the environment<\/h3>\n\n\n\n<p>ASP.NET Core uses <code>ASPNETCORE_ENVIRONMENT<\/code> (and the generic host uses <code>DOTNET_ENVIRONMENT<\/code>) to decide which environment file to load. Typical values are <code>Development<\/code>, <code>Staging<\/code>, and <code>Production<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-reading-configuration-with-iconfiguration\">Reading configuration with IConfiguration<\/h2>\n\n\n\n<p>For quick access, you can read values directly from <code>IConfiguration<\/code>. This is common in small apps or in glue code where binding might feel heavy.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-3a4309250f8b28134c0c560691ba5ab6\"><code>var builder = WebApplication.CreateBuilder(args);\n\n\/\/ Read a simple value\nvar appName = builder.Configuration&#91;\"App:Name\"];\n\n\/\/ Read an int with a fallback\nvar timeout = builder.Configuration.GetValue&amp;lt;int&amp;gt;(\"ExternalApis:Payments:TimeoutSeconds\", 30);\n<\/code><\/pre>\n\n\n\n<p>The colon syntax (<code>Section:SubSection:Key<\/code>) is how nested JSON is addressed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-preferred-approach-with-strongly-typed-options\">Preferred approach with strongly typed options<\/h2>\n\n\n\n<p>For most production code, binding configuration to a typed class makes your app safer and easier to maintain. You get autocomplete, compile-time checks, and one place to document the meaning of each setting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-1-create-an-options-class\">Step 1 Create an options class<\/h3>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-181bcd69eb998e7caba6de4d4ebf4154\"><code>public class PaymentsApiOptions\n{\n    public const string SectionName = \"ExternalApis:Payments\";\n\n    public string BaseUrl { get; set; } = \"\";\n    public int TimeoutSeconds { get; set; } = 15;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-2-register-it-in-program-cs\">Step 2 Register it in Program.cs<\/h3>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-3a9c765afef13e7bfcf6ca5b59535fc6\"><code>var builder = WebApplication.CreateBuilder(args);\n\nbuilder.Services\n    .AddOptions&amp;lt;PaymentsApiOptions&amp;gt;()\n    .Bind(builder.Configuration.GetSection(PaymentsApiOptions.SectionName))\n    .ValidateDataAnnotations()\n    .Validate(o =&amp;gt; !string.IsNullOrWhiteSpace(o.BaseUrl), \"BaseUrl is required\");\n<\/code><\/pre>\n\n\n\n<p>If you want validation with attributes, add <code>[Required]<\/code> and other annotations to the properties, then keep <code>ValidateDataAnnotations()<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-3-consume-via-ioptions-or-ioptionsmonitor\">Step 3 Consume via IOptions or IOptionsMonitor<\/h3>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-415aafc9cfcfd2b6ef9999736f41c484\"><code>using Microsoft.Extensions.Options;\n\npublic class PaymentsClient\n{\n    private readonly PaymentsApiOptions _options;\n\n    public PaymentsClient(IOptions&amp;lt;PaymentsApiOptions&amp;gt; options)\n    {\n        _options = options.Value;\n    }\n\n    public async Task CallAsync()\n    {\n        \/\/ Use _options.BaseUrl and _options.TimeoutSeconds\n        await Task.CompletedTask;\n    }\n}<\/code><\/pre>\n\n\n\n<p>Use <code>IOptionsMonitor&lt;T&gt;<\/code> if you want to react to configuration changes at runtime (useful in some hosted scenarios). Most line-of-business apps are fine with <code>IOptions&lt;T&gt;<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-connection-strings-and-the-connectionstrings-section\">Connection strings and the ConnectionStrings section<\/h2>\n\n\n\n<p>.NET treats the <code>ConnectionStrings<\/code> section as a first-class convention. You can access it like any other value, or use helpers:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-8a6e2f62ab4b51daddbade98ade8e7e7\"><code>var builder = WebApplication.CreateBuilder(args);\n\nvar connectionString = builder.Configuration.GetConnectionString(\"Default\");\n<\/code><\/pre>\n\n\n\n<p>In production, prefer overriding connection strings using environment variables or a secret store, rather than committing real credentials into JSON files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-overriding-settings-with-environment-variables\">Overriding settings with environment variables<\/h2>\n\n\n\n<p>Environment variables are a common way to configure containers, CI\/CD pipelines, and cloud services. .NET maps nested keys using double underscores.<\/p>\n\n\n\n<p>For example, to override:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ExternalApis:Payments:BaseUrl<\/code><\/li>\n<\/ul>\n\n\n\n<p>Set an environment variable named:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ExternalApis__Payments__BaseUrl<\/code><\/li>\n<\/ul>\n\n\n\n<p>This plays nicely with Kubernetes, Azure App Service configuration, and most deployment tooling.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-secrets-and-what-not-to-put-in-appsettings-json\">Secrets and what not to put in appsettings.json<\/h2>\n\n\n\n<p>A simple rule: if leaking a value would hurt you, do not store it in <code>appsettings.json<\/code> in source control. That includes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Production database passwords<\/li>\n\n\n\n<li>API keys and shared secrets<\/li>\n\n\n\n<li>Client secrets for OAuth apps<\/li>\n<\/ul>\n\n\n\n<p>Better options include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>User Secrets<\/strong> for local development<\/li>\n\n\n\n<li><strong>Environment variables<\/strong> for deployments<\/li>\n\n\n\n<li><strong>Managed secret stores<\/strong> like Azure Key Vault or AWS Secrets Manager<\/li>\n<\/ul>\n\n\n\n<p>The nice part is you do not have to change your code much. You keep reading the same configuration keys, but the values come from a safer provider later in the pipeline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-practical-steps-to-structure-appsettings-json-well\">Practical steps to structure appsettings.json well<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Group by domain<\/strong>. Use sections like <code>ExternalApis<\/code>, <code>Storage<\/code>, <code>Auth<\/code>, <code>FeatureFlags<\/code>.<\/li>\n\n\n\n<li><strong>Keep names consistent<\/strong>. Pick a naming style and stick with it.<\/li>\n\n\n\n<li><strong>Prefer typed options<\/strong> for anything more than a couple of keys.<\/li>\n\n\n\n<li><strong>Use defaults carefully<\/strong>. Defaults are great for developer experience, but dangerous for security-sensitive settings.<\/li>\n\n\n\n<li><strong>Document intent<\/strong>. A short comment is not allowed in strict JSON, so consider documenting settings in code (options class) or in a README.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-common-pitfalls-and-how-to-avoid-them\">Common pitfalls and how to avoid them<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-accidentally-relying-on-the-wrong-environment\">Accidentally relying on the wrong environment<\/h3>\n\n\n\n<p>If <code>ASPNETCORE_ENVIRONMENT<\/code> is not what you think it is, the wrong file loads and values can surprise you. Make environment explicit in your deployment pipeline and verify it in logs at startup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-storing-secrets-in-json\">Storing secrets in JSON<\/h3>\n\n\n\n<p>This is the most frequent mistake. If you need local convenience, use user secrets. If you need production safety, use environment variables or a secret manager.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-iconfiguration-everywhere\">Using IConfiguration everywhere<\/h3>\n\n\n\n<p>It works, but it spreads configuration knowledge throughout your code. Typed options centralise it, make it testable, and reduce runtime errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-overly-flat-configuration\">Overly flat configuration<\/h3>\n\n\n\n<p>A long list of top-level keys gets messy quickly. Nest settings into sections that match how your system is organised.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a-simple-checklist-for-your-next-net-project\">A simple checklist for your next .NET project<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a clean base <code>appsettings.json<\/code> with sensible defaults and no secrets.<\/li>\n\n\n\n<li>Add <code>appsettings.Development.json<\/code> for local overrides.<\/li>\n\n\n\n<li>Use environment variables or a secret store for production secrets.<\/li>\n\n\n\n<li>Bind important sections to typed options classes.<\/li>\n\n\n\n<li>Add validation so the app fails fast when configuration is missing or invalid.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-wrap-up\">Wrap up<\/h2>\n\n\n\n<p><code>appsettings.json<\/code> is more than a convenient file in your project. It is the front door to the .NET configuration pipeline, designed to keep your code clean, your deployments flexible, and your environment differences manageable. With a solid structure, typed options, and safe overrides for secrets, you get configuration that supports growth rather than slowing it down.<\/p>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links yoast-seo-related-links\">\n<li><a href=\"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/07\/22\/understanding-appsettings-json-in-net-and-c\/\">Understanding &#8216;appsettings.json&#8217; in .NET and C#<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudproinc.com.au\/index.php\/2024\/03\/28\/setting-google-chrome-as-the-default-browser-with-microsoft-intune\/\">Setting Google Chrome as the Default Browser with Microsoft Intune<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/22\/securing-streamlit-environment-vars-with-toml\/\">Securing Streamlit Environment Vars with TOML<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/08\/read-json-files-from-azure-app-configuration\/\">Read JSON Files from Azure App Configuration<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2025\/09\/14\/mastering-docker-environment-variables-with-docker\/\">Mastering Docker environment variables with Docker<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Learn how .NET appsettings.json works, how to structure it well, and how to load environment-specific settings safely. Includes practical code examples and common pitfalls to avoid.<\/p>\n","protected":false},"author":1,"featured_media":56854,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"How to Use .NET appsettings.json","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[27,13],"tags":[],"class_list":["post-56853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use .NET appsettings.json - CPI Consulting<\/title>\n<meta name=\"description\" content=\"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use .NET appsettings.json\" \/>\n<meta property=\"og:description\" content=\"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/\" \/>\n<meta property=\"og:site_name\" content=\"CPI Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-22T05:17:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-22T05:17:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudproinc.azurewebsites.net\/wp-content\/uploads\/2025\/12\/post-2-1024x585.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"585\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CPI Staff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CPI Staff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/\"},\"author\":{\"name\":\"CPI Staff\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\"},\"headline\":\"How to Use .NET appsettings.json\",\"datePublished\":\"2025-12-22T05:17:08+00:00\",\"dateModified\":\"2025-12-22T05:17:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/\"},\"wordCount\":1139,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/post-2.png\",\"articleSection\":[\".NET\",\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/\",\"name\":\"How to Use .NET appsettings.json - CPI Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/post-2.png\",\"datePublished\":\"2025-12-22T05:17:08+00:00\",\"dateModified\":\"2025-12-22T05:17:13+00:00\",\"description\":\"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#primaryimage\",\"url\":\"\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/post-2.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/post-2.png\",\"width\":1792,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/12\\\/22\\\/how-to-use-net-appsettings-json\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use .NET appsettings.json\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#website\",\"url\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\",\"name\":\"Cloud Pro Inc - CPI Consulting Pty Ltd\",\"description\":\"Cloud, AI &amp; Cybersecurity Consulting | Melbourne\",\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\",\"name\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\",\"url\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"width\":500,\"height\":500,\"caption\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\",\"name\":\"CPI Staff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"caption\":\"CPI Staff\"},\"sameAs\":[\"http:\\\/\\\/www.cloudproinc.com.au\"],\"url\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/index.php\\\/author\\\/cpiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use .NET appsettings.json - CPI Consulting","description":"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/","og_locale":"en_US","og_type":"article","og_title":"How to Use .NET appsettings.json","og_description":"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.","og_url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/","og_site_name":"CPI Consulting","article_published_time":"2025-12-22T05:17:08+00:00","article_modified_time":"2025-12-22T05:17:13+00:00","og_image":[{"width":1024,"height":585,"url":"https:\/\/cloudproinc.azurewebsites.net\/wp-content\/uploads\/2025\/12\/post-2-1024x585.png","type":"image\/png"}],"author":"CPI Staff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CPI Staff","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#article","isPartOf":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/"},"author":{"name":"CPI Staff","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e"},"headline":"How to Use .NET appsettings.json","datePublished":"2025-12-22T05:17:08+00:00","dateModified":"2025-12-22T05:17:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/"},"wordCount":1139,"commentCount":0,"publisher":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/post-2.png","articleSection":[".NET","Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/","url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/","name":"How to Use .NET appsettings.json - CPI Consulting","isPartOf":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/post-2.png","datePublished":"2025-12-22T05:17:08+00:00","dateModified":"2025-12-22T05:17:13+00:00","description":"Learn how to use .NET appsettings.json for clean configuration management in your applications and improve your development process.","breadcrumb":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#primaryimage","url":"\/wp-content\/uploads\/2025\/12\/post-2.png","contentUrl":"\/wp-content\/uploads\/2025\/12\/post-2.png","width":1792,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/12\/22\/how-to-use-net-appsettings-json\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudproinc.azurewebsites.net\/"},{"@type":"ListItem","position":2,"name":"How to Use .NET appsettings.json"}]},{"@type":"WebSite","@id":"https:\/\/cloudproinc.azurewebsites.net\/#website","url":"https:\/\/cloudproinc.azurewebsites.net\/","name":"Cloud Pro Inc - CPI Consulting Pty Ltd","description":"Cloud, AI &amp; Cybersecurity Consulting | Melbourne","publisher":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudproinc.azurewebsites.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization","name":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd","url":"https:\/\/cloudproinc.azurewebsites.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","width":500,"height":500,"caption":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd"},"image":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e","name":"CPI Staff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","caption":"CPI Staff"},"sameAs":["http:\/\/www.cloudproinc.com.au"],"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/author\/cpiadmin\/"}]}},"jetpack_featured_media_url":"\/wp-content\/uploads\/2025\/12\/post-2.png","jetpack-related-posts":[{"id":409,"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/07\/22\/understanding-appsettings-json-in-net-and-c\/","url_meta":{"origin":56853,"position":0},"title":"Understanding &#8216;appsettings.json&#8217; in .NET and C#","author":"CPI Staff","date":"July 22, 2024","format":false,"excerpt":"This Microsoft .NET article will explain what appsettings.json is in .NET and C# and how to use it. The 'appsettings.json' file allows us to manage an application configuration securely and efficiently and easily transition between development and production. Understanding 'appsettings.json' in .NET and C# First introduced in ASP.NET and later\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/Understanding-appsettings.json-in-.NET-and-C.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/Understanding-appsettings.json-in-.NET-and-C.webp 1x, \/wp-content\/uploads\/2024\/07\/Understanding-appsettings.json-in-.NET-and-C.webp 1.5x, \/wp-content\/uploads\/2024\/07\/Understanding-appsettings.json-in-.NET-and-C.webp 2x"},"classes":[]},{"id":652,"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/09\/10\/how-to-translate-text-using-azure-ai-translator-and-net\/","url_meta":{"origin":56853,"position":1},"title":"How to Translate Text Using Azure AI Translator and .NET","author":"CPI Staff","date":"September 10, 2024","format":false,"excerpt":"Following our previous post about Azure AI Translator, this post will show how to translate text between a source and target language using C#. About Azure AI Translator Microsoft Azure AI Translator offers translation services like language detection and translation for over 90 languages using a single API endpoint. The\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/09\/Translate-Text-With-Azure-AI-Translator.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/09\/Translate-Text-With-Azure-AI-Translator.webp 1x, \/wp-content\/uploads\/2024\/09\/Translate-Text-With-Azure-AI-Translator.webp 1.5x, \/wp-content\/uploads\/2024\/09\/Translate-Text-With-Azure-AI-Translator.webp 2x"},"classes":[]},{"id":414,"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/07\/22\/generate-an-image-caption-with-azure-ai-vision-and-net\/","url_meta":{"origin":56853,"position":2},"title":"Generate an Image Caption With Azure AI Vision and .NET","author":"CPI Staff","date":"July 22, 2024","format":false,"excerpt":"This Azure AI Vision article will show how to generate an image caption with Azure AI Vision and .NET C# application. Azure AI Vision is a Microsoft Azure service that is part of the Azure AI Services suite of cloud services, which also includes speech services and the popular Azure\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/Generate-an-Image-Caption-With-Azure-AI-Vision-and-.NET_.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/Generate-an-Image-Caption-With-Azure-AI-Vision-and-.NET_.webp 1x, \/wp-content\/uploads\/2024\/07\/Generate-an-Image-Caption-With-Azure-AI-Vision-and-.NET_.webp 1.5x, \/wp-content\/uploads\/2024\/07\/Generate-an-Image-Caption-With-Azure-AI-Vision-and-.NET_.webp 2x"},"classes":[]},{"id":459,"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/07\/29\/reading-handwriting-with-azure-ai-vision-and-net-c\/","url_meta":{"origin":56853,"position":3},"title":"Reading Handwriting with Azure AI Vision and .NET C#","author":"CPI Staff","date":"July 29, 2024","format":false,"excerpt":"This Azure AI Vision article will show you how to create a .NET app that reads handwritten text using Azure AI Vision. Microsoft Azure AI Services offers several AI services that can help streamline business processes or create in-house applications that can replace SaaS apps. Azure AI Vision allows us\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/Reading-Handwriting-with-Azure-AI-Vision-and-.NET-C.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/Reading-Handwriting-with-Azure-AI-Vision-and-.NET-C.webp 1x, \/wp-content\/uploads\/2024\/07\/Reading-Handwriting-with-Azure-AI-Vision-and-.NET-C.webp 1.5x, \/wp-content\/uploads\/2024\/07\/Reading-Handwriting-with-Azure-AI-Vision-and-.NET-C.webp 2x"},"classes":[]},{"id":390,"url":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/2024\/07\/21\/integrating-azure-ai-vision-for-image-analysis-in-c-applications\/","url_meta":{"origin":56853,"position":4},"title":"Integrating Azure AI Vision for Image Analysis in C# Applications","author":"CPI Staff","date":"July 21, 2024","format":false,"excerpt":"This Azure AI Services article will show how to integrate Azure AI Vision for image analysis in C# applications using .NET. Azure AI Services offers access to many AI services, including the popular Azure OpenAI service. Today, we will focus on Azure AI Vision, which offers AI capabilities when working\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/Integrating-Azure-AI-Vision-for-Image-Analysis-in-C-Applications.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/Integrating-Azure-AI-Vision-for-Image-Analysis-in-C-Applications.webp 1x, \/wp-content\/uploads\/2024\/07\/Integrating-Azure-AI-Vision-for-Image-Analysis-in-C-Applications.webp 1.5x, \/wp-content\/uploads\/2024\/07\/Integrating-Azure-AI-Vision-for-Image-Analysis-in-C-Applications.webp 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/56853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/comments?post=56853"}],"version-history":[{"count":2,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/56853\/revisions"}],"predecessor-version":[{"id":56856,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/56853\/revisions\/56856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/media\/56854"}],"wp:attachment":[{"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/media?parent=56853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/categories?post=56853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudproinc.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/tags?post=56853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}