Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Azure DocumentDB

You're reading from   Learning Azure DocumentDB Create outstanding enterprise solutions around DocumentDB using the latest technologies and programming tools with Azure

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781783552467
Length 152 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Riccardo Becker Riccardo Becker
Author Profile Icon Riccardo Becker
Riccardo Becker
Arrow right icon
View More author details
Toc

Managing your keys

As we have seen in Chapter 1, Getting Started with DocumentDB, access to your databases is granted by a combination of the URI to your DocumentDB and a key. In the Azure portal, on the All Settings blade of your database, you can see both your primary and secondary keys. Both keys can be used to access your database. But why are there two keys?

Recycling keys

DocumentDB, like other persistency mechanisms on Azure, such as Table storage, provides two keys. This is because it is good practice to regenerate your keys periodically to keep your connections more secure. The two-key approach enables access to your database with one key while regenerating the other. This way, your application is always online, while the keys are changed on a regular basis. This process is called rolling your keys.

Perform the following steps to roll your keys:

  1. Update all your applications that are using the primary key to use the secondary key.
  2. Regenerate the primary key from the Azure portal.
    Recycling keys

    Note...

You have been reading a chapter from
Learning Azure DocumentDB
Published in: Nov 2015
Publisher:
ISBN-13: 9781783552467
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image