-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Hi Microsoft,
Thank you for releasing this helpful library which my team is keen to explore further.
@daviewales and I are particularly interested in the Query data example in the README.md
However, when we try to run it, we receive the following error:
PowerPlatform.Dataverse.core.errors.HttpError: sql query parameter is not supported.
Sample code:
import os
from azure.identity import InteractiveBrowserCredential
from PowerPlatform.Dataverse.client import DataverseClient
# Set the environment variable first before running
environment = os.getenv("DYNAMICS_ENV")
if environment is None:
raise EnvironmentError("DYNAMICS_ENV is not set.")
credential = InteractiveBrowserCredential()
client = DataverseClient(f"https://{environment}.crm6.dynamics.com", credential)
# SQL query (read-only)
results = client.query_sql(
"SELECT TOP 10 accountid, name FROM account WHERE statecode = 0"
)
for record in results:
print(record["name"])
It authenticates OK and we can run the other examples fine e.g. the OData query with paging example code in your README.md.
We have tested under:
Python Poetry 2.2.1
WSL Ubuntu 24.04.3 with Python 3.12.3
PowerShell 7.5 with Python 3.13.5
PowerShell 5.1
powerplatform-dataverse-client: 0.1.0b2
Dynamics version: 9.2.25104.155
poetry show powerplatform-dataverse-client
name : powerplatform-dataverse-client
version : 0.1.0b2
description : Python SDK for Microsoft Dataverse
dependencies
- azure-core >=1.30.2
- azure-identity >=1.17.0
- requests >=2.32.0
Is this a bug in PowerPlatform-DataverseClient-Python or something related to our environment?
Thanks