Repository navigation
290759--Dot net 10 upgrade Changes - #542
Conversation
Upgraded all projects from .NET 8.0 to .NET 10.0. Updated NuGet dependencies to latest or .NET 10.0-compatible versions, including Swashbuckle.AspNetCore, Microsoft.AspNetCore.*, Serilog, FluentValidation, and Elastic.Apm. Added new dependencies: Microsoft.OpenApi, Snappier, and SharpCompress. Refactored Swagger annotations to use JsonSchemaType and Microsoft.OpenApi namespaces. Performed minor code and import cleanups for compatibility.
Upgraded azurerm provider to >=4.54.0 and Terraform to 1.15.8. Updated all web app resources to use .NET 10.0. Bumped pipeline container and .NET SDK versions to 1.15.8 and 10.0.x, respectively.
Added the -upgrade option to the terraform init command in terraform_conditional_run.ps1 to ensure modules and providers are updated during initialization. No other changes were made.
Updated terraform init commands in three PowerShell deployment scripts to include the -upgrade flag. This change ensures that Terraform modules and providers are upgraded to the latest acceptable versions during initialization. No other logic was altered.
…vopschanges Update Terraform, .NET, and pipeline versions to latest
* using replacement azurerm_portal_dashboard module type since old one is deprecated * AB#azurermdashbord-fixes issue * AB# revert back azurerm changes * AB#-changes in azurerm * AB# Added accountId inspite of name --------- Co-authored-by: MattWin90 <matthew.winstanley@mastek.com> Co-authored-by: Amrendra Pandey <amren1502129@mastek.com>
Fix/dotnet10 fix
Downgraded Microsoft.ApplicationInsights and Microsoft.ApplicationInsights.AspNetCore package versions in test projects from 3.1.2 to 2.23.0. Removed unused using directives from ProductBuilderController, ProductDataController, and ProductInformationController for improved code clarity.
Removed unused SharpCompress and Snappier package references from UKHO.ExchangeSetService.API.UnitTests.csproj to clean up dependencies.
…/github.com/UKHO/exchange-set-service into feature/290759-dotnet-10-upgrade-devchanges
…vchanges 290759 dotnet 10 upgrade devchanges
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
MuhammadJawad-Mastek
left a comment
There was a problem hiding this comment.
Its looking good to approve
There was a problem hiding this comment.
Pull request overview
This PR upgrades services and deployment infrastructure to .NET 10, Terraform 1.15.8, and AzureRM 4.x.
Changes:
- Updates application projects, dependencies, and Azure runtimes.
- Modernizes Terraform resources and storage/dashboard configuration.
- Enhances deployment automation and log sanitization.
Reviewed changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
UKHO.SalesCatalogueFileShareServicesMock.API/UKHO.SalesCatalogueFileShareServicesMock.API/UKHO.SalesCatalogueFileShareServicesMock.API.csproj |
Updates the mock API to .NET 10. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Webjob.UnitTests/UKHO.ExchangeSetService.Webjob.UnitTests.csproj |
Updates webjob tests and dependencies. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.FulfilmentService/UKHO.ExchangeSetService.FulfilmentService.csproj |
Updates fulfilment runtime and packages. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/UKHO.ExchangeSetService.Common.csproj |
Updates common runtime and dependencies. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/CommonHelper.cs |
Adds log-input sanitization. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/HealthCheck/AzureWebJobsHealthCheck.cs |
Sanitizes health-check logging. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/UKHO.ExchangeSetService.Common.UnitTests.csproj |
Updates common tests to .NET 10. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API.csproj |
Updates API runtime and dependencies. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Filters/SecurityRequirementsOperationFilter.cs |
Formatting cleanup. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Filters/LoggingMiddleware.cs |
Sanitizes logged headers. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Controllers/ProductDataController.cs |
Import and formatting cleanup. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API.UnitTests/UKHO.ExchangeSetService.API.UnitTests.csproj |
Updates API tests. |
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API.FunctionalTests/UKHO.ExchangeSetService.API.FunctionalTests.csproj |
Updates functional tests and dependencies. |
MockApiDeployment/src/Modules/Webapp/main.tf |
Configures mock web apps for .NET 10. |
MockApiDeployment/src/azure.tf |
Upgrades Terraform and AzureRM. |
Deployment/terraform_conditional_run.ps1 |
Updates Terraform initialization and deployment outputs. |
Deployment/terraform_conditional_run_v2.ps1 |
Updates v2 Terraform initialization and outputs. |
Deployment/terraform_conditional_run_apim.ps1 |
Updates APIM Terraform initialization. |
Deployment/terraform_conditional_run_apim_v2.ps1 |
Updates v2 APIM initialization. |
Deployment/templates/fulfilment-webapp-az.yml |
Adds a fulfilment deployment template. |
Deployment/templates/continuous-deployment.yml |
Adds runtime configuration deployment steps. |
Deployment/templates/continuous-deployment-v2.yml |
Adds v2 runtime configuration deployment steps. |
Deployment/src/outputs.tf |
Maintains Terraform outputs. |
Deployment/src/Modules/Webapp/main.tf |
Configures web apps for .NET 10. |
Deployment/src/Modules/KeyVault/main.tf |
Explicitly configures Key Vault RBAC. |
Deployment/src/Modules/FulfilmentWebapps/main.tf |
Configures fulfilment apps and slots for .NET 10. |
Deployment/src/Modules/FulfilmentStorage/main.tf |
Migrates selected storage resources to account IDs. |
Deployment/src/Modules/azuredashboard/main.tf |
Switches to the portal dashboard resource. |
Deployment/src/Modules/APIM/azure.tf |
Updates APIM AzureRM configuration. |
Deployment/src/azure.tf |
Upgrades Terraform and AzureRM. |
azure-pipelines.yml |
Updates Terraform and .NET SDK versions. |
Suppressed comments (4)
Deployment/templates/continuous-deployment-v2.yml:61
- The added
az webapp config setcalls do not check their exit status, and AzureCLI does not fail on stderr by default. If one of the many runtime updates fails, later successful commands can leave the task green while that app remains on the old runtime. Fail immediately or explicitly check$LASTEXITCODEafter each call.
az webapp config set `
--resource-group $rg `
--name "$env:WEB_APP_NAME" `
--slot "$env:WEB_APP_SLOT_NAME" `
--windows-fx-version "DOTNET|10.0"
Deployment/templates/continuous-deployment.yml:61
- The added
az webapp config setcalls do not check their exit status, and AzureCLI does not fail on stderr by default. If one of the many runtime updates fails, later successful commands can leave the task green while that app remains on the old runtime. Fail immediately or explicitly check$LASTEXITCODEafter each call.
az webapp config set `
--resource-group $rg `
--name "$env:WEBAPPNAME" `
--slot "$env:WEB_APP_SLOT_NAME" `
--windows-fx-version "DOTNET|10.0"
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Filters/LoggingMiddleware.cs:171
- Sanitizing only header names and values does not protect the other request-controlled values logged by this middleware, such as the URL, request body, and response body. Those values are still written directly in the log call, so CR/LF input can continue to forge log records. Apply the same normalization to all untrusted log fields or use a sink that escapes them.
.ToDictionary(h => CommonHelper.SanitizeLogInput(h.Key), h => HeadersToRedact.Any(r => r.Equals(h.Key, StringComparison.InvariantCultureIgnoreCase)) ? RedactedValue : CommonHelper.SanitizeLogInput(string.Join(", ", (object[])h.Value)));
UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/CommonHelper.cs:69
CommonHelperTestcovers the other helper methods, but no test was added for this new log-sanitization boundary. Add focused cases for empty input and embedded carriage-return/newline characters so the log-forging protection cannot regress unnoticed.
public static string SanitizeLogInput(string input)
{
if (string.IsNullOrEmpty(input))
return string.Empty;
// Remove newlines and carriage returns to prevent log forging
return input.Replace("\r", string.Empty).Replace("\n", string.Empty);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7493b18
MuhammadJawad-Mastek
left a comment
There was a problem hiding this comment.
Its looking good to approve.
This pull request updates the infrastructure and deployment scripts to support newer versions of dependencies, upgrades the .NET runtime for all web apps to .NET 10.0, and improves deployment automation and configuration handling. The changes also ensure compatibility with newer Terraform and AzureRM provider versions, and streamline how storage and dashboard resources are defined.
Key changes include:
Platform and Dependency Upgrades
1.15.8and the AzureRM provider to4.xin all relevantazure.tffiles, ensuring support for newer features and improved compatibility. [1] [2] [3]dotnet_versionfor all Azure Windows Web Apps and slots (including fulfilment and mock API webapps) fromv8.0tov10.0, both in Terraform modules and in deployment scripts, to run on the latest .NET runtime. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Infrastructure Resource Improvements
storage_account_idinstead ofstorage_account_namefor better alignment with Azure best practices and improved resource referencing.azurerm_dashboardtoazurerm_portal_dashboardto use the current Azure provider resource type.rbac_authorization_enabled = falsein the Key Vault resource for explicit configuration.Deployment Pipeline and Automation Enhancements
continuous-deployment.ymlandcontinuous-deployment-v2.ymlto explicitly set thewindows_fx_versionfor all webapps and their slots to.NET 10.0, ensuring runtime consistency post-deployment. [1] [2]fulfilment-webapp-az.ymlto standardize webjob deployment and configuration through parameterized steps.Terraform and Script Improvements
-upgradeflag to allterraform initcommands in deployment scripts to ensure modules and providers are updated during initialization. [1] [2] [3] [4]