简体   繁体   English

Azure Functions Proxy - 路由到存储帐户

[英]Azure Functions Proxy - route to storage account

I could create an azure function proxy with success that routes requests to my blob storage. 我可以成功创建一个azure函数代理,将请求路由到我的blob存储。 However, it only works if I specify the Backend URL with the full url to the blob file: 但是,它仅在我使用blob文件的完整URL指定后端URL时才有效:

ex: 例如:

https://account.blob.core.windows.net/site/index.html https://account.blob.core.windows.net/site/index.html

where '/site' is my container name and 'index.html' is my blob name. 其中'/ site'是我的容器名称,'index.html'是我的blob名称。

I had an understanding that I could use the route template as '/site' and if I leave the Backend URL as ' https://account.blob.core.windows.net/site/ ' what comes after the last '/' would be routed to my storage account. 我理解我可以使用路由模板作为'/ site',如果我将后端URL保留为' https://account.blob.core.windows.net/site/ ',那么在最后一个'/'之后会出现什么将被路由到我的存储帐户。 Did I understand wrong? 我明白了吗?

UPDATE After reading this other question Azure Function App Proxy to a blob storage account and update the route template / backend url it works, but if my blob name has an extension it does not work (such as .html). 更新在将此其他问题Azure功能应用程序代理读取到blob存储帐户并更新其工作的路由模板/后端URL之后,但如果我的blob名称具有扩展名,则它不起作用(例如.html)。 Any clues? 有线索吗?

Yes we have identified a bug when URL ends with an .extension and will release the fix in the next few days. 是的,我们在URL以.extension结尾时发现了一个错误,并将在接下来的几天内发布修复程序。 Thanks much for the feedback. 非常感谢您的反馈。

In the Azure Functions Proxy documentation they specify how to get the request parameters and pass those to your backend service. Azure Functions Proxy文档中,它们指定了如何获取请求参数并将其传递给后端服务。

Your template can be /site/{*restOfPath} 您的模板可以是/site/{*restOfPath}

And your backend would be https://account.blob.core.windows.net/site/{restOfPath} 你的后端将是https://account.blob.core.windows.net/site/{restOfPath}

I was able to get this working only on files that do NOT have a file extension. 我能够使这个只适用于没有文件扩展名的文件。 So I was able to add an index blob and get to it from https://myfunction.azurewebsites.net/index , however, when I tried index.html , the proxy returned a message "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." 所以我能够添加index blob并从https://myfunction.azurewebsites.net/index获取它,但是,当我尝试使用index.html ,代理返回了一条消息“您要查找的资源已被删除,其名称已更改,或暂时无法使用。“

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM