Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Recently, with the new release of Data Gateway Automation, we can now install and configure the gateway using PowerShell itself.
In this blog, we are going to see how to use the new PowerShell scripts to install and configure the data gateway and some best practices.
Note: This feature is still in public preview.
The below is the simple script used to install and configure the data gateway.
$Psversion = (Get-Host).Version
if($Psversion.Major -ge 7)
{
if (!(Get-Module "DataGateway")) {
Install-Module -Name DataGateway
}
$securePassword = "" | ConvertTo-SecureString -AsPlainText -Force;
$ApplicationId ="";
$Tenant = "";
$GatewayName = "MyGateway";
$RecoverKey = "Demo@123" | ConvertTo-SecureString -AsPlainText -Force;
$userIDToAddasAdmin = ""
#Gateway Login
Connect-DataGatewayServiceAccount -ApplicationId $ApplicationId -ClientSecret $securePassword -Tenant $Tenant
#Installing Gateway
Install-DataGateway -AcceptConditions
#Configuring Gateway
$GatewayDetails = Add-DataGatewayCluster -Name $GatewayName -RecoveryKey $RecoverKey
#Add User as Admin
Add-DataGatewayClusterUser -GatewayClusterId $GatewayDetails.GatewayObjectId -PrincipalObjectId $userIDToAddasAdmin -AllowedDataSourceTypes $null -Role Admin
}
else{
exit 1
}
You can also find the above script on GitHub.
You can find the Official PowerShell script here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.