I'm getting the following error when I create a blob storage triggered function (v2).
The function runtime is unable to start. Microsoft.WindowsAzure.Storage: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found. System.Private.CoreLib: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.
This happens if I create the function in VSTS or if I create it through the Azure portal.
The KUDO logs show the following error:
2019-06-24T13:00:38.588 [Error] A host error has occurred
Microsoft.WindowsAzure.Storage.StorageException : Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found. ---> System.ArgumentException : Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.
at System.Enum.TryParseEnum(Type enumType,String value,Boolean ignoreCase,EnumResult& parseResult)
at System.Enum.Parse(Type enumType,String value,Boolean ignoreCase)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.<>c.<ReadCorsPropertiesFromXml>b__67_0(XElement rule)
at System.Linq.Enumerable.SelectEnumerableIterator.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable source)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.ReadCorsPropertiesFromXml(XElement element)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.FromServiceXml(XDocument servicePropertiesDocument)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ReadServiceProperties(Stream inputStream)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.<>c.<GetServicePropertiesImpl>b__60_2(RESTCommand cmd,HttpResponseMessage resp,OperationContext ctx)
at async Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand cmd,IRetryPolicy policy,OperationContext operationContext,CancellationToken token)
End of inner exception
at async Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand cmd,IRetryPolicy policy,OperationContext operationContext,CancellationToken token)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobLogListener.EnableLoggingAsync(CloudBlobClient blobClient,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobLogListener.cs : 188
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobLogListener.CreateAsync(CloudBlobClient blobClient,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobLogListener.cs : 42
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.PollLogsStrategy.RegisterAsync(CloudBlobContainer container,ITriggerExecutor triggerExecutor,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\PollLogsStrategy.cs : 73
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.ScanBlobScanLogHybridPollingStrategy.RegisterAsync(CloudBlobContainer container,ITriggerExecutor triggerExecutor,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\ScanBlobScanLogHybridPollingStrategy.cs : 61
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobListenerFactory.RegisterWithSharedBlobListenerAsync(String hostId,SharedBlobListener sharedBlobListener,CloudBlobClient blobClient,CloudQueue hostBlobTriggerQueue,IMessageEnqueuedWatcher messageEnqueuedWatcher,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobListenerFactory.cs : 155
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobListenerFactory.cs : 93
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.ListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 426
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.HostListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\HostListenerFactory.cs : 62
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.ListenerFactoryListener.StartAsyncCore(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ListenerFactoryListener.cs : 45
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.ShutdownListener.StartAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ShutdownListener.cs : 29
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.JobHost.StartAsyncCore(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs : 101
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Script.ScriptHost.StartAsyncCore(CancellationToken cancellationToken) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 241
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Script.WebHost.WebJobsScriptHostService.StartHostAsync(CancellationToken cancellationToken,Int32 attemptCount,JobHostStartupMode startupMode) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\WebJobsScriptHostService.cs : 163
2019-06-24T13:00:38.696 [Information] Stopping JobHost```
As the exception stack explains, it can't parse the 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' into a single http method value. The reason why this is happening is due to some discovery process of the azure storage common library. It will fetch an xml server configuration to get the values of your cors rules. While the user interface allows you to select multiple methods, this library can not parse the value and will throw an exception.
A possible workaround could be to select only one method per rule.
I created a git hub issue for this.
Edit1 As remarked in comments only verbs 'GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, MERGE' are known 'PATCH' is not a known verb.
Edit2 The issue will not be solved in version 11 of the storage SDK which is annoying as this version is also used by the Azure function libraries version 4. To get it solved we need to wait till version 5 is available, as it will pick up the version 12 of the storage SDK.
I just removed the CORS policy, and it worked !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With