Open Closed

Data Seeding on Microservice setup (external database) #10884


User avatar
0
ydruck@greenwavecommissions.com created

I have setup release pipeline and deployment for staging environment in Azure Devops Deployment using IIS to host services and web applications.

In development enviroment I have been using Aspire to raise environment. To my understanding, Services are responsible for updating and seeding their instances.

However, issue is that in Staging environment for some reason undersettings I am not seeing Account/Chat features. Looking at tables in Administration database between two instances

SELECT COUNT() AS PermissionGroups FROM dbo.AbpPermissionGroups; SELECT COUNT() AS Permissions FROM dbo.AbpPermissions; SELECT COUNT() AS SettingDefinitions FROM dbo.AbpSettingDefinitions; SELECT COUNT() AS FeatureGroups FROM dbo.AbpFeatureGroups; SELECT COUNT(*) AS Features FROM dbo.AbpFeatures;

SELECT [Name] FROM dbo.AbpPermissionGroups WHERE [Name] LIKE '%Chat%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpPermissionGroups WHERE [Name] LIKE '%Account%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpPermissions WHERE [Name] LIKE '%Chat%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpPermissions WHERE [Name] LIKE '%Account%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpSettingDefinitions WHERE [Name] LIKE '%Chat%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpSettingDefinitions WHERE [Name] LIKE '%Account%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpFeatures WHERE [Name] LIKE '%Chat%' ORDER BY [Name]; SELECT [Name] FROM dbo.AbpFeatures WHERE [Name] LIKE '%Account%' ORDER BY [Name];

staging results in 0 data found. Dev Local - Has data.

Attached solution DELETED

I have tried everything I can think of.

Please help!

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • In the microservice template, the Administration service is the one that maintains/seeds the Administration database (permissions, features, settings, etc.). If, in staging, you see 0 rows in AbpPermissionGroups, AbpPermissions, AbpSettingDefinitions, AbpFeatureGroups, AbpFeatures, it means the Administration DB migrator/seeding didn’t run against that staging database (or it ran against a different connection string/database).
    • Also, even when seeding is correct, distributed cache (Redis) can cause the UI to keep showing “missing” permission/feature/setting definitions until the cache is cleared.

    Do this in your Azure DevOps release (staging) as a definitive fix:

    1. Run the Administration DbMigrator against the staging database

      • In your pipeline, add a step that executes the AdministrationService.DbMigrator (or whatever your solution’s migrator executable is for the Administration service) on every deployment (or at least on first deployment).
      • Ensure the migrator uses the same connection string that your staging Administration service uses.
      • After it runs, re-check the tables you listed; they should no longer be empty.
    2. Restart the Administration service after migrator/seeding

      • The Administration service is responsible for publishing/serving these management definitions and keeping the schema/data aligned.
    3. If you use Redis (distributed cache), clear it

      • In microservice setups, permission/feature/setting definition data is cached. If you seeded data but the UI still doesn’t show Account/Chat (or the permission dialogs are missing groups), clearing Redis typically resolves it.
      • Clear Redis, then restart the related services (Administration + the UI/gateway you use).
    4. Verify you are not accidentally pointing staging to a different DB

      • Since your staging DB has zero definition rows, the most common root cause is a connection string mismatch: the service is pointing to DB-A, but you are inspecting DB-B (or the migrator points to DB-B and the service points to DB-A). Make the pipeline set exactly one connection string source for both runtime and migrator.

    Links (verified):

    • https://abp.io/docs/latest/solution-templates/microservice/microservices
    • https://abp.io/docs/latest/solution-templates/microservice/permission-management

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0

    Please forward to Human support.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.