{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/Azure-Functions/issues/806","repository_url":"https://api.github.com/repos/Azure/Azure-Functions","labels_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/806/labels{/name}","comments_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/806/comments","events_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/806/events","html_url":"https://github.com/Azure/Azure-Functions/issues/806","id":324208269,"number":806,"title":"Service Bus Queue Trigger works locally but not after published to production","user":{"login":"tokyo0709","id":14184583,"avatar_url":"https://avatars3.githubusercontent.com/u/14184583?v=4","gravatar_id":"","url":"https://api.github.com/users/tokyo0709","html_url":"https://github.com/tokyo0709","followers_url":"https://api.github.com/users/tokyo0709/followers","following_url":"https://api.github.com/users/tokyo0709/following{/other_user}","gists_url":"https://api.github.com/users/tokyo0709/gists{/gist_id}","starred_url":"https://api.github.com/users/tokyo0709/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tokyo0709/subscriptions","organizations_url":"https://api.github.com/users/tokyo0709/orgs","repos_url":"https://api.github.com/users/tokyo0709/repos","events_url":"https://api.github.com/users/tokyo0709/events{/privacy}","received_events_url":"https://api.github.com/users/tokyo0709/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-17T22:29:21Z","updated_at":"2018-05-18T21:43:55Z","closed_at":null,"author_association":"NONE","body":"We have a function within a function app that we have been testing locally and everything works great. The function in question pulls items down from the queue as they pop into the queue and processes them. We are pointing to the queue in Azure that we are using for production as well. Once we publish, our other queues from the same service bus work fine except for this one function. We have added the app setting in Azure to match exactly to what we have locally in our local.settings.json file. We have also created a service bus queue trigger as another function in that function app as a test to see if we could pull down from that queue in production and that also worked fine. We have also tried remote debugging but nothing hits the breakpoints we have set.\r\n\r\n**Function in question**\r\n\r\n```csharp\r\n[FunctionName(\"ProcessEmail\")]\r\npublic static void Run([ServiceBusTrigger(\"email-queue-jobs\", AccessRights.Manage, \r\n    Connection = \"MicroServicesServiceBus\")]OutgoingEmail outgoingEmail, TraceWriter log,\r\n    [ServiceBus(\"email-queue-cleanup\", Connection = \"MicroServicesServiceBus\", EntityType = Microsoft.Azure.WebJobs.ServiceBus.EntityType.Queue)] ICollector<OutgoingEmail> cleanupEmailQueue,\r\n    [SendGrid] ICollector<SendGridMessage> messageCollector)\r\n{\r\n    try\r\n    {\r\n        log.Info($\"Attempting to send the email {outgoingEmail.Id}\");\r\n        var message = SendgridHelper.ConvertToSendgridMessage(outgoingEmail);\r\n        messageCollector.Add(message);\r\n\r\n        log.Info(\"Successfully sent email:\");\r\n        log.Info(JsonConvert.SerializeObject(outgoingEmail));\r\n    }\r\n    catch (Exception ex)\r\n    {\r\n        log.Info($\"Unable to process email {outgoingEmail.Id}\");\r\n        throw ex;\r\n    }\r\n\r\n    // Add email to the cleanup queue\r\n    log.Info(\"Sending email to the cleanup queue.\");\r\n    cleanupEmailQueue.Add(outgoingEmail);\r\n}\r\n```\r\n\r\n**Service Bus Connection in Application Settings in Azure**\r\n![queueconnection](https://user-images.githubusercontent.com/14184583/40206849-f40b5dfc-59ee-11e8-91ee-9d117a7d6ca8.PNG)\r\n\r\n**Service Bus Explorer showing a message to be processed**\r\n![queueimage](https://user-images.githubusercontent.com/14184583/40206874-09137072-59ef-11e8-9e7a-908a8fab9e58.PNG)\r\n\r\nJust can't get this function to pull anything down from the queue _email-queue-jobs_ from our Service Bus _MicroServicesServiceBus_\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/Azure-Functions/issues/comments/390340672","html_url":"https://github.com/Azure/Azure-Functions/issues/806#issuecomment-390340672","issue_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/806","id":390340672,"user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars3.githubusercontent.com/u/1056548?v=4","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T21:43:55Z","updated_at":"2018-05-18T21:43:55Z","author_association":"NONE","body":"Closing"}}
{"actor":{"display_login":"mathewc"}}