web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Images from Azure blob...
Power Apps
Suggested Answer

Images from Azure blob storage in model driven app

(2) ShareShare
ReportReport
Posted on by 181
Hi,
 
I have a dataverse table with a text string column showing the id of an image blob in an Azure blob storage container. This allows me to easily preview the image in a canvas app using the GetFileContentV2 connector. 
 
Now I'd like to preview this image in a model driven app using the same id column. I'm assuming this is done with a web resource component, but I've never created one of these or used one. 
 
Any help would be greatly appreciated.
 
Thanks.
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     

    To preview an image stored in Azure Blob Storage in a Model-Driven App using a Dataverse text column that holds the blob ID, you're right — the best approach is to use a Web Resource (typically an HTML web resource) that dynamically loads and displays the image.

    Here’s a step-by-step guide to help you get started:


    What You Need

    1. Azure Blob Storage with public or SAS-token-based access to the images.
    2. A Dataverse table with a column storing the blob ID or full URL.
    3. A custom HTML web resource to render the image.
    4. A form customization in your model-driven app to embed the web resource.

    Step-by-Step Setup

    1. Create the HTML Web Resource

    Create a simple HTML file like this:

     

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8" />
      <title>Image Preview</title>
      <style>
        img {
          max-width: 100%;
          height: auto;
        }
      </style>
    </head>
    <body>
      <img id="previewImage" src="" alt="Image preview" />
      <script>
        function loadImage() {
          var blobId = Xrm.Page.getAttribute("your_column_name").getValue();
          if (blobId) {
            // Construct the full URL to the blob
            var imageUrl = "https://yourstorageaccount.blob.core.windows.net/yourcontainer/" + blobId;
            document.getElementById("previewImage").src = imageUrl;
          }
        }
        window.onload = loadImage;
      </script>
    </body>
    </html>

    Replace:

    • your_column_name with the schema name of your Dataverse column.
    • The imageUrl construction logic with your actual blob URL pattern (or use a full URL if stored directly).

    2. Upload the Web Resource

    • Go to Power Apps > Solutions.
    • Open your solution and click + New > Web Resource.
    • Upload the HTML file, give it a name like image_preview.html, and publish it.

    3. Add the Web Resource to the Form

    • Open the form editor for your table.
    • Insert a Web Resource control.
    • Select your uploaded HTML file.
    • Pass the blob ID field as a parameter if needed (optional).
    • Set formatting (e.g., 300px height) and save/publish the form.

     

     Optional Enhancements

    • Use a JavaScript web resource to dynamically pass the blob ID as a parameter.
    • Add error handling for missing or invalid images.
    • Use a SAS token if your blob storage is private.
     
    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 977

#2
Valantis Profile Picture

Valantis 664

#3
11manish Profile Picture

11manish 530

Last 30 days Overall leaderboard