find a location for property in a new city

Friday, 18 May 2012

How to get Azure storage Account Key from a CloudStorageAccount object

I have a CloudStorageAccount object and I want to get the AccountKey out of it. Seems like you should be able to get the Cloud Storage Key out of a CloudStorageAccount but I did struggle a bit at first.

I first used the CloudStorageAccount.FromConfigurationSetting(string) method at first and then played about in debug mode to see if I could find it.

I then found that that method doesn't return the correct type of object which left me unable to find my Azure storage access key. I then tried the same thing but using CloudStorageAccount.Parse(string) instead. This did have access to the Azure storage access key.

//this method of getting your CloudStorageAccount is no good here
//var account = CloudStorageAccount.FromConfigurationSetting("StorageConnectionStr");

//these two lines do...
var accountVal = RoleEnvironment.GetConfigurationSettingValue("StorageConnectionStr");
var account = CloudStorageAccount.Parse(accountVal);

//and then you can retrieve the key like this:
var key = ((StorageCredentialsAccountAndKey)account.Credentials)
          .Credentials.ExportBase64EncodedKey();

It is strange that CloudStorageAccount.FromConfigurationSetting doesn't give you access to the account key in your credentials but CloudStorageAccount.Parse does. Oh well, hope that helps.

Follow britishdev on Twitter

53 comments:

  1. I have an .net app that we currently license to hardware - motherboard make, BIOS etc etc etc, is there any Unique Id for azure I can tie this to, or if you would know of a secure way I can license this SW without hardware, SW is written in C# - I currently have EC2 in Amazon Cloud sorted because every time I rebooted the instance the fingerprint for the license was then mismatched, I also need AZURE on the list as this will be the same, do you know what others are doing to license their software on these cloud platforms, sorry if this is not the right area for this question - I have been "googling till my head hurts" - any advice on where I could find this info would be appreciated, thanks, Simon - NZ

    ReplyDelete
  2. I really believe you will do much better in the future I appreciate everything you have added to my knowledge base. Admiring the time and effort you put into your blog and detailed information you offer!
    http://celabright.com/

    ReplyDelete
  3. Considerably the article is in reality the greatest on this noteworthy topic. I agree with your conclusions and will eagerly look forward to your next updates. Saying thanks will not just be sufficient for the wonderful clarity in your writing. I will immediately grab your rss feed to stay privy of any updates! http://scarprinnow.com

    ReplyDelete
  4. Thanks for taking the time to discuss this I feel strongly about it and love learning more on this topic. If possible as you gain expertise would you mind updating your blog with more information? as it is extremely helpful for me.
    www.fadeplex.com

    ReplyDelete
  5. There are other data storage solutions available to those who need it. For example, some people prefer to have an external hard drive that they can back up their data to as well as using it for a temporary storage device.
    Self Storage

    ReplyDelete
  6. Yes, this absolutely helps, really great tip. I am back to reading the review of WritemyPaper but right after that I will try to get azure storage account key your way :) thanks!

    ReplyDelete
  7. a given article is very interesting and very useful for me, and pardon me permission to share articles here hopefully helpful and useful

    Scarymazegames.co
    iogamez.com

    ReplyDelete
  8. Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.

    Friv.Pro
    Run3.me

    ReplyDelete
  9. Motifz Designer Lawn. 1, 2 & 3 Piece Unstitched Premium Embroidered Lawn 2019, Premium Lawn, Lawn 2019, Best lawn collection, Motifz, Best Lawn in Pakistan, Shipping worldwide. Stitching option available.

    ReplyDelete
  10. Buy Premium lawn Online for Women's at best prices available at Motifz. ✓ Latest Fashion, ✓ Trendy Designs ➤ Shop Now!

    ReplyDelete
  11. Currently it looks like article is the top blogging platform available right now.
    McAfee Activates offers excellent protection from any kind of digital threat like viruses, malware, data breaches, which causes your system to slow down or completely malfunction.

    ReplyDelete
  12. The history of America started long before the land was even called American, and the Aztec and Mayan Civilizations were the key participants in forming this history. The american history thesis topics include every stage of american history and a huge list of topics to opt from.

    ReplyDelete
  13. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. packing moving companies in dubai

    ReplyDelete
  14. Wholesale printed custom perfume boxes with the highest quality and affordable prices. Free worldwide Delivery and free Custom Perfume Boxes design.

    ReplyDelete
  15. We Greenstar Landscape provide services in the field of enhanced commercial and residential landscaping across India; in short, our brilliant team of professionals makes your property more valuable, lavish and aesthetic by creating inventive and customized masterpieces for your residential or commercial land.

    ReplyDelete
  16. Buy online wholesale printed custom cbd boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!

    ReplyDelete
  17. Buy online wholesale printed lipstick boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!

    ReplyDelete
  18. Buy online wholesale custom cosmetic boxes and packaging at seashore packaging at the easy price Free shipping worldwide with 24/7 customer support.

    ReplyDelete
  19. mylar label bags in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available

    ReplyDelete
  20. Great Article
    Cloud Computing Projects




    Networking Projects



    Final Year

    Projects for CSE





    JavaScript Training in Chennai



    JavaScript

    Training in Chennai




    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals,

    Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer.

    Angular Training

    ReplyDelete
  21. Packaging town is a one stop solution for the short-run kraft business card boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  22. Blackbird packaging provide you with any size, shape design, wholesale cookie boxes sooner than any other packaging competitor in the market

    ReplyDelete
  23. gelati bags 3.5g Direct Print on the front and back. % Cali Packs Available at Your Supplies. Heat sealable mylar bags. Fast Shipping.

    ReplyDelete
  24. Blackbird packaging provide you with any size, shape design, bath bomb display boxes sooner than any other packaging competitor in the market

    ReplyDelete
  25. Packaging town is a one stop solution for the short-run custom apparel boxes wholesale needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  26. Packaging town is a one stop solution for the short-run custom apparel boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  27. Blackbird packaging provide you with any size, shape design, essential oil packaging boxes sooner than any other packaging competitor in the market

    ReplyDelete
  28. The service providers are always there to help students complete their Dissertation Writing Services on time. So, you need not hesitate to ask for help at the eleventh hour. The team of professionals associated with each website can take care of the project at any given time. Each website is well equipped to handle any type of assignment. Therefore, take their help if needed.

    https://trackthattravel.com/travelblog/1879

    ReplyDelete
  29. Packaging town is a one stop solution for the short-run custom pillow boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  30. buy online electronics from alfatah at best prices. get free shipping

    ReplyDelete
  31. We at Al-Fatah have perfected the floor care with the right variety of Vacuum Cleaners available under one roof. Al-Fatah is a One-Stop Shop for all your home appliances buying needs. Buy best variety of Vacuum Cleaners online in Pakistan at Al-Fatah. Shop Vacuum Cleaners of Top & Genuine Brands in Pakistan at Al-Fatah now!

    ReplyDelete
  32. Shop your favorite brand's latest and trendy Chiffon Collection today from SAFFANA store. Available in a wide variety of premium silk chiffon, bemberg chiffon, crinkle chiffon, and embroidered bemberg crinkle chiffon. Shop from a diversified range Premium Chiffon collection available exclusively at SAFFANA store.

    ReplyDelete
  33. Blackbird packaging company can provide you with any size, shape design, and eco friendly bath bomb packaging sooner than any other packaging competitor in the market

    ReplyDelete
  34. Packaging town is a one stop solution for the short-run custom pillow boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  35. Blackbird packaging company can provide you with any size, shape design, and eco friendly bath bomb packaging sooner than any other packaging competitor in the market

    ReplyDelete
  36. Blackbird packaging company can provide you with any size, shape design, and eco friendly bath bomb packaging sooner than any other packaging competitor in the market

    ReplyDelete
  37. Blackbird packaging company can provide you with any size, shape design, and wholesale cookie boxes sooner than any other packaging competitor in the market.

    ReplyDelete
  38. Packaging town is a one stop solution for the short-run custom beverage packaging needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  39. Blackbird packaging provide you with any size, shape design, vape cartridge box sooner than any other packaging competitor in the market

    ReplyDelete
  40. Thanks for sharing information with us…satisfied after visiting your blog…. Learn the latest trends & their practical application by experts with us…you can contact us click on
    Visit ISMT India

    ReplyDelete
  41. buy baby care products online from medisense.pk at best prices delivred at your doorstep. get free shipping

    ReplyDelete
  42. buy baby care products in pakistan from Medisense.pk delivered at your doorstep at best prices. Get free shipping

    ReplyDelete
  43. buy inner wear for girls online from Dshred at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  44. buy makeup online in pakistan from alfatah at best prices delivered at your doorstep. get free delivery

    ReplyDelete
  45. buy gym tights online from dshred at easy prices delivered at your doorstep. get free shipping

    ReplyDelete
  46. NDURE brings you its wide range of Men's t-shirt. Now you can buy your favorites with just a tap. You can find our t-shirts online by logging into our site. Our shirts are made with pure fabric that makes you stand out. So don't wait around and shop from our collection of online t-shirts.

    ReplyDelete
  47. Study Engineering at the best autonomous college in AP with scholarships and full faculty support with high quality education and professional career support.
    https://www.adityatekkali.edu.in/

    ReplyDelete
  48. buy tops for girl online from dshred at easy prices delivered at your doorstep. Get free shipping

    ReplyDelete
  49. Buy men's grooming online from Al-Fatah at best prices delivered at your doorstep. Get free shipping

    ReplyDelete