Skip to content

Commit 3c93dea

Browse files
committed
docs: update docs/modules/azure.md
1 parent ab13925 commit 3c93dea

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

docs/modules/azure.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The Azure module exposes the following Go packages:
2323
- [ServiceBus](#servicebus): `github.com/testcontainers/testcontainers-go/modules/azure/servicebus`.
2424
!!! warning "EULA Acceptance"
2525
Due to licensing restrictions you are required to explicitly accept an End User License Agreement (EULA) for the EventHubs container image. This is facilitated through the `WithAcceptEULA` function.
26-
26+
- [CosmosDB](#cosmosdb): `github.com/testcontainers/testcontainers-go/modules/azure/cosmosdb`.
2727
<!--codeinclude-->
2828
[Creating a Azurite container](../../modules/azure/azurite/examples_test.go) inside_block:runAzuriteContainer
2929
<!--/codeinclude-->
@@ -307,4 +307,49 @@ In the following example, inspired by the [Azure Event Hubs Go SDK](https://lear
307307
[Create Client](../../modules/azure/servicebus/examples_test.go) inside_block:createClient
308308
[Send messages to a Queue](../../modules/azure/servicebus/examples_test.go) inside_block:sendMessages
309309
[Receive messages from a Queue](../../modules/azure/servicebus/examples_test.go) inside_block:receiveMessages
310-
<!--/codeinclude-->
310+
<!--/codeinclude-->
311+
312+
## CosmosDB
313+
314+
### Run function
315+
316+
- Not available until the next release <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
317+
318+
The CosmosDB module exposes one entrypoint function to create the CosmosDB container, and this function receives three parameters:
319+
320+
```golang
321+
func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*Container, error)
322+
```
323+
324+
- `context.Context`, the Go context.
325+
- `string`, the Docker image to use.
326+
- `testcontainers.ContainerCustomizer`, a variadic argument for passing options.
327+
328+
#### Image
329+
330+
Use the second argument in the `Run` function to set a valid Docker image.
331+
In example: `Run(context.Background(), "mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview")`.
332+
333+
### Container Options
334+
335+
When starting the CosmosDB container, you can pass options in a variadic way to configure it.
336+
337+
{% include "../features/common_functional_options_list.md" %}
338+
339+
### Container Methods
340+
341+
The CosmosDB container exposes the following methods:
342+
343+
#### ConnectionString
344+
345+
- Not available until the next release <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
346+
347+
Returns the connection string to connect to the CosmosDB container and an error, passing the Go context as parameter.
348+
349+
### Examples
350+
351+
#### Connect and Create database
352+
353+
<!--codeinclude-->
354+
[Connect_CreateDatabase](../../modules/azure/cosmosdb/examples_test.go) inside_block:ExampleRun_connect
355+
<!--/codeinclude-->

0 commit comments

Comments
 (0)