You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Azure Cosmos DB Emulator provides a local environment that emulates the Azure Cosmos DB service for development purposes. The emulator allows you to develop and test your application locally, without creating an Azure subscription or incurring any costs.
19
19
20
20
## PowerShell Task for Emulator
21
+
22
+
### [Classic](#tab/classic)
23
+
21
24
A typical PowerShell based task that will start the Azure Cosmos DB emulator can be scripted as follows:
22
25
23
26
Example of a job configuration, selecting the "windows-2019" agent type.
For agents that do not come with the Azure Cosmos DB emulator preinstalled, you can instead download the latest emulator's MSI package from https://aka.ms/cosmosdb-emulator using 'curl' or 'wget', then leverage ['msiexec'](/windows-server/administration/windows-commands/msiexec) to 'quiet' install it. After the install, you can run a similar PowerShell script as the one above to start the emulator.
63
+
You also have the option of building your own [self-hosted Windows agent](/azure/devops/pipelines/agents/v2-windows) if you need to use an agent that doesn't come with the Azure Cosmos DB emulator preinstalled. On your self-hosted agent, you can download the latest emulator's MSI package from https://aka.ms/cosmosdb-emulator using 'curl' or 'wget', then use ['msiexec'](/windows-server/administration/windows-commands/msiexec) to 'quiet' install it. After the install, you can run a similar PowerShell script as the one above to start the emulator.
64
+
65
+
### [YAML](#tab/yaml)
66
+
67
+
68
+
You can use the `windows-2019` agent and a PowerShell script task to run the Azure Cosmos DB Emulator.
69
+
70
+
```yaml
71
+
trigger:
72
+
- main
73
+
74
+
pool:
75
+
vmImage: windows-2019
76
+
77
+
steps:
78
+
- task: PowerShell@2
79
+
inputs:
80
+
targetType: 'inline'
81
+
script: |
82
+
# Write your PowerShell commands here.
83
+
84
+
dir "C:\Program Files\Azure Cosmos DB Emulator\"
85
+
86
+
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
You also have the option of building your own [self-hosted Windows agent](/azure/devops/pipelines/agents/v2-windows) if you need to use an agent that doesn't come with the Azure Cosmos DB emulator preinstalled. On your self-hosted agent, you can download the latest emulator's MSI package from https://aka.ms/cosmosdb-emulator using 'curl' or 'wget', then use ['msiexec'](/windows-server/administration/windows-commands/msiexec) to 'quiet' install it. After the install, you can run a similar PowerShell script as the one above to start the emulator.
0 commit comments