- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试按照 Microsoft 指南在本地运行 Azure 函数: https://learn.microsoft.com/nl-nl/azure/azure-functions/create-first-function-cli-python?tabs=azure-cli%2Cbash%2Cbrowser#create-venv
无论我尝试什么,当我尝试使用“func start”启动该函数时,我都会一遍又一遍地遇到相同的错误:
Found Python version 3.8.0 (py).
Azure Functions Core Tools
Core Tools Version: 4.0.4544 Commit hash: N/A (64-bit)
Function Runtime Version: 4.3.2.18186
Could not load file or assembly 'Microsoft.Azure.WebJobs.Script.Abstractions,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c5b9424214e8f8c'. The system cannot find
the file specified.
我的文件设置如下
主机.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
}
}
本地.setting.json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
}
}
需求.txt
azure-functions
函数.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "Anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
初始化.py
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
if name:
return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)
如有任何帮助,我们将不胜感激!
最佳答案
我也遇到过这个。不确定是什么原因造成的。
但是对我来说解决这个问题的是下载、卸载并重新安装 Azure Functions Core Tools(使用“修复”只是返回一个通用的“由于错误而失败”,我不得不杀死 PowerToys)
<小时/>不确定是否有必要,但我也清除了我的 nuget 缓存
dotnet nuget locals all -c
dotnet restore # in your sln folder
并重新安装了我的 vscode Azure 插件
关于python - 错误 : Could not load file or assembly 'Microsoft. Azure.WebJobs.Script.Abstractions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72454228/
我有一个 Azure WebJob,我正在从 visual studio 2017 发布到标准 S1 应用服务,WebJob 应该由 CRON 触发,但始终发布为连续,我无法弄清楚我做错了什么(另外两
我需要在计划的时间段内为不同的用户运行一项作业(例如 CRM 同步)。此同步由 ServiceBus 队列上的另一个函数放置的消息触发,该函数每 30 分钟由 TimerTrigger 触发一次。 现
我需要在计划的时间段内为不同的用户运行一项作业(例如 CRM 同步)。此同步由 ServiceBus 队列上的另一个函数放置的消息触发,该函数每 30 分钟由 TimerTrigger 触发一次。 现
我无法将计划的 Web 作业发布到 Azure 应用服务。我正在使用 Visual Studio 2017。 使用此设置一切正常: { "$schema": "http://schemastore.o
我计划使用连续的 Azure WebJob 发送电子邮件和推送通知。我了解 WebJobs 会因各种原因不时启动和停止。没关系,但我希望有机会在工作关闭之前“清理”一下。 这样我的 WebJob 可以
我已经看到了一些关于使用 settings.job 的指导。为此,但它不起作用 - 在控制台中我看到: WebJob singleton setting is False 如何防止横向扩展运行我的
我正在尝试部署一个触发的网络作业并使用 settings.json 文件安排它。我的 webapp 在 3 个实例中运行,所以我假设 webjob 将在 3 个实例中部署。因此,如果我使用带有 cro
我正在尝试找出是否有任何方法可以修改 webjobs sdk 重试策略。 现在,如果网络作业抛出异常,它会立即重新排队。这并不理想,特别是如果错误是由于数据库超时之类的原因造成的。 有谁知道该策略是否
我正在尝试部署一个触发的网络作业并使用 settings.json 文件安排它。我的 webapp 在 3 个实例中运行,所以我假设 webjob 将在 3 个实例中部署。因此,如果我使用带有 cro
我有一个启用了 Azure 持续交付的 Web 应用程序 (azure webapp)。这意味着每当我进行提交并将其推送到远程时,它都会自动构建应用程序并部署它。 我还有一些网络作业,我希望该过程也可
有没有办法从 MVC 应用程序中更改 webjob 的预定时间,或者是通过 azure 门户的唯一方法。 我不是指初始计划时间,而是在部署后通过 Mvc 应用程序中的 UI 更改计划时间。 最佳答案
Azure 提供了创建“触发式”WebJob 的可能性,例如每天都有时间表。 此外,还有 azure-webjobs-sdk-extensions( https://github.com/Azure/
我开始使用 WebJobs 来处理一些后台任务,但我遇到了关于错误处理和重试的问题。看来,如果我的任何函数是异步的,那么即使我在函数中抛出异常,该函数总是会在仪表板中报告成功。 考虑以下简单示例 ->
我们有一个带有“暂存”部署槽的 Azure 网站设置,我们使用连续的 Azure WebJob 来处理长时间运行的后台作业。看来,当您发布到网站(并包含 WebJob 二进制文件)时,如果 WebJo
我正在开发一个使用 TimerTrigger 的触发式网络作业. 在webjob停止之前,我需要处理一些对象,但我不知道如何触发“webjob停止”。 有了 NoAutomaticTrigger 函数
我正在处理一个网络作业,用于检查网络服务器的一些数据。有时网络服务器很忙,会在几秒钟后重试。 问题是,如果我只是忽略它并通过该函数,它将从队列中删除消息,我将无法重试调用。 我当前的解决方案(我一点也
我读过关于优雅关机的文章 here使用 WEBJOBS_SHUTDOWN_FILE 和 here使用取消 token ,所以我理解正常关闭的前提,但是我不确定它们将如何影响正在处理队列消息的 WebJ
如果运行webjob时出现任何异常或错误,我想释放所有对象。我如何知道是否发生错误。webjob 是否有任何错误触发器? 最佳答案 可以有两种方法来处理这个问题: 1) Try/Catch 方法:-
我在 AppService 中长时间运行 Web 作业(大约 1 小时)。AppService 已打开“始终打开”。 它的初始化是: var host = new JobHost(config); h
我在 AppService 中长时间运行 Web 作业(大约 1 小时)。AppService 已打开“始终打开”。 它的初始化是: var host = new JobHost(config); h
我是一名优秀的程序员,十分优秀!