Forum Discussion

timseltman's avatar
timseltman
Frequent Visitor
3 years ago
Solved

Importing user images into a custom visual

I am starting a Power BI custom visual project where I am trying to have the user assign an image to a data record; using the imageURL or webURL data role; and to be able to pull said image into the ...
  • dm-p's avatar
    3 years ago

    Hi timseltman,

     

    You can check for errors in your browser console using the developer tools regarding web access. For versions of powerbi-visuals-api < 4.6.0, this will likely be a cross-origin error (where the remote endpoint does not allow requests from a sandboxed iframe, which is how a custom visual is hosted by Power BI).

     

    Assuming that you are using >= 4.6.0 of the powerbi-visuals-api, this introduces privileges. For your visual to attempt web access, you will need to configure the WebAccess privilege accordingly. You can also check your console for errors to determine if the visual host has blocked the remote request, or if the remote host has.

     

    For generic web access using privileges, the following configuration should be sufficient, provided that a remote endpoint permits anonymous access also:

    {
        "privileges": [
            {
                "name": "WebAccess",
                "essential": true,
                "parameters": [
                    "https://*",
                    "http://*"
                ]
            }
        ],
        ...
    }

    I'm not aware of how to manage access to sites that require scenarios like OAuth authentication, but this may work for sites that accept basic HTTP auth (although you will need to provide your user the means to enter these credentials if you need something generic).

     

    Regards,

     

    Daniel