From e777c26aecc4b6139d07b83c4b6b91af01c88bd6 Mon Sep 17 00:00:00 2001 From: Maks <118552281+6PateL@users.noreply.github.com> Date: Sun, 22 Mar 2026 17:05:51 +0100 Subject: [PATCH 01/23] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_webappanddatabase.yml | 65 ++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/main_webappanddatabase.yml diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml new file mode 100644 index 000000000..b20878516 --- /dev/null +++ b/.github/workflows/main_webappanddatabase.yml @@ -0,0 +1,65 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - WebAppAndDataBase + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: .net-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_89CFBC7CEF5C48B79F096F5064C3FFA9 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C3BFFBAC3F714D3FBC3D5BA2AAC8CA9C }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5377BFFE15094A6CBF13D916949A3EC1 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'WebAppAndDataBase' + slot-name: 'Production' + package: . + \ No newline at end of file From c3118bd0ea1e5cdade7f74244ee1a82a9d10a887 Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 17:20:50 +0100 Subject: [PATCH 02/23] update --- .github/workflows/main_webappanddatabase.yml | 34 +++++++++++++------- Program.cs | 21 ++++-------- appsettings.json | 6 ++-- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index b20878516..22fc83363 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -29,6 +29,17 @@ jobs: - name: dotnet publish run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + # --- ² EF CORE --- + + - name: Install EF Core Tool + run: dotnet tool install -g dotnet-ef --version 7.0.14 + + - name: Create migration bundle + run: | + dotnet ef migrations bundle --runtime linux-x64 -p DotNetCoreSqlDb/DotNetCoreSqlDb.csproj -o ${{env.DOTNET_ROOT}}/myapp/migrate + + # ------------------------------ + - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 with: @@ -38,22 +49,22 @@ jobs: deploy: runs-on: ubuntu-latest needs: build - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: name: .net-app - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_89CFBC7CEF5C48B79F096F5064C3FFA9 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C3BFFBAC3F714D3FBC3D5BA2AAC8CA9C }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5377BFFE15094A6CBF13D916949A3EC1 }} + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E3558020DD4E4B8D86D01B916D58C3E3 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9C8D5E1C904D4CEE827FF14C612D75FF }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6D0468AC944441EEB46F077AFA62AF25 }} - name: Deploy to Azure Web App id: deploy-to-webapp @@ -61,5 +72,4 @@ jobs: with: app-name: 'WebAppAndDataBase' slot-name: 'Production' - package: . - \ No newline at end of file + package: . \ No newline at end of file diff --git a/Program.cs b/Program.cs index cd5e3cea8..a45a002e0 100644 --- a/Program.cs +++ b/Program.cs @@ -2,23 +2,14 @@ using DotNetCoreSqlDb.Data; var builder = WebApplication.CreateBuilder(args); -// Add database context and cache -if(builder.Environment.IsDevelopment()) +builder.Services.AddDbContext(options => + options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"))); +builder.Services.AddStackExchangeRedisCache(options => { - builder.Services.AddDbContext(options => - options.UseSqlServer(builder.Configuration.GetConnectionString("MyDbConnection"))); - builder.Services.AddDistributedMemoryCache(); -} -else -{ - builder.Services.AddDbContext(options => - options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"))); - builder.Services.AddStackExchangeRedisCache(options => - { - options.Configuration = builder.Configuration["AZURE_REDIS_CONNECTIONSTRING"]; + options.Configuration = builder.Configuration["AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"]; options.InstanceName = "SampleInstance"; - }); -} +}); + // Add services to the container. diff --git a/appsettings.json b/appsettings.json index ae3a5b52e..e48330c89 100644 --- a/appsettings.json +++ b/appsettings.json @@ -7,9 +7,7 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - // The following connection string works for running the .NET application in the dev container. - // If running this project in Visual Studio in Windows, use the commented connection string instead. - "MyDbConnection": "Server=localhost;Database=ApplicationDB;User Id=sa;Password=P@ssw0rd;TrustServerCertificate=True;MultipleActiveResultSets=true" - //"MyDbConnection": "Server=(localdb)\\mssqllocaldb;Database=MyDatabaseContext-8e1630ac-d3ae-4719-955b-5d3235f3fadf;Trusted_Connection=True;MultipleActiveResultSets=true" + "AZURE_SQL_CONNECTIONSTRING": "Data Source=webappanddatabase-server.database.windows.net,1433;Initial Catalog=webappanddatabase-database;User ID=webappanddatabase-server-admin;Password=xLspxkWrNpiqp$kY", + "AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING": "webappanddatabase-cache.redis.cache.windows.net:6380,password=PXtdyb0cKlXVt0Yj0d3LwZqEOSdVSQBiIAzCaIlLRr0=,ssl=True,defaultDatabase=0" } } \ No newline at end of file From b160fc9f3d29daf850cc7dc52643464c4bdd7e53 Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 17:41:18 +0100 Subject: [PATCH 03/23] upd --- .github/workflows/main_webappanddatabase.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 22fc83363..08ebcaf2b 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -29,16 +29,19 @@ jobs: - name: dotnet publish run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp - # --- ² EF CORE --- + # --- ² EF CORE Ϊ --- - name: Install EF Core Tool run: dotnet tool install -g dotnet-ef --version 7.0.14 - name: Create migration bundle run: | - dotnet ef migrations bundle --runtime linux-x64 -p DotNetCoreSqlDb/DotNetCoreSqlDb.csproj -o ${{env.DOTNET_ROOT}}/myapp/migrate + # + PROJECT_PATH=$(find . -name "*.csproj" -print -quit) + echo "Found project at: $PROJECT_PATH" + dotnet ef migrations bundle --runtime linux-x64 -p "$PROJECT_PATH" -o ${{env.DOTNET_ROOT}}/myapp/migrate - # ------------------------------ + # -------------------------------------------------- - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 From 84bed89d17800a25bd6549808ee52c9c80d9dd86 Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 17:46:26 +0100 Subject: [PATCH 04/23] upd --- .github/workflows/main_webappanddatabase.yml | 27 ++++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 08ebcaf2b..5f1c46188 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -1,6 +1,3 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - name: Build and deploy ASP.Net Core app to Azure Web App - WebAppAndDataBase on: @@ -13,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest permissions: - contents: read #This is required for actions/checkout + contents: read steps: - uses: actions/checkout@v4 @@ -29,21 +26,17 @@ jobs: - name: dotnet publish run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp - # --- ² EF CORE Ϊ --- - + # --- EF CORE MIGRATIONS --- - name: Install EF Core Tool run: dotnet tool install -g dotnet-ef --version 7.0.14 - name: Create migration bundle run: | - # PROJECT_PATH=$(find . -name "*.csproj" -print -quit) - echo "Found project at: $PROJECT_PATH" dotnet ef migrations bundle --runtime linux-x64 -p "$PROJECT_PATH" -o ${{env.DOTNET_ROOT}}/myapp/migrate - - # -------------------------------------------------- + # -------------------------- - - name: Upload artifact for deployment job + - name: Upload artifact uses: actions/upload-artifact@v4 with: name: .net-app @@ -53,11 +46,11 @@ jobs: runs-on: ubuntu-latest needs: build permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + id-token: write + contents: read steps: - - name: Download artifact from build job + - name: Download artifact uses: actions/download-artifact@v4 with: name: .net-app @@ -65,9 +58,9 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E3558020DD4E4B8D86D01B916D58C3E3 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9C8D5E1C904D4CEE827FF14C612D75FF }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6D0468AC944441EEB46F077AFA62AF25 }} + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App id: deploy-to-webapp From 9ebb2d98f8ae571483f3a77cf8eb5273e159dbf2 Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 17:58:40 +0100 Subject: [PATCH 05/23] upd1213 --- .github/workflows/main_webappanddatabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 5f1c46188..76d4bc12c 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -54,7 +54,7 @@ jobs: uses: actions/download-artifact@v4 with: name: .net-app - + - name: Login to Azure uses: azure/login@v2 with: From 7930eff03eee5c18ef532e57900e22597200ecff Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 18:09:30 +0100 Subject: [PATCH 06/23] 32 --- .github/workflows/main_webappanddatabase.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 76d4bc12c..5e7bdb6d5 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -26,15 +26,16 @@ jobs: - name: dotnet publish run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp - # --- EF CORE MIGRATIONS --- + # --- EF CORE MIGRATIONS ( ) --- - name: Install EF Core Tool run: dotnet tool install -g dotnet-ef --version 7.0.14 - name: Create migration bundle run: | PROJECT_PATH=$(find . -name "*.csproj" -print -quit) + echo "Found project at: $PROJECT_PATH" dotnet ef migrations bundle --runtime linux-x64 -p "$PROJECT_PATH" -o ${{env.DOTNET_ROOT}}/myapp/migrate - # -------------------------- + # ------------------------------------------ - name: Upload artifact uses: actions/upload-artifact@v4 @@ -54,13 +55,14 @@ jobs: uses: actions/download-artifact@v4 with: name: .net-app - + - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # Ҳ Ҳ в: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_89CFBC7CEF5C48B79F096F5064C3FFA9 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C3BFFBAC3F714D3FBC3D5BA2AAC8CA9C }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5377BFFE15094A6CBF13D916949A3EC1 }} - name: Deploy to Azure Web App id: deploy-to-webapp From 8ea3a7bc31ae6f722bbea14abca8323fe66da541 Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 19:02:34 +0100 Subject: [PATCH 07/23] fixUPD --- Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index a45a002e0..290ddca88 100644 --- a/Program.cs +++ b/Program.cs @@ -10,7 +10,12 @@ options.InstanceName = "SampleInstance"; }); - +using (var scope = app.Services.CreateScope()) +{ + var services = scope.ServiceProvider; + var context = services.GetRequiredService(); + context.Database.Migrate(); // Це створить таблиці, якщо їх немає +} // Add services to the container. builder.Services.AddControllersWithViews(); From 30a8d041d54dfb17542c3d0c178fadbf5973457e Mon Sep 17 00:00:00 2001 From: Maksym Chesnokov Date: Sun, 22 Mar 2026 19:06:12 +0100 Subject: [PATCH 08/23] 43 --- Program.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Program.cs b/Program.cs index 290ddca88..8dba1de5e 100644 --- a/Program.cs +++ b/Program.cs @@ -10,13 +10,6 @@ options.InstanceName = "SampleInstance"; }); -using (var scope = app.Services.CreateScope()) -{ - var services = scope.ServiceProvider; - var context = services.GetRequiredService(); - context.Database.Migrate(); // Це створить таблиці, якщо їх немає -} - // Add services to the container. builder.Services.AddControllersWithViews(); @@ -25,6 +18,13 @@ var app = builder.Build(); +using (var scope = app.Services.CreateScope()) +{ + var services = scope.ServiceProvider; + var context = services.GetRequiredService(); + context.Database.Migrate(); // Це створить таблиці, якщо їх немає +} + // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { From 56f42b3853b18487f36f960c2cfd6fa0a3ad4593 Mon Sep 17 00:00:00 2001 From: Oleksandr-Sydorov Date: Thu, 2 Apr 2026 15:17:11 +0300 Subject: [PATCH 09/23] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_vhlr2.yml | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/main_vhlr2.yml diff --git a/.github/workflows/main_vhlr2.yml b/.github/workflows/main_vhlr2.yml new file mode 100644 index 000000000..c625d3d16 --- /dev/null +++ b/.github/workflows/main_vhlr2.yml @@ -0,0 +1,65 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - VHLR2 + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: .net-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CD9400597E8D4878A2DB8746D8CBC3A0 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_19BA0BCCDD0E4686961924AA90B3E565 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A443A7B2260D4B948EBD9885F96883FD }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'VHLR2' + slot-name: 'Production' + package: . + \ No newline at end of file From b32fe72876b119f6e7445098e5f2c11c7c207b1b Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Thu, 2 Apr 2026 15:27:36 +0300 Subject: [PATCH 10/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main_webappanddatabase.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 5e7bdb6d5..df5321607 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -18,7 +18,7 @@ jobs: - name: Set up .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.x' + dotnet-version: '8.x' - name: Build with dotnet run: dotnet build --configuration Release @@ -60,9 +60,9 @@ jobs: uses: azure/login@v2 with: # Ҳ Ҳ в: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_89CFBC7CEF5C48B79F096F5064C3FFA9 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C3BFFBAC3F714D3FBC3D5BA2AAC8CA9C }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5377BFFE15094A6CBF13D916949A3EC1 }} + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CD9400597E8D4878A2DB8746D8CBC3A0 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_19BA0BCCDD0E4686961924AA90B3E565 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A443A7B2260D4B948EBD9885F96883FD }} - name: Deploy to Azure Web App id: deploy-to-webapp From 1f79d9ce15c6e8d43f4fdb4dc50e459603453d34 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 16:41:41 +0300 Subject: [PATCH 11/23] laba1.4 --- .github/workflows/main_webappanddatabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index df5321607..67c5df135 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -68,6 +68,6 @@ jobs: id: deploy-to-webapp uses: azure/webapps-deploy@v3 with: - app-name: 'WebAppAndDataBase' + app-name: 'VHLR2' slot-name: 'Production' package: . \ No newline at end of file From b2a7b48b51668a20f6d0ebcd2429898ff1658e82 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 16:52:07 +0300 Subject: [PATCH 12/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main_webappanddatabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 67c5df135..10c6967ea 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -62,7 +62,7 @@ jobs: # Ҳ Ҳ в: client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CD9400597E8D4878A2DB8746D8CBC3A0 }} tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_19BA0BCCDD0E4686961924AA90B3E565 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A443A7B2260D4B948EBD9885F96883FD }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_f0353499-22cf-446d-a9e5-dc4b2e1ecd92 }} - name: Deploy to Azure Web App id: deploy-to-webapp From ac4ebfed2ae63665df1df551b6bce65c8f7e5de5 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 16:56:16 +0300 Subject: [PATCH 13/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main_webappanddatabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 10c6967ea..a5f451d23 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -62,7 +62,7 @@ jobs: # Ҳ Ҳ в: client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CD9400597E8D4878A2DB8746D8CBC3A0 }} tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_19BA0BCCDD0E4686961924AA90B3E565 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_f0353499-22cf-446d-a9e5-dc4b2e1ecd92 }} + subscription-id: ${{ f0353499-22cf-446d-a9e5-dc4b2e1ecd92 }} - name: Deploy to Azure Web App id: deploy-to-webapp From 68a5999e24c6f418d726855aaec4729ebc5b397f Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 16:57:04 +0300 Subject: [PATCH 14/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main_webappanddatabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index a5f451d23..67c5df135 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -62,7 +62,7 @@ jobs: # Ҳ Ҳ в: client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CD9400597E8D4878A2DB8746D8CBC3A0 }} tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_19BA0BCCDD0E4686961924AA90B3E565 }} - subscription-id: ${{ f0353499-22cf-446d-a9e5-dc4b2e1ecd92 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A443A7B2260D4B948EBD9885F96883FD }} - name: Deploy to Azure Web App id: deploy-to-webapp From 83e316bf339b9c1062bb371ff155ee74ac679e85 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 17:25:02 +0300 Subject: [PATCH 15/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 8dba1de5e..3ca943141 100644 --- a/Program.cs +++ b/Program.cs @@ -24,7 +24,7 @@ var context = services.GetRequiredService(); context.Database.Migrate(); // Це створить таблиці, якщо їх немає } - +// // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { From cc623bcaad01253aa14894e58f9606beb72a62fa Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 17:54:39 +0300 Subject: [PATCH 16/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main_webappanddatabase.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main_webappanddatabase.yml b/.github/workflows/main_webappanddatabase.yml index 67c5df135..82af2bf6f 100644 --- a/.github/workflows/main_webappanddatabase.yml +++ b/.github/workflows/main_webappanddatabase.yml @@ -70,4 +70,5 @@ jobs: with: app-name: 'VHLR2' slot-name: 'Production' - package: . \ No newline at end of file + package: . + startup-command: 'dotnet DotNetCoreSqlDb.dll' \ No newline at end of file From 0b246c1c50aa6637c6481bcc8580130f717de7c5 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 18:30:43 +0300 Subject: [PATCH 17/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 3ca943141..01d11646c 100644 --- a/Program.cs +++ b/Program.cs @@ -6,7 +6,7 @@ options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"))); builder.Services.AddStackExchangeRedisCache(options => { - options.Configuration = builder.Configuration["AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"]; + options.Configuration = builder.Configuration.GetConnectionString["AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"]; options.InstanceName = "SampleInstance"; }); From 09dfa06b611415fb0b5718405352e35bc0ca61df Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 18:32:54 +0300 Subject: [PATCH 18/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 01d11646c..a5b952016 100644 --- a/Program.cs +++ b/Program.cs @@ -24,8 +24,7 @@ var context = services.GetRequiredService(); context.Database.Migrate(); // Це створить таблиці, якщо їх немає } -// -// Configure the HTTP request pipeline. + if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Home/Error"); From c7be7d12ee5349045f492b3cacb38f05c64e0aa6 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 18:36:01 +0300 Subject: [PATCH 19/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index a5b952016..8153afe10 100644 --- a/Program.cs +++ b/Program.cs @@ -6,7 +6,7 @@ options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"))); builder.Services.AddStackExchangeRedisCache(options => { - options.Configuration = builder.Configuration.GetConnectionString["AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"]; + options.Configuration = builder.Configuration.GetConnectionString("AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"); options.InstanceName = "SampleInstance"; }); From da15f7544e4c74f76943020c71a2a08085c107cd Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 18:38:09 +0300 Subject: [PATCH 20/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 8153afe10..5dc0fa548 100644 --- a/Program.cs +++ b/Program.cs @@ -22,7 +22,7 @@ { var services = scope.ServiceProvider; var context = services.GetRequiredService(); - context.Database.Migrate(); // Це створить таблиці, якщо їх немає + context.Database.Migrate(); } if (!app.Environment.IsDevelopment()) From a2d194855aa3cde20efd2e0a77262c185da7006b Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 22:11:35 +0300 Subject: [PATCH 21/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appsettings.json b/appsettings.json index e48330c89..877fdbca8 100644 --- a/appsettings.json +++ b/appsettings.json @@ -8,6 +8,6 @@ "AllowedHosts": "*", "ConnectionStrings": { "AZURE_SQL_CONNECTIONSTRING": "Data Source=webappanddatabase-server.database.windows.net,1433;Initial Catalog=webappanddatabase-database;User ID=webappanddatabase-server-admin;Password=xLspxkWrNpiqp$kY", - "AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING": "webappanddatabase-cache.redis.cache.windows.net:6380,password=PXtdyb0cKlXVt0Yj0d3LwZqEOSdVSQBiIAzCaIlLRr0=,ssl=True,defaultDatabase=0" + "AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING": ":6380,password=ByFyKv1DX1yMLHrOdLp0VOelwtEmvnidkAzCaBkpzkE=,ssl=True,abortConnect=False" } } \ No newline at end of file From 03661c2ad8bfd71c948406a1ecdea1f127e5ce9e Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 22:17:58 +0300 Subject: [PATCH 22/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 5dc0fa548..70a8fa2a1 100644 --- a/Program.cs +++ b/Program.cs @@ -6,7 +6,8 @@ options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING"))); builder.Services.AddStackExchangeRedisCache(options => { - options.Configuration = builder.Configuration.GetConnectionString("AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"); + options.Configuration = Environment.GetEnvironmentVariable("AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING") + ?? builder.Configuration.GetConnectionString("AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING"); options.InstanceName = "SampleInstance"; }); From ed1b071d8a7da429e135900629c306e4c6d5b049 Mon Sep 17 00:00:00 2001 From: Oleksandr Sydorov Date: Wed, 8 Apr 2026 22:25:33 +0300 Subject: [PATCH 23/23] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B01.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appsettings.json b/appsettings.json index 877fdbca8..9e5b35def 100644 --- a/appsettings.json +++ b/appsettings.json @@ -8,6 +8,6 @@ "AllowedHosts": "*", "ConnectionStrings": { "AZURE_SQL_CONNECTIONSTRING": "Data Source=webappanddatabase-server.database.windows.net,1433;Initial Catalog=webappanddatabase-database;User ID=webappanddatabase-server-admin;Password=xLspxkWrNpiqp$kY", - "AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING": ":6380,password=ByFyKv1DX1yMLHrOdLp0VOelwtEmvnidkAzCaBkpzkE=,ssl=True,abortConnect=False" + "AZURE_REDIS_REDISCONNECTOR_CONNECTIONSTRING": "vhlr-cache.redis.cache.windows.net:6380,password=ByFyKv1DX1yMLHrOdLp0VOelwtEmvnidkAzCaBkpzkE=,ssl=True,abortConnect=False" } } \ No newline at end of file