从 azure-webjobs-sdk-samples (1.0.0-rc1) ( https://github.com/Azure/azure-webjobs-sdk-samples/tree/master/BasicSamples/BlobOperations ) 运行 BlobOperations 示例时,我有以下问题。
当 WebJob 启动时,BlobTriggers 运行良好:
Job host started
Executing: 'Functions.BlobNameFromQueueMessage' because New queue message
detected on 'persons'.
Executing: 'Functions.BlobToBlob' because New blob detected:
input/BlobOperations.txt
Executing: 'Functions.BlobTrigger' because New blob detected:
output/BlobOperations.txt
但是当我将新文件添加到“输入”(或“输出”)容器时,即使等待超过 10 分钟,也没有任何反应。
当我重新启动 WebJob 时,我上传的文件确实会被 BlobTrigger 拾取!
这是样本中的(未更改的)BlobTrigger:
public static void BlobToBlob([BlobTrigger("input/{name}")] TextReader input,
[Blob("output/{name}")] out string output)
{
output = input.ReadToEnd();
}
这些示例使用的是最新版本的 Azure Webjobs SDK:
<packages>
<package id="Microsoft.Azure.WebJobs" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.Azure.WebJobs.Core" version="1.0.0-rc1" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="4.0.1" targetFramework="net45" />
</packages>
我没有更改示例的代码,除了包的位置(我的位于共享位置 - D:\Development\Nuget.Packages)以及 AzureWebJobsDashboard 和 AzureWebJobsStorage 连接字符串。
在即将投入生产的“真实”项目中,我遇到了同样的问题。
这是一个错误,还是我做错了什么?