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!