Forum Discussion
Data flows connected to SQL are not refreshing on schedule but refreshing manually.
Hi Prasanth460
This is a credential/token issue. Manual refresh works because it uses your current login token, but scheduled refresh fails because the stored credentials expired.
Please do these 3 steps:
1. Dataflow Credentials:
Power BI Service > Workspace > Dataflows > Settings > Data source credentials
Click Edit for your SQL source > Sign In again > Save
2. Gateway Credentials:
Settings > Manage connections and gateways > Your Gateway > Data Sources
Click Edit for your SQL source > Re-enter credentials > Test Connection > Apply
3. Service Account Check:
Make sure the service account running the gateway has db_datareader access on SQL DB and password is not set to expire. Also ensure MFA is not enabled on that account.
Root cause: Dataflow and Gateway credentials must be same and valid. After updating both, do 1 manual refresh then check next scheduled run.
This should fix it. Let me know if you still get the error.
Hi Gautam_Kumar01 Thanks for the response. and detailed steps. Could you help me to know where can i find Token expiry details.
and yes Data flow and Gate way credentials are valid but not same. Gateway is configured with Service account and data flow is connected with User account.
Point 3: service accoint hase access to SQL DB.
can I directly change ownership of flow to service accoint in power BI service--> settings
or can i change by edit flow in Service and save with service account credentials.
Thanks in advance
- Gautam_Kumar0130 days agoPost Partisan
Hi Prasanth460
You nailed the root cause. Because Dataflow and Gateway credentials are different, scheduled refresh will always fail.
Ans 1: Token Expiry
There is no UI in PowerBI to see "token expiry". For SQL it depends on your DB password policy. For OAuth it’s auto-refreshed. The main issue here is not token expiry, it's mismatched accounts.Ans 2: Yes, that is the problem
Gateway running as Service Account cannot use your User Account token for scheduled runs. Both must be same.Ans 3: How to change Ownership - Yes you can do both
This is the best practice fix. Use Option B.Option A: Change Gateway to your User Account
`Settings > Manage gateways > Data Source > Edit > Sign in with your User account`Option B: Change Dataflow Ownership to Service Account - (Recommended)
1. Add the `Service Account` as `Admin` to your Workspace first
2. Go to `Workspace > Dataflows > ... > Settings > General > Take over`
3. Now go to `Data source credentials` and Sign in with the `Service Account`
4. Ensure the same `Service Account` is configured in Gateway Data Source with SQL login
5. Important: For the Service Account in AD/SQL, set `Password Never Expires` and disable `MFA`After Option B, do 1 manual refresh. Your daily/weekly scheduled refresh will start working.
Let me know after trying Option B.
- Prasanth46028 days agoRegular Visitor
Thanks Gautam_Kumar01 , I got access to SQL DB for service account. added this as admin for workspace and now I will modify the data flow ownership to service account credentials. will keep you updated the status after this changes.
- v-achippa25 days agoCommunity Support
Hi Prasanth460,
As we haven’t heard back from you, we wanted to kindly follow up to check if the iisue is resolved? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa