Skip to content

Commit 836ca29

Browse files
Abel Milashclaude
andcommitted
Fix azure.identity import: InteractiveBrowserCredential is not in aio namespace
azure.identity.aio does not export InteractiveBrowserCredential (it is sync-only). Use azure.identity.InteractiveBrowserCredential for dev/interactive use. Also drop the erroneous `await credential.close()` call in the README quick start (sync credential, no coroutine to await). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 170b550 commit 836ca29

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

.claude/skills/dataverse-sdk-use/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ The SDK ships a full async client, `AsyncDataverseClient`, under `PowerPlatform.
594594

595595
### Import
596596
```python
597-
from azure.identity.aio import InteractiveBrowserCredential # or ClientSecretCredential, etc.
597+
from azure.identity import InteractiveBrowserCredential # development (sync, works with async client)
598+
from azure.identity.aio import ClientSecretCredential # production (native async)
598599
from PowerPlatform.Dataverse.aio.async_client import AsyncDataverseClient
599600
```
600601

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -800,24 +800,21 @@ pip install "PowerPlatform-Dataverse-Client[async]"
800800

801801
```python
802802
import asyncio
803-
from azure.identity.aio import InteractiveBrowserCredential
803+
from azure.identity import InteractiveBrowserCredential
804804
from PowerPlatform.Dataverse.aio.async_client import AsyncDataverseClient
805805

806806
async def main():
807807
credential = InteractiveBrowserCredential()
808-
try:
809-
async with AsyncDataverseClient("https://yourorg.crm.dynamics.com", credential) as client:
810-
# Create a contact
811-
contact_id = await client.records.create("contact", {"firstname": "John", "lastname": "Doe"})
812-
813-
# Read it back
814-
contact = await client.records.retrieve("contact", contact_id, select=["firstname", "lastname"])
815-
print(f"Created: {contact['firstname']} {contact['lastname']}")
816-
817-
# Clean up
818-
await client.records.delete("contact", contact_id)
819-
finally:
820-
await credential.close()
808+
async with AsyncDataverseClient("https://yourorg.crm.dynamics.com", credential) as client:
809+
# Create a contact
810+
contact_id = await client.records.create("contact", {"firstname": "John", "lastname": "Doe"})
811+
812+
# Read it back
813+
contact = await client.records.retrieve("contact", contact_id, select=["firstname", "lastname"])
814+
print(f"Created: {contact['firstname']} {contact['lastname']}")
815+
816+
# Clean up
817+
await client.records.delete("contact", contact_id)
821818

822819
asyncio.run(main())
823820
```

src/PowerPlatform/Dataverse/aio/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AsyncDataverseClient:
7777
Example:
7878
**Recommended -- async context manager** (enables HTTP connection pooling)::
7979
80-
from azure.identity.aio import InteractiveBrowserCredential
80+
from azure.identity import InteractiveBrowserCredential
8181
from PowerPlatform.Dataverse.aio.async_client import AsyncDataverseClient
8282
8383
credential = InteractiveBrowserCredential()

src/PowerPlatform/Dataverse/claude_skill/dataverse-sdk-use/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ The SDK ships a full async client, `AsyncDataverseClient`, under `PowerPlatform.
594594

595595
### Import
596596
```python
597-
from azure.identity.aio import InteractiveBrowserCredential # or ClientSecretCredential, etc.
597+
from azure.identity import InteractiveBrowserCredential # development (sync, works with async client)
598+
from azure.identity.aio import ClientSecretCredential # production (native async)
598599
from PowerPlatform.Dataverse.aio.async_client import AsyncDataverseClient
599600
```
600601

0 commit comments

Comments
 (0)