【发布时间】:2018-08-29 05:52:36
【问题描述】:
我正在运行一个具有 Azure 功能的项目,但它没有运行我的 azure 功能。我已经放了断点,它也没有达到断点。此外,输出不清楚,因此我可以调试我的代码。有什么办法可以调试代码找到问题的根本原因?
输出:
[3/20/2018 9:39:31 AM] 读取主机配置文件 'C:\Users\myname\Source\MyProject\aspnet-core\src\Nec.MyProject.Processors\bin\Debug\netstandard2.0\host.json' [2018 年 3 月 20 日上午 9:39:31] 主机配置文件读取:[3/20/2018 上午 9 点 39 分 31 秒] { [2018 年 3 月 20 日上午 9 点 39 分 31 秒] “队列”:{ [2018 年 3 月 20 日 9 点 39 分 31 秒 AM]“maxPollingInterval”:1000,[2018 年 3 月 20 日上午 9:39:31]
"visibilityTimeout": "00:00:00", [3/20/2018 9:39:31 AM]
“batchSize”:1,[2018 年 3 月 20 日上午 9:39:31] “maxDequeueCount”:5 [2018 年 3 月 20 日上午 9:39:31] } [2018 年 3 月 20 日上午 9:39:31] } [2018 年 3 月 20 日上午 9:39:48 AM] 生成 15 个工作职能 [3/20/2018 9:39:48 AM] 启动主机 (HostId=windowsmyname-655615619, 版本=2.0.11415.0, ProcessId=6320, Debug=False,ConsecutiveErrors=0,StartupCount=1, FunctionsExtensionVersion=) [3/20/2018 9:39:49 AM] 发现以下内容 功能:[2018 年 3 月 20 日上午 9:39:49] MyCompany.MyProject.Processors.BackOfficeFilesGeneratorJobs.RunTestGeneratorAsync [3/20/2018 9:39:49 AM] [3/20/2018 9:39:49 AM] 作业主机已启动 收听http://localhost:7071/ 按CTRL-C 退出... [2018 年 3 月 20 日 9:39:50 AM] 实例 ID 获取主机锁租约 '0000000000000000000000000C78D3496'。
Azure 函数:
[FunctionName("GenerateTestOfficeMasterDataFiles")]
public static async Task RunTestGeneratorAsync(
[QueueTrigger("%MasterDataFiles:Supplier:QueueName%", Connection = "ConnectionStrings:BlobStorageAccount")] BackOfficeFileGeneratorMessage<string> message,
ExecutionContext context,
TraceWriter log)
注意:当它是 BackOfficeFileGeneratorMessage 而不是 BackOfficeFileGeneratorMessage<string> 时,它工作正常。
更新:
public class BackOfficeFileGeneratorMessage<TEntityKey>
{
public BackOfficeFileGeneratorMessage()
{
Items = new MasterDataFileOperationItem <TEntityKey>[0];
}
public bool UseStaging { get; set; }
public string StoreNo { get; set; }
public bool RefreshAll { get; set; }
public IEnumerable<MasterDataFileOperationItem <TEntityKey>> Items { get; set; }
}
【问题讨论】:
-
您要触发的队列中有消息吗?
标签: c# azure asp.net-core azure-storage azure-functions