问题描述
我在Mac上使用Azure Functions核心工具v2.3.148.我将其用于本地开发和发布我的应用程序.我的应用程序需要代理,因此我已经在proxies.json文件中定义了所有代理.在本地开发期间,Core Tools会识别文件,但会指向 到此处已硬编码的backUris(= Function App上的实际功能).因此,要解决此问题,我必须在手动进行本地开发之前更改backendUris.是否有任何方法可以自动执行此操作,或者可以在本地后端和实际后端之间轻松切换 功能?欢迎其他任何建议.
I'm using Azure Functions Core Tools v2.3.148 on my mac. I'm using it for local development and publishing my app. My app needs proxies, so I've defined all proxies in proxies.json file. During local development, Core Tools recognises the file but points to backendUris which are hardcoded there (=actual functions on Function App). So to fix the issue, I have to change backendUris before doing local development, manually. Is there any way to automate this or easily switch between local and actual backendUri functions? Any other suggestion is welcomed.
推荐答案
您的 proxies.json 文件看起来像这样
{
"
如果您的函数不是匿名函数,则可以使用函数键
1.直接在您的请求中,例如/api/test?code =< code>
2.在此JSON中, backendUri 类似于/api/HttpTrigger?code =< code>
If your function is not anonymous, you could either use your function key
1. Directly in your request like, /api/test?code=<code>
2. In this JSON, so backendUri will be like, /api/HttpTrigger?code=<code>
这篇关于Azure Functions核心工具中的动态代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!