Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Not applicable

Refresh a Power BI Dataset with PowerShell

How to refresh a Power BI Dataset with PowerShell.


could you please help me the step by step details for the same.

Community Support
Community Support

Hi @Anonymous 

Please refer to below articles for detailed guide.

Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Super User
Super User

# Calls the Active Directory Authentication Library (ADAL) to authenticate against AAD
function GetAuthToken
    if(-not (Get-Module AzureRm.Profile)) {
        Import-Module AzureRm.Profile
    $clientId = "*****"
    $redirectUri = "urn:ietf:wg:oauth:2.0:oob"
    $resourceAppIdURI = ""
    $authority = "";
    $authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
    $authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $redirectUri, "Auto")
    return $authResult

# Get the auth token from AAD
$token = GetAuthToken

# Building Rest API header with authorization token
$authHeader = @{

# Refresh the dataset

$groupsPath = "*****"
$datasetID  = "*****"

$MailFailureNotify = @{"notifyOption"="MailOnFailure"}
$uri = "$groupsPath/datasets/$datasetID/refreshes"
Invoke-RestMethod -Uri $uri –Headers $authHeader –Method POST -Body $MailFailureNotify –Verbose

Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.