none
Unable to get storage connection string to Parse

    Question

  • I am unable to get a valid storage connection string to parse today, using the CloudStorageAccount.Parse() method.  I tried both .TryParse() and .Parse().  I've sent the connection string (which is verified using Azure Storage Explorer to connect the same string) in direct, I've put the connection string into <appsettings>, and I've also put it into <connectionstrings> and retrieved with .GetSetting and .GetConnectionString respectively.  

    I did finally get a valid storage connection using the version where you build the StorageCredentials and then pass that into the CloudStorageAccount ctor.  My code is below.  Using nuget WindowsAzure.Storage v 7.2.1 and Microsoft.WindowsAzure.ConfigurationManager v 3.2.3

     

    CloudStorageAccount stg =null;

    // fails
    bool stgOK = CloudStorageAccount.TryParse(           "DefaultEndPointsProtocol=https;AccountName=will;AccountKey=Kj2y7AoDnG6VJrgHto3MJrIp1pRmRY6mZobHmTxfyYALa70kGGzDhlrI0FEqBX/40LsMjGXzQ==", out stg);
          

    I changed the accountname and accountkey above so they will not work.

    Thank you,

    William


    NONE

    Thursday, November 17, 2016 10:19 PM

All replies

  • Hi Will,

    The ``DefaultEndPointsProtocol`` element is incorrect. You're likely looking for ``DefaultEndpointsProtocol``. Please try this instead.

    Best,

    Peter

    Thursday, November 17, 2016 10:52 PM
  • I knew it was something minor that I was missing.  I received that connection string from someone else - apparently the capital P was introduced at that point.

    I am sorry that I took your time with that question.  There are no stupid questions, but this one is close.

    #shouldhavegottheconnectionstringmyself

    William



    NONE

    Friday, November 18, 2016 8:29 PM