-
-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c19d866
commit 0b83a3e
Showing
2 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
|
||
namespace Audit.IntegrationTest | ||
{ | ||
public static class AzureSettings | ||
{ | ||
public static string AzureBlobServiceUrl => GetFromEnv("AZUREBLOBSERVICEURL"); | ||
public static string AzureBlobAccountName => GetFromEnv("AZUREBLOBACCOUNTNAME"); | ||
public static string AzureBlobAccountKey => GetFromEnv("AZUREBLOBACCOUNTKEY"); | ||
public static string AzureBlobCnnString => GetFromEnv("AZUREBLOBCNNSTRING"); | ||
public static string AzureTableCnnString => GetFromEnv("AZURETABLECNNSTRING"); | ||
public static string AzureDocDbUrl => GetFromEnv("AZUREDOCDBURL"); | ||
public static string AzureDocDbAuthKey => GetFromEnv("AZUREDOCDBAUTHKEY"); | ||
public static string BlobAccountName => GetFromEnv("BLOBACCOUNTNAME"); | ||
public static string BlobTenantId => GetFromEnv("BLOBTENANTID"); | ||
public static string ElasticSearchUrl => "http://127.0.0.1:9200"; | ||
public static string PostgreSqlConnectionString => "Server=localhost;Port=5432;User Id=postgres;Password=admin;Database=postgres;"; | ||
|
||
private static string GetFromEnv(string key, string @default = null) | ||
{ | ||
var varName = "AUDIT_NET_" + key.ToUpper(); | ||
var value = Environment.GetEnvironmentVariable(varName) ?? @default ?? throw new Exception($"No environment variable or default set for variable '{key}'"); | ||
return value; | ||
} | ||
} | ||
} |