"Key": { > "type": "string", >-6ren">
gpt4 book ai didi

azure - 在 ARM 模板中获取功能键 - 间歇性失败

转载 作者:行者123 更新时间:2023-12-03 02:52:55 24 4
gpt4 key购买 nike

您好,我使用以下代码在 Arm 模板中获取功能键和触发器 Url 作为输出。

>     "outputs": {
> "Key": {
> "type": "string",
> "value": "[listsecrets(resourceId('Microsoft.Web/sites/functions',
> variables('funcName'),
> parameters('NameOfService')),'2015-08-01').key]"
> },
> "functionUrl": {
> "type": "string",
> "value": "[listsecrets(resourceId('Microsoft.Web/sites/functions',
> variables('funcName'),
> parameters('NameOfService')),'2015-08-01').trigger_url]"
> } }

我们在应用程序设置中将“AzureWebJobsSecretStorageType”设置为"file",因为在 Functions v2 中没有它它就无法工作,当我们执行 ARM 模板时,它有时可以工作,但有时会抛出以下错误,而不是确定出了什么问题,ARM 模板是有效的,因为它确实可以工作,并且我可以看到该功能也成功部署在 Azure 门户中,所以不确定它到底为什么失败,有任何线索吗?

[error]BadRequest: { "error": { "code": "BadRequest", "message": "System.FormatException: unable to decrypt CfDJ8AAAAAAAAAAAAAAAAAAAAAB93sc99M4b_klhBWrLMfQYRpSN9, the key is either invalid or malformed ---> System.Security.Cryptography.CryptographicException: The payload was invalid.\r\n at Microsoft.AspNetCore.DataProtection.Cng.CbcAuthenticatedEncryptor.DecryptImpl(Byte* pbCiphertext, UInt32 cbCiphertext, Byte* pbAdditionalAuthenticatedData, UInt32 cbAdditionalAuthenticatedData)\r\n at Microsoft.AspNetCore.DataProtection.Cng.Internal.CngAuthenticatedEncryptorBase.Decrypt(ArraySegment1
ciphertext, ArraySegment
1 additionalAuthenticatedData)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)\r\n at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)\r\n at Microsoft.AspNetCore.DataProtection.DataProtectionCommonExtensions.Unprotect(IDataProtector protector, String protectedData)\r\n at Kudu.Core.Infrastructure.SecurityUtility.DecryptSecretString(String content) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\SecurityUtility.cs:line 40\r\n --- End of inner exception stack trace ---\r\n at Kudu.Core.Infrastructure.SecurityUtility.DecryptSecretString(String content) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\SecurityUtility.cs:line 45\r\n at Kudu.Core.Functions.FunctionManager.d__91.MoveNext()
in C:\\Kudu
Files\\Private\\src\\master\\Kudu.Core\\Functions\\FunctionManager.cs:line
203\r\n--- End of stack trace from previous location where exception
was thrown ---\r\n at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
Kudu.Core.Functions.FunctionManager.<GetFunctionSecretsAsync>d__12.MoveNext()
in C:\\Kudu
Files\\Private\\src\\master\\Kudu.Core\\Functions\\FunctionManager.cs:line
220\r\n--- End of stack trace from previous location where exception
was thrown ---\r\n at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
Kudu.Services.Functions.FunctionController.<GetSecrets>d__12.MoveNext()
in C:\\Kudu
Files\\Private\\src\\master\\Kudu.Services\\Functions\\FunctionController.cs:line
141\r\n--- End of stack trace from previous location where exception
was thrown ---\r\n at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3
1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()" }

最佳答案

我找到了导致此问题的原因,它仅在功能的全新部署期间发生,即当我删除功能应用程序然后尝试部署时遇到此问题,原因是我只是删除功能应用程序而不是存储帐户与之相关,所以旧的存储帐户保留了有关已删除的功能应用程序的一些信息(我认为),事情变得困惑,当我开始使用功能应用程序删除存储帐户时,问题就消失了。只是补充一下,存储帐户专用于此功能应用程序,不被其他任何东西使用。

关于azure - 在 ARM 模板中获取功能键 - 间歇性失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54930870/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com