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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Duroma
Regular Visitor

Gateway Error generating an asymmetric key. Key not valid for use in specified state.

Hello everyone,

 

I just changed my pc and when I try to reinstall my old On-premises data Gateway on it, it shows the following error :

Error generating an asymmetric key.
Exception message: Key not valid for use in specified state.

Key not valid for use in specified state.

Here are the logs :

Server stack trace:
à System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
à System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
à System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
à System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
à System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
à Microsoft.PowerBI.DataMovement.Pipeline.ConfigurationContracts.IGatewayConfigurationService.GenerateAsymmetricKey()
à Microsoft.PowerBI.DataMovement.Pipeline.GatewayClient.GatewayConfigurationClient.GenerateAsymmetricKey()ExceptionDetail, probablement créé par IncludeExceptionDetailInFaults=True, dont la valeur est :
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.

at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayServiceHost.AsymmetricKeyGenerator.ProduceAsymmetricKey(String containerName, Boolean cleanUpOldKeys, Int32 rsaKeySize)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayPipelineTelemetry.PipelineTelemetryService.ExecuteInActivity[T](PipelineActivityType pipelineActivityType, Func`1 action)
at SyncInvokeGenerateAsymmetricKey(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

 

I tried different solutions, including the deletion of the RSA folder located at :

C:\Users\myuser\AppData\Roaming\Microsoft\Crypto

 

But it doesn't work...

 

Any idea on how to fix this issue? I get the same thing when trying to create a new one.

 

Thanks a lot in advance,

 

Cheers,

 

Romain

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Duroma ,

According to this issue thread, the reason for the gateway installation failure error may also be caused by the antivirus software (like McAfee) is preventing it from signing in. You can ask your company's IT support to add the on-premise gateway to McAfee's white list, and your problem may be solved. If you still can't solve the problem, you can refer to the following blog to try it out.

Power BI key errors: Fix them with these detailed solutions


1. Change the Virtual Machine if the gateway installed in Virtual Machine

2. Upgrade the OS (Windows Server) to the newer version Windows Server 2012 or later

3. Install Data Gateway Manually with latest version

4. Change Logon User for Service


Best Regards

Hello Yingyinr,

 

Thank you for your answer ! Unfortunately it doesn't come from the antivirus because it hasn't changed from my old laptop to the one i'm trying to install the gateway on.

 

I tried the various solutions from the link you sent, but i'm not on a virtual machine and the local fixes don't work.

 

I'll keep trying to find a way ! Any help is welcomed 🙂

 

Romain

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.