Dataverse Plug-in Secure and Unsecure Configuration: Store Settings Safely

Dataverse plug-in step registrations can carry unsecure and secure configuration strings. Unsecure configuration is available to users with access to the registration, while secure configuration is intended for sensitive settings and has more restricted visibility. Neither should be treated as a general-purpose secret vault.

When this pattern is useful

Learn when to use secure and unsecure plug-in step configuration, how to read configuration in C#, and how to avoid storing secrets unsafely.

Implementation steps

  • Identify settings that are environment-specific, such as a feature flag or non-secret endpoint name, and pass them as unsecure configuration when appropriate.
  • Keep credentials and sensitive values out of source code and unsecure configuration. Prefer managed identity or a secure external secret store for secrets where the architecture supports it.
  • Register the plug-in step with the appropriate configuration values in each environment.
  • Read the constructor configuration in the plug-in class and validate required values before use.
  • Document configuration ownership and include environment-specific values in deployment procedures.

Example implementation

public sealed class OrderPlugin : IPlugin
{
    private readonly string _unsecure;
    private readonly string _secure;

    public OrderPlugin(string unsecure, string secure)
    {
        _unsecure = unsecure ?? string.Empty;
        _secure = secure ?? string.Empty;
    }

    public void Execute(IServiceProvider serviceProvider)
    {
        var settings = _unsecure.Split(';', StringSplitOptions.RemoveEmptyEntries);
        // Parse and validate non-secret settings before processing.
    }
}

Common pitfalls

  • Do not place passwords, API keys or client secrets in unsecure configuration.
  • Do not assume secure configuration automatically encrypts arbitrary downstream use or grants access to external systems.
  • Validate missing or malformed configuration to fail with a clear diagnostic.

Validation checklist

Verify who can view each configuration value, test missing settings, and confirm deployment steps populate the correct environment values.

Conclusion

A reliable implementation starts with a clear contract, explicit failure handling and repeatable environment configuration. Test the operational edge cases—not only the happy path—before making this part of a production workload.