英文:
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:
Under networking added private endpoint:
Make sure to add Vnet integration try to add same virtual network associated with VM like below:
Now in function app when I try to trigger manually, it triggered successfully like below:
The function app is reachable from on-premises with private endpoint network like below:
To get logs and activity check the below:
curl -X POST -H "Content-Type application/json" "https://<appname>.azurewebsites.net/api/<appname>/<functionkey>"
In your function app -> logs -> type requests
you will be able to see the log and activity of status like below:
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.
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:
Under networking added private endpoint:
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:
The function app is reachable from on-premises with private endpoint network like below:
To get logs and activity check the below:
curl -X POST -H "Content-Type application/json" "https://<appname>.azurewebsites.net/api/<appname>/<functionkey>"
In your function app -> logs -> type requests
you will be able to see the log and activity of status like below:
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.
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论