After migrating to Azure and recreating the On‑premises Data Gateway, existing Power Automate flows often keep stale connection references. Even if you recreate connections/custom connectors, flows will continue to fail until every action is explicitly re‑bound to the new gateway/connection and the custom connector definition is refreshed and republished.
Common root causes & fixes
1)Gateway mismatch
Connections still point to the old gateway ID.
Fix: Recreate the connection selecting the new gateway, then edit the flow and reselect the connection on every action.
2)Stale connection references in flows
Flow actions cache the old connection.
Fix: Open each action → reselect the connection (don’t rely on “fix connection” at the flow level).
3)Custom connector not republished
After environment/API changes, old Swagger/host URLs remain.
Fix: Update the custom connector (host, base URL, auth), Save → Update connector → Republish, then recreate the connection.
4)Authentication changes
API auth type changed (Basic ↔ OAuth ↔ API Key), cert rotated, or credentials expired.
Fix: Verify auth settings in the connector; re‑enter secrets; confirm scopes/headers.
5)Environment variables still pointing to old endpoints
Especially with solutions.
Fix: Update environment variables and re‑import / upgrade the solution.
6)Gateway permissions
New gateway installed but service account not authorized.
Fix: Add the account as a Gateway Admin/User and ensure firewall/ports are open.
Quick validation steps
Test the connection itself (not just the flow).
Create a new test flow using the same connector, if it works, the old flow still has cached refs.
Check Run History → Action error details for gateway/host/auth hints.
Conclusion:
Recreating the gateway/connections is necessary but not sufficient. You must republish custom connectors and rebind every flow action to the new connections/gateway. This resolves most “connection error after Azure migration” issues.
✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
👍 Feel free to Like the post if you found it useful.