Conversation
Refactored HttpClient registration to use IHttpClientFactory with a named client and centralized base address configuration via "BackendUrl" from appsettings. Updated all environments to include the correct "BackendUrl" value. Removed redundant HttpClient registrations in ViewModels and improved error handling for missing configuration. Adjusted project file to ensure appsettings.json is copied to output but not publish directory. Made minor namespace and using directive updates.
Co-authored-by: BekAllaev <37025308+BekAllaev@users.noreply.github.com>
Co-authored-by: BekAllaev <37025308+BekAllaev@users.noreply.github.com>
…-dev Add stage CI/CD pipeline for dev branch using Staging configuration
Delete yml file in the dev that is mentioned for master
Remove section - permission
Added appsettings.Staging.json with staging BackendUrl. Updated OMSBlazor.Client.csproj to copy the staging config file to the output directory during build and publish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the deployment workflow and configuration management for the OMSBlazor application, focusing on environment-based deployments and more robust configuration handling for backend URLs. The main themes are: (1) enhanced GitHub Actions workflow for multi-environment deployment, (2) improved configuration of backend URLs per environment, and (3) refactoring of HTTP client setup for both frontend and backend projects.
Deployment Workflow Enhancements:
.github/workflows/deploy-oms.yml) now supports deployments from bothmasteranddevbranches, with dynamic selection of configuration (Releaseformaster,Stagingfordev) and Azure WebApp names based on the branch. This enables seamless staging and production deployments. [1] [2] [3] [4] [5] [6]Configuration Management:
appsettings.*.jsonfiles are added for both frontend and backend projects, each specifying the appropriateBackendUrlfor Development, Staging, and Production. The defaultBackendUrlinappsettings.jsonis now empty, enforcing explicit configuration per environment. [1] [2] [3] [4] [5]HTTP Client Setup Refactoring:
src/OMSBlazor.Client/Program.cs) and backend (src/OMSBlazor/Program.cs) projects now useIHttpClientFactorywith named/default clients, retrieving theBackendUrlfrom configuration and throwing clear exceptions if missing. This replaces the previous approach of directly instantiatingHttpClientwith a hardcoded or potentially missing URL. [1] [2]StatisticsDataReaderservice now uses the default HTTP client name for consistency. [1] [2]Project File Adjustments:
OMSBlazor.Client.csproj) is updated to ensure the staging appsettings file is copied to the output directory, supporting correct environment configuration during deployment.OMSBlazor.csproj) is adjusted to ensureappsettings.jsonis always copied to the output directory.These changes collectively improve deployment flexibility, configuration safety, and maintainability across multiple environments.