Forum Discussion
Data Gateway PowerShell module issue with `Add-DataGatewayClusterMember` command `-RegionKey` param
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
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
Next log into my gateway account:
Login-DataGatewayServiceAccount
(Get-Item "C:\Program Files\On-premises data gateway\Microsoft.PowerBI.EnterpriseGateway.exe").VersionInfo.FileVersion
Use the following command to get the zone of the gateway to see which zone my current gateway is installed in:
Get-DataGatewayRegion
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
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"
Use the following command to get the just added gateway cluster:
get-dataGatewayCluster -RegionKey uksouth -Verbose -Debug
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.
- mikeeq2 years agoFrequent Visitor
Hi Anonymous,
The problem is when you are trying to add a member to the cluster which is deployed in non-default region, as far as I can see you are adding the member to the cluster which is your default one - UK South, try another region 😉
- Anonymous2 years agoNot applicable
Hi, mikeeq
Thanks for your reply. As you mentioned, when I add my gateway member to another region, it fails to add.
Since my current main gateway is located in westus3, when I add members to this main gateway, I specify other regions, such as westeurope.
Then when we execute the current command, Power BI will try to search for the current main gateway in the westeurope region, but in fact, our main gateway does not exist in the current region, so 404 not found appears.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.