The Simplest Way to Make Cosmosdb and JetBrains Space Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using cosmosdb and jetbrains space together lets your team automate code tests and data updates. Space runs your build jobs, while CosmosDB stores your global app data. When these two tools talk to each other, developers can test code against real data structures. They can also push schema updates or run cleanup scripts during a release. Still, wiring a cloud database to a build tool creates real security risks. You must set up clear identity rules and strict network paths from day one. How

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.

Using cosmosdb and jetbrains space together lets your team automate code tests and data updates. Space runs your build jobs, while CosmosDB stores your global app data.

When these two tools talk to each other, developers can test code against real data structures. They can also push schema updates or run cleanup scripts during a release.

Still, wiring a cloud database to a build tool creates real security risks. You must set up clear identity rules and strict network paths from day one.

How cosmosdb and jetbrains space share identity and data

JetBrains Space holds your git repos, team chats, and build workers. When a developer merges code, a Space worker starts up to run your job.

That worker needs a safe way to log in to your Azure cloud account. Once inside, it reads or writes records in your CosmosDB containers.

Most teams start by putting a master database key into the project secrets store. The Space worker reads that secret and opens a path to the database.

A better way uses Azure identity federated with your build tool. The worker asks Azure for a short token instead of using a static key.

Azure checks the worker identity and hands back a token with a set role. Then the worker runs its data scripts and shuts down when the job ends.

Common failure modes and how to fix them

The biggest mistake teams make is sharing one root key across all build jobs. If that key leaks in a build log, anyone can wipe your data.

Shared keys also ruin your audit trail during a security review. Every read and write looks like it came from the exact same generic account.

CosmosDB RBAC + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You cannot tell if a test job or a person changed a record. Another common issue is giving build workers full admin rights over the whole database.

A broken script in a test branch could drop a live container by mistake. You can fix this by splitting your roles by task and branch.

Give pull request jobs read rights on a staging database only. Give main branch release jobs write rights on the exact containers they must update.

Network paths between the cloud worker and the database also need tight rules. Cloud build workers often use public IP pools that change on every single run.

Opening your database firewall to the whole internet to let workers in is dangerous. Instead, run self-hosted Space workers inside your own private cloud network.

Then you can link those workers to CosmosDB over a private network link. This keeps all data traffic off the public web and inside your cloud.

Keeping sensitive records safe during team reviews

Sometimes engineers need to check live data when a Space deploy job fails. They may run a quick query to see why a document broke the build.

Live containers often hold user emails, phone numbers, card numbers, or national IDs. If you let engineers query live tables with shared keys, raw data spills out.

You should add data masking so the system rewrites matched fields in query results. You should also log every single query back to the person who ran it.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should we store CosmosDB master keys in JetBrains Space secrets?

Avoid master keys if you can. Use role-based identity tokens that expire fast and limit what each job can read or write.

How do we restrict network traffic between Space workers and CosmosDB?

Run self-hosted Space workers inside your virtual network. Then use a private link so database traffic is masked in responses before reaching the public internet.

How can we audit database changes made during a Space release?

Assign a unique identity to each pipeline and user. This ensures your audit logs show who ran each query and when it happened.

The query runs. The emails stay hidden.