File tree Expand file tree Collapse file tree 2 files changed +25
-19
lines changed
Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 2727 - name : dotnet publish
2828 run : dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
2929
30+ - name : nstall dotnet ef
31+ run : dotnet tool install -g dotnet-ef --version 8.*
32+
33+ - name : Create migration bundle
34+ run : dotnet ef migrations bundle --runtime linux-x64 -o ${{env.DOTNET_ROOT}}/myapp/migrationsbundle
35+
3036 - name : Upload artifact for deployment job
3137 uses : actions/upload-artifact@v4
3238 with :
@@ -39,21 +45,21 @@ jobs:
3945 environment :
4046 name : ' Production'
4147 url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
42- permissions :
43- id-token : write # This is required for requesting the JWT
48+ permissions :
49+ id-token : write # This is required for requesting the JWT
4450
4551 steps :
4652 - name : Download artifact from build job
4753 uses : actions/download-artifact@v4
4854 with :
4955 name : .net-app
50-
51- - name : Login to Azure
52- uses : azure/login@v2
53- with :
54- client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_319DDE8D9F4B4C74A9AB966B051D210E }}
55- tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_AF081E3B8DC54CBAB41CE97FFE6A6307 }}
56- subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_01AC867E738A4C3DBBC0E2E51A4BF863 }}
56+
57+ - name : Login to Azure
58+ uses : azure/login@v2
59+ with :
60+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_319DDE8D9F4B4C74A9AB966B051D210E }}
61+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_AF081E3B8DC54CBAB41CE97FFE6A6307 }}
62+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_01AC867E738A4C3DBBC0E2E51A4BF863 }}
5763
5864 - name : Deploy to Azure Web App
5965 id : deploy-to-webapp
Original file line number Diff line number Diff line change 99 options . UseSqlServer ( builder . Configuration . GetConnectionString ( "MyDbConnection" ) ) ) ;
1010 builder . Services . AddDistributedMemoryCache ( ) ;
1111}
12- // else
13- // {
14- // builder.Services.AddDbContext<MyDatabaseContext>(options =>
15- // options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING")));
16- // builder.Services.AddStackExchangeRedisCache(options =>
17- // {
18- // options.Configuration = builder.Configuration["AZURE_REDIS_CONNECTIONSTRING"];
19- // options.InstanceName = "SampleInstance";
20- // });
21- // }
12+ else
13+ {
14+ builder . Services . AddDbContext < MyDatabaseContext > ( options =>
15+ options . UseSqlServer ( builder . Configuration . GetConnectionString ( "AZURE_SQL_CONNECTIONSTRING" ) ) ) ;
16+ builder . Services . AddStackExchangeRedisCache ( options =>
17+ {
18+ options . Configuration = builder . Configuration [ "AZURE_REDIS_CONNECTIONSTRING" ] ;
19+ options . InstanceName = "SampleInstance" ;
20+ } ) ;
21+ }
2222
2323// Add services to the container.
2424builder . Services . AddControllersWithViews ( ) ;
You can’t perform that action at this time.
0 commit comments