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 / AzureBlobStorage.Creat...
Power Apps
Unanswered

AzureBlobStorage.CreateShareLinkByPath parameters for Shared Access Signature

(0) ShareShare
ReportReport
Posted on by 313

I'm getting stuck working with AzureBlobStorage to store MS Office documents and then launch them in the appropriate application. The problem is setting up the Shared Access Signature.

 

Say I've successfully uploaded a Word document "MyDoc.docx" into /attachments. I've got as far as this action to open the document in Word:

 

Launch(
  "ms-word:ofe|u|" & AzureBlobStorage.CreateShareLinkByPath(
    "/attachments/MyDoc.docx"
  ).WebUrl
)

Word launches fine but I get the error "We can't connect to https://myblobsxxx. Please make sure you're using the correct web address".

 

I can get round this by going into Azure Storage Explorer and setting the Public Access level to "Public read access for container and blobs", so it's clearly a permissions issue. But I want to control access to my Blob Container rather than leave it open.

 

I've tried this:

Launch(
  "ms-word:ofe|u|" & AzureBlobStorage.CreateShareLinkByPath(
    "/attachments/MyDoc.docx",
    {
      ExpiryTime: DateValue("1/1/2050"),
      Permissions: "Read"
    }
  ).WebUrl
)

but it still fails to open. I can't find anywhere that explains the possible settings for the CreateShareLinkByPath parameters - the documentation doesn't give samples.

 

I know there is another option of appending a Shared Access Signature that's been generated in Azure Storage Explorer to the url - is that the way? Hard code a SAS from Storage Explorer that has an infinite expiry date? Doesn't seem right.. Or can I generate one of those within PowerApps somehow?

 

Help appreciated!

 

 

Categories:
  • PaulD1 Profile Picture
    2,914 on at

    I think you need to break it down into steps.

    1. Save the File to Blob Storage

    2. Set the permissions and get back the Web URL

    3. Store Web URL

    4. Open the document using the Web URL.

     

    I suspect in your set up, that perhaps the Web URL is not being returned before the Launch is firing.

    I *think* each time you run CreateShareLinkByPath you will be overwriting any existing shared access link. Probably better to create one link (when you save the document) store the link and re-use it as required (that is the pattern I use and have not had issues).

  • JonathanGibbs Profile Picture
    313 on at

    Thanks @PaulD1 

    Yes, that makes sense to generate the WebURL at the time of saving.

    When I tried this I still got the error, but then found more information about the MSWord launch URI schema here. This states "These schemes do not include an authority component as defined in section 3.2 of RFC 3986. Invocation of the commands specified in this document takes place in the context of the system invoking the command".

    If I just launch the WebURL, without the prefix "ms-word:ofe|u|", it launches a browser which in turn downloads the docx file, and this download can be opened as normal.

    It looks like the reason I can't cut out the browser-launch and go straight to launching MSWord is not because of a problem with CreateShareLinkByPath, but because ms-word:ofe|u| doesn't work in this particular case, where the authority to open is expressed in the suffix of the URL (?sv=2018-03-28&sr=b..etc).

    Shame - you either have to set your Blob Container Access Level to Public, in which case the direct launch of MSWord (or any other Office application) works fine using the appropriate URI prefix; or you have to make the user launch a browser instead and download the document into their Downloads folder, and then double-click to launch Word.

    Not a showstopper, just feels a bit clunky!

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard