forked from dotnet/SqlClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cs
69 lines (66 loc) · 2.88 KB
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using Newtonsoft.Json;
namespace Microsoft.Data.SqlClient.TestUtilities
{
public class Config
{
public string TCPConnectionString = null;
public string NPConnectionString = null;
public string TCPConnectionStringHGSVBS = null;
public string TCPConnectionStringAASVBS = null;
public string TCPConnectionStringNoneVBS = null;
public string TCPConnectionStringAASSGX = null;
public string AADAuthorityURL = null;
public string AADPasswordConnectionString = null;
public string AADServicePrincipalId = null;
public string AADServicePrincipalSecret = null;
public string AzureKeyVaultURL = null;
public string AzureKeyVaultTenantId = null;
public string AzureKeyVaultClientId = null;
public string AzureKeyVaultClientSecret = null;
public string LocalDbAppName = null;
public string LocalDbSharedInstanceName = null;
public bool EnclaveEnabled = false;
public bool TracingEnabled = false;
public bool SupportsIntegratedSecurity = false;
public bool ManagedIdentitySupported = true;
public string FileStreamDirectory = null;
public bool UseManagedSNIOnWindows = false;
public string DNSCachingConnString = null;
public string DNSCachingServerCR = null; // this is for the control ring
public string DNSCachingServerTR = null; // this is for the tenant ring
public bool IsAzureSynapse = false; // True for Azure Data Warehouse/Synapse
public bool IsDNSCachingSupportedCR = false; // this is for the control ring
public bool IsDNSCachingSupportedTR = false; // this is for the tenant ring
public string EnclaveAzureDatabaseConnString = null;
public string UserManagedIdentityClientId = null;
public string PowerShellPath = null;
public string KerberosDomainPassword = null;
public string KerberosDomainUser = null;
public bool IsManagedInstance = false;
public string AliasName = null;
public static Config Load(string configPath = @"config.json")
{
try
{
using (StreamReader r = new StreamReader(configPath))
{
return JsonConvert.DeserializeObject<Config>(r.ReadToEnd());
}
}
catch
{
throw;
}
}
public static void UpdateConfig(Config updatedConfig, string configPath = @"config.json")
{
string config = JsonConvert.SerializeObject(updatedConfig);
File.WriteAllText(configPath, config);
}
}
}