How to Integrate Looker and Cosmos DB Safely
Teams link looker and cosmos db to build fast charts from live app data. This setup lets analysts read document records through an analytics engine in real time. App teams store flexible JSON items inside their NoSQL store. Business users then run SQL queries from dashboards to spot sales trends and track user behavior. How data flows between looker and cosmos db A direct link between these two tools needs a SQL translation engine in the middle. The dashboard tool speaks relational SQL, whil
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams link looker and cosmos db to build fast charts from live app data. This setup lets analysts read document records through an analytics engine in real time.
App teams store flexible JSON items inside their NoSQL store. Business users then run SQL queries from dashboards to spot sales trends and track user behavior.
How data flows between looker and cosmos db
A direct link between these two tools needs a SQL translation engine in the middle. The dashboard tool speaks relational SQL, while the document store holds nested JSON objects.
Most teams turn on the built-in analytical store inside their cloud database account. This feature copies live document changes into a columnar format made for fast reporting.
A cloud serverless SQL pool then reads that columnar store and exposes a standard endpoint. The dashboard app logs in to that SQL endpoint using a dedicated service principal.
Once linked, the analytics app sends standard queries over an encrypted connection. The SQL pool translates those requests, scans the columnar data, and returns flat tables.
Data engineers map nested JSON fields into clean rows and columns inside the modeling layer. Analysts then drag and drop those clean fields to build daily reports.
Common security gaps and how to scope roles
Many teams make the mistake of using a master read-write key for reporting. A shared master key gives the dashboard app full power to delete or change live data.
If an attacker steals that shared key, they can wipe out production records. Shared accounts also hide which person ran a slow or sensitive query.
Unlogged queries create another big risk for security teams. When ten analysts share one login, the database log shows only one generic service user.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, create a read-only role scoped only to the analytical store. Never give your reporting service account permission to write or change live containers.
Set up separate service accounts for different business groups like finance and support. Restrict each account so it can read only the specific tables that group needs.
Lock down the network path between the two cloud platforms as well. Turn off public internet access on the database and use private network links or IP rules.
Protecting sensitive fields in analytics queries
Document stores often hold private user details right next to basic app events. A single JSON document might store an order total alongside emails and phone numbers.
When the analytical link syncs that container, those private fields move into the reporting layer. Broad dashboard roles can then expose card numbers or national IDs to every analyst.
Engineers should strip or mask sensitive fields inside the SQL view layer before sharing models. Rewriting matched fields like emails and card numbers in query results keeps raw data safe.
Teams should also set query timeout rules and row limits on the reporting connection. These limits stop a bad dashboard join from burning through cloud compute budgets.
Review your database audit logs every week to spot strange query patterns. Good logs show when a dashboard pulls too many rows or scans restricted tables.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Can Looker query Cosmos DB without a SQL layer in the middle?
No, the dashboard tool requires a relational SQL driver to run queries. You must use an analytical link or a SQL translation driver to bridge the gap.
Does running dashboard queries slow down live app writes?
It can if you query transactional containers directly during peak traffic hours. Using the separate analytical store isolates heavy reporting reads from live app writes.
How should we handle nested JSON arrays in our dashboard models?
Flatten nested JSON arrays inside your SQL views before exposing them to business users. This step keeps dashboard models simple and prevents broken joins during daily analysis.
Related guides
In this post