Open Azure Storage File From C++


  • 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,

    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.

    Sumanth BM

    Tuesday, October 18, 2016 6:46 PM
  • 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,

    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 ( for testing. For more information about SAS URI's, please check out this article:


    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 ?


    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 ...



    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

    Sumanth BM

    Tuesday, January 3, 2017 3:53 PM