logo
down
shadow

Where to store Settings from local.settings.json for proddeployment?


Where to store Settings from local.settings.json for proddeployment?

By : user2185233
Date : November 21 2020, 04:01 AM
With these it helps You can put your self-defined settings in whatever files you need, and read them using ConfigurationBuilder as you have done. Put custom settings file let's say appsettings.json under function project and set it to be copied to output/publish directory(Copy if newer), in this way it can be deployed by VS publish.
code :


Share : facebook icon twitter icon
When is the Documents and Settings\USER\Local Settings\Temp folder cleared?

When is the Documents and Settings\USER\Local Settings\Temp folder cleared?


By : fragglechen
Date : March 29 2020, 07:55 AM
Does that help It gets cleared whenever the computer gets "cleaned up". This could be done a number of ways: manually by a user, through the Disk Cleanup tool, etc.
Error: Could not import settings 'app' (Is it on sys.path?): No module named settings on Local

Error: Could not import settings 'app' (Is it on sys.path?): No module named settings on Local


By : user3774716
Date : March 29 2020, 07:55 AM
This might help you I copied the project folder to another directory, deleted .DStore as well, and copied the folder back, and it works now
Django ImportError: Could not import settings 'mysite.settings.local' (Is it on sys.path?): No module named settings.loc

Django ImportError: Could not import settings 'mysite.settings.local' (Is it on sys.path?): No module named settings.loc


By : Arkaprava
Date : March 29 2020, 07:55 AM
like below fixes the issue I'm setting up a site in django with multiple settings files as recommended in 2 scoops of django where settings.py is replaced with a settings directory that contains multiple settings files (local.py, etc.). My development server will run fine when I leave settings.py in the default location, but when I move it into the new settings directory I created and run the development server with: , try touch __init__.py in your settings directory
Why is more secure to store sensitive settings in instance settings instead config settings in Flask?

Why is more secure to store sensitive settings in instance settings instead config settings in Flask?


By : Sander
Date : March 29 2020, 07:55 AM
To fix the issue you can do As @davidism suggested, Config files are never meant to be tracked since these are your secret keys and anybody with access to your code will have access to your keys if tracked.
But, there is no hard and fast rule in Flask to keep your settings file in a specific location. You can keep them anywhere and name them anything. But, when adding the config to the app, the correct file path must be given.
Read custom settings from local.settings.json in Azure functions

Read custom settings from local.settings.json in Azure functions


By : Dora Crow
Date : March 29 2020, 07:55 AM
may help you . @Kirk and @Slava have helped you get rid of confusion. Just add some details for you to refer.
By default, publication neither upload local.settings.json to Azure, nor makes modification on Application settings based on that local file, hence we need to update them manually on Azure portal. We can also do that on VS publish panel.(Create profile first if we need to change settings before publish.)
code :
// Get Application settings
var appParameter= "AzureWebJobsStorage";
System.Environment.GetEnvironmentVariable($"{appParameter}");

// Get Connection strings(put local and Azure env together)
var connParameter= "MySqlAzureConnection";
var Prefix = "SQLAZURECONNSTR_";
var connectionString = System.Environment.GetEnvironmentVariable($"ConnectionStrings:{connParameter}");
if(string.IsNullOrEmpty(connectionString )){
   connectionString = System.Environment.GetEnvironmentVariable($"{Prefix}{connParameter}");
}
[FunctionName("FunctionName")]
public static void Run(...,ExecutionContext context)
{
   //"Values" and "Connection" sections are injected into EnvironmentVariables automatically hence we don't need to load Json file again. 
   //Hence SetBasePath and AddJsonFile are only necessary if you have some custom settings(e.g. nested Json rather than key-value pairs) outside those two sections. It's recommended to put those setting to another file if we need to publish them.
   //Note that Function binding settings(e.g. Storage Connection String) must be EnvironmentVariables, i.e. must be stored in "Values" section.
    var config = new ConfigurationBuilder()
        .SetBasePath(context.FunctionAppDirectory)
        .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
        .AddEnvironmentVariables()
        .Build();

    // Get Application Settings
    var appParameter= "AzureWebJobsStorage";
    string appsetting = config[$"{appParameter}"];

    // Get Connection strings
    var connParameter= "MySqlAzureConnection";
    string connectionString = config.GetConnectionString($"{connParameter}");
}
Related Posts Related Posts :
  • self signed certificate for azure ad registered applications
  • Azure & Powershell: Get-AzureRmDeletedWebApp throws weird error
  • is a pod DNS can be reached (with dig or nslookup)?
  • Azure-storage-blob - What is the destination server domain name
  • Can I validate an azure-pipelines.yml file via CLI?
  • How export full result Databricks Azure
  • Azure AKS Client Secret expired - How to change?
  • Azure Function App HTTP Trigger CosmosDB input query from the request's body
  • Azure Powershell - Can find package but not install it
  • Azure AD Jwt token validation no internet
  • How to run powershell script in azure functions in schedule
  • Azure API management POST request - All body parameters required
  • Checking the version of Databricks Runtime in Azure
  • How do I find the network interface ID associated with an Azure VM
  • Strategies to prevent duplicate data in Azure SQL Data Warehouse
  • What parts of ASP.NET does Azure Functions use?
  • npm ERR! 404 Not Found: har-validator@5.1.2
  • Azure DataLake (ADLS) BulkDownload Bad Request
  • Using division operator in app insight analytics
  • How do I get all alerts from azure monitor via JAVA
  • Azure Search Lucene Query Incorrect Result
  • Azure functions & HTTP OPTIONS request
  • Azure Stream Analytics Tool for Visual Studio in 2019 preview
  • Creating azure application gateway with azure cli
  • Connection String to an Azure Cloud Storage Account
  • What is standard encoding for ServiceConfiguration.cscfg file in Windows Azure?
  • Is Multiple Active Result Sets (MARS) supported on Azure SQL Database?
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org