{"id":13130,"date":"2026-10-27T06:31:06","date_gmt":"2026-10-27T13:31:06","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=13130"},"modified":"2026-10-27T06:31:06","modified_gmt":"2026-10-27T13:31:06","slug":"inspecting-local-data-with-azure-cosmos-db-shell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/inspecting-local-data-with-azure-cosmos-db-shell\/","title":{"rendered":"Inspecting Local Data with Azure Cosmos DB Shell"},"content":{"rendered":"<p><em>Explore local data from the terminal, with the emulator as your development environment.<\/em><\/p>\n<p><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\"><strong>Azure Cosmos DB Shell<\/strong><\/a> gives me a direct way to work with my data from the terminal. I can navigate databases and containers, query documents, and read a specific item without opening the portal or adding temporary application code. That is useful while I am getting an application ready to ship. A value looks wrong, a document is missing, or I want to check one partition. Instead of guessing what was stored, I can inspect it.<\/p>\n<p>The <a href=\"https:\/\/learn.microsoft.com\/azure\/cosmos-db\/emulator-linux\"><strong>Azure Cosmos DB Linux Emulator<\/strong><\/a> provides the local environment for this walkthrough. In the <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/from-local-development-to-ci-workflows-with-the-azure-cosmos-db-emulator\/\">previous post in this series<\/a>, we used it to make local development and CI repeatable. This installment adds the shell so we can inspect that local data directly before deployment.<\/p>\n<p>I am reusing <a href=\"https:\/\/github.com\/AzureCosmosDB\/fleetcharge-agent-cosmos-ci\">FleetCharge<\/a>&#8216;s dispatch records as the example data. The focus is the shell: connect, navigate, inspect, query, and point-read. We are troubleshooting during development, not investigating a production incident.<\/p>\n<p><div style=\"width: 1920px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-13130-1\" width=\"1920\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/cosmos-shell-walkthrough-captioned.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/cosmos-shell-walkthrough-captioned.mp4\">https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/cosmos-shell-walkthrough-captioned.mp4<\/a><\/video><\/div><\/p>\n<h2 id=\"open-azure-cosmos-db-shell\">Open Azure Cosmos DB Shell<\/h2>\n<p>Shell is the inspection tool for this walkthrough, but it is not required to run FleetCharge or its CI tests. Choose one of these installation methods.<\/p>\n<h3 id=\"install-as-a-net-global-tool\">Install as a .NET global tool<\/h3>\n<p>The <a href=\"https:\/\/learn.microsoft.com\/azure\/cosmos-db\/shell\/install\">official installation guide<\/a> includes a .NET global-tool option. This method requires the <strong>.NET SDK 10.0 or later<\/strong>. Install the tool and check its version:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">dotnet tool install --global CosmosDBShell --prerelease\r\ncosmosdbshell --version\r\n<\/code><\/pre>\n<p>If you already installed the global tool for the previous post, skip the install command and check its version. Start the shell with:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cosmosdbshell\r\n<\/code><\/pre>\n<h3 id=\"download-a-self-contained-binary\">Download a self-contained binary<\/h3>\n<p>Alternatively, get a self-contained binary from the <a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/releases\">official releases<\/a>. This option includes its runtime, so no separate .NET installation is needed. For this Windows x64 walkthrough, I used the <a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/releases\/download\/v1.1.280\/cosmosdbshell_win-x64_1.1.280-preview.zip\">1.1.280-preview Windows x64 ZIP<\/a>. Extract it and open PowerShell in the extracted directory containing <code style=\"font-family: terminal, monaco, monospace;\">CosmosDBShell.exe<\/code>. Check the version and start the shell:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">.\\CosmosDBShell.exe --version\r\n.\\CosmosDBShell.exe\r\n<\/code><\/pre>\n<p>For other platforms or a source build, follow the<a href=\"https:\/\/github.com\/Azure\/CosmosDBShell#quick-start\"> shell&#8217;s installation guidance<\/a> and choose the matching release asset. The source-build path requires the .NET SDK; it is not an extra step in the ZIP-based path above. The examples below use commands verified with Shell 1.1.280-preview. The <code style=\"font-family: terminal,monaco,monospace;\">print &lt;item-id&gt; &lt;partition-key&gt;<\/code> command reads one item; the application and its data model have not changed.<\/p>\n<h2 id=\"give-the-shell-a-local-data-source\">Give the shell a local data source<\/h2>\n<p>The emulator lets me try these operations locally, without connecting to a live Azure account. The <a href=\"https:\/\/github.com\/AzureCosmosDB\/fleetcharge-agent-cosmos-ci\">FleetCharge sample<\/a> provides the same seed records as the previous post. If you followed that walkthrough, reuse your checkout: no application code, fixture, schema, or CI workflow changes are required. We are adding an inspection tool, not building a new application.<\/p>\n<p>For the walkthrough, I need:<\/p>\n<ul>\n<li>Azure Cosmos DB Shell, opened as described above.<\/li>\n<li>A FleetCharge checkout with Python 3.12 and uv, as described in its README.<\/li>\n<li>Docker running Linux containers on a supported x86-64 Windows or Linux host.<\/li>\n<\/ul>\n<p>The previous post used Git Bash; I am using PowerShell for the host commands below. That changes the terminal syntax, not the application. Commands inside Cosmos DB Shell are in separate <code style=\"font-family: terminal, monaco, monospace;\">text<\/code> blocks; they are not PowerShell commands.<\/p>\n<h3 id=\"start-an-emulator-that-stays-available-for-inspection\">Start an emulator that stays available for inspection<\/h3>\n<p>FleetCharge&#8217;s managed demo and CI commands start their own emulators with dynamically assigned ports. They clean up their resources when they finish. That is useful for tests, but I do not want my inspection environment to disappear halfway through this walkthrough.<\/p>\n<p>As in the previous post, I use the sample&#8217;s direct-startup approach. If your own directly started emulator is still running, reuse it: skip <code style=\"font-family: terminal, monaco, monospace;\">docker run<\/code> below and continue with the readiness check. If you chose different ports, use those ports consistently for readiness, seeding, and the shell connection.<\/p>\n<p>Otherwise, start the emulator in one PowerShell terminal:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">$image = \"mcr.microsoft.com\/cosmosdb\/linux\/azure-cosmos-emulator:vnext-latest\"\r\ndocker run --rm --name fleetcharge-shell-local `\r\n    -p 127.0.0.1:8081:8081 -p 127.0.0.1:8080:8080 `\r\n    $image --protocol http\r\n<\/code><\/pre>\n<p>Leave that terminal running. The emulator&#8217;s standard ports are exposed unchanged: <code style=\"font-family: terminal, monaco, monospace;\">8081<\/code> for the database endpoint and <code style=\"font-family: terminal, monaco, monospace;\">8080<\/code> for readiness. Both are bound to loopback. If either port or the container name is already in use, check what owns it before continuing. Do not stop or reuse an unrelated container.<\/p>\n<p>In a second PowerShell terminal, opened at the FleetCharge repository root, check readiness:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Invoke-RestMethod -Uri http:\/\/127.0.0.1:8080\/ready\r\n<\/code><\/pre>\n<p>Wait for HTTP 200 with <code style=\"font-family: terminal, monaco, monospace;\">ready: true<\/code> before seeding. If the emulator is still starting, check again rather than continuing after an error. Then install the locked dependencies, preserve any existing local settings, and explicitly select the endpoint and database for this session. These environment variables override the checkout&#8217;s existing <code style=\"font-family: terminal, monaco, monospace;\">.env<\/code> settings, keeping the seed script and shell on the same endpoint without changing application code:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">uv sync --locked\r\nif (-not (Test-Path .env)) {\r\n    Copy-Item .env.example .env\r\n}\r\n$env:COSMOS_ENDPOINT = \"http:\/\/127.0.0.1:8081\"\r\n$env:COSMOS_DATABASE = \"fleetchargetest-demo\"\r\nuv run --locked python -m scripts.seed_cosmos\r\n<\/code><\/pre>\n<p>The seed command provisions the containers and writes the sample documents. Run it only against your own local demonstration environment: rerunning it upserts the fixture records and can replace changes you made to those records. The shell can now inspect those records directly. Neither FleetCharge&#8217;s API nor Ollama needs to be running for this walkthrough.<\/p>\n<h2 id=\"connect-to-the-emulator\">Connect to the emulator<\/h2>\n<p>Inside Cosmos DB Shell:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">connect http:\/\/127.0.0.1:8081\/\r\n<\/code><\/pre>\n<p>The shell recognizes this loopback emulator endpoint and selects the well-known emulator key and Gateway mode. Optionally, to display the current connection information, run <code style=\"font-family: terminal,monaco,monospace;\">connect<\/code> without an argument. This is an inspection step, not a second connection:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">connect\r\n<\/code><\/pre>\n<p>The connection information should show <code style=\"font-family: terminal, monaco, monospace;\">http:\/\/127.0.0.1:8081\/<\/code> and <code style=\"font-family: terminal, monaco, monospace;\">Gateway<\/code>. This is the database endpoint, not the readiness URL. Now I can start exploring:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">ls\r\n<\/code><\/pre>\n<figure class=\"wp-caption alignnone\" style=\"max-width: 100%;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13131\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect.png\" alt=\"Cosmos DB Shell shows the loopback endpoint in Gateway mode and lists the fleetchargetest-demo database.\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect.png 1920w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect-300x169.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect-768x432.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/01-connect-1536x864.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 1. Confirm the local endpoint, then list the databases without leaving\nthe terminal.<\/figcaption><\/figure>\n<h2 id=\"find-the-fleetcharge-database\">Find the FleetCharge database<\/h2>\n<p>At the account level, <code style=\"font-family: terminal, monaco, monospace;\">ls<\/code> lists databases. The seed command created one named <code style=\"font-family: terminal, monaco, monospace;\">fleetchargetest-demo<\/code>. Move into it, check the current path, and list its containers:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cd fleetchargetest-demo\r\npwd\r\nls\r\n<\/code><\/pre>\n<p>For this example, I want <code style=\"font-family: terminal, monaco, monospace;\">dispatchUpdates<\/code>, the container holding the current pickup-bay information for each depot:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cd dispatchUpdates\r\npwd\r\n<\/code><\/pre>\n<p>The current path is now:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">\/fleetchargetest-demo\/dispatchUpdates\r\n<\/code><\/pre>\n<p>I can also navigate directly using the full path:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cd \/fleetchargetest-demo\/dispatchUpdates\r\n<\/code><\/pre>\n<figure class=\"wp-caption alignnone\" style=\"max-width: 100%;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13132\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation.png\" alt=\"Real shell commands navigate from the account into fleetchargetest-demo and dispatchUpdates, then show the current path.\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation.png 1920w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation-300x169.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation-768x432.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/02-navigation-1536x864.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2. Navigate from the account to FleetCharge&#8217;s dispatch data like moving\nthrough a filesystem.<\/figcaption><\/figure>\n<h2 id=\"look-at-the-data\">Look at the data<\/h2>\n<p>Now that I am inside the container, I can inspect the items stored there. To return up to 10:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">ls -m 10\r\n<\/code><\/pre>\n<p>That is a limit, not a request for the 10 newest items. This command does not establish a chronological order. For this tiny seeded container, I can also remove the limit:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">ls -m 0\r\n<\/code><\/pre>\n<p>On a fresh seed, there are two dispatch documents:<\/p>\n<div style=\"max-width: 100%; overflow-x: auto;\">\n<table>\n<thead>\n<tr>\n<th>Depot<\/th>\n<th>Item ID<\/th>\n<th>Update reference<\/th>\n<th>Pickup bay<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"font-family: terminal, monaco, monospace;\">SEA-01<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">dispatch-001<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">BAY-2<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"font-family: terminal, monaco, monospace;\">PDX-02<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">dispatch-099<\/code><\/td>\n<td><code style=\"font-family: terminal, monaco, monospace;\">BAY-99<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Unlimited listing is convenient for two local sample documents, not a default I would carry over to a large container. Start with a limit or a narrower query.<\/p>\n<p>This is useful while developing because I can see what is actually in Cosmos DB, rather than what I expected the application to write. No portal. No temporary endpoint. No debug code.<\/p>\n<figure class=\"wp-caption alignnone\" style=\"max-width: 100%;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13133\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect.png\" alt=\"Cosmos DB Shell lists Seattle and Portland dispatch documents stored in the local emulator.\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect.png 1920w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect-300x169.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect-768x432.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/03-inspect-1536x864.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 3. Inspect the stored documents directly in the shell, with the\nemulator supplying the local data.<\/figcaption><\/figure>\n<h2 id=\"query-the-container\">Query the container<\/h2>\n<p>Listing documents is useful, but most of the time I am looking for something specific. Start with a basic query against this small container:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">query \"SELECT * FROM c\"\r\n<\/code><\/pre>\n<p>Now narrow the results to one depot:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">query \"SELECT * FROM c WHERE c.depotId = 'SEA-01'\"\r\n<\/code><\/pre>\n<p>On a fresh seed, that returns the Seattle dispatch document. Or return only the fields I care about:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">query \"SELECT c.id, c.depotId, c.updateId, c.pickupBay FROM c\"\r\n<\/code><\/pre>\n<p>That last query projects four fields from both depots; it does not include the Seattle filter. The smaller result is easier to scan without the system metadata included by <code style=\"font-family: terminal, monaco, monospace;\">SELECT *<\/code>. These are literal, interactive queries against known sample data. Application code should continue using parameterized queries for values supplied at runtime, as FleetCharge already does.<\/p>\n<figure class=\"wp-caption alignnone\" style=\"max-width: 100%;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13134\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query.png\" alt=\"A depot-filtered query returns the Seattle document with dispatch-001 and BAY-2.\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query.png 1920w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query-300x169.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query-768x432.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/04-query-1536x864.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 4. Narrow the view to a single depot using the same query language the\napplication uses.<\/figcaption><\/figure>\n<h2 id=\"point-read-a-specific-item\">Point-read a specific item<\/h2>\n<p>Sometimes I already know exactly which document I want. The <code style=\"font-family: terminal, monaco, monospace;\">dispatchUpdates<\/code> container uses <code style=\"font-family: terminal, monaco, monospace;\">\/depotId<\/code> as its partition key. For Seattle, the item ID is <code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code> and the partition-key value is <code style=\"font-family: terminal, monaco, monospace;\">SEA-01<\/code>:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">print current-dispatch SEA-01\r\n<\/code><\/pre>\n<p>The business fields in the result are shown below. This is an excerpt; the actual point-read output also includes Cosmos DB system metadata.<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">{\r\n  \"id\": \"current-dispatch\",\r\n  \"type\": \"dispatchUpdate\",\r\n  \"depotId\": \"SEA-01\",\r\n  \"updateId\": \"dispatch-001\",\r\n  \"pickupBay\": \"BAY-2\"\r\n}\r\n<\/code><\/pre>\n<p>For Portland:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">print current-dispatch PDX-02\r\n<\/code><\/pre>\n<p>The corresponding excerpt is:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">{\r\n  \"id\": \"current-dispatch\",\r\n  \"type\": \"dispatchUpdate\",\r\n  \"depotId\": \"PDX-02\",\r\n  \"updateId\": \"dispatch-099\",\r\n  \"pickupBay\": \"BAY-99\"\r\n}\r\n<\/code><\/pre>\n<p>Same item ID. Different partition key. Different document. For a point read, the item ID alone is not enough: the complete partition key is part of the address. The shell&#8217;s <code style=\"font-family: terminal, monaco, monospace;\">print<\/code> command performs a point read, rather than querying the container to find a matching item. For FleetCharge, that makes it straightforward to compare the current dispatch document for two depots without querying every dispatch document.<\/p>\n<figure class=\"wp-caption alignnone\" style=\"max-width: 100%;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13135\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads.png\" alt=\"Two cropped real point reads show the same item ID: SEA-01 returns BAY-2 and PDX-02 returns BAY-99.\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads.png 1920w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads-300x169.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads-768x432.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/10\/05-point-reads-1536x864.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 5. <code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code> identifies a different item in each depot&#8217;s\npartition.<\/figcaption><\/figure>\n<h2 id=\"move-around-without-starting-over\">Move around without starting over<\/h2>\n<p>The shell works much like navigating a filesystem. Move back one level and list the containers:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cd ..\r\nls\r\n<\/code><\/pre>\n<p>Or jump directly back to the dispatch container:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cd \/fleetchargetest-demo\/dispatchUpdates\r\n<\/code><\/pre>\n<p>That sounds simple, but it matters when an application has several containers. I can move through the data model without reconnecting or rebuilding each command.<\/p>\n<h2 id=\"use-it-while-getting-the-application-ready-to-ship\">Use it while getting the application ready to ship<\/h2>\n<p>This is the part I like about putting the emulator and the shell together. The shell makes the stored data visible while I am building and testing. The emulator supplies the repeatable local environment behind it.<\/p>\n<p>An application write looks unexpected. Open the shell. A local test fails because the stored document does not look right. Inspect the same document in the same test environment while it is still available. Need to check one partition without adding diagnostic code? Use a point read.<\/p>\n<p>The workflow stays close to the application: <strong>Build -&gt; Run -&gt; Inspect -&gt; Query -&gt; Fix -&gt; Run again<\/strong><\/p>\n<p>The command-line workflow also fits naturally into development containers and scripted tooling. Here it complements FleetCharge&#8217;s existing CI checks; it does not replace them or add a new CI gate.<\/p>\n<p>The same shell commands work after an application changes the data. If I run the dispatch-feed example from the FleetCharge README, I can point-read the updated document and compare its <code style=\"font-family: terminal, monaco, monospace;\">updateId<\/code> and <code style=\"font-family: terminal, monaco, monospace;\">pickupBay<\/code> with what the application acknowledged. I do not need a separate inspection endpoint.<\/p>\n<h3 id=\"when-the-local-result-is-not-what-i-expected\">When the local result is not what I expected<\/h3>\n<div style=\"max-width: 100%; overflow-x: auto;\">\n<table>\n<thead>\n<tr>\n<th>What I see<\/th>\n<th>What I check before changing code<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>The shell cannot connect.<\/td>\n<td>Is Docker running, did readiness return HTTP 200, and am I connecting to port <code style=\"font-family: terminal, monaco, monospace;\">8081<\/code>, not <code style=\"font-family: terminal, monaco, monospace;\">8080<\/code>?<\/td>\n<\/tr>\n<tr>\n<td>The database is missing.<\/td>\n<td>Did I seed this endpoint? Did a managed demo or CI run use a different port or already clean up its database?<\/td>\n<\/tr>\n<tr>\n<td>My query runs in the wrong place.<\/td>\n<td>Run <code style=\"font-family: terminal, monaco, monospace;\">pwd<\/code>, then <code style=\"font-family: terminal, monaco, monospace;\">cd \/fleetchargetest-demo\/dispatchUpdates<\/code>.<\/td>\n<\/tr>\n<tr>\n<td>A point read cannot find the item.<\/td>\n<td>Check both <code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code> and the depot&#8217;s partition-key value.<\/td>\n<\/tr>\n<tr>\n<td>Seattle shows <code style=\"font-family: terminal, monaco, monospace;\">BAY-7<\/code> instead of <code style=\"font-family: terminal, monaco, monospace;\">BAY-2<\/code>.<\/td>\n<td>Check <code style=\"font-family: terminal, monaco, monospace;\">updateId<\/code>. Running FleetCharge&#8217;s dispatch-feed example changes the seeded snapshot; that difference is expected.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>These are local checks during development, not a production incident-response procedure. The emulator does not prove production authentication, authorization, performance, throughput, or resiliency. Its well-known key is not a production credential, and successful local operations do not validate Azure access. Keep this HTTP setup on loopback.<\/p>\n<p>FleetCharge itself accepts only loopback Cosmos endpoints and test-prefixed database names. It is intentionally not configured for deployment to a live account. Production readiness still needs the appropriate security, networking, deployment, monitoring, and workload validation.<\/p>\n<h2 id=\"try-it-yourself\">Try it yourself<\/h2>\n<p>With the local emulator running and the FleetCharge fixtures seeded, open Cosmos DB Shell and try:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">connect http:\/\/127.0.0.1:8081\/\r\nls\r\ncd fleetchargetest-demo\r\nls\r\ncd dispatchUpdates\r\npwd\r\nls -m 10\r\nquery \"SELECT * FROM c WHERE c.depotId = 'SEA-01'\"\r\nprint current-dispatch SEA-01\r\nprint current-dispatch PDX-02\r\n<\/code><\/pre>\n<p>That is enough to go from a local application environment to inspecting the data behind it without writing additional application code. When finished, in the repository terminal with the same Cosmos environment variables, remove only your demo database:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">uv run --locked python -m scripts.cleanup_cosmos\r\n<\/code><\/pre>\n<p>Then stop the emulator&#8217;s <code style=\"font-family: terminal, monaco, monospace;\">docker run<\/code> terminal with Ctrl+C. The <code style=\"font-family: terminal, monaco, monospace;\">--rm<\/code> option removes that container when it exits. This walkthrough does not configure persistent storage, so do not treat it as a durable data store.<\/p>\n<p><strong>Make the shell part of your next local test run.<\/strong> <a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/releases\">Download Azure Cosmos DB Shell<\/a>, connect it to the emulator, and run the query and point reads above. Confirm that <code style=\"font-family: terminal, monaco, monospace;\">current-dispatch<\/code> returns <code style=\"font-family: terminal, monaco, monospace;\">BAY-2<\/code> for <code style=\"font-family: terminal, monaco, monospace;\">SEA-01<\/code> and <code style=\"font-family: terminal, monaco, monospace;\">BAY-99<\/code> for <code style=\"font-family: terminal, monaco, monospace;\">PDX-02<\/code>. Then inspect one document your application writes. Compare its stored values with what your tests expect, fix any mismatch, and rerun your local checks before opening your next pull request.<\/p>\n<p>If you have not set up local development and CI yet, start with <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/from-local-development-to-ci-workflows-with-the-azure-cosmos-db-emulator\/\">From Local Development to CI Workflows with the Azure Cosmos DB Emulator<\/a>. Then return here to add direct data inspection to that workflow.<\/p>\n<h3 id=\"further-reading\">Further reading<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/AzureCosmosDB\/fleetcharge-agent-cosmos-ci\">FleetCharge sample and emulator workflow<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\">Azure Cosmos DB Shell<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/blob\/main\/docs\/connect.md\">Shell connection guide<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Azure\/CosmosDBShell\/blob\/main\/docs\/commands.md\">Shell command reference<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/azure\/cosmos-db\/emulator-linux\">Azure Cosmos DB Linux emulator<\/a><\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">About Azure Cosmos DB<\/h2>\n<\/div>\n<p dir=\"auto\">Azure Cosmos DB is a fully managed NoSQL and vector database for modern applications, including AI. Ready to move beyond local testing? <a href=\"https:\/\/cosmos.azure.com\/try\/\" target=\"_blank\" rel=\"nofollow noopener\">Try Azure Cosmos DB for free<\/a>.<\/p>\n<p dir=\"auto\">Follow us on <a href=\"https:\/\/twitter.com\/AzureCosmosDB\" rel=\"nofollow\">X<\/a>, <a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\" rel=\"nofollow\">YouTube<\/a> and <a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" rel=\"nofollow\">LinkedIn<\/a> for product updates and developer walkthroughs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explore local data from the terminal with Azure Cosmos DB Shell. Connect to the emulator, inspect FleetCharge documents, run queries, and point-read depot partitions.<\/p>\n","protected":false},"author":39313,"featured_media":13139,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-13130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api"],"acf":[],"blog_post_summary":"<p>Explore local data from the terminal with Azure Cosmos DB Shell. Connect to the emulator, inspect FleetCharge documents, run queries, and point-read depot partitions.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/13130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/39313"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=13130"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/13130\/revisions"}],"predecessor-version":[{"id":13147,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/13130\/revisions\/13147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/13139"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=13130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=13130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=13130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}