Azure Functions Proxy - route to storage account

岁酱吖の 提交于 2019-12-08 05:36:19

问题


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:

ex:

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

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

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?

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?


回答1:


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

Your template can be /site/{*restOfPath}

And your backend would be 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."




回答2:


Yes we have identified a bug when URL ends with an .extension and will release the fix in the next few days. Thanks much for the feedback.



来源:https://stackoverflow.com/questions/42449624/azure-functions-proxy-route-to-storage-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!