Skip to content

Commit a17efd9

Browse files
authored
Merge pull request #97150 from SnehaGunda/monitoring
Adding yaml CI/CD pipeline task
2 parents c619c97 + 62af01f commit a17efd9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

articles/cosmos-db/tutorial-setup-ci-cd.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,24 @@ After the build completes, observe that your tests pass, all running against the
145145

146146
![Save and run the build](./media/tutorial-setup-ci-cd/buildComplete_1.png)
147147

148+
## Set up using YAML
149+
150+
If you are setting up the CI/CD pipeline by using a YAML task, you can define the YAML task as shown in the following code:
151+
152+
```yml
153+
- task: azure-cosmosdb.emulator-public-preview.run-cosmosdbemulatorcontainer.CosmosDbEmulator@2
154+
displayName: 'Run Azure Cosmos DB Emulator'
155+
156+
- script: yarn test
157+
displayName: 'Run API tests (Cosmos DB)'
158+
env:
159+
HOST: $(CosmosDbEmulator.Endpoint)
160+
# Hardcoded key for emulator, not a secret
161+
AUTH_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
162+
# The emulator uses a self-signed cert, disable TLS auth errors
163+
NODE_TLS_REJECT_UNAUTHORIZED: '0'
164+
```
165+
148166
## Next steps
149167
150168
To learn more about using the emulator for local development and testing, see [Use the Azure Cosmos DB Emulator for local development and testing](https://docs.microsoft.com/azure/cosmos-db/local-emulator).

0 commit comments

Comments
 (0)