How to Connect to a Specific Environment
This guide shows how to connect to an OSDU environment at Equinor.
Identify your target environment
| Environment | When to use |
|---|---|
| Development | Experimentation and pipeline building |
| Test | Integration and validation |
| Production | Stable environment where governed data is made available to the organisation |
Grab the config file for your target environment from the Configuration Files reference page.
For interactive use — browsing data, running queries, or exploring OSDU from the command line.
Prerequisites:
- Platform access to ADME
- The OSDU CLI installed
1. Save the config file to your .osducli/ directory:
- Windows:
C:\Users\<YourUsername>\.osducli\ - macOS/Linux:
~/.osducli/
2. Verify your connection:
osdu status
3. To switch between environments:
osdu config use config_dev
osdu config use config_test
osdu config use config_prod
For scripts, notebooks, and lightweight automation.
Prerequisites:
- Platform access for applications to ADME
- An app registration in Microsoft Entra ID — see Setting Up an App Registration
Install the SDK:
pip install osdu-sdk
Connect and run a search health check (using the Development config):
from osdu.client import OsduClient
from osdu.identity import OsduMsalNonInteractiveCredential
server = "https://equinorswedev.energy.azure.com"
data_partition = "dev"
client_id = "<your-app-client-id>"
client_secret = "<your-app-client-secret>"
resource_id = "https://energy.azure.com/.default"
authority = "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
credential = OsduMsalNonInteractiveCredential(client_id, client_secret, authority, resource_id)
client = OsduClient(server, data_partition, credential)
response = client.get(f"{server}/api/search/v2/readiness_check")
print(response.status_code)
For full control from any language — pipelines, CI/CD, or custom tooling.
Prerequisites:
- Platform access for applications to ADME
- An app registration in Microsoft Entra ID — see Setting Up an App Registration
Your application needs these values from the Configuration Files:
- server — the base URL for API calls
- data_partition_id — the partition header to send with every request
- authority and scopes — for acquiring an OAuth2 token from Entra ID
Acquire a token and include it in your requests (using the Development config):
import requests
from msal import ConfidentialClientApplication
authority = "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
scopes = ["https://energy.azure.com/.default"]
client_id = "<your-app-client-id>"
client_secret = "<your-app-client-secret>"
app = ConfidentialClientApplication(client_id, client_secret, authority=authority)
token = app.acquire_token_for_client(scopes)["access_token"]
response = requests.get(
"https://equinorswedev.energy.azure.com/api/search/v2/readiness_check",
headers={
"Authorization": f"Bearer {token}",
"data-partition-id": "dev",
},
)
print(response.status_code)
See ADME Technical Reference for the full list of service endpoints.