Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pbiembed5
New Member

Gateway public key size problem

Hello,

 

Is something changed with the public key size on the enterprise gateway lately?


I've been using this key successfully to encrypt credentials and update DataSources bound on an already set up gateway.
However after updating the gateway suddenly the returned key is 2048 bit instead the old one which was 1024bit ?

 

(print scr. of the current vs old key)

http://prntscr.com/q8tja2

 

With this key size, the following documentation on the official powerbi docs 
https://docs.microsoft.com/en-us/power-bi/developer/encrypt-credentials

is not working since it is using the previous 1024 vit key version.

 

Any idea why this has been changed or possibly it is problem with my gateway ?

 

 

Thanks a lot.

Cheers

 

6 REPLIES 6
PeterPetkov
Frequent Visitor

Got the same problem last week while setting up a new gateway.

 

Found updated code example in https://github.com/microsoft/PowerBI-CSharp/tree/master/sdk/PowerBI.Api/Extensions/V2

Not had time to fully qualify, but initial tests did not show this code making any difference
The error went away, but additional errors occurred on the gateway with other operations as a result

 

I've not had time to check into it exactly, but wondering did this fix the problem for you?

My problem is solved. But in addition to new AsymmetricKeyEncryptor code, i've updated the Microsoft.PowerBI.Api NuGet package to 2.14 and Enterprise Gateway is the latest 3000.27.30 (February 2020) release

 

P.S.

The link from my previous comment is not working. Code is moved one level up

https://github.com/microsoft/PowerBI-CSharp/tree/master/sdk/PowerBI.Api/Extensions/

dmarkham
Frequent Visitor

Any update on this problem?

dmarkham
Frequent Visitor

We are also seeing the same problem

Were you able to find out more, or has there been an official response?

Thanks

Incidently,

If you fix the provided code to use an encrypted length based on the key size, Power BI gateway won't decrypt and throws the following error:

DM.EnterpriseGateway Error: 0 : 2019-12-27T10:48:00.1390752Z DM.EnterpriseGateway a2650f49-396e-4e2c-b148-2cffef33b894 2880da58-6746-4578-83c6-40a997897f6a MGEC 00000000-0000-0000-0000-000000000000 d4c561e9-1c83-458a-84ed-1d5130e1dded d4c561e9-1c83-458a-84ed-1d5130e1dded 4B80A52E [DM.Pipeline.Common] Non-gateway exception encountered in activity scope: System.Security.Cryptography.CryptographicException: The parameter is incorrect.

at System.Security.Cryptography.NCryptNative.DecryptData[T](SafeNCryptKeyHandle key, Byte[] data, T& paddingInfo, AsymmetricPaddingMode paddingMode, NCryptDecryptor`1 decryptor)
at System.Security.Cryptography.NCryptNative.DecryptDataOaep(SafeNCryptKeyHandle key, Byte[] data, String hashAlgorithm)
at System.Security.Cryptography.RSACng.Decrypt(Byte[] data, RSAEncryptionPadding padding)
at Microsoft.PowerBI.DataMovement.CommonUtilities.Security.AsymmetricHigherKeyEncryptionHelper.Decrypt(String cipherText, String containerName)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.EncryptCredentialsWithSymmetricKey(GatewaySerializationContext responseContext, Func`1 getPlainCredentials)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.<>c__DisplayClass6_0.<<EncryptCredentialsWithTestDataSourceConnection>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayPipelineTelemetry.PipelineTelemetryService.<ExecuteInActivity>d__7`1.MoveNext()

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors