Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

huangapple go评论59阅读模式
英文:

Azure function app with private endpoint on time trigger - manual trigger is not working

问题

Azure功能应用程序使用定时触发器和私有端点时,手动触发无法正常工作。

当手动触发功能应用程序时,会出现403错误,但计划触发正常工作。功能应用程序具有私有端点,并且可以从本地访问。

功能应用程序可以从同一网络中的虚拟机手动触发:虚拟机上不会出现错误,但日志中没有显示任何活动。

微软表示,使用私有端点时,这是预期行为,但至少在同一虚拟网络中的虚拟机应该触发。欢迎提出任何想法。

英文:

Azure function app with private endpoint on time trigger - manual trigger is not working

An Error 403 occurs when triggering the function app manually, scheduled triggering is working. The function app has private endpoints and is reachable from on-premise. [tag:function-app-manual-trigger]
<h1 id="unavailable">Error 403 - Forbidden</h1>
<p id="tryAgain">The web app you have attempted to reach has blocked your access.</p>

The function app can be manually triggered from a vm within the same network: no error occurs on the vm, but the logs don't show any activity.

curl -X POST -H "Content-Type application/json" "https://<appname>.azurewebsites.net/api/<appname>/<functionkey>"

Microsoft says this is expected behavior when using private endpoints, but at least the vm within the same vnet should trigger? Any thoughts are appreciated.

An Error 403 occurs when triggering the function app manually, scheduled triggering is working. The function app has private endpoints and is reachable from on-premise. [tag:function-app-manual-trigger]
<h1 id="unavailable">Error 403 - Forbidden</h1>
<p id="tryAgain">The web app you have attempted to reach has blocked your access.</p>

The function app can be manually triggered from a vm within the same network: no error occurs on the vm, but the logs don't show any activity.

curl -X POST -H "Content-Type application/json" "https://<appname>.azurewebsites.net/api/<appname>/<functionkey>"

答案1

得分: 1

I tried the same in my environment created Azure function app with private endpoint like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Under networking added private endpoint:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Make sure to add Vnet integration try to add same virtual network associated with VM like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Now in function app when I try to trigger manually, it triggered successfully like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

The function app is reachable from on-premises with private endpoint network like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

To get logs and activity check the below:

curl -X POST -H "Content-Type application/json" "https://<appname>.azurewebsites.net/api/<appname>/<functionkey>"

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

In your function app -> logs -> type requests you will be able to see the log and activity of status like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

You can make use of diagnostic setting:

In function app -> diagnostic setting selects the destination for your logs and metrics. You can route it to either Azure Monitor, Event Hubs, Log Analytics workspace, or Storage account like below.

You may configure the collection and transmission of logs and metrics from your Azure Function app to various monitoring and analytics services using the diagnostic settings for Azure Function.

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

While using virtual network ensure Service endpoints is enabled. As a result, your function app may securely access these services without depending to rely on public endpoints.

Check the Access restrictions in this GitHub blog by ggailey.

英文:

I tried the same in my environment created Azure function app with private endpoint like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Under networking added private endpoint:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Make sure to add Vnet integration try to add same virtual network associated with VM like below:

![enter image description here](https://i.imgur.com/tZTmaef.png)

Now in function app when I try to trigger manually, it triggered successfully like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

The function app is reachable from on-premises with private endpoint network like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

To get logs and activity check the below:

curl -X POST -H &quot;Content-Type application/json&quot; &quot;https://&lt;appname&gt;.azurewebsites.net/api/&lt;appname&gt;/&lt;functionkey&gt;&quot;

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

In your function app -> logs -> type requests you will be able to see the log and activity of status like below:

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

You can make use of diagnostic setting:

In function app -> diagnostic setting selects the destination for your logs and metrics. You can route it to either Azure Monitor, Event Hubs, Log Analytics workspace, or Storage account like below.

You may configure the collection and transmission of logs and metrics from your Azure Function app to various monitoring and analytics services using the diagnostic settings for Azure Function.

Azure函数应用程序使用私有端点的定时触发器 – 手动触发不起作用。

While using virtual network ensure Service endpoints is enabled. As a result, your function app may securely access these services without depending to rely on public endpoints.

Check the Access restrictions in this GitHub blog by ggailey.

huangapple
  • 本文由 发表于 2023年5月25日 23:14:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76333860.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定