1,151 questions
3
votes
1
answer
106
views
IConfiguration Bind doesn't work with arrays
I have to set a string array in the configuration when starting an ASP.NET Core web application. I get the string array from Azure Key Vault, and it works fine. It's only included in the code below ...
0
votes
1
answer
166
views
Values are coming as null from appsettings.json , but configuration values like connection string are working fine
I'm working on an ASP.NET Core Web API project that used to work fine with IOptions<ApplicationSettings> to bind values from appsettings.json.
But suddenly, appSettings.Value is returning null, ...
0
votes
0
answers
37
views
Using Dev instance Minio url
1. ObjectStorageFramework Extension:
using ASobjectstorage.Interface;
using ASobjectstorage.Models;
using ASobjectstorage.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions....
0
votes
2
answers
173
views
Migrating from .NET Framework to .NET 9.0, How to access ConnectionStrings from a static class? (web.config vs appsettings.json)
I am in the process of migrating a large solution from .NET Framework 4.8 to .NET 9.0. I used .NET Upgrade Assistant to get started. I have a long way to go.
All of the projects in the solution have ...
0
votes
1
answer
84
views
How to get nested appSettings value(s) strongly typed?
I have this configuration in an ASP.NET Core MVC app:
"CustomSite": {
"Management": {
"Confined": {
"DefaultUILanguage": "en-GB&...
-1
votes
1
answer
79
views
How to get the sasl.username & sasl.password in Dockerized ,net core application
i have a .net core application that uses event hub to consume & produce messages. it uses azure event hub & i configured sasl.username as "$ConnectionString" & sasl.password as &...
-1
votes
1
answer
338
views
Azure function app with SQL Trigger not working after deployment
I have an Azure Function app created locally using Python code, SQL Server change tracking that tracks any operation and triggers the SQL Server trigger for further process.
app = func.FunctionApp() ...
0
votes
1
answer
68
views
Can't load options from appsettings in ASP.NET Core site using IOptions
I'm trying to load data from my appsettings file in an ASP.NET Core project. I've done it before, but now I can't get it to work.
Furthermore, I'm trying to configure a section names Images and bind ...
0
votes
0
answers
60
views
GitLab CI/CD variables in appsettings.json for .NET Projects
Is there a simple way to simulate Azure DevOps Replace Token task in GitLab CI/CD?
I have the following secret (with many others) in appsettings.Testing.json that I need to replace in deploy stage:
&...
0
votes
0
answers
20
views
How to add a collection element in appsettings.production.json without overwriting the collection from appsettings.json
I want to add a collection element to application configuration for certain environments like production or development, without overwriting already present collection elements added earlier through ...
2
votes
1
answer
65
views
How to use appsettings.json in program.cs without warning "ASP0000 Calling 'BuildServiceProvider' from application code results in an copy ..."
I am building a .net minimal api with a lot of settings defined via appsettings.json.
But how to use this setting classes in program.cs without the compiler generating the warning:
ASP0000 Calling '...
0
votes
0
answers
66
views
.NET Core Appsettings get wrong values
I have appsettings storing different blob storage config. However, API occasionally will retrieve wrong blob storage config although it set to read the correct config.
Here's my code - Startup.cs:
...
0
votes
0
answers
104
views
A good and simple way to set the connection string depending on whether we are testing the application or pushing it to production
I was tasked with upgrading the application version from .net core 2.0 to .net 8, since I'm doing it for the first time, I had to fix the code a bit. I noticed that in my company the connection string ...
0
votes
2
answers
81
views
How to access appsettings param inside .html file
In my .NET 6.0 / C# project, I have variable defined as
{
"Address": {
"AddressLine1": "220 E. Yut Drive Suite 20",
"AddressLine2": "...
-1
votes
1
answer
83
views
Can i "outsource" the NLog-portion of appsettings.json?
I have a bunch of different appsettings.json for a number of customers. However, the nLog-portion of these appsettings never changes, so I'd love to have one single json-File for the nLog-config.
So I ...
0
votes
1
answer
51
views
How to read development settings when running in-memory test server?
I have an ASP.NET Core 8 Web API project which contains the following setting files:
appsettings.json
appsettings.Local.json
Following the instructions here, I also have a test project to run an in-...
0
votes
0
answers
297
views
Kestrel not using default certificate from appsettings.json
I've been using the default certificate from appSettings.json in a bunch of ASP.NET Core applications without any issues.
"Kestrel": {
"Certificates": {
"Default": {...
0
votes
0
answers
155
views
Variable substitution in appsettings.json Not Working
I have a GitHub Actions workflow where I'm trying to substitute a connection string in the appsettings.json file before deploying to Kubernetes. However, the substitution step doesn't seem to be ...
0
votes
1
answer
76
views
Need to exclude checksiteNode parameter specified in the appsettings.json while releasing in the azure devops
We have a DTAP (DEv, Test, Acc and Prod) environments, and when we do a release in the env's for node specific. (In Acc and PROD I have 3 nodes), while trying to create a release in Azure DevOps,the ...
0
votes
1
answer
487
views
Azure Function App .Net 8 version not able to bind the ServiceBusTrigger connection string value from appsettings.json
I have my servicebustrigger connection string in the appsettings.json file. function app 8 version can't able to bind the value.
Here is appsettings.json file
approach 1:
`{
"keyVault": &...
0
votes
1
answer
43
views
Programmatically specify a value within appsettings.json
I am trying to set up a logging system that adds log files to subfolders based on the year. However I've been unable to programmatically specify the year. I can hardcode it and it works fine, but I ...
0
votes
2
answers
484
views
In YAML is it possible to supply a template json file for appsettings
I am adding some appsettings for a function app in YAML:
steps:
- download: current
displayName: Download app artifact
artifact: app
- task: AzureAppServiceSettings@1
displayName: Azure App ...
0
votes
2
answers
284
views
How to fetch a key from appsettings.json to JavaScript page in .Net8
I wanted to fetch a key from appsettings.json file to javascript code in .net 8 MVC project.
i have added the key in appsetting.json in the below manner.
appsettings.json
{
"RequestCountlimit&...
2
votes
1
answer
230
views
Reading variables from app settings another time in Azure Function App
I have a function app, the app settings has several different PATs
One of the function is an HTTP trigger, the request body will contain a specific name
and that name should be used to retrieve the ...
0
votes
1
answer
660
views
How to access connection string with python
I have this local.settings.json in my local Azure function (Timer trigger)
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"...