From 33c04a034ef933258b00f4d2ccc1a5afb6b919c0 Mon Sep 17 00:00:00 2001 From: Bryan Jonker Date: Thu, 8 Jan 2026 16:58:02 -0600 Subject: [PATCH 1/2] Update files, fix yml --- ...duction.yml => wigg-app-prod-resource.yml} | 14 ++--- .../workflows/wigg-app-staging-resource.yml | 57 +++++++++++++++++++ ...duction.yml => wigg-fun-prod-resource.yml} | 12 ++-- .../workflows/wigg-fun-staging-resource.yml | 43 ++++++++++++++ ResourceInformationV2.sln | 10 ++-- ResourceInformationV2/Program.cs | 4 +- 6 files changed, 118 insertions(+), 22 deletions(-) rename .github/workflows/{app_production.yml => wigg-app-prod-resource.yml} (75%) create mode 100644 .github/workflows/wigg-app-staging-resource.yml rename .github/workflows/{fun_production.yml => wigg-fun-prod-resource.yml} (88%) create mode 100644 .github/workflows/wigg-fun-staging-resource.yml diff --git a/.github/workflows/app_production.yml b/.github/workflows/wigg-app-prod-resource.yml similarity index 75% rename from .github/workflows/app_production.yml rename to .github/workflows/wigg-app-prod-resource.yml index 431cd63..f3d3df9 100644 --- a/.github/workflows/app_production.yml +++ b/.github/workflows/wigg-app-prod-resource.yml @@ -9,9 +9,6 @@ on: - main workflow_dispatch: -env: - DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use - jobs: build: runs-on: windows-latest @@ -19,17 +16,17 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment + - name: Set up .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: '8.x' include-prerelease: true - name: Build with dotnet run: dotnet build --configuration Release - name: dotnet publish - run: dotnet publish ResourceInformationV2 -c Release -r linux-x64 --property:PublishDir=${{env.DOTNET_ROOT}}/myapp + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 @@ -54,7 +51,6 @@ jobs: id: deploy-to-webapp uses: azure/webapps-deploy@v2 with: - app-name: itp-app-resource2 - package: . - slot-name: staging + app-name: 'wigg-resource-infra-winapp01' publish-profile: ${{ secrets.AZURE_WEB_PUBLISH_PROFILE_PRODUCTION }} + package: . \ No newline at end of file diff --git a/.github/workflows/wigg-app-staging-resource.yml b/.github/workflows/wigg-app-staging-resource.yml new file mode 100644 index 0000000..483f336 --- /dev/null +++ b/.github/workflows/wigg-app-staging-resource.yml @@ -0,0 +1,57 @@ +# 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: Staging WIGG Build and deploy ASP.Net Core app to Azure Web App + +on: + push: + branches: + - develop + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.x' + include-prerelease: true + + - 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: windows-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: .net-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'wigg-resource-infra-winapp01' + slot-name: 'staging' + publish-profile: ${{ secrets.AZURE_WEB_PUBLISH_PROFILE_STAGING }} + package: . \ No newline at end of file diff --git a/.github/workflows/fun_production.yml b/.github/workflows/wigg-fun-prod-resource.yml similarity index 88% rename from .github/workflows/fun_production.yml rename to .github/workflows/wigg-fun-prod-resource.yml index ea71a4a..672d620 100644 --- a/.github/workflows/fun_production.yml +++ b/.github/workflows/wigg-fun-prod-resource.yml @@ -12,10 +12,10 @@ on: env: AZURE_FUNCTIONAPP_PACKAGE_PATH: 'ResourceInformationV2.Function' # set this to the path to your web app project, defaults to the repository root DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use - + jobs: build-and-deploy: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: 'Checkout GitHub Action' @@ -25,20 +25,18 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ env.DOTNET_VERSION }} - include-prerelease: true - name: 'Resolve Project Dependencies Using Dotnet' shell: pwsh run: | pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' - dotnet build --configuration Release --output ./output -r linux-x64 + dotnet build --configuration Release --output ./output popd - name: 'Run Azure Functions Action' uses: Azure/functions-action@v1 id: fa with: - app-name: 'itp-function-resource2' + app-name: 'wigg-resource-infra-funapp01' package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' - slot-name: staging - publish-profile: ${{ secrets.AZURE_FUNCTION_PUBLISH_PROFILE_PRODUCTION }} + publish-profile: ${{ secrets.AZURE_FUNCTION_PUBLISH_PROFILE_PRODUCTION }} \ No newline at end of file diff --git a/.github/workflows/wigg-fun-staging-resource.yml b/.github/workflows/wigg-fun-staging-resource.yml new file mode 100644 index 0000000..3afd381 --- /dev/null +++ b/.github/workflows/wigg-fun-staging-resource.yml @@ -0,0 +1,43 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Staging WIGG Build and deploy ASP.Net Core app to Azure Function App + +on: + push: + branches: + - develop + workflow_dispatch: + +env: + AZURE_FUNCTIONAPP_PACKAGE_PATH: 'ResourceInformationV2.Function' # set this to the path to your web app project, defaults to the repository root + DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use + +jobs: + build-and-deploy: + runs-on: windows-latest + + steps: + - name: 'Checkout GitHub Action' + uses: actions/checkout@v4 + + - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: 'Resolve Project Dependencies Using Dotnet' + shell: pwsh + run: | + pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' + dotnet build --configuration Release --output ./output + popd + + - name: 'Run Azure Functions Action' + uses: Azure/functions-action@v1 + id: fa + with: + app-name: 'wigg-resource-infra-funapp01' + slot-name: 'staging' + package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' + publish-profile: ${{ secrets.AZURE_FUNCTION_PUBLISH_PROFILE_STAGING }} \ No newline at end of file diff --git a/ResourceInformationV2.sln b/ResourceInformationV2.sln index c68d444..040c033 100644 --- a/ResourceInformationV2.sln +++ b/ResourceInformationV2.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.13.36105.23 +# Visual Studio Version 18 +VisualStudioVersion = 18.1.11312.151 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceInformationV2", "ResourceInformationV2\ResourceInformationV2.csproj", "{BB72C320-FC9B-4B8D-AE96-2417A099B41B}" EndProject @@ -19,9 +19,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceInformationV2.Templ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}" ProjectSection(SolutionItems) = preProject - .github\workflows\app_production.yml = .github\workflows\app_production.yml - .github\workflows\fun_production.yml = .github\workflows\fun_production.yml README.md = README.md + .github\workflows\wigg-app-prod-resource.yml = .github\workflows\wigg-app-prod-resource.yml + .github\workflows\wigg-app-staging-resource.yml = .github\workflows\wigg-app-staging-resource.yml + .github\workflows\wigg-fun-prod-resource.yml = .github\workflows\wigg-fun-prod-resource.yml + .github\workflows\wigg-fun-staging-resource.yml = .github\workflows\wigg-fun-staging-resource.yml EndProjectSection EndProject Global diff --git a/ResourceInformationV2/Program.cs b/ResourceInformationV2/Program.cs index d8bcb5d..8df6536 100644 --- a/ResourceInformationV2/Program.cs +++ b/ResourceInformationV2/Program.cs @@ -40,8 +40,8 @@ builder.Services.AddDbContextFactory(options => options.UseSqlServer(builder.Configuration.GetConnectionString("AppConnection")).EnableSensitiveDataLogging(true)); builder.Services.AddScoped(); -builder.Services.AddSingleton(b => OpenSearchFactory.CreateClient(builder.Configuration["SearchUrl"], builder.Configuration["SearchAccessKey"], builder.Configuration["SearchSecretAccessKey"], bool.Parse(builder.Configuration["SearchDebug"] ?? "false"))); -builder.Services.AddSingleton(b => OpenSearchFactory.CreateLowLevelClient(builder.Configuration["SearchUrl"], builder.Configuration["SearchAccessKey"], builder.Configuration["SearchSecretAccessKey"], bool.Parse(builder.Configuration["SearchDebug"] ?? "false"))); +builder.Services.AddSingleton(b => OpenSearchFactory.CreateClient(builder.Configuration["SearchUrl"], builder.Configuration["AccessKey"], builder.Configuration["SecretKey"], bool.Parse(builder.Configuration["SearchDebug"] ?? "false"))); +builder.Services.AddSingleton(b => OpenSearchFactory.CreateLowLevelClient(builder.Configuration["SearchUrl"], builder.Configuration["AccessKey"], builder.Configuration["SecretKey"], bool.Parse(builder.Configuration["SearchDebug"] ?? "false"))); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); From 791f453bb63f869660f7f5a56ce76830591b8391 Mon Sep 17 00:00:00 2001 From: Bryan Jonker <65776851+bryanjonker-illinois@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:01:23 -0600 Subject: [PATCH 2/2] Update configuration keys for database and email services --- ResourceInformationV2.Function/Program.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ResourceInformationV2.Function/Program.cs b/ResourceInformationV2.Function/Program.cs index e39edfb..c9638a4 100644 --- a/ResourceInformationV2.Function/Program.cs +++ b/ResourceInformationV2.Function/Program.cs @@ -30,18 +30,18 @@ options.PropertyNamingPolicy = new JsonNamingPolicyLowerCase(); }); _ = services.ConfigureFunctionsApplicationInsights(); - _ = services.AddDbContextFactory(options => options.UseSqlServer(hostContext.Configuration["AppConnection"]).EnableSensitiveDataLogging(true)); + _ = services.AddDbContextFactory(options => options.UseSqlServer(hostContext.Configuration["Values:AppConnection"]).EnableSensitiveDataLogging(true)); _ = services.AddScoped(); _ = services.AddScoped(); _ = services.AddScoped(); _ = services.AddScoped(); _ = services.AddScoped(); _ = services.AddScoped(); - _ = services.AddScoped(b => new EmailClient(hostContext.Configuration["EmailApiKey"] ?? "", hostContext.Configuration["EmailFromEmail"] ?? "", hostContext.Configuration["EmailServerId"] ?? "", hostContext.Configuration["EmailUrl"] ?? "")); + _ = services.AddScoped(b => new EmailClient(hostContext.Configuration["Values:EmailApiKey"] ?? "", hostContext.Configuration["Values:EmailFromEmail"] ?? "", hostContext.Configuration["Values:EmailServerId"] ?? "", hostContext.Configuration["Values:EmailUrl"] ?? "")); _ = services.AddScoped(); _ = services.AddScoped(); - _ = services.AddSingleton(c => OpenSearchFactory.CreateLowLevelClient(hostContext.Configuration["SearchUrl"], hostContext.Configuration["AccessKey"], hostContext.Configuration["SecretKey"], hostContext.Configuration["Debug"] == "true")); - _ = services.AddSingleton(c => OpenSearchFactory.CreateClient(hostContext.Configuration["SearchUrl"], hostContext.Configuration["AccessKey"], hostContext.Configuration["SecretKey"], true)); + _ = services.AddSingleton(c => OpenSearchFactory.CreateLowLevelClient(hostContext.Configuration["Values:SearchUrl"], hostContext.Configuration["Values:AccessKey"], hostContext.Configuration["Values:SecretKey"], hostContext.Configuration["Values:Debug"] == "true")); + _ = services.AddSingleton(c => OpenSearchFactory.CreateClient(hostContext.Configuration["Values:SearchUrl"], hostContext.Configuration["Values:AccessKey"], hostContext.Configuration["Values:SecretKey"], true)); _ = services.AddScoped(); _ = services.AddScoped(); _ = services.AddScoped(); @@ -52,4 +52,4 @@ }) .Build(); -host.Run(); \ No newline at end of file +host.Run();