azure-functions-dotnet-worker: TimerTrigger and ServiceBusTrigger not firing
I published a Windows FunctionsApp running on a consumption plan in “germanywestcentral” following the instructions and the examples on your repository. So far almost everything works smoothly, e.g., HttpTrigger
works as expected, etc.
However, functions annotated with TimerTrigger
do not fire on their schedule. Also, ServiceBusTrigger
functions are not firing when items are published on the queue. When I open the FunctionsApp on the Azure Portal, all the delayed TimerTrigger
and ServiceBusTrigger
functions fire at once immediately. This has not been a problem before I migrated the project to .NET 5.
Here the .csproject of my FunctionsApp project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.0.2" />
<PackageReference Include="Azure.Identity" Version="1.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.1-preview5" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.12" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="4.2.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
I noticed one more thing when publishing the FunctionsApp to Azure. Here is the corresponding snippet of the console output:
func azure functionapp publish <functionsappname>
...
...
Getting site publishing info...
Creating archive for current directory...
Uploading 15,36 MB [##############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Syncing triggers...
Syncing triggers...
Functions in <functionsappname>:
MyTimerTriggerFunction1 - [No Trigger Found]
HttpExample - [No Trigger Found]
Invoke url: https://<functionsappname>.azurewebsites.net/api/httpexample?code=PZYmsD3YzYPeVT2k5sWaW9GBVtPgInMq7lr2KrI5XxI77EmEb5teaQ==
MyServiceBusTriggerFunction - [No Trigger Found]
As it seems, the triggers are not recognized ([No Trigger Found]
). Could there be a problem when syncing triggers?
Do you have any suggestions?
Thanks!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (8 by maintainers)
@fabiocav I’ve only just tried these again today but so far so good. Looks like the timers and service triggers are firing when they should without needing to go to the portal 😌
@kinetiq I’ve opened a different issue using what you’ve reported above so we can avoid mixing issues, as the root cause for those might be very different. Let’s continue to follow up there.
@djjlewis Yeah, definitely something that needs to be documented and made available in diagnostics/detector. Let us know if that helps with the issue so we can confirm.
@paulisch will continue to look at this