Base solution for your next web application

Activities of "pliaspzero"

Hi,

how is it possible to Deployment of Angular app and ASPNET Core V13.4 in one website - we want to create release which contains angualr app and ASPNET Core and deploy it to LINUX based container image.

Thanks

could it be like this?

To use HTTP within the cluster while keeping external access over HTTPS, you can make the following changes without applying extensive code modifications (as suggested in the ASPZERO blog post):

  1. Changes in appsettings.json:

    ServerRootAddress: Change the backend URL for internal communication to http://localhost:8080 (instead of https://myExternalDomain-api.com ClientRootAddress: Keep this URL as https://myExternalDomain.com to ensure external access over HTTPS. CorsOrigins: Update CORS to allow the Angular app to access the backend over http://localhost:8080 for internal communication.

Example for appsettings.json:

{ "ServerRootAddress": "http://localhost:8080", // Internal HTTP communication "ClientRootAddress": "https://myExternalDomain.com", // External HTTPS communication "CorsOrigins": "http://localhost:8080", // CORS for internal communication "SwaggerEndPoint": "/swagger/v1/swagger.json" }

  1. Docker Configuration:

Ensure that the ASPNETCORE_URLS=http://+:8080 environment variable is set in the Docker container (either in the Dockerfile or docker-compose.yml) so the backend listens on HTTP inside the container. 3. CORS Configuration:

Configure CORS in the backend to allow requests from the Angular app, even though it communicates over HTTP.

In Summary:

Internally within the cluster: HTTP (e.g., http://localhost:8080)
Externally: HTTPS (e.g., https://myExternalDomain.com)

thanks - locks quite a big change is coding... Could it be a solution to deploy Angular App and aspnet code in one image container? or some other hints?

Hello ASPZERO Team,

We are implementing your solution with Angular as the frontend and ASP.NET Core as the backend, running within a Red Hat OpenShift (RHOS) cluster. We aim to simplify our setup by using HTTP (ASPNETCORE_URLS=http://+:8080) only for internal communications within the RHOS namespace, while retaining HTTPS for external access. Questions:

HTTP-Only Configuration for Internal Traffic:
Is it possible to configure the ASP.NET Core backend to use HTTP only for internal (namespace-level) traffic in the RHOS cluster? If so, could you provide guidance or recommendations on setting this up without affecting the security of external HTTPS access?

CORS Configuration with Internal HTTP:
Given that HTTP will be used internally, do you have recommended settings for Cross-Origin Resource Sharing (CORS) to allow secure communication between the Angular frontend and the ASP.NET Core backend? We want to ensure CORS is correctly configured to support internal HTTP requests while keeping external traffic secure via HTTPS.

Any example configurations or best practices would be highly appreciated to help us configure internal HTTP communication effectively.

V13.4:

Dear ASP.NET Zero Support Team,

I hope this message finds you well. We are currently using the ASP.NET Zero framework with Angular as our front-end and ASP.NET Core for our backend.

We are looking to implement a feature in our application that allows users to access specific components through the menu and directly via URL, while toggling the visibility of the menu. Here’s a brief overview of our requirements, including examples:

Menu Navigation: When a user navigates to https://<myApp>/app/area1/dispositions, the component is displayed with the menu visible.

Direct Access Without Menu: We want to allow users to access the same component directly via https://<myApp>/dispositions, where the menu is hidden, providing a cleaner view of the component.

Expand/Collapse Functionality:
    Each menu item should have an expand icon (using Font Awesome) that, when clicked, takes the user to the component's URL without the menu.
    Inside the component, there should be a collapse icon that, when clicked, navigates back to the original URL with the menu displayed.

We would greatly appreciate any guidance, best practices, or examples you could provide to help us set up this functionality effectively. Your support is invaluable to us as we continue to develop our application.

... would do something like this: // Check the Redis connection string var redisConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; if (!string.Equals(redisConnectionString, "localhost", StringComparison.OrdinalIgnoreCase)) { // Uncomment this line to use Redis cache instead of in-memory cache. // See app.config for Redis configuration and connection string Configuration.Caching.UseRedis(options => { options.ConnectionString = redisConnectionString; options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId"); }); }

Hi,

thanks - when I include this - we have also installations where UseRedis is not needed - then if no redis is configured - how is the behaviour then?

Configuration.Caching.UseRedis(options => { options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId"); });

Dear ASPZero Support Team,

I hope this message finds you well.

We are currently working on our ASP.NET Core application and have identified the following NuGet packages that are in use:

System.Runtime.Caching - Version 6.0.0
System.Drawing.Common - Version 4.7.0
System.Data.SqlClient - Version 4.8.6

These versions have been flagged as violations against our internal Toolchain Policy, and we are looking to upgrade them to the latest versions to ensure compliance and enhance security:

System.Runtime.Caching to 8.0.1
System.Drawing.Common to 8.0.10
System.Data.SqlClient to 4.8.6 (or the latest available version)

We would like to inquire if upgrading these packages could potentially cause any issues or if you foresee any compatibility problems with our existing framework or application functionality.

Additionally, if there are specific guidelines or considerations we should keep in mind while performing these upgrades, please let us know.

Thank you for your assistance. We look forward to your prompt response.

Best regards, Oliver

yes

Dear Support Team,

We have set up a CI/CD pipeline in DevOps for direct deployment of both the API and the Angular application. Based on version 12, everything worked smoothly.

We recently copied the pipeline and adjusted it to build with the .NET 8 framework for version 13.4. The API continues to run without issues, but the Angular app no longer builds or is not copied over correctly. The "dist" folder in wwwroot is missing.

Do you have any suggestions or insights into what might be causing this problem?

Below are excerpts from the package.json and the pipeline definition.

package.json { "name": "abp-zero-template", "version": "13.4.0", "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "publish": "gulp build && ng build --configuration production", "lint": "eslint -c .eslintrc.js --ext .ts src", "post-publish": "shx mv ./wwwroot/dist/* ./wwwroot/", "publish-k8s": "gulp build && ng build --configuration k8s --verbose", "start": "ng serve --host 0.0.0.0 --port 4200", "hmr": "gulp buildDev && ng serve --host 0.0.0.0 --port 4200 --hmr", "test": "gulp buildDev && ng test", "create-dynamic-bundles": "gulp buildDev", "nswag": "cd nswag/ && refresh.bat", "build": "ng build --configuration production" },

trigger: branches: include: - refs/heads/master batch: True name: $(date:yyyyMMdd)$(rev:.r) resources: repositories:

  • repository: self type: git ref: refs/heads/dev jobs:
  • job: Job_1 displayName: Agent job 1 timeoutInMinutes: 0 cancelTimeoutInMinutes: 60 pool: name: PLIVM001 steps:
    • checkout: self

    • task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: Clean Agent Directories

    • task: UseDotNet@2 displayName: Use .NET Core sdk 8.0.x inputs: version: 8.0.x vsVersion: 17.8.3 includePreviewVersions: true performMultiLevelLookup: true

    • task: NodeTool@0 displayName: Use Node 20.x inputs: versionSpec: 20.x

    • task: CmdLine@2 displayName: Command Line Script inputs: script: >+ rmdir /s /q node_modules

      npm cache clean --force
      
    • task: DotNetCoreCLI@2 displayName: Restore inputs: command: restore projects: '**/MyApp.Web.Host.csproj' custom: restore arguments: --force feedRestore: 61e6cd5a-e31d-46dd-973a-caeced7a75fd/a94ff0e1-806f-4475-a711-137a0f2b1dde nugetConfigPath: Saml package/nuget.exe noCache: true verbosityRestore: Diagnostic verbosityPack: Detailed

    • task: DotNetCoreCLI@2 displayName: Build inputs: projects: '**/MyApp.Web.Host.csproj' arguments: --configuration $(BuildConfiguration) verbosityRestore: Detailed verbosityPack: Detailed

    • task: CmdLine@2 displayName: Command Line Script continueOnError: True inputs: script: >- npm install gulp-sass -ES --unsafe-perm=true

      npm update node-sass@latest
      

      workingDirectory: src/MyApp.Web.Host

    • task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3 displayName: 'Yarn ' continueOnError: True inputs: projectDirectory: src/MyApp.Web.Host productionMode: true customFeed: c3c4c89e-67c6-4c90-8cda-19db656fbb9d

    • task: CmdLine@2 displayName: Command Line Script gulp continueOnError: True inputs: script: >2-

      sudo npm install -g gulp
      
      yarn add gulp
      
      npm run build
      

      workingDirectory: src/MyApp.Web.Host

    • task: DotNetCoreCLI@2 displayName: Publish inputs: command: publish publishWebProjects: false projects: '**/MyApp.Web.Host.csproj' arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory) zipAfterPublish: True verbosityRestore: Detailed verbosityPack: Detailed

    • task: DotNetCoreCLI@2 displayName: dotnet publish inputs: command: publish publishWebProjects: false projects: '**/MyApp.Migrator.csproj' arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory) zipAfterPublish: false verbosityRestore: Detailed verbosityPack: Detailed

    • task: PublishBuildArtifacts@1 displayName: Publish Artifact condition: succeededOrFailed() inputs: PathtoPublish: $(build.artifactstagingdirectory) TargetPath: '\my\share$(Build.DefinitionName)$(Build.BuildNumber)'

    • task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: Clean Agent Directories copy ...

Best regards, Oliver

Showing 31 to 40 of 143 entries