Dnirmania


Technical Article

Powershell Script - Azure cosmos DB(SQL API)

Scripts contains 4 following functions. Users can create 3 different script from this for inserting, fetching and deleting a document.
1. Function Generate-MasterKeyAuthorizationSignature - This function is used to create connection to Azure cosmos DB. This function codes were taken from Technet.
2. Function Post-CosmosDb - Insert single document in azure cosmos DB. Same function can be used to perform bulkinsert. This function code was taken from following article. To make it useful i made some modification in it.
(https://www.systemcenterautomation.com/2018/06/cosmos-db-rest-api-powershell/)
3. Function Get-CosmosDocument - Fetch single document from azure cosmos DB. Same function can be used to fetch all documents from Cosmos DB.
4. Function Delete-CosmosDbDocument - Delete single document from cosmos DB. Same function can be used to delete more than one document with some additional codes.

To use any of the function like Post,Get, Delete. you have to comment the other 2 function call. If you are using all 3 functions(Post,Get, Delete), Be cautious while using them.

You rated this post out of 5. Change rating

2020-05-11 (first published: )

3,769 reads

Blogs

Five Ways Redshift Serverless Quietly Eats Your Budget

By

It is Friday, the queries are running, and nobody is watching the bill. That...

A Career of Memories

By

Annabel retired from Redgate Software this week. Across most of my career at Redgate,...

Rethinking Index Maintenance: Why avg_fragmentation_in_percent Is Outdated and What You Should Do Instead

By

As a SQL Server DBA with years of experience tuning production environments, I’ve seen...

Read the latest Blogs

Forums

Alamat Kantor BCA KCP Bumiayu Telp:0817866887

By Layanan_24jam

WhatsApp:0817-866-887 Jl. Kalierang No.Ruko 3-5, Dukuhturi, Kec. Bumiayu, Kabupaten Brebes, Jawa Tengah 52273 (@bcakcpbumiayu)

BCA KCP Permata Ujung Menteng Tlp:0817839777

By R4nt4u

WhatsApp: 0817839777 Jl. Raya Bekasi Km. 25 Blok A/17, RW.18, Ujung Menteng, Wil, Kota...

Alamat Kantor BCA KCU RAWAMANGUN Tlp:0817839777

By layanan_Bca88

WhatsApp: 0817839777 Jl. Paus No.81, RT.1/RW.8, Wil, Kec. Pulo Gadung, Kota Jakarta Timur, Daerah...

Visit the forum

Question of the Day

BCP on Linux

When running bcp on Linux, what is the field terminator?

See possible answers