Open Closed

Apply OpenIddict and Redis correctly on Azure #3677


User avatar
0
ageiter created
  • ABP Framework version: v6.0.0-rc.3
  • UI type: Blazor
  • DB provider: EF Core

I installed the preview (6.0.0-rc.3) and created a new Blazor Server App by using the template.

Because of OpenIddict, I then had to install Redis on my machine (via WSL2).

Then I did a deployment to Azure. And there I wondered why the app worked without adding the "Azure Cache for Redis".

Why does it work without the Redis service in Azure App Service? And when would it be important to use it?

By the way, in order for OpenIddict to work in Azure, I still had to do some configuration in BlazorModule. I scraped the information together from issues from others. It works, but I don't understand everything yet (e.g. generating the SigningKey & EncryptionKey) and it would be great if you could document the necessary steps to deploy it to Azure (so that the application can be run securely).

Thanks, Adrian


6 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    I scraped the information together from issues from others. It works, but I don't understand everything yet (e.g. generating the SigningKey & EncryptionKey)

    Hi, can you see this comment and apply it in your module class.

  • User Avatar
    0
    ageiter created

    Hello, this ticket has been closed although my question has not yet been answered....

    Why does it work without the Redis service in Azure App Service? And when would it be important to use it?

  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    Redis and OpenIddict are not related to each other.

    Redis is used in tiered applications (projects with individual AuthServer projects) and SPA applications (angular, Blazor Wasm) to cache permissions, HTTP requests etc. Since these kind of projects are distributed, they need an external caching server.

    If you are using non-tiered Blazor-Server or MVC application, caching is done in the memory hence you don't need an extra server (Redis) for it.

    OpenIddict Module is referenced by your Web application (for non-tiered applications like MVC/Blazor-Server) or AuthServer (for tiered application) that has no correlation with Redis. It uses caching no matter what. It's using in-memory cache or Redis depends on your template type (tiered/non-tiered).

  • User Avatar
    0
    ageiter created

    Thank you for the explanation.

    Then there was probably a problem with the version 6.0.0-rc.3. Because with a newly generated app (Blazor Server non-tiered) I had an exception that pointed to the missing Redis cache. So I had to install this on my PC and then was surprised that it did not need it on Azure. But maybe that was a bug you guys fixed in 6.0.0-rc.4.

  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    Thank you for the explanation.

    Then there was probably a problem with the version 6.0.0-rc.3. Because with a newly generated app (Blazor Server non-tiered) I had an exception that pointed to the missing Redis cache. So I had to install this on my PC and then was surprised that it did not need it on Azure. But maybe that was a bug you guys fixed in 6.0.0-rc.4.

    I may add that, It may be related to the public-site. If you create a new template with public-site enabled; it will require redis. Since public-site will be using blazor-server app to login and share some cached data.

  • User Avatar
    0
    ageiter created

    Aaaah, yes exactly, that's the point. I wanted to try the public site (with the CRM module). But since the CRM module can only be used on the public site and not in Blazor, we discarded it and generated a new app without the public site.

    Thanks, it's clear to me now. :-)

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11