Thank you @hackcrr
Hi, @mikeeq
I apologize for my late reply. I did a complete test based on the code you are using. During the test, the gateway module honors the region parameter. Here are the results of my tests:
First, I updated my PowerShell to version 7.4.3 using the following commands:
winget source reset --force
winget source update
winget install --id Microsoft.Powershell --source winget
![vjianpengmsft_0-1720782399602.png vjianpengmsft_0-1720782399602.png]()
I installed the gateway module using the following command:
Install-Module -Name OnPremisesDataGatewayHAMgmt
Install-Module -Name DataGateway
Import the gateway module in PowerShell and view the gateway version:
Import-Module DataGateway
(Get-Module DataGateway).version
![vjianpengmsft_1-1720782669595.png vjianpengmsft_1-1720782669595.png]()
Next log into my gateway account:
Login-DataGatewayServiceAccount
![vjianpengmsft_2-1720782874743.png vjianpengmsft_2-1720782874743.png]()
(Get-Item "C:\Program Files\On-premises data gateway\Microsoft.PowerBI.EnterpriseGateway.exe").VersionInfo.FileVersion
![vjianpengmsft_3-1720783459766.png vjianpengmsft_3-1720783459766.png]()
Use the following command to get the zone of the gateway to see which zone my current gateway is installed in:
Get-DataGatewayRegion
![vjianpengmsft_4-1720784711194.png vjianpengmsft_4-1720784711194.png]()
Add a gateway cluster member to the gateway region:
Add-DataGatewayClusterMember -GatewayClusterId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -GatewayName datagatewaypoc-2 -RecoveryKey $secureRecoveryKey -OverwriteExistingGateway -RegionKey uksouth
![vjianpengmsft_5-1720785098820.png vjianpengmsft_5-1720785098820.png]()
You can see that we were also able to add the gateway member without any problems when we specified the RegionKey uksouth.
Use your debug command below to test that the Power BI API automatically redirects to the specified region when you add a gateway cluster member:
PS C:\> Add-DataGatewayClusterMember -RegionKey uksouth -GatewayName "DataGatewayPoC-4" -RecoveryKey $secureRecoveryKey -OverwriteExistingGateway -Debug -Verbose -GatewayClusterId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"![vjianpengmsft_0-1720785910935.png vjianpengmsft_0-1720785910935.png]()
![vjianpengmsft_1-1720785928868.png vjianpengmsft_1-1720785928868.png]()
Use the following command to get the just added gateway cluster:
get-dataGatewayCluster -RegionKey uksouth -Verbose -Debug![vjianpengmsft_2-1720786146902.png vjianpengmsft_2-1720786146902.png]()
During this entire test, the gateway module worked fine. You can try to add the gateway cluster members again using PowerShell commands. Or you can perform the operation in another computer.
In addition to this, you can choose an alternative solution: add the gateway cluster using the local data gateway software.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.