首先,我查看了具有相同错误消息的其他SO帖子,但似乎没有一个可以解决我的问题。我尝试了许多排列和选项。我的函数构建良好,但无法在CLI中运行,我收到以下神秘错误。MSFT文档似乎也没有答案。
找不到工作职能。尝试公开您的工作类别和方法。如果您正在使用绑定扩展(例如ServiceBus,Timer等),请确保已在启动代码(例如config.UseServiceBus(),config.UseTimers()等)中调用了扩展的注册方法。 )。
我正在尝试运行计时器作业,然后将消息集合写入事件中心。我想念什么?我已经为此战斗了好几个小时。
功能:
[FunctionName("CreateData")]
public static async Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer,
[EventHub("murraytest", Connection = "evingest")] IAsyncCollector<string> myeventhub,
TraceWriter log)
{
await myeventhub.AddAsync("data1");
await myeventhub.AddAsync("data2");
await myeventhub.AddAsync("data3");
log.Info($"COMPLETED: {DateTime.Now}");
}
Run Code Online (Sandbox Code Playgroud)
local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"Eventhub": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "",
"evingest": "Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=LtcqBLT5VWjg0dGMdIvxCcEGs8902010Y6y14iGg="
}
}
Run Code Online (Sandbox Code Playgroud)
配套
function.json-缺少任何eventhub绑定!
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "timerTrigger",
"schedule": "0 */5 * * * *",
"useMonitor": true,
"runOnStartup": false,
"name": "myTimer"
}
],
"disabled": …Run Code Online (Sandbox Code Playgroud) c# azure-webjobs azure-webjobssdk azure-functions azure-functions-runtime
我们创建了一个天蓝色函数,将其设置为计时器触发。我们想安排在不同的时间间隔调用相同的func012.tion。即
1)每个星期星期五具有某些输入参数2)每个月最后一天具有某些输入参数
谢谢
我有一个在 VS 中执行的 Timer Azure 函数。右键单击 Azure Function 项目并进行调试。该函数有一个 ILogger 日志。
检查日志对象,我可以看到它有两个记录器
我还可以看到 RootLogPath 是 %temp%\LogFiles\Application\Functions。
然而,在那个位置只有一个“主机”文件夹。我希望找到一个带有日志文件的“功能”文件夹。
我需要以某种方式启用文件记录器吗?我想念什么吗?
打开功能应用程序时,不知何故开始看到此错误,但应用程序正在运行。
Unable to retrieve diagnostics and error information for your function app.
Encountered a StorageException while trying to fetch the diagnostic events.
Please make sure the connection string in the app setting "AzureWebJobsStorage" has the permissions to access Azure Table Storage
Run Code Online (Sandbox Code Playgroud)
存储帐户网络访问设置为“从选定的虚拟网络和 IP 地址启用”。即使这样设置,之前也没有错误。
但现在只有更改为“从所有网络启用”时,上述错误消息才会消失。
最近将 functionapp 更新为 dotnet 6.0 和 v4 运行时,即使如此,也没有错误。不确定这是否与此有关。
我该如何解决这个问题?
azure azure-storage azure-storage-account azure-functions azure-functions-runtime
我正在使用Azure Functions Preview并想要添加QueueTrigerFunction.
该函数定义如下:
[FunctionName("QueueTrigger")]
public static void Run([QueueTrigger("testqueue1", Connection = "AzureWebJobsStorage")]string myQueueItem, TraceWriter log)
{
log.Info($"C# Queue trigger function processed: {myQueueItem}");
}
Run Code Online (Sandbox Code Playgroud)
使用local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=test1storage;AccountKey=XXXXX==;EndpointSuffix=core.windows.net/;",
"AzureWebJobsDashboard": ""
}
}
Run Code Online (Sandbox Code Playgroud)
当我启动VS调试器时,我收到以下错误消息:
[8/5/2017 1:07:56 AM] Microsoft.WindowsAzure.Storage:找不到有效的帐户信息组合.
我错过了什么?Azure中是否有一些其他设置需要检查以确保正确配置此方案?
azure azure-storage-queues azure-functions azure-functions-runtime
我有以下功能,我在本地定义,并能够正常调试它.
[FunctionName("QueueTrigger")]
public static void DUMMYFUNCTION(
[QueueTrigger("myqueue", Connection = "AzureWebJobsStorage")]string myQueueItem, TraceWriter log)
{
log.Info($"C# function processed: {myQueueItem}");
}
Run Code Online (Sandbox Code Playgroud)
在本地,"AzureWebJobsStorage"在local.settings.json文件中定义,以使用具有"myqueue"的存储帐户.在Azure上的功能设置中,"AzureWebJobsStorage"也设置为正确的连接字符串(与本地设置的相同).这意味着,我没有与Azure中的问题相同的问题不在Azure中执行(无错误)
现在,我使用Visual Studio Team Service在git存储库中托管我的源代码.我已将部署配置为使用源代码并部署其中包含的功能.我不认为该问题与VSTS有关,因为部署成功执行并且该功能显示在我的功能列表中:
部署之后,生成文件function.json并具有以下内容:
{
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.8",
"configurationSource": "attributes",
"bindings": [
{
"type": "queueTrigger",
"connection": "AzureWebJobsStorage",
"queueName": "myqueue",
"name": "myQueueItem"
}],
"disabled": false,
"scriptFile": "../bin/myAssembly.dll",
"entryPoint": "myAssembly.MyClass.DUMMYFUNCTION"
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我在本地调试时向队列中添加一个项目时,该函数会被执行,但是当该函数在azure上运行时它不会.
我需要在代码中进行哪些更改才能使其在azure上工作?我认为它可以开箱即用.
我知道它可能与配置错误有关,但是很遗憾,我得到的最多信息是
函数运行时无法启动。会话ID:b939c608ae424150878a55eeac6e7d36时间戳:2018-10-04T18:05:22.023Z
我的功能看起来像
[FunctionName("DoJob")]
public static async Task DoJobAsync([ServiceBusTrigger("job-queue", Connection = "MyServiceBusConnection")] string json, ILogger log)
{
…
}
Run Code Online (Sandbox Code Playgroud)
而我的local.settings.json就像
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"MyServiceBusConnection": "[my service bus connection string]"
}
}
Run Code Online (Sandbox Code Playgroud)
该功能应用程序在本地构建并发布,但是一旦我在门户中导航到该应用程序,我就会收到上述错误。
我正在使用.NET Standard(V2)和最新版本1.0.22。
另外,如果尝试在门户中进行测试,则会收到500 Internal Server Error,但日志流中没有任何显示。
c# azure azure-webjobs azure-functions azure-functions-runtime
我已经下载了 azure-functions-core-tool@3 ,当我使用 Azure Tools 运行新创建的函数项目时,它似乎正在运行 v2,尽管我不确定。
该settings.json文件如下:
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.postDeployTask": "npm install",
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune"
}
Run Code Online (Sandbox Code Playgroud)
但是,当我使用“npm start”或“func start”运行Azure函数时,标头部分报告:
Azure Functions Core Tools (2.7.2184 Commit hash: 5afacc827c2848e4debc23bb96604f1ffce09cc7)
Function Runtime Version: 2.0.12961.0
Run Code Online (Sandbox Code Playgroud)
后来在日志中我看到:
[warn] The Node.js version you are using (v12.17.0) is not fully supported by Azure Functions V2. We recommend using one the following major versions: 8, 10.
Run Code Online (Sandbox Code Playgroud)
这似乎意味着这些功能仍在 2.0 模式下运行。
如何确定正在执行哪个版本的运行时?
azure azure-functions azure-functions-runtime azure-functions-core-tools
我已经设置了 Azure Function v3。根据本文档配置标准计划:https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout。另外,将 functionTimeout 设置为 Unlimited
标准(S1:1)计划是否正确?我是否需要将其更改为 P1V12 才能将其设置为“无限”超时?
好像没有考虑host.json?还是计划不正确?请帮忙。
.net c# asp.net-core azure-functions azure-functions-runtime
我正在处理现有的 Azure Functions 项目
我知道在 AzFuncs 4.0 中,我们可以在进程模式(在与 AzFunc 运行时相同的上下文中运行)或隔离模式(单独的进程,这允许灵活性,例如在不同版本的框架上运行)运行 .Net 6 应用程序)。
我如何知道它使用的是什么处理模型?