![]() In the Azure Portal, we can get the connection string and key information (along with regenerating keys) from the Keys option under Settings. In addition, we will also see where we can get and update this information through the Azure Portal, since the portal can be appropriate in organizations where there are few resources. If you close the PowerShell session, another login will be required. ![]() Throughout this tip, we will not log in again but re-use the same PowerShell session. ![]() Once we have the correct module installed, we will connect to Azure using the below PowerShell call. For security reasons, I recommend testing with a new account and not an existing account if the existing account is being used for any other purposes outside of testing. In addition, we can either create a new Cosmos database account (done for this tip), or we can use an existing account for these scripts to get the properties (such as the Azure Cosmos DB we created in the first part of this series). Identical to the create and remove of a Cosmos database account, these scripts require PowerShell’s Az module. In secure settings, we want to save these values directly to their location (file, table, encrypted storage, etc), if we have a target for our obtaining these properties. In the same manner, we may want to regenerate the keys for the account and save the connection strings with the new keys.įor the sake of examples in this tip, we’ll show keys to demonstrate the functionality of these PowerShell scripts with Azure Cosmos DB. In secure contexts, this ensures security without the properties after passing through human eyes since they are saved directly to an encrypted location. We may use some of the get functionality that PowerShell provides to dynamically save values to encrypted configuration files or tables that we use for application purposes and this functionality could be added to the creation of the Cosmos database account, or a separate step in addition to the creation. ![]() ![]() After we set up our Azure Cosmos DB, we may want to get, add to, or update existing properties. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |