Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to host MP4 files on Azure web site

Tags:

mp4

host

azure

I am hosting a static website on a reserved web site in Azure (It is PaaS, no access to OS/IIS). I am trying to add some .mp4 videos but when I click on the links I get

The resource you are looking for has been removed, had its name changed, 
or is temporarily unavailable.

Please see example here. If I right click on the link and try to save file I get - Failed - No file.

I am using a paid instance so don't think it is resource issue. The video files are less than 2MB. They have never worked. The site is very static.

Does anyone know how I can resolve this? Should I be hosting MP4 files in some other way?

Thanks,

like image 578
Ed Cunn Avatar asked Jun 17 '13 15:06

Ed Cunn


3 Answers

The linked SO answer worked for me conceptually, but it didn't indicate the appropriate fileExtension. My config had to instead indicate the following. (Note, for any who have this question, by default my azure website didn't have a web.config initially, so I had to add the following to a text file, save as web.config, and FTP to my webroot.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
               <remove fileExtension=".mp4" />
               <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
               <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
     </staticContent>
    </system.webServer>
</configuration>
like image 104
ewitkows Avatar answered Nov 18 '22 08:11

ewitkows


There is only a single way to do this currently, and I confirmed this with the Azure team.

Add a web.config file to the root of the application wwwroot\web.config with the following contents

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="application/mp4" />
      </staticContent>
    </system.webServer>
  </configuration>
like image 8
A. Wentzel Avatar answered Nov 18 '22 08:11

A. Wentzel


Have you confirmed your MIME type for .MP4 is correctly configured, as asked:

Windows Azure - Serve unknown (mp4) MIME types in Windows Azure IIS storage

like image 7
RyanCEI Avatar answered Nov 18 '22 07:11

RyanCEI