- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Azure Http 触发器函数,该函数构建成功并且运行时没有错误,但它没有加载该函数。当前运行输出以详细模式给出以下内容:
在使用 Postman 测试端点时,出于明显的原因,它给了我 404 HTTP 响应。为了解决这个问题,我尝试了与函数本身相关的多种可能性,例如:
最初的假设是,这是由于我正在开发的功能造成的,但进一步的调查表明,我想要在本地运行和调试的所有本地开发功能都会发生这种情况(在多个 IDE 和终端中使用新的测试功能)。这指出了一个更全局性的问题。目前使用 JetRider 运行它,但也尝试使用 Visual Studio 并直接命令行执行。
使用 azure 函数Azure Functions 核心工具:4.0.4915函数运行时版本:4.14.0.19631框架:.net 6.0语言:C#
问题:可能是什么原因造成的以及如何解决?
更新:
在调查时发现 func
没有从项目函数根读取 host.json
和 local.settings.json
。如何纠正这个问题以从项目中读取它?
最佳答案
我使用 Http 触发器获取了 .NET 6 Azure 函数,并使用命令 func host start --verbose
运行该函数,然后我在控制台/终端中收到以下日志:
PS C:\Users\Hari\Azure Functions\KrishNet6FunApp104> func host start --verbose
MSBuild version 17.4.1+9a89d02ff for .NET
Determining projects to restore...
All projects are up-to-date for restore.
KrishNet6FunApp104 -> C:\Users\Hari\Azure Functions\KrishNet6FunApp104\bin\output\KrishNet6FunApp104.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:14.49
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools
Core Tools Version: 4.0.4915 Commit hash: N/A (64-bit)
Function Runtime Version: 4.14.0.19631
[2023-02-14T07:11:40.662Z] Found C:\Users\Hari\Azure Functions\KrishNet6FunApp104\KrishNet6FunApp104.csproj. Using for user secrets file configuration.
[2023-02-14T07:11:42.596Z] Building host: version spec: , startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '6d9cc98b-20c2-463b-822a-05cf23ae8998'
[2023-02-14T07:11:42.617Z] Reading host configuration file 'C:\Users\Hari\Azure Functions\KrishNet6FunApp104\bin\output\host.json'
[2023-02-14T07:11:42.622Z] Host configuration file read:
[2023-02-14T07:11:42.624Z] {
[2023-02-14T07:11:42.626Z] "version": "2.0",
[2023-02-14T07:11:42.627Z] "logging": {
[2023-02-14T07:11:42.628Z] "applicationInsights": {
[2023-02-14T07:11:42.630Z] "samplingSettings": {
[2023-02-14T07:11:42.631Z] "isEnabled": true,
[2023-02-14T07:11:42.633Z] "excludedTypes": "Request"
[2023-02-14T07:11:42.635Z] }
[2023-02-14T07:11:42.636Z] }
[2023-02-14T07:11:42.638Z] }
[2023-02-14T07:11:42.639Z] }
[2023-02-14T07:11:42.671Z] Loading extensions from C:\Users\Hari\Azure Functions\KrishNet6FunApp104\bin\output\bin. BundleConfigured: False, PrecompiledFunctionApp: False, LegacyBundle: False
[2023-02-14T07:11:42.674Z] Script Startup resetting load context with base path: 'C:\Users\Hari\Azure Functions\KrishNet6FunApp104\bin\output\bin'.
[2023-02-14T07:11:42.707Z] Reading host configuration file 'C:\Users\Hari\Azure Functions\KrishNet6FunApp104\bin\output\host.json'
[2023-02-14T07:11:42.709Z] Host configuration file read:
[2023-02-14T07:11:42.711Z] {
[2023-02-14T07:11:42.714Z] "version": "2.0",
[2023-02-14T07:11:42.716Z] "logging": {
[2023-02-14T07:11:42.717Z] "applicationInsights": {
[2023-02-14T07:11:42.719Z] "samplingSettings": {
[2023-02-14T07:11:42.721Z] "isEnabled": true,
[2023-02-14T07:11:42.723Z] "excludedTypes": "Request"
[2023-02-14T07:11:42.724Z] }
[2023-02-14T07:11:42.725Z] }
[2023-02-14T07:11:42.727Z] }
[2023-02-14T07:11:42.728Z] }
[2023-02-14T07:11:43.950Z] Initializing Warmup Extension.
[2023-02-14T07:11:44.090Z] Initializing Host. OperationId: '6d9cc98b-20c2-463b-822a-05cf23ae8998'.
[2023-02-14T07:11:44.115Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=6d9cc98b-20c2-463b-822a-05cf23ae8998
[2023-02-14T07:11:44.173Z] LoggerFilterOptions
[2023-02-14T07:11:44.174Z] {
[2023-02-14T07:11:44.176Z] "MinLevel": "None",
[2023-02-14T07:11:44.178Z] "Rules": [
[2023-02-14T07:11:44.180Z] {
[2023-02-14T07:11:44.182Z] "ProviderName": null,
[2023-02-14T07:11:44.183Z] "CategoryName": null,
[2023-02-14T07:11:44.185Z] "LogLevel": null,
[2023-02-14T07:11:44.187Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.190Z] },
[2023-02-14T07:11:44.192Z] {
[2023-02-14T07:11:44.193Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2023-02-14T07:11:44.195Z] "CategoryName": null,
[2023-02-14T07:11:44.197Z] "LogLevel": "None",
[2023-02-14T07:11:44.199Z] "Filter": null
[2023-02-14T07:11:44.200Z] },
[2023-02-14T07:11:44.202Z] {
[2023-02-14T07:11:44.204Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2023-02-14T07:11:44.206Z] "CategoryName": null,
[2023-02-14T07:11:44.208Z] "LogLevel": null,
[2023-02-14T07:11:44.210Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.212Z] },
[2023-02-14T07:11:44.214Z] {
[2023-02-14T07:11:44.216Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2023-02-14T07:11:44.218Z] "CategoryName": null,
[2023-02-14T07:11:44.220Z] "LogLevel": null,
[2023-02-14T07:11:44.222Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.224Z] }
[2023-02-14T07:11:44.226Z] ]
[2023-02-14T07:11:44.231Z] }
[2023-02-14T07:11:44.234Z] LoggerFilterOptions
[2023-02-14T07:11:44.236Z] {
[2023-02-14T07:11:44.238Z] "MinLevel": "None",
[2023-02-14T07:11:44.241Z] "Rules": [
[2023-02-14T07:11:44.243Z] {
[2023-02-14T07:11:44.245Z] "ProviderName": null,
[2023-02-14T07:11:44.249Z] "CategoryName": null,
[2023-02-14T07:11:44.251Z] "LogLevel": null,
[2023-02-14T07:11:44.253Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.255Z] },
[2023-02-14T07:11:44.260Z] {
[2023-02-14T07:11:44.266Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2023-02-14T07:11:44.268Z] "CategoryName": null,
[2023-02-14T07:11:44.271Z] "LogLevel": "None",
[2023-02-14T07:11:44.274Z] "Filter": null
[2023-02-14T07:11:44.276Z] },
[2023-02-14T07:11:44.278Z] {
[2023-02-14T07:11:44.281Z] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2023-02-14T07:11:44.283Z] "CategoryName": null,
[2023-02-14T07:11:44.286Z] "LogLevel": null,
[2023-02-14T07:11:44.288Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.291Z] },
[2023-02-14T07:11:44.294Z] {
[2023-02-14T07:11:44.297Z] "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2023-02-14T07:11:44.300Z] "CategoryName": null,
[2023-02-14T07:11:44.303Z] "LogLevel": null,
[2023-02-14T07:11:44.305Z] "Filter": "<AddFilter>b__0"
[2023-02-14T07:11:44.310Z] }
[2023-02-14T07:11:44.313Z] ]
[2023-02-14T07:11:44.315Z] }
[2023-02-14T07:11:44.317Z] ConcurrencyOptions
[2023-02-14T07:11:44.320Z] {
[2023-02-14T07:11:44.322Z] "DynamicConcurrencyEnabled": false,
[2023-02-14T07:11:44.326Z] "MaximumFunctionConcurrency": 500,
[2023-02-14T07:11:44.332Z] "CPUThreshold": 0.8,
[2023-02-14T07:11:44.335Z] "SnapshotPersistenceEnabled": true
[2023-02-14T07:11:44.337Z] }
[2023-02-14T07:11:44.339Z] FunctionResultAggregatorOptions
[2023-02-14T07:11:44.343Z] {
[2023-02-14T07:11:44.346Z] "BatchSize": 1000,
[2023-02-14T07:11:44.350Z] "FlushTimeout": "00:00:30",
[2023-02-14T07:11:44.353Z] "IsEnabled": true
[2023-02-14T07:11:44.357Z] }
[2023-02-14T07:11:44.361Z] SingletonOptions
[2023-02-14T07:11:44.366Z] {
[2023-02-14T07:11:44.372Z] "LockPeriod": "00:00:15",
[2023-02-14T07:11:44.376Z] "ListenerLockPeriod": "00:00:15",
[2023-02-14T07:11:44.379Z] "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2023-02-14T07:11:44.383Z] "LockAcquisitionPollingInterval": "00:00:05",
[2023-02-14T07:11:44.385Z] "ListenerLockRecoveryPollingInterval": "00:01:00"
[2023-02-14T07:11:44.387Z] }
[2023-02-14T07:11:44.393Z] Starting JobHost
[2023-02-14T07:11:44.405Z] Starting Host (HostId=c1ml47687ms-778510111, InstanceId=454fc6f1-0750-4023-b206-73112827b0d6, Version=4.14.0.19631, ProcessId=5892, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2023-02-14T07:11:44.483Z] Loading functions metadata
[2023-02-14T07:11:44.491Z] Reading functions metadata
[2023-02-14T07:11:44.497Z] Reading functions metadata
[2023-02-14T07:11:44.524Z] 1 functions found
[2023-02-14T07:11:44.531Z] 1 functions found
[2023-02-14T07:11:44.566Z] Reading functions metadata
[2023-02-14T07:11:44.622Z] 1 functions found
[2023-02-14T07:11:44.626Z] 1 functions loaded
[2023-02-14T07:11:45.667Z] Generating 1 job function(s)
[2023-02-14T07:11:45.771Z] Found the following functions:
[2023-02-14T07:11:45.773Z] KrishNet6FunApp104.Function1.Run
[2023-02-14T07:11:45.775Z]
[2023-02-14T07:11:45.805Z] HttpOptions
[2023-02-14T07:11:45.807Z] {
[2023-02-14T07:11:45.809Z] "DynamicThrottlesEnabled": false,
[2023-02-14T07:11:45.810Z] Initializing function HTTP routes
[2023-02-14T07:11:45.812Z] "EnableChunkedRequestBinding": false,
[2023-02-14T07:11:45.814Z] Mapped function route 'api/Function1' [get,post] to 'Function1'
[2023-02-14T07:11:45.816Z] "MaxConcurrentRequests": -1,
[2023-02-14T07:11:45.818Z]
[2023-02-14T07:11:45.820Z] "MaxOutstandingRequests": -1,
[2023-02-14T07:11:45.825Z] "RoutePrefix": "api"
[2023-02-14T07:11:45.830Z] }
[2023-02-14T07:11:45.855Z] Host initialized (1410ms)
[2023-02-14T07:11:45.865Z] Host started (1453ms)
[2023-02-14T07:11:45.868Z] Job host started
Functions:
Function1: [GET,POST] http://localhost:7071/api/Function1
我观察到,在生成和验证项目中找到的函数数量之前,运行时工作线程正在读取函数元数据:
在同一项目中创建第二个 Http 触发函数后:
[2023-02-14T08:45:23.800Z] Starting JobHost
[2023-02-14T08:45:23.804Z] Starting Host (HostId=c1ml47687ms-778510111, InstanceId=08cbea94-a74d-4167-892f-9802ed417b9a, Version=4.14.0.19631, ProcessId=18812, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2023-02-14T08:45:23.829Z] Loading functions metadata
[2023-02-14T08:45:23.834Z] Reading functions metadata
[2023-02-14T08:45:23.837Z] Reading functions metadata
[2023-02-14T08:45:23.849Z] 2 functions found
[2023-02-14T08:45:23.854Z] 2 functions found
[2023-02-14T08:45:23.867Z] Reading functions metadata
[2023-02-14T08:45:23.882Z] 1 functions found
[2023-02-14T08:45:23.886Z] 2 functions loaded
[2023-02-14T08:45:24.100Z] Generating 2 job function(s)
[2023-02-14T08:45:24.145Z] Found the following functions:
[2023-02-14T08:45:24.147Z] KrishNet6FunApp104.Function1.Run
[2023-02-14T08:45:24.149Z] Company.Function.Function2.Run
[2023-02-14T08:45:24.150Z]
[2023-02-14T08:45:24.161Z] HttpOptions
[2023-02-14T08:45:24.163Z] Initializing function HTTP routes
[2023-02-14T08:45:24.163Z] {
[2023-02-14T08:45:24.165Z] Mapped function route 'api/Function1' [get,post] to 'Function1'
[2023-02-14T08:45:24.168Z] "DynamicThrottlesEnabled": false,
[2023-02-14T08:45:24.169Z] Mapped function route 'api/Function2' [get,post] to 'Function2'
[2023-02-14T08:45:24.170Z] "EnableChunkedRequestBinding": false,
[2023-02-14T08:45:24.171Z]
[2023-02-14T08:45:24.172Z] "MaxConcurrentRequests": -1,
[2023-02-14T08:45:24.174Z] "MaxOutstandingRequests": -1,
[2023-02-14T08:45:24.175Z] "RoutePrefix": "api"
[2023-02-14T08:45:24.176Z] }
[2023-02-14T08:45:24.185Z] Host initialized (365ms)
[2023-02-14T08:45:24.192Z] Host started (384ms)
[2023-02-14T08:45:24.194Z] Job host started
Functions:
Function1: [GET,POST] http://localhost:7071/api/Function1
Function2: [GET,POST] http://localhost:7071/api/Function2
此函数元数据特定于触发器类型,例如 Http、队列、Blob 存储等。
对于 Http 触发器,它期望名称、类型和方向应正确映射到本 MS 文档中提到的绑定(bind)元数据1 & 2
所有这些绑定(bind)将在 Http 触发器类文件的函数声明中提供 - 本地创建的 cSharp Azure 函数。
这是 GitHub Repository ,我已经推送了我的Azure Functions (.NET 6 Stack) - Http Trigger项目代码供大家引用。
关于c# - 在本地运行 Azure Functions 显示找到 1 个函数,但加载了 0 个函数,并且该函数不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75435901/
似乎有很多方法可以在 Azure 中自动使用 PowerShell。由于 ARM 模板是最新的,Azure 中的其他 PowerShell 选项是否已过时?这些工具/脚本之间有什么区别: Azure
我正在开发一个将托管在 Azure 中的 Web API。我想使用 Azure 诊断将错误记录到 Azure 表存储中。在经典门户中,我可以将日志配置为转到 Azure 表存储。 Classic Po
Azure 文件存储事件可以触发 Azure WebJob 或 Azure Function 吗? 例如,在文件夹“/todo/”中创建文件时。 最佳答案 我们目前没有任何 Azure 文件绑定(bi
我需要创建一个逻辑应用程序,我的要求是,我需要从 azure data Lake Gen2 文件夹迁移 json 文件,并根据某些值需要将该 json 转换为 xml,然后将其发送到 SQL。 因此,
我使用 VS Code 创建了 1 个 node.js 和 1 个 java Azure Function 当我使用 VS Code 将这两个函数部署到 Azure 时,我最终获得了这么多 Azure
收集 Azure 诊断数据时,暂存槽是否也会将诊断数据发送到 WadPerformanceCounters 表? 如果是这样,我该如何关闭它?或者在阅读诊断信息时如何区分暂存/生产。 我不想显示有关我
您好,我是 Azure 的新手。我有 VS 2012 和 Azure SDK 2.1,当我使用模拟器运行我的 Web 应用程序时一切正常。但是当我在 azure 上部署时出现错误消息: Could n
我很难区分 Azure 订阅和 Azure 租户有何不同?我尝试使用示例来弄清楚,但每次我得出的结论是它们在某种程度上是相同的?如果租户是组织在注册 Microsoft 云服务时接收并拥有的 Azur
如果我想在 Azure Insights 中设置自定义指标集合,并以(近)实时的方式可视化其中一些指标,并查看聚合的历史数据,我应该使用 Azure Metrics Explorer 还是 Azure
我想了解具有以下配置的 Azure 数据工厂 (ADF) 的现实示例/用例: Azure 集成运行时 (AIR) 默认值 自托管集成运行时(SHIR) 其他问题: 这两种配置(AIR 和 SHIR)是
请参阅下面来自 Azure 服务总线的指标。想要识别请求数量中的背景噪音|流量较低时的响应。假设振荡请求| session 中 amqp 握手的响应是潜在的。只是不明白这是什么类型的握手?从总线接收的
此问题与 Azure 事件中心和 Azure 服务总线之间的区别无关。 问题如下: 如果您将Azure Events Hub添加到您的应用程序中,那么您会注意到它依赖于Azure Service Bu
这两个事情是完全不同的,还是它们能完成的事情大致相同/相似? 最佳答案 Azure 辅助角色是“应用程序场”中您自己的一组虚拟机。您可以以分布式方式在它们上运行任何代码。通常,您编写业务代码以在这些服
我目前正在使用 Windows Azure 虚拟机来运行 RStudio, 我的虚拟机是 Windows Server R2 2012,它是 Azure 上的一项附加服务。 我还有一个 Azure 存
我们正在寻找托管一个网站(一些 css、js、一个 html 文件,但不是 aspx、一个通用处理程序)。 我们部署为: 1) Azure 网站 2) Azure 云服务 两种解决方案都有效。但有一个
我想从 Azure 表创建 blob。 AzCopy 支持此功能,但我找不到任何说明数据移动 API 也支持它的文档。此选项可用吗? https://azure.microsoft.com/en-us
This article表示 Azure 订阅所有者有权访问订阅中的所有资源。但是,要访问 Azure 数据库,必须是数据库中的用户,或者是 Azure Admin AD 组的成员。 无论 SQL 安
我尝试使用以下代码将 XML 文件上传到 Azure FTP 服务器: https://www.c-sharpcorner.com/article/upload-and-download-files-
除了 Azure 服务总线使用主题而 Azure 事件中心基于事件 - Azure 事件中心和 Azure 服务总线之间是否有任何根本区别? 对我来说,事件和消息之间没有真正的区别,因为两者只是不同类
我有一个通过虚拟网络网关连接到 Azure 虚拟网络的 Windows VPN 客户端。目标#1 是使用其内部 IP 地址连接到我的虚拟机。这有效。 第二个目标是使用其内部计算机名称进行连接(因为 I
我是一名优秀的程序员,十分优秀!