A cloud-based identity and access management service for securing user authentication and resource access
Hey Ashik, it looks like Azure is still complaining that your client secret is expired even though you’ve created a new one. Here are a few things to check and try:
- Verify the new secret in Azure AD • Go to Azure portal > Entra ID > App registrations > your app > Certificates & secrets. • Confirm the new secret is listed and hasn’t expired. Copy its full value right after you create it—once you leave the blade you can’t view it again.
- Update the secret in your Power Automate flow If you’re using a Custom Connector: • In Power Automate, go to Data > Custom Connectors > your connector > Edit. • On the Security tab, paste the new client secret in the “Client secret” field, save and re-publish. • Then edit your flow’s connection and re-authenticate using the updated connector. If you’re using the built-in “HTTP with Azure AD” action: • Edit the HTTP action, expand “Azure AD” auth settings, and replace the old secret with the new one. • Save the flow and trigger it again.
- Allow time for propagation Fresh client secrets can take a few minutes to become effective. If you test immediately after creation you may still hit the old-secret-expired error.
- Test outside of Power Automate Run a quick cURL or Postman request to isolate the issue: POST https://login.microsoftonline.com/{YOUR_TENANT_ID}/oauth2/v2.0/token Body (x-www-form-urlencoded): • grant_type=client_credentials • client_id={YOUR_CLIENT_ID} • client_secret={YOUR_NEW_SECRET} • scope=https://api.powerplatform.com/.default If this still returns AADSTS7000222, you know the problem is on the secret itself (e.g. wrong value or you copied an old/expired one).
- Consider certificate-based auth For longer-lived credentials and better security, you can switch from client secrets to certificate credentials: https://aka.ms/certCreds
Follow-up questions if you’re still stuck:
• Are you 100% certain you updated the active connection or connector with the new secret?
• Did you test the new secret with Postman/cURL outside of Power Automate?
• How long ago did you create the new secret? Could the old one still be cached somewhere?
• Are there multiple secrets on the app and might you be accidentally using the wrong one?
References
• Request an access token from Power Platform: https://learn.microsoft.com/power-platform/admin/programmability-authentication-v2#step-5-request-an-access-token
• Create a new client secret (AADSTS7000222): https://aka.ms/NewClientSecret
• Certificate credentials for apps: https://aka.ms/certCreds
Hope this helps! Let me know what you find.
Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.