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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
am trying to set-up a little c# script to be run in an SSIS package to refresh dataset(s) after the ETL part of the solution has updated the DB.
(code will be repeated in several ETL processes)
am initially just doing a proof-of-concept as a WindowsForms app (easier to work with).
Following code works....
string workspaceConnection = "powerbi://api.powerbi.com/v1.0/myorg/ProofOfConcept Test";
string userId = "UserName@myOrg.com";
string password = "123456";
string connectStringUser = $"DataSource={workspaceConnection};User ID={userId};Password={password};";
Server server = new Server();
server.Connect(connectStringUser);
foreach (Database database in server.Databases)
{
database.Model.RequestRefresh(RefreshType.DataOnly);
database.Model.SaveChanges();
}
but I have a problem with the userid / password
i enter my credentials - the app accepts these and asks for a password (even tho i have entered one as in example)
is it possible to enter the password into the connection string ??
also - we are using Multi-Factor Auth - can this be bypassed on do we need a user specificslly setup to avoid MFA
thx
Solved! Go to Solution.
Hi @Anonymous,
AFAIK, power bi already provides the rest API for these operations, I'd like to suggest you use API to do manage power bi contents.
In addition, you can also take a look at the following link about use C# to manage power bi if helps:
C# Application that Manages Power BI - Microsoft Power BI Community
Regards,
Xiaoxin Sheng
Hi @Anonymous,
AFAIK, power bi already provides the rest API for these operations, I'd like to suggest you use API to do manage power bi contents.
In addition, you can also take a look at the following link about use C# to manage power bi if helps:
C# Application that Manages Power BI - Microsoft Power BI Community
Regards,
Xiaoxin Sheng
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |