Forum Discussion
mikeeq
2 years agoFrequent Visitor
Data Gateway PowerShell module issue with `Add-DataGatewayClusterMember` command `-RegionKey` param
Hi all, I recently encountered an issue with the latest version of DataGateway PowerShell module (latest version of PS7 and DataGateway service): https://www.powershellgallery.com/packages/DataGat...
mikeeq
2 years agoFrequent Visitor
Seems like API requests are missing "®ion=westeurope" parameter at the end of URI, or region specific API endpoint is not filtering data (gateways in that case) per region.
PS C:\Users\vagrant> add-datagatewaycluster -RecoveryKey $secureRecoveryKey -Name DataGatewayPoC -OverwriteExistingGateway -RegionKey westeurope -Verbose -Debug
DEBUG: 12:18:57 - Add-DataGatewayCluster begin processing with ParameterSet __AllParameterSets.
DEBUG: 12:18:57 - Cmdlet version: 3000.196.145
VERBOSE: Request Uri: https://api.powerbi.com/v2.0/myorg/me/gatewayRegions
VERBOSE: Status Code: OK (200)
VERBOSE: Request Uri: https://wabi-west-europe-redirect.analysis.windows.net/v2.0/myorg/me/gatewayClusters?$expand=permissions,memberGateways
VERBOSE: Status Code: OK (200)
VERBOSE: Request Uri: https://wabi-west-europe-redirect.analysis.windows.net/unifiedgateway/gateways/CreateGatewayWithApps
VERBOSE: Status Code: OK (200)
DEBUG: Microsoft.PowerBI.DataMovement.ExternalContracts.API.CreateGatewayResponse
DEBUG: 12:19:02 - Add-DataGatewayCluster end processing.
GatewayId GatewayObjectId GatewayName GatewayType
--------- --------------- ----------- -----------
xxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx DataGatewayPoC Resource
PS C:\> Add-DataGatewayClusterMember -RegionKey westeurope -GatewayName "DataGatewayPoC-2" -RecoveryKey $secureRecoveryKey -OverwriteExistingGateway -Debug -Verbose -GatewayClusterId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
DEBUG: 12:19:51 - Add-DataGatewayClusterMember begin processing with ParameterSet __AllParameterSets.
DEBUG: 12:19:51 - Cmdlet version: 3000.196.145
VERBOSE: Request Uri: https://api.powerbi.com/v2.0/myorg/me/gatewayRegions
VERBOSE: Status Code: OK (200)
VERBOSE: Request Uri: https://wabi-west-europe-redirect.analysis.windows.net/v2.0/myorg/me/gatewayClusters?$expand=permissions,memberGateways
VERBOSE: Status Code: OK (200)
Add-DataGatewayClusterMember: Gateway cluster xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx was not found
DEBUG: System.ArgumentException: Gateway cluster xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx was not found
at Microsoft.DataMovement.Powershell.Commands.DataGateway.AddDataGatewayClusterMember.ExecuteCmdletAsync()
at Microsoft.DataMovement.Powershell.Commands.Common.PowerBICmdlet.ProcessRecordAsync()
DEBUG: 12:19:52 - Add-DataGatewayClusterMember end processing.
PS C:\Users\vagrant> get-dataGatewayCluster -RegionKey westeurope -Verbose -Debug
DEBUG: 12:29:37 - Get-DataGatewayCluster begin processing with ParameterSet __AllParameterSets.
DEBUG: 12:29:37 - Cmdlet version: 3000.196.145
VERBOSE: Request Uri: https://api.powerbi.com/v2.0/myorg/me/gatewayClusters?$expand=permissions,memberGateways®ion=westeurope
VERBOSE: Status Code: OK (200)
Id : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Name : DataGatewayPoC
Description :
Permissions : {app-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, app-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Type : Resource
MemberGateways : {DataGatewayPoC}
Datasources : {}
LoadBalancingSettings :
AllowableOptions : Microsoft.PowerBI.ServiceContracts.Api.ODataDictionary`1[System.Boolean]
StaticCapabilities : 0
MaxPermission : Microsoft.PowerBI.ServiceContracts.Api.Permission
DEBUG: 12:29:38 - Get-DataGatewayCluster end processing.