March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there,
I'm using IaC to automatically provision and recover a PowerBi On-Prem DataGateway with PowerShell (see command below). I'm using this approach since 8 month now and - so far - it worked well. Since approx. 1 week, the data-gateway can't be recovered anymore due to an powershell error, so I decided to re-create the gateway from scratch again, but it fails with same error (see below).
This is part of my script:
Install-Module -Name AWS.Tools.SecretsManager -RequiredVersion 4.1.506 -Repository PSGallery -Force
# Retrieve Secrets
$Secrets = (Get-SECSecretValue -SecretId arn:aws:secretsmanager:eu-central-1:XXXXXXXX:secret:powerbi_gateway_recovery_key20240201061715149600000001).SecretString | ConvertFrom-Json
# Install PowerBi Gateway - no version pinning as latest version seems to be required always
Install-Module -Name DataGateway -Repository PSGallery -Force
Import-Module -Name DataGateway
Connect-DataGatewayServiceAccount -ApplicationId $Secrets.ServiceUser_ClientId -ClientSecret (ConvertTo-SecureString $Secrets.ServiceUser_Secret -AsPlainText -Force) -Tenant $Secrets.ServiceUser_TenantId
Install-DataGateway -AcceptConditions
# Add gateway
Add-DataGatewayCluster -RecoveryKey $SecureRecoveryKey -GatewayName gateway_v1
Error, produced by last command of the script above:
Add-DataGatewayCluster: Error getting Gateway static capabilities.
Exception message: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter urn:ps:GetGatewayStaticCapabilitiesResult. The InnerException message was 'Invalid enum value 'GatewaySqlTrustedServers' cannot be deserialized into type 'Microsoft.PowerBI.DataMovement.ExternalContracts.API.GatewayStaticCapabilities'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. Please see InnerException for more details.
The data gateway was installed at version https://www.powershellgallery.com/packages/DataGateway/3000.240.50 which is the most-recent at time of writing:
I also tried the older version https://www.powershellgallery.com/packages/DataGateway/3000.236.121 but Add-DataGatewayCluster fails with same error.
Any idea what is causing this and how to get it fixed?
Thanks in advance,
Max
Solved! Go to Solution.
This is a known issue with the latest release of the gateway itself. Nothing is wrong with the cmdlet. If you install the July version of the gateway, the cmdlet commands work fine. I have an open ticket with the product team and they're investigating since they've been able to reproduce the error. TrackingID #2409190050002652.
Please guys!! Work hard to solve this!! Do your job well!!
The problem is resolved now. If you install the most recent DataGateway module it will work with the latest On-premises Data Gateway release. You can grab the latest DataGateway module from PowerShell Gallery | DataGateway 3000.244.23
They resolved one and create other on my script Powershell , with the latest version my Connect-DataGatewayServiceAccount -ApplicationId $appId -ClientSecret (ConvertTo-SecureString -String $cSec -AsPlainText -Force) -Tenant $tId is not working. Gives me this error under and If I rollback to older version it works, but fail on the Add-DataGatewayCluster, such a mess they have!! QA needs to work more on this.
2024-10-01 15:29:49 - Failed to log into Power BI Service Account. Error: The 'Connect-DataGatewayServiceAccount' command was found in the module 'DataGateway.Profile', but the module could not be loaded due to the following error: [Could not load file or assembly 'System.Management.Automation, Version=7.4.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.]
For more information, run 'Import-Module DataGateway.Profile'.
PS C:\> Get-Module -ListAvailable Datagateway*
Directory: C:\Program Files\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Binary 3000.244.… DataGateway Core {Add-DataGatewayCluster, Add-DataGatewa…
Binary 3000.244.… DataGateway.Profile Core {Connect-DataGatewayServiceAccount, Dis…
PS C:\> (Get-Module -ListAvailable Datagateway.Profile).ModuleBase
C:\Program Files\PowerShell\Modules\DataGateway.Profile\3000.244.23
PS C:\> (Get-Module -ListAvailable Datagateway).ModuleBase
C:\Program Files\PowerShell\Modules\DataGateway\3000.244.23
I have only come across this issue when there is a gateway configured on the machine. Otherwise when there is no gateway configured the commands run just fine.
I was going to raise another ticket with them about this problem but it seems intermittent.
However now I have another problem with the gateway where it's missing the Simba ODBC driver.
@mzare yeah downgrading fixed it! Thank you so much!
This is how I pinned it in code now:
Invoke-WebRequest 'https://download.microsoft.com/download/D/A/1/DA1FDDB8-6DA8-4F50-B4D0-18019591E182/GatewayInstall-24-07.exe' -OutFile 'C:\Windows\Temp\GatewayInstall.exe'
Install-DataGateway -InstallerLocation 'C:\Windows\Temp\GatewayInstall.exe' -AcceptConditions
This is a known issue with the latest release of the gateway itself. Nothing is wrong with the cmdlet. If you install the July version of the gateway, the cmdlet commands work fine. I have an open ticket with the product team and they're investigating since they've been able to reproduce the error. TrackingID #2409190050002652.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
39 | |
26 | |
15 | |
11 | |
10 |
User | Count |
---|---|
58 | |
51 | |
23 | |
14 | |
11 |