I am doing some testing on my cosmos db and I would like to use Cosmos Db emulator to be set up locally using scripts. I would like to use PowerShell scripts to create Db , containers , populate test data using PowerShell in cosmos db emulator but I couldn't find any documentation online. Can someone direct me or help me in doing this. Till now I have followed this documentation which allows me to start CosmosDb emulator using PowerShell
How do I set up cosmosdb emulator locally from powershell script
1.5k views Asked by ZZZSharePoint At
1
There are 1 answers
Related Questions in POWERSHELL
- Spark .mapValues setup with multiple values
- Where do 'normal' println go in a scala jar, under Spark
- How to query JSON data according to JSON array's size with Spark SQL?
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- How to add a new event to Apache Spark Event Log
- Spark streaming + kafka throughput
- dataframe or sqlctx (sqlcontext) generated "Trying to call a package" error
- Spark pairRDD not working
- How to know which worker a partition is executed at?
- Using HDFS with Apache Spark on Amazon EC2
Related Questions in AZURE-COSMOSDB
- Spark .mapValues setup with multiple values
- Where do 'normal' println go in a scala jar, under Spark
- How to query JSON data according to JSON array's size with Spark SQL?
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- How to add a new event to Apache Spark Event Log
- Spark streaming + kafka throughput
- dataframe or sqlctx (sqlcontext) generated "Trying to call a package" error
- Spark pairRDD not working
- How to know which worker a partition is executed at?
- Using HDFS with Apache Spark on Amazon EC2
Related Questions in AZURE-COSMOSDB-EMULATOR
- Spark .mapValues setup with multiple values
- Where do 'normal' println go in a scala jar, under Spark
- How to query JSON data according to JSON array's size with Spark SQL?
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- How to add a new event to Apache Spark Event Log
- Spark streaming + kafka throughput
- dataframe or sqlctx (sqlcontext) generated "Trying to call a package" error
- Spark pairRDD not working
- How to know which worker a partition is executed at?
- Using HDFS with Apache Spark on Amazon EC2
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The PowerShell module (
Az.Cosmos
) provided by Microsoft focuses only on the Cosmos DB accounts in the cloud. As of version 5.8.0, it does not have a support for Cosmos DB emulator.Luckily there's a community solution available that you can use: https://github.com/PlagueHO/CosmosDB.
To create a context for emulator account, this is what you will have to do:
Once you have the context, you should be able to create databases and containers. For example:
This project was last updated 6 months ago so I am not sure if it has all the features you're looking for.
Other idea would be to make use of Cosmos DB .Net SDK and use that in PowerShell scripts of your own.
UPDATE
This is what I did:
Admin
mode.Cosmos
module usingInstall-Module -Name CosmosDB
. I got an error initially (something about module not found) which I fixed by setting the TLS command to 1.2 using[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
.$cosmosDbContext = New-CosmosDbContext -Emulator
.