Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I’m building a dashboard using Power BI Desktop on an AWS EC2 instance and planning to publish it to the Power BI Service. The data source is a CSV file stored in S3, accessed via Amazon Athena using the ODBC driver.
I would like to schedule automatic data refresh, so I’m considering installing an On-Premises Data Gateway on the EC2 instance. The EC2 instance is configured to automatically start and stop every day.
I have two questions regarding this setup:
If I configure the Athena ODBC connection to use the EC2's Instance Profile, will the scheduled refresh in Power BI Service still work properly, given that the EC2 instance automatically stops and starts daily?
If I configure the Athena ODBC connection using IAM credentials (Access ID and Secret Access Key) via the ODBC Data Source Administrator, will that configuration persist across EC2 restarts? In other words, will Power BI Service still be able to perform scheduled refreshes after the EC2 instance is restarted?
Based on my research, I couldn't find any definitive information regarding Option ①, which uses an Instance Profile (IAM role) for the Athena ODBC connection.
However, with Option ②, where IAM credentials (Access Key and Secret Access Key) are used, the ODBC configuration is stored in the Windows registry, so it persists after the EC2 instance is restarted. Therefore, scheduled refresh in Power BI Service should work without issues.
That said, Option ① using an Instance Profile is ideal, as it eliminates the need to issue and manage Access Keys. It allows authentication via temporary credentials and is therefore more secure and aligned with best practices.
I’d appreciate any insights or experiences you could share regarding this setup.
Thank you in advance!
Solved! Go to Solution.
Hey @ash_y,
Power BI Auto Refresh with EC2
Option 1: Go with this
Yes, it works fine with daily EC2 restarts. The Instance Profile automatically reassigns when EC2 starts up, so your Gateway stays connected.
Quick setup:
Option 2:
You're right - ODBC settings in registry persist after restarts. Works but not ideal for security.
From experience: Instance Profile is the way to go. I've run similar setups and the credentials refresh seamlessly when EC2 restarts. Just make sure your Gateway service starts automatically with Windows.
Test tip: Do a manual restart first to verify everything reconnects properly before setting up your scheduled refreshes.
The daily start/stop schedule won't break this - Instance Profiles are designed for exactly this kind of scenario.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Hey @ash_y,
Great questions! Let me clarify each point:
1. Default Credentials Chain explained:
2. Gateway auto-start configuration:
3. Anonymous authentication in Power BI Service:
Quick verification steps:
This setup is solid for daily EC2 cycling. The Instance Profile handles all the heavy lifting.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Thank you very much for your detailed explanation.
We plan to try out the solution you suggested.
Due to personal environment constraints, it may not function as expected. In that case, we may ask you additional questions.
Thank you for your continued support.
@ash_y
Thank you for the kind recognition - always happy to contribute to our community's success!
Best Regards,
Jainesh Poojara | Power BI Developer
Hey @ash_y,
Power BI Auto Refresh with EC2
Option 1: Go with this
Yes, it works fine with daily EC2 restarts. The Instance Profile automatically reassigns when EC2 starts up, so your Gateway stays connected.
Quick setup:
Option 2:
You're right - ODBC settings in registry persist after restarts. Works but not ideal for security.
From experience: Instance Profile is the way to go. I've run similar setups and the credentials refresh seamlessly when EC2 restarts. Just make sure your Gateway service starts automatically with Windows.
Test tip: Do a manual restart first to verify everything reconnects properly before setting up your scheduled refreshes.
The daily start/stop schedule won't break this - Instance Profiles are designed for exactly this kind of scenario.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Hi @jaineshp
Thank you for your previous response. I now understand that using an Instance Profile is possible.
I have three follow-up questions:
What does the “Default Credentials Chain” mean in this context?
My understanding is that we are using the Instance Profile to authenticate the Athena ODBC connection. Is that correct?
Regarding the on-premises gateway installed on the EC2 instance, is the setting to automatically start the gateway when Windows boots available only during installation, or can it also be configured/modified after installation?
I vaguely remember reading that a gateway connection in Power BI Service can be configured using anonymous authentication. Is that actually correct?
Thank you in advance for your help.
Hey @ash_y,
Great questions! Let me clarify each point:
1. Default Credentials Chain explained:
2. Gateway auto-start configuration:
3. Anonymous authentication in Power BI Service:
Quick verification steps:
This setup is solid for daily EC2 cycling. The Instance Profile handles all the heavy lifting.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
Hi @jaineshp
Thank you very much for your detailed explanation.
Currently, we are in the security risk review phase within our company before installing the gateway.
Once the review is completed and the installation is done, we plan to try out the solutions you suggested.
Due to some company-specific environmental constraints, things may not work as expected. In that case, I may reach out again with additional questions.
Thank you for your continued support.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!