Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • daniel snyder 7 posts 97 karma points
    Feb 02, 2022 @ 02:32
    daniel snyder
    0

    Images shows in Dev but not in Azure

    I pushed to an Azure free site to test things so far, and there is a problem with the three images on the page, they are returning 404 errors on Azure, but work fine on localhost.

    The first time through the value for "source" is /media/m4aliqox/loneperson.png

    I didn't create this folder, nor can I find it with a search inside visual studio, but I can find it in File Manager.

    However, it does load just fine when on localhost, but on azure the images all return 404.

    What do I need to do for the published image to not get a 404 on Azure? thanks

     @foreach (var article in previewArticles)
        {
            if(!article.IsVisible)
                    {
                        continue;
                    }
    
            var articleImage = article.ArticleImage;
        var crops = (from i in articleImage.Crops where i.Alias == "Thumb" select i).First();
    
            string source = articleImage.Src;
            var title = article.ArticleTitle;
            var leadin = article.LeadIn;
            var Article = article.Article;
    
  • Kevin Meilander 82 posts 408 karma points c-trib
    Feb 03, 2022 @ 22:26
    Kevin Meilander
    100

    The media is stored on the file system by default (in that /media folder). That means if you added the media items locally, they wouldn't be in Azure.

    You can include the images in the .csproject, and then I think they should publish up to Azure with the the rest of the code.

    But if you're going to be making content places in both Azure and local, you might want to use an Azure Blob Storage container to store media. This allows both azure and your local use the same media directory so that if you add media locally, Azure will see it (and vice versa).

    Here's the packages you can use to set that up.

    (for v9) https://our.umbraco.com/packages/developer-tools/azure-blob-storage-provider/ (for v8,v7) https://our.umbraco.com/packages/collaboration/umbracofilesystemprovidersazure/

  • daniel snyder 7 posts 97 karma points
    Feb 06, 2022 @ 01:15
    daniel snyder
    0

    thank you, that fixes it.

Please Sign in or register to post replies

Write your reply to:

Draft