asp.net - Windows Azure Website and static html in Blob storage -
so have .net mvc app published in azure website should serve static html pages stored in blob container when clicking on corresponding hyperlink.
my questions are:
- the way access blob in azure https://blobtest.blob.core.windows.net/container/htmlpage1.html, peculiar part when login azure site , url like: http://azuretestwebapp.azurewebsites.net/user123 , if click on hyperlink html blob can't take me blob azure site (well of course). therefore wondering if there way have url similar this: http://azuretestwebapp.azurewebsites.net/user123/container/htmlpage1.html considering html pages stored elsewhere in azure.
- if not feasible using azure website or storing static html pages in blob, better approach?
thank in advance time.
you can modify web.config site forward requests static pages blob storage using redirect rule. static content stored in , served blob storage.
place following in file named web.config (or modify existing web.config) , put web.config in folder site/wwwroot on website, next site content.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.webserver> <rewrite> <rules> <rule name="static" stopprocessing="true"> <match url="static/(.*)" /> <action type="rewrite" url="https://blobtest.blob.core.windows.net/static/{r:1}" /> </rule> </rules> </rewrite> </system.webserver> </configuration>
Comments
Post a Comment