Integration hub plugin fails to connect to Dataverse-'AADSTS7000215' error

Our server-side plugin in the integration hub suddenly stopped syncing data to Dataverse with error ‘AADSTS7000215: Invalid client secret provided’. The plugin authenticates using an Azure AD app registration that worked fine for months.

Here’s the authentication code:

var credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
var serviceClient = new ServiceClient(credential, instanceUrl);

The failure started three days ago without any code changes. We checked the Azure AD app registration and the client secret, but everything looks correct in the portal. The plugin configuration in D365 hasn’t been modified either.

This is blocking our daily data sync process completely. Has anyone encountered this specific AADSTS error with integration hub plugins? What should we check beyond the obvious app registration settings?

Here’s the complete resolution process for your AADSTS7000215 error with proper client secret rotation:

Azure AD App Registration: First, navigate to your app registration in Azure Portal. Under ‘Certificates & secrets’, click ‘New client secret’. Set a description like ‘D365-Integration-2025’ and choose an appropriate expiration (I recommend 12 months maximum for security). Copy the secret value immediately - you won’t be able to see it again.

Plugin Configuration Update: Update your plugin’s secure configuration in D365. The exact location depends on your implementation:

// Update in plugin registration or configuration entity
var secureConfig = new SecureConfiguration {
    ClientId = "your-client-id",
    ClientSecret = "new-secret-value",
    TenantId = "your-tenant-id"
};

If using environment variables or solution configuration, update those values through the D365 admin interface. For plugin steps registered through code, you may need to update and redeploy your solution package.

Testing and Validation: Test in your sandbox environment first. Verify the plugin can authenticate and perform its sync operations. Monitor the Azure AD sign-in logs to confirm successful authentication attempts. Once validated, deploy to production during a maintenance window.

Preventive Measures:

  1. Set up Azure Monitor alerts for secret expiration (30-day and 7-day warnings)
  2. Document your rotation procedure in your runbook
  3. Consider implementing certificate-based authentication for longer validity
  4. Use Azure Key Vault to manage secrets centrally rather than hardcoding
  5. Establish a quarterly review of all app registrations and their credentials

Rollback Plan: Keep both secrets active for 24-48 hours after deployment. If issues arise, you can quickly revert to the previous secret without waiting for Azure AD propagation. Only delete the old secret after confirming stable operation.

The key lesson here is that client secret rotation should be a planned, documented process rather than an emergency response. With proper monitoring, you’ll never be surprised by an expired secret again.


This draft is based on general Microsoft Dynamics 365 Sales knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

AADSTS7000215 typically means the client secret has expired or is invalid. Even if it looks correct in the portal, Azure AD client secrets have expiration dates. Check the ‘Certificates & secrets’ section of your app registration - you might see the secret is expired or expiring soon. The timing (three days ago) suggests this is almost certainly an expired secret rather than a configuration issue.

You’re absolutely right! The secret expired on March 11th. I was looking at the wrong app registration initially. Now I need to rotate the client secret and update the plugin configuration. What’s the best approach to do this without causing more downtime? Should I create a new secret first before removing the old one, or does the order matter for plugin authentication?

Always create the new secret BEFORE removing the expired one. Azure AD allows multiple active secrets per app registration for exactly this reason - zero-downtime rotation. Generate your new secret in Azure AD, then update your plugin configuration with the new value. Test thoroughly in a non-production environment first. Only after confirming the new secret works should you remove the expired one. This gives you a rollback option if something goes wrong during the update.

I’d add that you should implement a monitoring system for secret expiration. We use Azure Monitor alerts set to notify us 30 days before any client secret expires. This prevents the exact situation you’re in. Also, consider using certificate-based authentication instead of client secrets - certificates can have longer validity periods and are generally more secure. For your immediate issue though, Raj’s advice is spot-on. Document your rotation procedure so this doesn’t catch you off guard again.

Quick tip for the plugin configuration update: don’t just update the secret in your code and redeploy. You need to update it in the D365 plugin configuration settings as well, which are often stored in secure configuration or environment variables. If you’re using a solution, export it, update the configuration XML, then reimport. Missing this step is a common mistake that leads to continued authentication failures even after rotating the secret in Azure AD.