简体   繁体   English

Blob 触发的 Azure 函数在部署后不起作用,但在本地运行,并且没有任何错误迹象

[英]Blob triggered Azure function doesn't work deployed but works locally, and no sign of any error

Here's my Azure function made with VS2017 15.6.0 Preview 1.1 - https://github.com/alvipeo/azfunc .这是我使用 VS2017 15.6.0 Preview 1.1 制作的 Azure 函数 - https://github.com/alvipeo/azfunc It perfectly works when I run it locally with VS.当我使用 VS 在本地运行它时,它完美地工作。

I created a CI/CD pipeline with VSTS.我用 VSTS 创建了一个 CI/CD 管道。 No errors there too, all deployed successfully.那里也没有错误,全部部署成功。

I set all settings in Azure, so it should work when deployed.我在 Azure 中设置了所有设置,因此在部署时它应该可以工作。 But it doesn't.但事实并非如此。 And what's more, I see NO SIGN of errors or any log records anywhere (but I enabled everything in the Diagnostics and I have App Insights).更重要的是,我在任何地方都看不到任何错误迹象或任何日志记录(但我启用了诊断中的所有内容并且我有 App Insights)。

Thanks to Microsoft engineers, it's solved.感谢微软工程师,它已经解决了。 Here's what needs to be done:以下是需要做的事情:

  1. When function is built in VS2017 for .NET Core 2.0 and deployed with VSTS, for some reason runtime version in Azure is set to 1. But when I run it locally I see the runtime version = 2. So you need to set in Azure this setting FUNCTIONS_EXTENSION_VERSION=~2当函数在 VS2017 中为 .NET Core 2.0 构建并使用 VSTS 部署时,出于某种原因,Azure 中的运行时版本设置为 1。但是当我在本地运行它时,我看到运行时版本 = 2。所以你需要在 Azure 中设置这个设置FUNCTIONS_EXTENSION_VERSION=~2
  2. When you use blob triggered Azure Function you can't use Blob-only Storage accounts (and I used the one).当您使用 Blob 触发的 Azure 函数时,您不能使用仅限 Blob 的存储帐户(我使用了一个)。 You have to use General Purpose storage account.您必须使用通用存储帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将映像上传到Azure Blob存储-本地工作,部署后失败 - Uplod images to azure blob storage - Works locally, fails when deployed $ .post不适用于本地部署的站点 - $.post doesn't work on locally deployed site 部署后,Azure 函数中的依赖注入失败但在本地工作 - Dependency Injection failing in Azure function once deployed but works locally C# Azure ServiceBus / Azure SQL - 在本地工作,部署到 Azure 时似乎不起作用 - C# Azure ServiceBus / Azure SQL - works locally, does not seem to work when deployed to Azure GitLab:未找到项目:在本地运行良好,无法正常部署 - GitLab: Project Not Found: Runs Fine Locally, Doesn't Work Deployed Azure Function 已部署并且可以工作,但 Function 监视器不显示调用数据 - Azure Function is deployed and does work but Function Monitor doesn't display the invocation data 简单的WebClient在本地工作,但在部署到Azure时无法工作 - Simple WebClient works locally, but not when deployed to Azure 如何对时间触发的 azure function 进行单元测试? 我的测试不起作用 - How to unit test azure function triggered by time? My test doesn't work Azure Blob 触发 function 存储帐户连接 - Azure Blob triggered function storage account connection Azure Function 中的可选变量由 BLOB 触发 - Optional variables in Azure Function triggered by BLOB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM