{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-functions-host/issues/3315","repository_url":"https://api.github.com/repos/Azure/azure-functions-host","labels_url":"https://api.github.com/repos/Azure/azure-functions-host/issues/3315/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-functions-host/issues/3315/comments","events_url":"https://api.github.com/repos/Azure/azure-functions-host/issues/3315/events","html_url":"https://github.com/Azure/azure-functions-host/issues/3315","id":353572343,"node_id":"MDU6SXNzdWUzNTM1NzIzNDM=","number":3315,"title":"[Singleton] attribute fails silently on consumption plan","user":{"login":"simeyla","id":3656278,"node_id":"MDQ6VXNlcjM2NTYyNzg=","avatar_url":"https://avatars1.githubusercontent.com/u/3656278?v=4","gravatar_id":"","url":"https://api.github.com/users/simeyla","html_url":"https://github.com/simeyla","followers_url":"https://api.github.com/users/simeyla/followers","following_url":"https://api.github.com/users/simeyla/following{/other_user}","gists_url":"https://api.github.com/users/simeyla/gists{/gist_id}","starred_url":"https://api.github.com/users/simeyla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simeyla/subscriptions","organizations_url":"https://api.github.com/users/simeyla/orgs","repos_url":"https://api.github.com/users/simeyla/repos","events_url":"https://api.github.com/users/simeyla/events{/privacy}","received_events_url":"https://api.github.com/users/simeyla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-23T22:10:33Z","updated_at":"2018-08-27T16:46:03Z","closed_at":null,"author_association":"NONE","body":"The [Singleton] attribute currently does nothing in a functions consumption plan.\r\n\r\nThis is quite frankly horrific for an enterprise service that it would fail silently like this. I'm just playing, but for some this may have critical data integrity consequences. Especially when moving from local testing or an app services plan (both where it works) directly to consumption plan it can easily go unnoticed.\r\n\r\n* If this is temporary while in beta then please add to 'known issues' for beta.\r\n* If this is as intended for the forseeable future, then the documentation must be updated for\r\n[Singleton](https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to#singleton-attribute).\r\n* Also need to update [functions documentation about consumption plan](https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#how-the-consumption-plan-works).\r\n\r\n* Potentially [Singleton] should fail hard and refuse to deploy on consumption plan (with a configurable override).\r\n\r\n\r\n#### Repro steps\r\n\r\n        [Singleton()]\r\n        [FunctionName(\"ProcessWebSessionQueue\")]\r\n        public static async Task Run([QueueTrigger(\"websession-updates\")]string myQueueItem, ILogger log)\r\n        {\r\n            log.LogInformation($\"HELLO \" + Environment.MachineName);\r\n            await Task.Delay(5000);\r\n            log.LogInformation($\"GOODBYE \"+ Environment.MachineName);\r\n        }\r\n\r\n#### Expected behavior\r\n\r\nHELLO\r\nGOODBYE\r\nHELLO\r\nGOODBYE\r\n\r\n#### Actual behavior\r\n\r\nHELLO\r\nHELLO\r\nGOODBYE\r\nGOODBYE\r\n\r\n#### Known workarounds\r\n\r\nUse app services plan.\r\n\r\n#### Related information \r\n\r\nWhen developing locally you get the expected response:\r\n\r\n[8/23/2018 9:04:22 PM] HELLO SWEAVER-5530\r\n[8/23/2018 9:04:27 PM] GOODBYE SWEAVER-5530\r\n[8/23/2018 9:04:27 PM] Executed 'ProcessWebSessionQueue' (Succeeded, Id=2f6d46a1-99c3-44d8-ab06-ce058162742e)\r\n[8/23/2018 9:04:27 PM] HELLO SWEAVER-5530\r\n[8/23/2018 9:04:32 PM] GOODBYE SWEAVER-5530\r\n[8/23/2018 9:04:32 PM] Executed 'ProcessWebSessionQueue' (Succeeded, Id=19cea4ce-25bf-4b7b-b657-c2f07948503f)\r\n[8/23/2018 9:04:33 PM] HELLO SWEAVER-5530\r\n[8/23/2018 9:04:38 PM] GOODBYE SWEAVER-5530\r\n[8/23/2018 9:04:38 PM] Executed 'ProcessWebSessionQueue' (Succeeded, Id=816fa53d-a2af-4770-826e-5cb3a49fb34e)\r\n[8/23/2018 9:04:39 PM] HELLO SWEAVER-5530\r\n[8/23/2018 9:04:44 PM] GOODBYE SWEAVER-5530\r\n[8/23/2018 9:04:44 PM] Executed 'ProcessWebSessionQueue' (Succeeded, Id=6e419025-b8d2-4797-92c8-88a5057909d3)\r\n[8/23/2018 9:04:44 PM] HELLO SWEAVER-5530\r\n[8/23/2018 9:04:49 PM] GOODBYE SWEAVER-5530\r\n[8/23/2018 9:04:49 PM] Executed 'ProcessWebSessionQueue' (Succeeded, Id=3cd1312c-f1a5-4948-b908-df567fd6e214)\r\n\r\nIn consumption plan you get :\r\n\r\n2018-08-23T20:55:53.458 [Information] HELLO\r\n2018-08-23T20:55:57.414 [Information] Executing 'UpdateWebSessionQueue' (Reason='This function was programmatically called via the host APIs.', Id=8b1f09ba-c686-4f30-a9d5-beff79167e64)\r\n2018-08-23T20:55:57.438 [Information] Executed 'UpdateWebSessionQueue' (Succeeded, Id=8b1f09ba-c686-4f30-a9d5-beff79167e64)\r\n2018-08-23T20:55:57.445 [Information] Executing 'ProcessWebSessionQueue' (Reason='New queue message detected on 'websession-updates'.', Id=8f2fb4f2-a525-4cf8-a88b-e6297795457e)\r\n2018-08-23T20:55:57.414 [Information] Executing 'UpdateWebSessionQueue' (Reason='This function was programmatically called via the host APIs.', Id=8b1f09ba-c686-4f30-a9d5-beff79167e64)\r\n2018-08-23T20:55:57.438 [Information] Executed 'UpdateWebSessionQueue' (Succeeded, Id=8b1f09ba-c686-4f30-a9d5-beff79167e64)\r\n2018-08-23T20:55:57.445 [Information] Executing 'ProcessWebSessionQueue' (Reason='New queue message detected on 'websession-updates'.', Id=8f2fb4f2-a525-4cf8-a88b-e6297795457e)\r\n2018-08-23T20:55:58.462 [Information] GOODBYE\r\n2018-08-23T20:55:58.468 [Information] Executed 'ProcessWebSessionQueue' (Succeeded, Id=5123da8d-04af-4b15-b332-89a4e224d3e0)\r\n2018-08-23T20:55:58.461 [Information] GOODBYE\r\n2018-08-23T20:55:58.468 [Information] Executed 'ProcessWebSessionQueue' (Succeeded, Id=5123da8d-04af-4b15-b332-89a4e224d3e0)\r\n2018-08-23T20:55:59.364 [Information] HELLO\r\n2018-08-23T20:55:59.364 [Information] HELLO\r\n2018-08-23T20:56:04.365 [Information] GOODBYE\r\n2018-08-23T20:56:04.372 [Information] Executed 'ProcessWebSessionQueue' (Succeeded, Id=4040f930-c4c0-40bb-9850-f8db95d6038a)\r\n2018-08-23T20:56:04.365 [Information] GOODBYE\r\n2018-08-23T20:56:04.372 [Information] Executed 'ProcessWebSessionQueue' (Succeeded, Id=4040f930-c4c0-40bb-9850-f8db95d6038a)\r\n2018-08-23T20:56:07.479 [Information] HELLO\r\n2018-08-23T20:56:07.479 [Information] HELLO\r\n2018-08-23T20:56:12.480 [Information] GOODBYE\r\n\r\nI've seen a few mentions of this in other issues, but only indirectly. At the very least the documentation needs to be clear on this limitation."},"comment":{"url":"https://api.github.com/repos/Azure/azure-functions-host/issues/comments/416289692","html_url":"https://github.com/Azure/azure-functions-host/issues/3315#issuecomment-416289692","issue_url":"https://api.github.com/repos/Azure/azure-functions-host/issues/3315","id":416289692,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjI4OTY5Mg==","user":{"login":"jeffhollan","id":7132626,"node_id":"MDQ6VXNlcjcxMzI2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/7132626?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffhollan","html_url":"https://github.com/jeffhollan","followers_url":"https://api.github.com/users/jeffhollan/followers","following_url":"https://api.github.com/users/jeffhollan/following{/other_user}","gists_url":"https://api.github.com/users/jeffhollan/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffhollan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffhollan/subscriptions","organizations_url":"https://api.github.com/users/jeffhollan/orgs","repos_url":"https://api.github.com/users/jeffhollan/repos","events_url":"https://api.github.com/users/jeffhollan/events{/privacy}","received_events_url":"https://api.github.com/users/jeffhollan/received_events","type":"User","site_admin":false},"created_at":"2018-08-27T16:46:03Z","updated_at":"2018-08-27T16:46:03Z","author_association":"MEMBER","body":"Do have on my list to test out but haven't yet. Last I heard it should work in consumption but was a caveat on if you'd be billed while other instances wait for the lock to release... but I'll give it a shot and maybe we just pull it if it is consistent.  I'll assign this to me"}}
{"actor":{"display_login":"jeffhollan"}}