BLAZORLOVER
BLAZORLOVER

Reputation: 2011

Why would a PNG image be returning 404 from an Azure Web App when it works on localhost?

I'm attempting to load a PNG through a CSS background-image property:

 background-image: url("../../img/lp-background/lp-properties2.png");

This is what the browser shows me when I deploy the app to an app-service:

enter image description here

But the image loads perfectly on localhost. The image is on my app server:

enter image description here

Why would this be happening?

I've tried: - Renaming the files - Moving the files - Deleting and re-adding the files between deployments - Redeploying to another pap service

Upvotes: 0

Views: 790

Answers (2)

Colin Asquith
Colin Asquith

Reputation: 654

As the Content folder is capitalised, if you are on Windows then this is case insensitive, but when you push out to Azure if it is a case-sensitive file system (e.g. Linux) then the capitalisation will matter.

Upvotes: 0

kokko1G
kokko1G

Reputation: 163

You could try using an absolute path in your code and see if that helps.

background-image: url("COMPLETE PATH HERE/img/lp-background/lp-properties2.png");

Upvotes: 1

Related Questions