File tree Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 1
1
# # Ignore Visual Studio temporary files, build results, and
2
2
# # files generated by popular Visual Studio add-ons.
3
3
4
- # Azure keys
5
- AzureSettings.cs
6
-
7
4
# User-specific files
8
5
* .suo
9
6
* .user
@@ -261,14 +258,6 @@ paket-files/
261
258
# Python Tools for Visual Studio (PTVS)
262
259
__pycache__ /
263
260
* .pyc
264
- /AuditFw.pptx
265
- /AuditFw.pptx
266
- /AuditFw.pptx
267
261
268
262
Docs /
269
- /src /Newtonsoft.Json.dll
270
- /src /UpgradeVersion.exe
271
- /src /StrongName /Audit.NET.snk
272
- /test /Audit.TestRunnerFull
273
- /test /Audit.Integration.AspNet
274
- /test /Audit.Integration.AspNet.Runner
263
+ /src /StrongName /Audit.NET.snk
Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ namespace Audit . IntegrationTest
4
+ {
5
+ public static class AzureSettings
6
+ {
7
+ public static string AzureBlobServiceUrl => GetFromEnv ( "AZUREBLOBSERVICEURL" ) ;
8
+ public static string AzureBlobAccountName => GetFromEnv ( "AZUREBLOBACCOUNTNAME" ) ;
9
+ public static string AzureBlobAccountKey => GetFromEnv ( "AZUREBLOBACCOUNTKEY" ) ;
10
+ public static string AzureBlobCnnString => GetFromEnv ( "AZUREBLOBCNNSTRING" ) ;
11
+ public static string AzureTableCnnString => GetFromEnv ( "AZURETABLECNNSTRING" ) ;
12
+ public static string AzureDocDbUrl => GetFromEnv ( "AZUREDOCDBURL" ) ;
13
+ public static string AzureDocDbAuthKey => GetFromEnv ( "AZUREDOCDBAUTHKEY" ) ;
14
+ public static string BlobAccountName => GetFromEnv ( "BLOBACCOUNTNAME" ) ;
15
+ public static string BlobTenantId => GetFromEnv ( "BLOBTENANTID" ) ;
16
+ public static string ElasticSearchUrl => "http://127.0.0.1:9200" ;
17
+ public static string PostgreSqlConnectionString => "Server=localhost;Port=5432;User Id=postgres;Password=admin;Database=postgres;" ;
18
+
19
+ private static string GetFromEnv ( string key , string @default = null )
20
+ {
21
+ var varName = "AUDIT_NET_" + key . ToUpper ( ) ;
22
+ var value = Environment . GetEnvironmentVariable ( varName ) ?? @default ?? throw new Exception ( $ "No environment variable or default set for variable '{ key } '") ;
23
+ return value ;
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments