Skip to content

Commit

Permalink
Updated documentation with Cosmos DB
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed Aug 4, 2018
1 parent b8d8dec commit f8d177c
Show file tree
Hide file tree
Showing 47 changed files with 397 additions and 392 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -15,7 +15,7 @@ If you'd like to contribute to this project, there are several different methods

Before working on any enhancement, submit an Issue describing the proposed enhancement. Someone may already be working on the same thing. It also allows other contributors to comment on the proposal.

Alternately, feel free to post on the [CosmosDB Gitter Chat at https://gitter.im/PlagueHO/CosmosDB](https://gitter.im/PlagueHO/CosmosDB). This is also a great place to just say Hi, ask any questions you might have or get help.
Alternately, feel free to post on the [CosmosDB PowerShell Module Gitter Chat at https://gitter.im/PlagueHO/CosmosDB](https://gitter.im/PlagueHO/CosmosDB). This is also a great place to just say Hi, ask any questions you might have or get help.

If you're new to Git revision control, and the GitHub service, it's suggested that you learn about some basic Git fundamentals, and take an overview of the GitHub service offerings.

Expand Down Expand Up @@ -50,10 +50,10 @@ For more information, learn about our [branch structure](#branch-structure).
- When you create a pull request, fill out the description with a summary of what's included in your changes.
If the changes are related to an existing GitHub issue, please reference the issue in pull request title or description (e.g. ```Closes #11```). See [this](https://help.github.com/articles/closing-issues-via-commit-messages/) for more details.

- Include an update in the [/CosmosDB/Docs/ChangeList.md](/CosmosDB/Docs/ChangeList.md) file in your pull request to reflect changes for future versions changelog. Put them in `Unreleased` section (create one if doesn't exist). This would simplify the release process for Maintainers. Example:
- Include an update in the [/CHANGELOG.md](/CHANGELOG.md) file in your pull request to reflect changes for future versions changelog. Put them in `Unreleased` section (create one if doesn't exist). This would simplify the release process for Maintainers. Example:

```
### Unreleased
## Unreleased
- Added support for `-FriendlyName` in `Update-xDscResource`.
```
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Expand Up @@ -3,8 +3,8 @@ Before submitting your issue for the CosmosDB project, please take a moment to p
- [ ] Version of PowerShell you're using
- [ ] PowerShell host you're using (eg. Console Host, ISE, Visual Studio)
- [ ] Operating system you're running
- [ ] Version of CosmosDB you're using (use `Get-Module -Name CosmosDB`)
- [ ] Version of CosmosDB PowerShell Module you're using (use `Get-Module -Name CosmosDB`)

If you have a general question or suggestion, feel free to post on the [CosmosDB Gitter Chat at https://gitter.im/PlagueHO/CosmosDB](https://gitter.im/PlagueHO/CosmosDB). This is also a great place to just say Hi, ask any questions you might have or get help.
If you have a general question or suggestion, feel free to post on the [CosmosDB PowerShell Module Gitter Chat at https://gitter.im/PlagueHO/CosmosDB](https://gitter.im/PlagueHO/CosmosDB). This is also a great place to just say Hi, ask any questions you might have or get help.

Thanks for contributing your feedback and support! You can optionally submit a Pull Request against this project, if you have a fix you'd like to share.
Thanks for contributing your feedback and support! You can optionally submit a Pull Request against this project, if you have a fix you'd like to share.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log

## Unreleased

- Changed references to `CosmosDB` to `Cosmos DB` in documentation - fixes [Issue #147](https://github.com/PlagueHO/CosmosDB/issues/147)

## 2.1.4.536

- Added `RemoveDefaultTimeToLive` switch parameter to `Set-CosmosDbCollection`
Expand Down
58 changes: 29 additions & 29 deletions README.md
Expand Up @@ -22,7 +22,7 @@
- [Working with Contexts](#working-with-contexts)
- [Create a Context specifying the Key Manually](#create-a-context-specifying-the-key-manually)
- [Use CosmosDB Module to Retrieve Key from Azure Management Portal](#use-cosmosdb-module-to-retrieve-key-from-azure-management-portal)
- [Create a Context for a CosmosDB Emulator](#create-a-context-for-a-cosmosdb-emulator)
- [Create a Context for a Cosmos DB Emulator](#create-a-context-for-a-cosmos-db-emulator)
- [Create a Context from Resource Authorization Tokens](#create-a-Context-from-resource-authorization-tokens)
- [Working with Databases](#working-with-databases)
- [Working with Offers](#working-with-offers)
Expand All @@ -47,7 +47,7 @@

This PowerShell module provides cmdlets for working with Azure Cosmos DB.

The CosmosDB PowerShell module enables management of:
The _CosmosDB PowerShell module_ enables management of:

- [Attachments](#working-with-attachments)
- [Collections](#working-with-collections)
Expand All @@ -60,9 +60,9 @@ The CosmosDB PowerShell module enables management of:
- [User Defined Functions](#working-with-user-defined-functions)
- [Users](#working-with-users)

The module uses the CosmosDB (DocumentDB) Rest APIs.
The module uses the Cosmos DB (DocumentDB) Rest APIs.

For more information on the CosmosDB Rest APIs, see [this link](https://docs.microsoft.com/en-us/rest/api/documentdb/restful-interactions-with-documentdb-resources).
For more information on the Cosmos DB Rest APIs, see [this link](https://docs.microsoft.com/en-us/rest/api/documentdb/restful-interactions-with-documentdb-resources).

## Requirements

Expand Down Expand Up @@ -90,12 +90,12 @@ Install-Module -Name CosmosDB

The easiest way to use this module is to first create a context
object using the `New-CosmosDbContext` cmdlet which you can then
use to pass to the other CosmosDB cmdlets in the module.
use to pass to the other Cosmos DB cmdlets in the module.

To create the context object you will either need access to the
primary primary or secondary keys from your CosmosDB account or allow
the CosmosDB module to retrieve the keys directly from the Azure
management portal for you.
primary primary or secondary keys from your Cosmos DB account or allow
the _CosmosDB Powershell module_ to retrieve the keys directly from
the Azure management portal for you.

### Working with Contexts

Expand All @@ -107,7 +107,7 @@ First convert your key into a secure string:
$primaryKey = ConvertTo-SecureString -String 'GFJqJesi2Rq910E0G7P4WoZkzowzbj23Sm9DUWFX0l0P8o16mYyuaZBN00Nbtj9F1QQnumzZKSGZwknXGERrlA==' -AsPlainText -Force
```

Use the key secure string, Azure CosmosDB account name and database to
Use the key secure string, Azure Cosmos DB account name and database to
create a context variable:

```powershell
Expand All @@ -116,25 +116,25 @@ $cosmosDbContext = New-CosmosDbContext -Account 'MyAzureCosmosDB' -Database 'MyD

#### Use CosmosDB Module to Retrieve Key from Azure Management Portal

To create a context object so that the CosmosDB module retrieves the
primary or secondary key from the Azure Management Portal, use the
following command:
To create a context object so that the _CosmosDB PowerShell module_
retrieves the primary or secondary key from the Azure Management
Portal, use the following command:

```powershell
$cosmosDbContext = New-CosmosDbContext -Account 'MyAzureCosmosDB' -Database 'MyDatabase' -ResourceGroup 'MyCosmosDbResourceGroup' -MasterKeyType 'SecondaryMasterKey'
```

_Note: if PowerShell is not connected to Azure then an interactive
Azure login will be initiated. If PowerShell is already connected to
an account that doesn't contain the CosmosDB you wish to connect to then
an account that doesn't contain the Cosmos DB you wish to connect to then
you will first need to connect to the correct account using the
`Add-AzureRmAccount` cmdlet._

#### Create a Context for a CosmosDB Emulator
#### Create a Context for a Cosmos DB Emulator

Microsoft provides a [CosmosDB emulator](https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator) that
Microsoft provides a [Cosmos DB emulator](https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator) that
you can run locally to enable testing and debugging scenarios. To create
a context for a CosmosDB emulator installed on the localhost use the
a context for a Cosmos DB emulator installed on the localhost use the
following command:

```powershell
Expand All @@ -149,33 +149,33 @@ Authorization Tokens_.

### Working with Databases

Create a new database in the CosmosDB account:
Create a new database in the Cosmos DB account:

```powershell
New-CosmosDbDatabase -Context $cosmosDbContext -Id 'AnotherDatabase'
```

Get a list of databases in the CosmosDB account:
Get a list of databases in the Cosmos DB account:

```powershell
Get-CosmosDbDatabase -Context $cosmosDbContext
```

Get the specified database from the CosmosDB account:
Get the specified database from the Cosmos DB account:

```powershell
Get-CosmosDbDatabase -Context $cosmosDbContext -Id 'MyDatabase'
```

### Working with Offers

Get a list of offers in the CosmosDB account:
Get a list of offers in the Cosmos DB account:

```powershell
Get-CosmosDbOffer -Context $cosmosDbContext
```

Query the offers in the CosmosDB account:
Query the offers in the Cosmos DB account:

```powershell
Get-CosmosDbOffer -Context $cosmosDbContext -Query 'SELECT * FROM root WHERE (root["id"] = "lyiu")'
Expand Down Expand Up @@ -233,10 +233,10 @@ Remove-CosmosDbCollection -Context $cosmosDbContext -Id 'MyNewCollection'
You can create a collection with a custom indexing policy by assembling
an Indexing Policy object using the functions:

- New-CosmosDbCollectionIncludedPathIndex
- New-CosmosDbCollectionIncludedPath
- New-CosmosDbCollectionExcludedPath
- New-CosmosDbCollectionIndexingPolicy
- `New-CosmosDbCollectionIncludedPathIndex`
- `New-CosmosDbCollectionIncludedPath`
- `New-CosmosDbCollectionExcludedPath`
- `New-CosmosDbCollectionIndexingPolicy`

For example, to create a string range, a number range index and a point
spatial index on the '/*' path using consistent indexing mode with no
Expand All @@ -251,7 +251,7 @@ $indexingPolicy = New-CosmosDbCollectionIndexingPolicy -Automatic $true -Indexin
New-CosmosDbCollection -Context $cosmosDbContext -Id 'MyNewCollection' -PartitionKey 'account' -IndexingPolicy $indexingPolicy
```

For more information on how CosmosDB indexes documents, see [this page](https://docs.microsoft.com/en-us/azure/cosmos-db/indexing-policies).
For more information on how Cosmos DB indexes documents, see [this page](https://docs.microsoft.com/en-us/azure/cosmos-db/indexing-policies).

#### Update an existing Collection with a new Indexing Policy

Expand Down Expand Up @@ -464,7 +464,7 @@ The typical pattern for using _resource authorization tokens_ is to
have a **token broker app** that provides some form of user authentication
and then returns the _resource authorization tokens_ assigned to that
user. This removes the requirement for the user to be given access to
the **master** key for the CosmosDB database.
the **master** key for the Cosmos DB database.

For more information on using _resource authorization tokens_ or the
**token broker app* pattern, please see [this document](https://docs.microsoft.com/en-us/azure/cosmos-db/secure-access-to-data#resource-tokens).
Expand Down Expand Up @@ -784,11 +784,11 @@ document first. We would be very grateful of any contributions.

## Cmdlets

A list of Cmdlets in the CosmosDB module can be found by running the
A list of Cmdlets in the _CosmosDB PowerShell module_ can be found by running the
following PowerShell commands:

```PowerShell
Import-Module CosmosDB
Import-Module -Name CosmosDB
Get-Command -Module CosmosDB
```

Expand Down

0 comments on commit f8d177c

Please sign in to comment.