Umbraco集成Azure Blob存储:可上传查看图片但前端报404错误
Let’s work through the most likely fixes for this issue—since you can already upload and directly access the blobs, the problem is almost certainly in how Umbraco is generating or routing media URLs for the frontend.
Verify your FileSystemProviders.config setup
Double-check themediaprovider configuration in~/config/FileSystemProviders.config. Make sure:- The
containerNamematches the one you’re using in Azure (you mentionedmedia-stage, so confirm that’s exactly what’s set here). - If you’re using the direct Blob URL, ensure
useCdnis set totrueandcdnUrlpoints to your container’s base URL (https://azureaccount.blob.core.windows.net/media-stage/). - Also, confirm there’s no conflicting
umbracoMediaPathoverride in yourweb.configthat’s forcing Umbraco to look for local media files instead of Azure.
- The
Check Blob container permissions and content types
Even though you can access the blob directly, frontend requests might fail if:- Your container’s public access level isn’t set to Blob (anonymous read access for blobs only). Private containers require signed URLs, which Umbraco 7.3.1 might not handle correctly out of the box.
- The blob’s
Content-Typeis incorrect (e.g.,application/octet-streaminstead ofimage/png). Browsers can’t render files with the wrong content type, which can look like a 404. Head to the Azure Portal, find your blob, and check its properties to confirm.
Clear Umbraco’s media cache
Umbraco 7.x caches media URLs aggressively. Try:- Restarting your application pool to clear in-memory cache.
- Deleting all files in
~/App_Data/TEMP/to wipe cached media paths. - Using the Umbraco backoffice’s cache clear tool (Settings > Cache > Clear All Cache).
After clearing, check the frontend’s page source to confirm the img tags are using the Azure Blob URL instead of a local/media/path.
Rule out URL rewrite conflicts
Look at yourweb.configfor any URL rewrite rules that might be intercepting/mediarequests. If there’s a rule redirecting/mediato a local folder, it’ll block requests to your Azure blobs. Also, ensureumbracoReservedPathsinweb.configisn’t excluding your media path from Umbraco’s routing.Confirm version compatibility
Umbraco 7.3.1 is an older version—make sure you’re using a compatible release of UmbracoFileSystemProviders.Azure. Newer versions of the provider might drop support for legacy Umbraco 7 builds. Check the provider’s release notes to find the version specifically targeted at Umbraco 7.x, then downgrade if needed.
内容的提问来源于stack exchange,提问作者user2887609

