Azure Functions代理-路由到存储帐户 [英] Azure Functions Proxy - route to storage account

查看:132
本文介绍了Azure Functions代理-路由到存储帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以成功创建一个Azure函数代理,该代理将请求路由到我的Blob存储.但是,仅当我指定带有完整Blob文件URL的后端URL时,它才起作用:

I could create an azure function proxy with success that routes requests to my blob storage. However, it only works if I specify the Backend URL with the full url to the blob file:

例如:

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

其中"/site"是我的容器名称,"index.html"是我的Blob名称.

where '/site' is my container name and 'index.html' is my blob name.

我了解我可以将路由模板用作"/site",并且如果将后端URL保留为" https://account.blob.core.windows.net/site/",最后一个'/'之后的内容将被路由到我的存储帐户.我明白错了吗?

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. Did I understand wrong?

更新 阅读此其他问题后, Azure Function App Proxy到Blob存储帐户并更新路由模板/后端url可以使用,但是如果我的blob名称具有扩展名则无法使用(例如.html).有任何线索吗?

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). Any clues?

推荐答案

In the Azure Functions Proxy documentation they specify how to get the request parameters and pass those to your backend service.

您的模板可以是/site/{*restOfPath}

您的后端将是https://account.blob.core.windows.net/site/{restOfPath}

我只能在没有文件扩展名的文件上使用此功能.因此,我能够添加index blob并从https://myfunction.azurewebsites.net/index到达它,但是,当我尝试index.html时,代理返回一条消息您正在寻找的资源已被删除,其名称已更改,或暂时不可用."

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."

这篇关于Azure Functions代理-路由到存储帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆