I have the following code running in an Azure Function (V2);
new DocumentClient(new Uri(keys.dbEndPoint), keys.dbPrimaryKey);
Which has worked fine running in azure functions on localhost until today, without changing anything I'm now getting the following exception:
Data [IDictionary]:{System.Collections.ListDictionaryInternal} HResult [int]:-2146233036 HelpLink [string]:null InnerException [Exception]:{System.NullReferenceException: Object reference not set to an instance of an object.} Message [string]:"The type initializer for 'Microsoft.Azure.Documents.UserAgentContainer' threw an exception." Source [string]:"Microsoft.Azure.DocumentDB.Core" StackTrace [string]:" at Microsoft.Azure.Documents.UserAgentContainer..ctor()\r\n at Microsoft.Azure.Documents.Client.ConnectionPolicy..ctor()\r\n at Microsoft.Azure.Documents.Client.ConnectionPolicy.get_Default()\r\n
at Microsoft.Azure.Documents.Client.DocumentClient.Initialize(Uri serviceEndpoint, ConnectionPolicy connectionPolicy, Nullable1 desiredConsistencyLevel)\r\n at Microsoft.Azure.Documents.Client.DocumentClient..ctor(Uri serviceEndpoint, String authKeyOrResourceToken, ConnectionPolicy connectionPolicy, Nullable
1 desiredConsistencyLevel)\r\n at Platform.AzureConfig.get_Database() in D:\DeansCloud\AzureConfig.cs:line 60" TargetSite [MethodBase]:{Void .ctor()} TypeName [string]:"Microsoft.Azure.Documents.UserAgentContainer" Static members Non-Public members
Which doesn't say much, the inner exception mentions a null reference exception:
Message [string]:"Object reference not set to an instance of an object."
Is this an issue with azure cosmos db now? Do I need to update something?