gpt4 book ai didi

Azure 函数无法从 PowerShell 命令行部署

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

我已经成功部署 PowerShell Azure 函数“MyApp-UT”一段时间了。我最近在 Azure 中创建了一个名为“MyApp-PROD”的新函数,但是当我将完全相同的代码部署到这个新函数时,出现以下错误。

func azure functionapp publish MyApp-PROD          
Getting site publishing info...
Creating archive for current directory...
Uploading 8.78 KB [###############################################################################]
Creating archive for current directory...
Uploading 8.78 KB [###############################################################################]
Creating archive for current directory...
Uploading 8.78 KB [###############################################################################]
Error uploading archive (InternalServerError).
Server Response: {"Message":"An error has occurred.","ExceptionMessage":"ChangeSetId(prod) does not match 7124f41ebe2c40278a6c3b6e96271a7b, 'master' or 'HEAD'","ExceptionType":"System.InvalidOperationException","StackTrace":" at Kudu.Core.SourceControl.NullRepository.GetChangeSet(String id) in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\SourceControl\\NullRepository.cs:line 73\r\n at Kudu.Core.Deployment.FetchDeploymentManager.<PerformDeployment>d__9.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\Deployment\\FetchDeploymentManager.cs:line 235\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.Deployment.FetchDeploymentManager.<>c__DisplayClass8_0.<<FetchDeploy>b__0>d.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\Deployment\\FetchDeploymentManager.cs:line 115\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.Contracts.Infrastructure.LockExtensions.<LockOperationAsync>d__7`1.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Contracts\\Infrastructure\\LockExtensions.cs:line 134\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.Deployment.FetchDeploymentManager.<FetchDeploy>d__8.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Core\\Deployment\\FetchDeploymentManager.cs:line 108\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.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at Kudu.Services.Deployment.PushDeploymentController.<PushDeployAsync>d__12.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Deployment\\PushDeploymentController.cs:line 429\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.Deployment.PushDeploymentController.<ZipPushDeploy>d__8.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Deployment\\PushDeploymentController.cs:line 97\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.<InvokeActionAsyncCore>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.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>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.<ExecuteActionFilterAsyncCore>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.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>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.<ExecuteActionFilterAsyncCore>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.<ExecuteAsync>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.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>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.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}

但是切换回 MyApp-UT 我可以部署。

func azure functionapp publish MyApp-UT                                                                                                                                                                                                                                  
Getting site publishing info...
Creating archive for current directory...
Uploading 8.78 KB [###############################################################################]
Upload completed successfully.
Deployment completed successfully.

这两个函数之间应该没有什么不同。但它们属于不同的资源组。我对两者都有同等的访问权。关于如何开始解决此问题的想法?

最佳答案

发布答案是因为我花了 2 天多的时间才弄清楚。必须删除此 deployments 文件夹。但我不知道为什么......抱歉!

enter image description here

关于Azure 函数无法从 PowerShell 命令行部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67273083/

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