Forum Discussion
ilav
6 years agoFrequent Visitor
Can't select Maps To in Gateway setting via API/Powershell
Hello - I have a dataset which successfully connects to an azure DB via gateway when configured manually. However, when trying to configure the dataset via powershell, unable to select the gateway in...
Anonymous
5 years agoNot applicable
I was able to select the Map To field with the following:
# TRY TO BIND
$bindUrl = 'datasets/<ReplaceWithYourGatewayId>/Default.BindToGateway'
$postBindParams = @{
gatewayObjectId = "yourGatewayId"
datasourceObjectIds =@(
"yourDataSourceId"
)
} | ConvertTo-Json
write-host $postBindParams
Invoke-PowerBIRestMethod -Url $bindUrl -Method Post -Body $postBindParams -ContentType $content -Verbose