Forum Discussion
The credentials provided for the sql source are invalid - Azure SQL Mirror
Hi JAnder ,
Thank you for reaching out to the Microsoft Community Forum.
It is a intermittent authentication issue rather than a permissions or configuration problem.
Please try below things to fix the issue.
1. Please Enable Diagnostic Logging, Turn on Azure SQL and Azure AD sign-in logs to see if there are failed token refresh attempts or conditional access blocks.
2. Default token lifetime is usually 1 hour. If refresh fails, you will see intermittent issues.
3. Check if there were any Azure AD or SQL outages during the failure windows.
4. Restart the mirror service or clear connection pools when the error occurs to confirm if it’s token-related.
5. Review Conditional Access, Ensure no policies intermittently affect the service principal.
Note: Implement retry logic for authentication failures. Use Managed Identity instead of a service principal, as it handles token refresh more reliably. Schedule mirror refreshes or restart jobs periodically to avoid stale tokens.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- JAnder8 months agoHelper II
I have checked and confirmed there was no cycling of the secrets during that time. I will look into the possibility of a managed identity and get back to this thread once done. Thanks
- v-dineshya8 months agoCommunity Support
Hi JAnder ,
As you mentioned in your previous response, you are working on manged identity options, Once it is done .Please do let us know.
Regards,
Dinesh