我使用 Azure 门户创建了一个函数应用。我检查了 POST 和 OPTIONS 作为允许的方法。我删除了默认的 CORS 设置并允许 *. 现在,当我使用 REST 客户端发出 OPTIONS 请求时,我收到一个错误返回。我检查了日志,发现以下内容。我的问题:听起来我的函数可能正在执行,当没有发现授权标头和/或有效负载时,它会引发错误。也许我不明白 OPTIONS 请求。在 Azure 门户函数应用中防止这种情况发生的选项有哪些?
TIA 寻求帮助。
2019-05-17T09:16:26.479 [Info] Executing HTTP request: {
"requestId": "38609669-59f4-4ded-9685-ef67af3c2909",
"method": "OPTIONS",
"uri": "/api/ProcessEntries"
}
2019-05-17T09:16:26.479 [Info,ProcessEntries] Function started (Id=41b4691d-98ec-432f-8e6e-de1e1dcd13b6)
2019-05-17T09:16:26.479 [Info,ProcessEntries] Executing 'Functions.ProcessEntries' (Reason='This function was programmatically called via the host APIs.', Id=41b4691d-98ec-432f-8e6e-de1e1dcd13b6)
2019-05-17T09:16:26.495 [Error] A ScriptHost error has occurred
2019-05-17T09:16:26.495 [Error] Cannot perform runtime binding on a null reference
2019-05-17T09:16:26.526 [Error,ProcessEntries] Exception while executing function: Functions.ProcessEntries. Microsoft.Azure.WebJobs.Script: One or more errors occurred. Anonymously Hosted DynamicMethods Assembly: Cannot perform runtime binding on a null reference.
2019-05-17T09:16:26.573 [Error,ProcessEntries] Exception while executing function: Functions.ProcessEntries
2019-05-17T09:16:26.573 [Error,ProcessEntries] Cannot perform runtime binding on a null reference
2019-05-17T09:16:26.573 [Error,ProcessEntries] Function completed (Failure, Id=41b4691d-98ec-432f-8e6e-de1e1dcd13b6, Duration=87ms)
2019-05-17T09:16:26.573 [Error,ProcessEntries] Executed 'Functions.ProcessEntries' (Failed, Id=41b4691d-98ec-432f-8e6e-de1e1dcd13b6)
2019-05-17T09:16:26.573 [Error,ProcessEntries] Cannot perform runtime binding on a null reference
2019-05-17T09:16:26.573 [Error,ProcessEntries] Function had errors. See Azure WebJobs SDK dashboard for details. Instance ID is '41b4691d-98ec-432f-8e6e-de1e1dcd13b6'
2019-05-17T09:16:26.573 [Error,ProcessEntries] Cannot perform runtime binding on a null reference
2019-05-17T09:16:26.588 [Error] {"id":"eada812b-1530-4d26-85e3-4c6e6e243f01","requestId":"38609669-59f4-4ded-9685-ef67af3c2909","statusCode":500,"errorCode":0,"message":"An error has occurred. For more information, please check the logs for error ID eada812b-1530-4d26-85e3-4c6e6e243f01"}
2019-05-17T09:16:26.588 [Error] Cannot perform runtime binding on a null reference