File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 27
27
<PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 3.1.4" />
28
28
<PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 3.1.4" />
29
29
<PackageReference Include =" Microsoft.EntityFrameworkCore.Design" Version =" 3.1.4" />
30
+ <PackageReference Include =" Microsoft.Azure.Services.AppAuthentication" Version =" 1.4.0" />
30
31
<!-- <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> -->
31
32
<PackageReference Include =" Swashbuckle.AspNetCore" Version =" 5.4.1" />
32
33
</ItemGroup >
Original file line number Diff line number Diff line change 2
2
namespace ClaimsApi . Models {
3
3
public class ClaimsContext : DbContext {
4
4
public ClaimsContext ( DbContextOptions < ClaimsContext > options ) : base ( options ) {
5
+ var conn = ( Microsoft . Data . SqlClient . SqlConnection ) Database . GetDbConnection ( ) ;
6
+ conn . AccessToken = ( new Microsoft . Azure . Services . AppAuthentication . AzureServiceTokenProvider ( ) ) . GetAccessTokenAsync ( "https://database.windows.net/" ) . Result ;
5
7
6
8
}
7
9
public DbSet < ClaimItem > ClaimItems { get ; set ; }
@@ -62,4 +64,4 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) {
62
64
. HasDefaultValueSql ( "NEXT VALUE FOR ServiceLineNumbers" ) ;
63
65
}
64
66
}
65
- }
67
+ }
Original file line number Diff line number Diff line change 8
8
},
9
9
"AllowedHosts" : " *" ,
10
10
"ConnectionStrings" : {
11
- "SqlServerDb" : " Server=tcp:#{SQL_SRV_PREFIX}# .database.windows.net;Initial Catalog=ClaimsDB;Persist Security Info=False;User ID=#{SQL_USER_ID}#;Password=#{SQL_USER_PWD}#;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30 ;"
11
+ "SqlServerDb" : " Server=tcp:graksdb .database.windows.net,1433;Database=grakslab ;"
12
12
},
13
13
"ApplicationInsights" : {
14
14
"InstrumentationKey" : " <Instrumentation Key>"
You can’t perform that action at this time.
0 commit comments