{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/Azure-Functions/issues/825","repository_url":"https://api.github.com/repos/Azure/Azure-Functions","labels_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/825/labels{/name}","comments_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/825/comments","events_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/825/events","html_url":"https://github.com/Azure/Azure-Functions/issues/825","id":327905252,"node_id":"MDU6SXNzdWUzMjc5MDUyNTI=","number":825,"title":"Cannot connect to CosmosDB from VS Code Azure Function","user":{"login":"rmaziarka","id":5219374,"node_id":"MDQ6VXNlcjUyMTkzNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/5219374?v=4","gravatar_id":"","url":"https://api.github.com/users/rmaziarka","html_url":"https://github.com/rmaziarka","followers_url":"https://api.github.com/users/rmaziarka/followers","following_url":"https://api.github.com/users/rmaziarka/following{/other_user}","gists_url":"https://api.github.com/users/rmaziarka/gists{/gist_id}","starred_url":"https://api.github.com/users/rmaziarka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmaziarka/subscriptions","organizations_url":"https://api.github.com/users/rmaziarka/orgs","repos_url":"https://api.github.com/users/rmaziarka/repos","events_url":"https://api.github.com/users/rmaziarka/events{/privacy}","received_events_url":"https://api.github.com/users/rmaziarka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-30T21:25:37Z","updated_at":"2018-06-14T22:14:31Z","closed_at":null,"author_association":"NONE","body":"Hi Azure Functons team,\r\n\r\nI created Azure Function (2.0v) from C# HTTP template . Then I added output binding to CosmosDB based on [CosmosDB docs](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb#output---example):\r\n\r\n```csharp    public static class AddEvent\r\n\r\n    {\r\n        [FunctionName(\"AddEvent\")]\r\n        public static void Run(\r\n            [HttpTrigger(AuthorizationLevel.Anonymous, \"get\", \"post\", Route = null)]\r\n                HttpRequest req, \r\n            [CosmosDB(\"SomeDatabase\", \"SomeCollection\", Id = \"id\", \r\n            ConnectionStringSetting = \"myCosmosDB\", CreateIfNotExists = true)] \r\n                out dynamic document)\r\n        {\r\n            document = new { Text = \"something\", id = Guid.NewGuid() };\r\n        }\r\n    }\r\n```\r\nThis is my local.settings.json. I based on values from CosmosDB emulator:\r\n ```json\r\n{\r\n    \"IsEncrypted\": false,\r\n    \"Values\": {\r\n        \"AzureWebJobsStorage\": \"UseDevelopmentStorage=true\",\r\n        \"AzureWebJobsDashboard\": \"\",\r\n        \"myCosmosDB\": \"AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==\"\r\n    }\r\n}\r\n```\r\n\r\nUnfortunately, when I hit HTTP trigger I get:\r\n`\r\nSystem.Private.CoreLib: Exception while executing function: AddEvent. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'document'. Microsoft.Azure.DocumentDB.Core: The type initializer for 'Microsoft.Azure.Documents.UserAgentContainer' threw an exception. Object reference not set to an instance of an object.\r\n`\r\n\r\nWhat does this exception means? I cannot find any relevant information about it and it completely stops my local work. Function works well without CosmosDB attribute.\r\n\r\n// sorry if this is not a correct place to put this issue\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/Azure-Functions/issues/comments/397454714","html_url":"https://github.com/Azure/Azure-Functions/issues/825#issuecomment-397454714","issue_url":"https://api.github.com/repos/Azure/Azure-Functions/issues/825","id":397454714,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzQ1NDcxNA==","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-06-14T22:14:31Z","updated_at":"2018-06-14T22:14:31Z","author_association":"MEMBER","body":"@fabiocav do you have status of this? Just wondering if we should move repos or if we can close. Thanks"}}
{"actor":{"display_login":"jeffhollan"}}