v2 Azure Function with Service Bus trigger not firing










1















I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically



The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null message) it kicks it into life and picks up the other messages on the queue and processes them correctly.



This obviously isn't ideally for our automated tests. Has anybody seen this, or know of anything that will help?



Also, the Function App is running on a consumption plan.










share|improve this question
























  • On what plan are you running your functions?

    – Sebastian Achatz
    Nov 14 '18 at 18:41











  • Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

    – pkunal7
    Nov 15 '18 at 9:41












  • So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

    – pkunal7
    Nov 19 '18 at 11:58















1















I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically



The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null message) it kicks it into life and picks up the other messages on the queue and processes them correctly.



This obviously isn't ideally for our automated tests. Has anybody seen this, or know of anything that will help?



Also, the Function App is running on a consumption plan.










share|improve this question
























  • On what plan are you running your functions?

    – Sebastian Achatz
    Nov 14 '18 at 18:41











  • Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

    – pkunal7
    Nov 15 '18 at 9:41












  • So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

    – pkunal7
    Nov 19 '18 at 11:58













1












1








1








I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically



The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null message) it kicks it into life and picks up the other messages on the queue and processes them correctly.



This obviously isn't ideally for our automated tests. Has anybody seen this, or know of anything that will help?



Also, the Function App is running on a consumption plan.










share|improve this question
















I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically



The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null message) it kicks it into life and picks up the other messages on the queue and processes them correctly.



This obviously isn't ideally for our automated tests. Has anybody seen this, or know of anything that will help?



Also, the Function App is running on a consumption plan.







azure azure-functions azureservicebus azure-keyvault






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 9:42







pkunal7

















asked Nov 14 '18 at 14:05









pkunal7pkunal7

1759




1759












  • On what plan are you running your functions?

    – Sebastian Achatz
    Nov 14 '18 at 18:41











  • Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

    – pkunal7
    Nov 15 '18 at 9:41












  • So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

    – pkunal7
    Nov 19 '18 at 11:58

















  • On what plan are you running your functions?

    – Sebastian Achatz
    Nov 14 '18 at 18:41











  • Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

    – pkunal7
    Nov 15 '18 at 9:41












  • So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

    – pkunal7
    Nov 19 '18 at 11:58
















On what plan are you running your functions?

– Sebastian Achatz
Nov 14 '18 at 18:41





On what plan are you running your functions?

– Sebastian Achatz
Nov 14 '18 at 18:41













Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

– pkunal7
Nov 15 '18 at 9:41






Good question @SebastianAchatz. I'm on a Consumption plan - added to the original question.

– pkunal7
Nov 15 '18 at 9:41














So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

– pkunal7
Nov 19 '18 at 11:58





So having contacted Microsoft, they have confirmed that this approach does not work when on the consumption plan. See: comment by Paul Batum on the answer here stackoverflow.com/questions/52655284/…

– pkunal7
Nov 19 '18 at 11:58












1 Answer
1






active

oldest

votes


















0














App Service Plan



If you're using App Service plan then it's simple, just make use of Always on



Consumption Plan



If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.



When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here



Take a look at these issues:




  1. Service Bus Topic Trigger goes to sleep - Consumption Plan



    They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.



  2. Issue #210
    enter image description here


  3. Issue #681

There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above




In order to synchronize triggers when these deployment options are
used, open the Azure Portal and click the Refresh button, or make a
API call to the sync triggers endpoint:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90



Powershell sample:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365







share|improve this answer

























  • Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

    – pkunal7
    Nov 15 '18 at 17:43











  • @pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

    – Rohit Saigal
    Nov 15 '18 at 18:02










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302071%2fv2-azure-function-with-service-bus-trigger-not-firing%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














App Service Plan



If you're using App Service plan then it's simple, just make use of Always on



Consumption Plan



If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.



When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here



Take a look at these issues:




  1. Service Bus Topic Trigger goes to sleep - Consumption Plan



    They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.



  2. Issue #210
    enter image description here


  3. Issue #681

There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above




In order to synchronize triggers when these deployment options are
used, open the Azure Portal and click the Refresh button, or make a
API call to the sync triggers endpoint:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90



Powershell sample:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365







share|improve this answer

























  • Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

    – pkunal7
    Nov 15 '18 at 17:43











  • @pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

    – Rohit Saigal
    Nov 15 '18 at 18:02















0














App Service Plan



If you're using App Service plan then it's simple, just make use of Always on



Consumption Plan



If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.



When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here



Take a look at these issues:




  1. Service Bus Topic Trigger goes to sleep - Consumption Plan



    They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.



  2. Issue #210
    enter image description here


  3. Issue #681

There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above




In order to synchronize triggers when these deployment options are
used, open the Azure Portal and click the Refresh button, or make a
API call to the sync triggers endpoint:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90



Powershell sample:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365







share|improve this answer

























  • Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

    – pkunal7
    Nov 15 '18 at 17:43











  • @pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

    – Rohit Saigal
    Nov 15 '18 at 18:02













0












0








0







App Service Plan



If you're using App Service plan then it's simple, just make use of Always on



Consumption Plan



If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.



When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here



Take a look at these issues:




  1. Service Bus Topic Trigger goes to sleep - Consumption Plan



    They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.



  2. Issue #210
    enter image description here


  3. Issue #681

There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above




In order to synchronize triggers when these deployment options are
used, open the Azure Portal and click the Refresh button, or make a
API call to the sync triggers endpoint:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90



Powershell sample:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365







share|improve this answer















App Service Plan



If you're using App Service plan then it's simple, just make use of Always on



Consumption Plan



If you're using Consumption plan, the issue could be that your triggers did not sync properly with the Azure Infrastructure (Central Listener). It could have happened due to the way you deployed/edited your trigger related settings as explained in issue #210 below.



When you access the function directly from Portal, it might be forcing your function app to come alive, but as you can see that's only a workaround. Something similar is mentioned here



Take a look at these issues:




  1. Service Bus Topic Trigger goes to sleep - Consumption Plan



    They also mention that it wakes up only on accessing it via the portal or calling a HTTP triggered function in the same app, which is similar to the behavior you are seeing.



  2. Issue #210
    enter image description here


  3. Issue #681

There are 3 suggested ways to resolve it, mentioned as part of Issue #210 above




In order to synchronize triggers when these deployment options are
used, open the Azure Portal and click the Refresh button, or make a
API call to the sync triggers endpoint:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/ARMTemplates/FunctionsWebDeploy.json#L90



Powershell sample:
https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1#L360-L365








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 '18 at 0:08

























answered Nov 15 '18 at 0:01









Rohit SaigalRohit Saigal

3,2322218




3,2322218












  • Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

    – pkunal7
    Nov 15 '18 at 17:43











  • @pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

    – Rohit Saigal
    Nov 15 '18 at 18:02

















  • Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

    – pkunal7
    Nov 15 '18 at 17:43











  • @pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

    – Rohit Saigal
    Nov 15 '18 at 18:02
















Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

– pkunal7
Nov 15 '18 at 17:43





Thanks for your answer. We are using the standard VSTS app service deploy step without the Web Deploy option selected. Syncing the triggers hasn't solved the issue :(

– pkunal7
Nov 15 '18 at 17:43













@pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

– Rohit Saigal
Nov 15 '18 at 18:02





@pkunal7 ok got it. One of the suggestions in first issue link from answer is to check if the VSTS deployment task uses web deploy.. see here github.com/Azure/azure-functions-host/issues/… .. although I don't know enough about VSTS app service deploy to say it would make things work for sure.. do give it a try if it makes sense.

– Rohit Saigal
Nov 15 '18 at 18:02



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302071%2fv2-azure-function-with-service-bus-trigger-not-firing%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands