【问题标题】:Cannot deploy Azure Function: Error calling sync triggers无法部署 Azure 函数:调用同步触发器时出错
【发布时间】:2022-06-10 18:42:58
【问题描述】:

我有一个尝试部署到 Azure Functions 的应用程序。我正在尝试使用 <_functionsskipcleanoutput>true 作为 PropertyGroup 中“无法加载文件或程序集 System.IdentityModel.Tokens.Jwt”问题的解决方案。但是当我在那里添加时,我无法将我的应用正确部署到 Azure。

   func azure functionapp publish <app-name>

然后,我收到以下错误:

    Azure.Functions.Cli.Common.CliException: Error calling sync triggers (BadRequest). Request ID = '8352b514-e606-4316-b316-9ad47ad1e3b5'.
   at Azure.Functions.Cli.Helpers.RetryHelper.Retry(Func`1 func, Int32 retryCount, TimeSpan retryDelay, Boolean displayError) in D:\a\_work\1\s\src\Azure.Functions.Cli\Helpers\RetryHelper.cs:line 27
   at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.SyncTriggers(Site functionApp) in D:\a\_work\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 520
   at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.PublishFunctionApp(Site functionApp, GitIgnoreParser ignoreParser, IDictionary`2 additionalAppSettings) in D:\a\_work\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 504
   at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.RunAsync() in D:\a\_work\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 191
   at Azure.Functions.Cli.ConsoleApp.RunAsync[T](String[] args, IContainer container) in D:\a\_work\1\s\src\Azure.Functions.Cli\ConsoleApp.cs:line 64

csproj 文件中的版本:

TargetFrameworknetcoreapp 3.1

AzureFunctionsVersion v3

【问题讨论】:

    标签: c# .net azure


    【解决方案1】:

    请检查以下步骤是否有助于解决问题:

    1. 由于你没有提到System.IdentityModel.Tokens.Jwt包的版本,很多变通方法说某些版本存在问题。请通过降级或升级package 进行检查。
    2. 尝试使用此包Microsoft.AspNetCore.Authentication.JwtBearer 而不是包System.IdentityModel.Tokens.Jwt。

    【讨论】:

      猜你喜欢
      • 2023-01-26
      • 1970-01-01
      • 1970-01-01
      • 2023-02-08
      • 1970-01-01
      • 1970-01-01
      • 2021-01-17
      • 2022-11-10
      • 1970-01-01
      相关资源
      最近更新 更多