How to Connect to a Specific Environment
This guide shows how to connect to an OSDU environment at Equinor.
Choose your environment
| Environment | When to use |
|---|---|
| Dev | To be determined |
| Test | To be determined |
| Prod | To be determined |
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 dev config):
from osdu.client import OsduClient
from osdu.identity import OsduMsalInteractiveCredential
server = "https://equinorswedev.energy.azure.com"
data_partition = "dev"
client_id = "7a414874-4b27-4378-b34f-bc9e5a5faa4f"
resource_id = "7daee810-3f78-40c4-84c2-7a199428de18"
authority = "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
credential = OsduMsalInteractiveCredential(client_id, authority, resource_id)
client = OsduClient(server, data_partition, credential)
response = client.get(f"{server}/api/search/v2/health/readiness_check")
print(response.status_code)
For non-interactive authentication (e.g. pipelines), use OsduMsalNonInteractiveCredential with a client secret instead. See the Python SDK repository for more examples.
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 dev config):
import requests
from msal import ConfidentialClientApplication
authority = "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
scopes = ["7daee810-3f78-40c4-84c2-7a199428de18/.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/health/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.