2017-08-24 141 views
8

Azure函数错误。我得到的错误在门户Azure函数:我们无法检索运行时主密钥

Error: 

We are not able to retrieve the runtime master key. Please try again later. 
Session Id: d13fceebd4ea4cb1b7fb3d3829dd1406 

Timestamp: 2017-08-24T20:04:23.555Z 

我已经尝试了所有在这里的建议: https://blogs.msdn.microsoft.com/jpsanders/2017/05/09/function-app-error-we-are-not-able-to-retrieve-the-runtime-master-key/

我使用的运行时版本1.0.10917,但我已经试过~1并得到同样的结果。

这似乎发生在我从门户中删除功能然后重新创建它时。在我们拥有的每一个功能之后,它会一直发生。第一次创建函数时,它似乎工作。

+0

分享您的会话ID和时间戳。此外github或论坛可能更适合这个问题https://github.com/Azure/Azure-Functions/issues – ahmelsayed

+0

我怎么得到这个?当然这是一个编程问题,所以downvote非常愚蠢 – Jeff

+0

会话ID是错误消息的一部分,它显示出''我们无法检索运行时主密钥'' – ahmelsayed

回答

2

这是你打

System.Security.Cryptography.CryptographicException : The payload was invalid. 
    at Microsoft.AspNetCore.DataProtection.Cng.CbcAuthenticatedEncryptor.DecryptImpl(Byte* pbCiphertext,UInt32 cbCiphertext,Byte* pbAdditionalAuthenticatedData,UInt32 cbAdditionalAuthenticatedData) 
    at Microsoft.AspNetCore.DataProtection.Cng.Internal.CngAuthenticatedEncryptorBase.Decrypt(ArraySegment`1 ciphertext,ArraySegment`1 additionalAuthenticatedData) 
    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData,Boolean allowOperationsOnRevokedKeys,UnprotectStatus& status) 
    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData,Boolean ignoreRevocationErrors,Boolean& requiresMigration,Boolean& wasRevoked) 
    at Microsoft.Azure.WebJobs.Script.WebHost.DataProtectionKeyValueConverter.Unprotect(Key key) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\DataProtectionKeyValueConverter.cs : 43 
    at Microsoft.Azure.WebJobs.Script.WebHost.SecretManager.ReadHostSecrets(HostSecrets hostSecrets) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\SecretManager.cs : 383 
    at async Microsoft.Azure.WebJobs.Script.WebHost.SecretManager.GetHostSecretsAsync() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\Security\SecretManager.cs : 83 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at async Microsoft.Azure.WebJobs.Script.WebHost.WebJobsSdkExtensionHookProvider.GetOrCreateExtensionKey(String extensionName) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\WebHooks\WebJobsSdkExtensionHookProvider.cs : 71 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at Microsoft.Azure.WebJobs.Script.WebHost.WebJobsSdkExtensionHookProvider.GetExtensionWebHookRoute(String extensionName) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\WebHooks\WebJobsSdkExtensionHookProvider.cs : 64 
    at Microsoft.Azure.WebJobs.Extensions.EventGrid.EventGridExtensionConfig.Initialize(ExtensionConfigContext context) 
    at Microsoft.Azure.WebJobs.Host.Executors.JobHostConfigurationExtensions.InvokeExtensionConfigProviders(ExtensionConfigContext context) 
    at Microsoft.Azure.WebJobs.Host.Executors.JobHostConfigurationExtensions.CreateStaticServices(JobHostConfiguration config) 
    at Microsoft.Azure.WebJobs.JobHost.PopulateStaticServices() 
    at Microsoft.Azure.WebJobs.Script.Utility.CreateMetadataProvider(JobHost host) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Utility.cs : 362 
    at Microsoft.Azure.WebJobs.Script.ScriptHost.LoadCustomExtensions() at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 670 
    at Microsoft.Azure.WebJobs.Script.ScriptHost.Initialize() at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 510 
    at Microsoft.Azure.WebJobs.Script.ScriptHost.Create(IScriptHostEnvironment environment,IScriptEventManager eventManager,ScriptHostConfiguration scriptConfig,ScriptSettingsManager settingsManager) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 937 

这是很难为用户发现这些错误,他们的应用程序,因为运行时不记录他们的任何地方UX可以查询例外。

这一问题已被跟踪异常:https://github.com/Azure/azure-webjobs-sdk-script/issues/1832

,我们还不能完全确定为什么发生这种情况。您是否有机会重新发布您的密钥? (编辑:或删除并重新创建具有相同名称的应用程序)这些密钥由功能应用程序特定的密钥加密,并且不会在该上下文之外工作。

修复从法比奥Cavalcante的

+2

由于azure函数部署机制中的错误(关于锁定文件和竞争条件的随机错误),有时需要删除并重新创建函数应用程序,而不是仅更新它。 – Jeff

1

复制切换功能Azure的存储账户到新的存储帐户可以引发类似的问题。

Error: We are not able to get the key swaggerdocumentationkey.
Please check the runtime logs for any errors or try again later.

这可能与正在使用新站点未初始化的存储帐户有关。我无法确认这种行为,但似乎在切换存储帐户时,新帐户不会初始化新网站,并会导致类似的问题。

0

我删除了天蓝色的功能并重新命名了它。之后,它开始正常工作。看起来即使你删除了天蓝色的功能,痕迹也存在于天蓝色的日志中,并且搞砸了一些东西。

此外,请确保您为每个功能保留单独的azure blob存储,如果您在多个天青功能中使用它,那么它会给出一些奇怪的错误。我认为他们正在使用它进行日志记录和身份验证。