尝试在 VSCode 中运行逻辑应用程序时,出现以下错误
当我在 host.json 所在的文件夹中从命令提示符运行
c:\Users\xxxx\.azurelogicapps\dependencies\FuncCoreTools\func host start
时,它可以工作
我查看了详细日志,我怀疑是这一步导致了问题。
[2024-05-16T12:41:46.149Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle.Workflows available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle.Workflows/index.json
是否可以在 VSCode 中禁用此检查?
Executing task: C:\Users\xxxx\.azurelogicapps\dependencies\FuncCoreTools\func host start
Azure Functions Core Tools
Core Tools Version: 4.0.5455 Commit hash: N/A (64-bit)
Function Runtime Version: 4.27.5.21554
[2024-05-16T12:35:05.618Z] There was an error performing a read operation on the Blob Storage Secret Repository.
[2024-05-16T12:35:05.621Z] Azure.Storage.Blobs: Service request failed.
[2024-05-16T12:35:05.622Z] Status: 301 (Moved Permanently)
[2024-05-16T12:35:05.622Z]
[2024-05-16T12:35:05.623Z] Headers:
[2024-05-16T12:35:05.624Z] Server: BlueCoat-Security-Appliance
[2024-05-16T12:35:05.624Z] Location: REDACTED
[2024-05-16T12:35:05.625Z] Connection: close
[2024-05-16T12:35:05.625Z] .
[2024-05-16T12:35:05.656Z] A host error has occurred during startup operation 'fe9f6d13-1e96-4772-9cea-784392c5085c'.
[2024-05-16T12:35:05.657Z] Azure.Storage.Blobs: Service request failed.
[2024-05-16T12:35:05.658Z] Status: 301 (Moved Permanently)
[2024-05-16T12:35:05.658Z]
[2024-05-16T12:35:05.659Z] Headers:
[2024-05-16T12:35:05.660Z] Server: BlueCoat-Security-Appliance
[2024-05-16T12:35:05.661Z] Location: REDACTED
[2024-05-16T12:35:05.661Z] Connection: close
[2024-05-16T12:35:05.662Z] .
[2024-05-16T12:35:05.853Z] There was an error performing a read operation on the Blob Storage Secret Repository.
[2024-05-16T12:35:05.855Z] Azure.Storage.Blobs: Service request failed.
[2024-05-16T12:35:05.855Z] Status: 301 (Moved Permanently)
[2024-05-16T12:35:05.861Z]
[2024-05-16T12:35:05.862Z] Headers:
[2024-05-16T12:35:05.862Z] Server: BlueCoat-Security-Appliance
[2024-05-16T12:35:05.863Z] Location: REDACTED
[2024-05-16T12:35:05.863Z] Connection: close
[2024-05-16T12:35:05.863Z] .
Value cannot be null. (Parameter 'provider')
[2024-05-16T12:35:05.874Z] Host startup operation has been canceled
下面的逻辑应用程序工作流程(StackOverlfow 迫使我添加更多详细信息,因此这里有一些文字)
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Send_message": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"entityName": "qu001",
"message": {
"contentData": "hello"
}
},
"serviceProviderConfiguration": {
"connectionName": "serviceBus",
"operationId": "sendMessage",
"serviceProviderId": "/serviceProviders/serviceBus"
}
},
"runAfter": {}
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"Recurrence": {
"type": "Recurrence",
"recurrence": {
"interval": 3,
"frequency": "Day"
}
}
}
},
"kind": "Stateful"
}
我已按照以下步骤使用 vs code 中的标准逻辑应用程序向服务总线队列发送消息。
请注意,我在设计器中添加连接器时选择了
Use connectors from Azure
选项。
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Send_message": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"entityName": "test",
"message": {
"contentData": "Hello"
}
},
"serviceProviderConfiguration": {
"connectionName": "serviceBus",
"operationId": "sendMessage",
"serviceProviderId": "/serviceProviders/serviceBus"
}
},
"runAfter": {}
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"Recurrence": {
"type": "Recurrence",
"recurrence": {
"interval": 3,
"frequency": "Minute"
}
}
}
},
"kind": "Stateful"
}
我在 host.json 文件中有以下代码。
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
"version": "[1.*, 2.0.0)"
}
}
通过单击
Fn + F1 -> Azurite start
启用蓝铜矿。
我在调试时能够得到预期的响应。
Executing task: C:\Users\*****\.azurelogicapps\dependencies\FuncCoreTools\func host start
Azure Functions Core Tools
Core Tools Version: 4.0.5455 Commit hash: N/A (64-bit)
Function Runtime Version: 4.27.5.21554
Functions:
WorkflowDispatcher: edgeWorkflowRuntimeTrigger
For detailed output, run func with --verbose flag.
[2024-05-17T12:33:16.055Z] Host lock lease acquired by instance ID '000000000000000000000000BF6D1ED5'.
[2024-05-17T12:33:20.001Z] Executing 'Functions.WorkflowDispatcher' (Reason='(null)', Id=43196e17-f9f3-4aa7-962b-a2d269efd239)
[2024-05-17T12:33:22.917Z] Executed 'Functions.WorkflowDispatcher' (Succeeded, Id=43196e17-f9f3-4aa7-962b-a2d269efd239, Duration=3000ms)
服务巴士 -