Azure Functions 不在 Azure 上 运行 但在本地运行
Azure Functions does not run on Azure but works locally
我正在开发 Azure Function App,我使用的是 .net standard 2.0。在本地一切正常。但是当我将函数应用程序发布到 azure 时,出现对象引用未设置为对象错误的实例。
请查看下面的屏幕截图。
谁能帮我解决这个问题。我试过删除应用程序并重新创建它并重新启动多次,但似乎没有任何效果。
谢谢
赛义德
更新 1
请检查我从诊断日志中收到的以下屏幕截图。
更新 2
来自 KUDU 的日志。
2018-11-21T06:15:20.268 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:30.126 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:39.512 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:43.021 [Information] Stopping JobHost
2018-11-21T06:15:43.055 [Information] Job host stopped
2018-11-21T06:15:58.165 [Information] Initializing Host.
2018-11-21T06:15:58.175 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1
2018-11-21T06:15:58.206 [Information] Starting JobHost
2018-11-21T06:15:58.214 [Information] Starting Host (HostId=esaldafaterfunctions-dev, InstanceId=d73e44cb-bbb3-4749-ac67-354729119e0c, Version=2.0.12180.0, ProcessId=6276, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~2)
2018-11-21T06:15:58.244 [Information] Loading functions metadata
2018-11-21T06:15:58.305 [Information] 6 functions loaded
2018-11-21T06:15:58.375 [Information] Generating 0 job function(s)
2018-11-21T06:15:58.611 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.659 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.669 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.679 [Information] Found the following functions:
Esal.Dafater.DafaterInvoiceProcessor.Run
Esal.Dafater.DafaterPaymentProcessor.Run
Esal.Dafater.DafaterPaymentUpdater.Run
Esal.Dafater.EsalDocsTransferer.Run
Esal.Dafater.EsalPaymentProcessor.Run
Esal.Dafater.EsalReportProcessor.Run
2018-11-21T06:15:58.680 [Information] Host initialized (465ms)
2018-11-21T06:15:58.954 [Information] The next 5 occurrences of the 'Esal.Dafater.EsalReportProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:15:58.954 [Information] The next 5 occurrences of the 'Esal.Dafater.DafaterPaymentProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:15:58.955 [Information] Host started (740ms)
2018-11-21T06:15:58.955 [Information] Job host started
2018-11-21T06:15:58.962 [Error] The following 6 functions are in error:
DafaterInvoiceProcessor: Object reference not set to an instance of an object.
DafaterPaymentProcessor: Object reference not set to an instance of an object.
DafaterPaymentUpdater: Object reference not set to an instance of an object.
EsalDocsTransferer: Object reference not set to an instance of an object.
EsalPaymentProcessor: Object reference not set to an instance of an object.
EsalReportProcessor: Object reference not set to an instance of an object.
2018-11-21T06:16:08.448 [Information] Initializing Host.
2018-11-21T06:16:08.458 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1
2018-11-21T06:16:08.495 [Information] Starting JobHost
2018-11-21T06:16:08.497 [Information] Starting Host (HostId=esaldafaterfunctions-dev, InstanceId=572857ce-39a9-4eab-80f2-91bf79deb0a9, Version=2.0.12180.0, ProcessId=19092, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~2)
2018-11-21T06:16:08.561 [Information] Loading functions metadata
2018-11-21T06:16:08.597 [Information] 6 functions loaded
2018-11-21T06:16:08.689 [Information] Generating 0 job function(s)
2018-11-21T06:16:08.808 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.868 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.896 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.899 [Information] Found the following functions:
Esal.Dafater.DafaterInvoiceProcessor.Run
Esal.Dafater.DafaterPaymentProcessor.Run
Esal.Dafater.DafaterPaymentUpdater.Run
Esal.Dafater.EsalDocsTransferer.Run
Esal.Dafater.EsalPaymentProcessor.Run
Esal.Dafater.EsalReportProcessor.Run
2018-11-21T06:16:08.899 [Information] Host initialized (395ms)
2018-11-21T06:16:09.049 [Information] The next 5 occurrences of the 'Esal.Dafater.EsalReportProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:16:09.052 [Information] The next 5 occurrences of the 'Esal.Dafater.DafaterPaymentProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:16:09.052 [Information] Host started (548ms)
2018-11-21T06:16:09.052 [Information] Job host started
2018-11-21T06:16:09.058 [Error] The following 6 functions are in error:
DafaterInvoiceProcessor: Object reference not set to an instance of an object.
DafaterPaymentProcessor: Object reference not set to an instance of an object.
DafaterPaymentUpdater: Object reference not set to an instance of an object.
EsalDocsTransferer: Object reference not set to an instance of an object.
EsalPaymentProcessor: Object reference not set to an instance of an object.
EsalReportProcessor: Object reference not set to an instance of an object.
2018-11-21T06:16:14.130 [Information] Host lock lease acquired by instance ID '036afd797780213c0dd87264cf9c02c4'.
2018-11-21T06:16:35.006 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:16:57.533 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:18:10.164 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
在应用程序设置中,在 Azure 门户中。 FUNCTIONS_WORKER_RUNTIME 设置为节点,将其更改为 dotnet 解决了问题。
谢谢
赛义德
我正在开发 Azure Function App,我使用的是 .net standard 2.0。在本地一切正常。但是当我将函数应用程序发布到 azure 时,出现对象引用未设置为对象错误的实例。
请查看下面的屏幕截图。
谁能帮我解决这个问题。我试过删除应用程序并重新创建它并重新启动多次,但似乎没有任何效果。
谢谢 赛义德
更新 1
请检查我从诊断日志中收到的以下屏幕截图。
更新 2
来自 KUDU 的日志。
2018-11-21T06:15:20.268 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:30.126 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:39.512 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:15:43.021 [Information] Stopping JobHost
2018-11-21T06:15:43.055 [Information] Job host stopped
2018-11-21T06:15:58.165 [Information] Initializing Host.
2018-11-21T06:15:58.175 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1
2018-11-21T06:15:58.206 [Information] Starting JobHost
2018-11-21T06:15:58.214 [Information] Starting Host (HostId=esaldafaterfunctions-dev, InstanceId=d73e44cb-bbb3-4749-ac67-354729119e0c, Version=2.0.12180.0, ProcessId=6276, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~2)
2018-11-21T06:15:58.244 [Information] Loading functions metadata
2018-11-21T06:15:58.305 [Information] 6 functions loaded
2018-11-21T06:15:58.375 [Information] Generating 0 job function(s)
2018-11-21T06:15:58.611 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.659 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.669 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:15:58.679 [Information] Found the following functions:
Esal.Dafater.DafaterInvoiceProcessor.Run
Esal.Dafater.DafaterPaymentProcessor.Run
Esal.Dafater.DafaterPaymentUpdater.Run
Esal.Dafater.EsalDocsTransferer.Run
Esal.Dafater.EsalPaymentProcessor.Run
Esal.Dafater.EsalReportProcessor.Run
2018-11-21T06:15:58.680 [Information] Host initialized (465ms)
2018-11-21T06:15:58.954 [Information] The next 5 occurrences of the 'Esal.Dafater.EsalReportProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:15:58.954 [Information] The next 5 occurrences of the 'Esal.Dafater.DafaterPaymentProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:15:58.955 [Information] Host started (740ms)
2018-11-21T06:15:58.955 [Information] Job host started
2018-11-21T06:15:58.962 [Error] The following 6 functions are in error:
DafaterInvoiceProcessor: Object reference not set to an instance of an object.
DafaterPaymentProcessor: Object reference not set to an instance of an object.
DafaterPaymentUpdater: Object reference not set to an instance of an object.
EsalDocsTransferer: Object reference not set to an instance of an object.
EsalPaymentProcessor: Object reference not set to an instance of an object.
EsalReportProcessor: Object reference not set to an instance of an object.
2018-11-21T06:16:08.448 [Information] Initializing Host.
2018-11-21T06:16:08.458 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1
2018-11-21T06:16:08.495 [Information] Starting JobHost
2018-11-21T06:16:08.497 [Information] Starting Host (HostId=esaldafaterfunctions-dev, InstanceId=572857ce-39a9-4eab-80f2-91bf79deb0a9, Version=2.0.12180.0, ProcessId=19092, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~2)
2018-11-21T06:16:08.561 [Information] Loading functions metadata
2018-11-21T06:16:08.597 [Information] 6 functions loaded
2018-11-21T06:16:08.689 [Information] Generating 0 job function(s)
2018-11-21T06:16:08.808 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.868 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.896 [Warning] Function 'Run' is async but does not return a Task. Your function may not run correctly.
2018-11-21T06:16:08.899 [Information] Found the following functions:
Esal.Dafater.DafaterInvoiceProcessor.Run
Esal.Dafater.DafaterPaymentProcessor.Run
Esal.Dafater.DafaterPaymentUpdater.Run
Esal.Dafater.EsalDocsTransferer.Run
Esal.Dafater.EsalPaymentProcessor.Run
Esal.Dafater.EsalReportProcessor.Run
2018-11-21T06:16:08.899 [Information] Host initialized (395ms)
2018-11-21T06:16:09.049 [Information] The next 5 occurrences of the 'Esal.Dafater.EsalReportProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:16:09.052 [Information] The next 5 occurrences of the 'Esal.Dafater.DafaterPaymentProcessor.Run' schedule will be:
11/21/2018 6:20:00 AM
11/21/2018 6:25:00 AM
11/21/2018 6:30:00 AM
11/21/2018 6:35:00 AM
11/21/2018 6:40:00 AM
2018-11-21T06:16:09.052 [Information] Host started (548ms)
2018-11-21T06:16:09.052 [Information] Job host started
2018-11-21T06:16:09.058 [Error] The following 6 functions are in error:
DafaterInvoiceProcessor: Object reference not set to an instance of an object.
DafaterPaymentProcessor: Object reference not set to an instance of an object.
DafaterPaymentUpdater: Object reference not set to an instance of an object.
EsalDocsTransferer: Object reference not set to an instance of an object.
EsalPaymentProcessor: Object reference not set to an instance of an object.
EsalReportProcessor: Object reference not set to an instance of an object.
2018-11-21T06:16:14.130 [Information] Host lock lease acquired by instance ID '036afd797780213c0dd87264cf9c02c4'.
2018-11-21T06:16:35.006 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:16:57.533 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
2018-11-21T06:18:10.164 [Information] Host Status: {
"id": "esaldafaterfunctions-dev",
"state": "Running",
"version": "2.0.12180.0",
"versionDetails": "2.0.12180.0 Commit hash: a375d112383fb48f5acd0424bb807513a8917f6b"
}
在应用程序设置中,在 Azure 门户中。 FUNCTIONS_WORKER_RUNTIME 设置为节点,将其更改为 dotnet 解决了问题。
谢谢 赛义德