none
Open Azure Storage File From C++

    Question

  • Good Evening,

    I am trying to open a file in the Azure cload with an API.

    if I try to open a pdf on the local machine :
    • ShellExecute(0, 0, L"E:\\Users\\Andrew\\Documents\\Programs\\Tests\\Open PDF\\GAMA.pdf", 0, 0 , SW_SHOW ); // works fine

    But to do with Azure :
    • ShellExecute(0, 0, L"https://[user name]:[login name]:[login password]:[full path]", 0, 0 , SW_SHOW );
    Where full path = URL as supplied by Azure Edit Box including file name and .pdf

    Can't get to open file.

    Any one familiar with launching a Azure Storage file from an API ?

    Thanks in Advance,
    Andrew

    Tuesday, October 18, 2016 4:07 AM

All replies

  • Hello,

    We are checking on the query and would get back to you soon on this.

    I apologize for the inconvenience and appreciate your time and patience in this matter.

    Regards,
    Sumanth BM

    Tuesday, October 18, 2016 6:46 PM
    Moderator
  • Andrew, could you clarify what you mean by "Azure Edit Box" and which storage service you are using from Azure storage?
    Wednesday, October 19, 2016 8:27 PM
  • Hi,

    Thanks for viewing,

    I log into my Azure Portal | Dashboard | under all Resources :
    I Select Storage Account,  then Files Under File Service -
    I have Separate listings here ( File Folders ) that I created, I then select one that has the required file,
    On the Far Right I have the Directory Name (called Location ) if I click on a file,
    a new window pane opens to the right for file properties. Here we have a EditBox with the location https:// ....  under URL

    Hope this helps,
    Andrew

    Thursday, October 20, 2016 4:36 AM
  • Hi Andrew,

    To open a file on an Azure File Share using a URL, you must attach a Shared Access Signature. You can create one using the [free] Azure Storage Explorer (storageexplorer.com) for testing. For more information about SAS URI's, please check out this article:

    https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/

    Robin


    Sr. Content Developer at Microsoft

    Friday, October 28, 2016 6:08 AM
  • Thanks for the response.

    I have been able to open a file through an exe file now, but there are issues.

    If I upload a file, and use the Azure to generate the URL for the file, and combine with the SAS generated from Azure with access key.... also added endpoint for a month from now, I can open a file.

    Two issues 1) the jpg always upside down, even if I reload an inverted one, and 2) only works one time ?

    Thanks for any help.


    Monday, November 28, 2016 9:48 AM
  • Continued,

    If I use the created URL from Azure for a file, and add the SAS generated by Azure, I can open a file through my Executable successfully.

    If I close the file, and try to re-open through the executable - it fails after the first time.

    If I regenerate the SAS, copy it back it in, It again only works once.

    I have set my End date for a month from now - so I am now stuck.

    Any Ideas ?

    Thanks

    Tuesday, November 29, 2016 5:01 PM
  • Further details :

    In C++

    ShellExecute(0, 0, L"[url created by Azure to the specific file][sas created by Azure]", 0, 0 , SW_SHOW );

    Will work, but only once.I regenerate the the SAS, repaste  and can then do one more time.

    Also verified start time = previous to now, and end date = next month ...

    ??

    Thanks,

    Wednesday, November 30, 2016 12:47 AM
  • Hello,

    Sorry for the delay response!

     If the issue is still not rectified, for more specialized assistance on this kindly contact Azure technical
    support: http://azure.microsoft.com/en-us/support/options/

    Regards,
    Sumanth BM

    Tuesday, January 3, 2017 3:53 PM
    Moderator