refactor!: update namespace from DirectClient to Sdk (#88)#32
Closed
refactor!: update namespace from DirectClient to Sdk (#88)#32
Conversation
Update all using directives from Microsoft.Azure.Connectors.DirectClient.{Connector}
to Microsoft.Azure.Connectors.Sdk.{Connector} to match the SDK namespace
rename in Azure/Connectors-NET-SDK#90.
Depends on: Azure/Connectors-NET-SDK >= 0.9.0
There was a problem hiding this comment.
Pull request overview
Updates the DirectConnector sample project to align with the Azure Connectors .NET SDK namespace rename by switching references from Microsoft.Azure.Connectors.DirectClient.* to Microsoft.Azure.Connectors.Sdk.*.
Changes:
- Updated connector-specific
usingdirectives across sample function files toMicrosoft.Azure.Connectors.Sdk.{Connector}. - Updated a doc
<see cref="...">reference inConnectorTriggerMetadataAttributeto the new namespace. - Updated one fully-qualified Teams request type reference to the new namespace.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| DirectConnector/SmtpFunctions.cs | Update SMTP connector namespace import to Microsoft.Azure.Connectors.Sdk.Smtp. |
| DirectConnector/Program.cs | Update DI-time connector client imports to Microsoft.Azure.Connectors.Sdk.*. |
| DirectConnector/OneDriveFunctions.cs | Update OneDrive connector import and BlobMetadata alias namespace. |
| DirectConnector/Office365UsersFunctions.cs | Update Office365 Users connector namespace import. |
| DirectConnector/MsGraphFunctions.cs | Update MS Graph Groups & Users connector namespace import. |
| DirectConnector/MqFunctions.cs | Update IBM MQ connector namespace import. |
| DirectConnector/ConnectorTriggerMetadataAttribute.cs | Update XML doc example reference to Microsoft.Azure.Connectors.Sdk.*. |
| DirectConnector/ConnectorFunctions.cs | Update Office365/SharePoint/Teams imports, BlobMetadata alias, and one Teams type reference. |
| DirectConnector/AzureLogAnalyticsFunctions.cs | Update Log Analytics connector namespace import. |
| DirectConnector/AzureBlobFunctions.cs | Update Azure Blob connector namespace import. |
Comment on lines
+6
to
7
| using Microsoft.Azure.Connectors.Sdk.Azureblob; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+6
to
7
| using Microsoft.Azure.Connectors.Sdk.Azureloganalytics; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+7
to
8
| using Microsoft.Azure.Connectors.Sdk.Mq; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+6
to
7
| using Microsoft.Azure.Connectors.Sdk.Msgraphgroupsanduser; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+6
to
7
| using Microsoft.Azure.Connectors.Sdk.Office365users; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+8
to
9
| using Microsoft.Azure.Connectors.Sdk.Onedriveforbusiness; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+7
to
8
| using Microsoft.Azure.Connectors.Sdk.Smtp; | ||
| using Microsoft.Azure.Connectors.Sdk; |
Comment on lines
+8
to
11
| using Microsoft.Azure.Connectors.Sdk.Office365; | ||
| using Microsoft.Azure.Connectors.Sdk.Sharepointonline; | ||
| using Microsoft.Azure.Connectors.Sdk.Teams; | ||
| using Microsoft.Azure.Connectors.Sdk; |
daviburg
added a commit
to Azure/Connectors-NET-SDK
that referenced
this pull request
May 5, 2026
## Summary
Generated connector clients now inherit from `ConnectorClientBase`
instead of implementing `IDisposable` directly. This eliminates ~1,500
lines of duplicated boilerplate across 11 connector files.
## Breaking changes
- **Constructor signature**: new optional `ConnectorClientOptions`
parameter (position 3), `HttpClient` moves to position 4
- **Exception types**: per-connector exceptions (e.g.,
`Office365ConnectorException`) replaced by unified `ConnectorException`
- **Namespace**: `Microsoft.Azure.Connectors.DirectClient.{Connector}` →
`Microsoft.Azure.Connectors.Sdk.{Connector}`
- **Navigator class**: `DirectClientConnectors` → `SdkConnectors`
## SDK core changes
| New type | Purpose |
|----------|---------|
| `ConnectorClientBase` | Convenience constructors,
`CallConnectorAsync`, `ResolveUrl` (SSRF), shared JSON options |
| `TokenCredentialTokenProvider` | Adapts `Azure.Core.TokenCredential`
to `ITokenProvider` |
| `ConnectorException` | Unified exception with `ConnectorName`,
`Operation`, `StatusCode`, `ResponseBody` |
## Generated files
All 11 connector files regenerated via updated `CodefulSdkGenerator`
(not hand-edited). Each client now inherits `ConnectorClientBase`,
overrides `ConnectorName`, and accepts optional
`ConnectorClientOptions`.
## Related PRs
- [BPM generator PR
#15600409](https://msazure.visualstudio.com/One/_git/AzureUX-BPM/pullrequest/15600409)
— generator template changes
-
[Azure/Connectors-NET-LSP#67](Azure/Connectors-NET-LSP#67)
— namespace update
-
[Azure/Connectors-NET-Samples#32](Azure/Connectors-NET-Samples#32)
— namespace update
## Test results
218/218 tests pass ✅
Closes #88
Member
Author
|
Closing — superseded by #40 which consolidates all SDK v0.9.0-preview.1 breaking changes, namespace migrations, and new features into a single PR. |
daviburg
added a commit
that referenced
this pull request
May 9, 2026
* Upgrade to Azure.Connectors.Sdk 0.9.0-preview.1
Breaking changes addressed:
- Package: Microsoft.Azure.Connectors.Sdk -> Azure.Connectors.Sdk
- Namespaces: Microsoft.Azure.Connectors.DirectClient.* -> Azure.Connectors.Sdk.*
- Models sub-namespace: types now in Azure.Connectors.Sdk.{Connector}.Models
- PascalCase client names: SharePointOnlineClient, OneDriveForBusinessClient,
MsGraphGroupsAndUsersClient, AzureBlobClient
- Constructors: removed managedIdentityClientId parameter, use TokenCredential
- Exceptions: per-connector types replaced with unified ConnectorException
(inherits RequestFailedException, .Status instead of .StatusCode)
- IsFatal(): removed (now internal), use plain catch (Exception ex)
- AzureLogAnalytics: replaced with AzureMonitorLogs connector
New capabilities demonstrated:
- DI extension methods (AddOffice365Client, etc.) replace 15+ lines of
boilerplate per connector with one-liner config-driven registration
- DefaultAzureCredential via DI for local dev authentication
- ARM connector added
- local.settings.json.template updated with AzureMonitorLogs + ARM entries
* Add ArmFunctions.cs + update README for v0.9.0 connector lineup
- ARM sample functions (list subscriptions, resource groups, deployments)
ported from PR #33 with namespace updates for v0.9.0
- README table updated: removed Azure Log Analytics, added Azure Monitor
Logs and ARM connectors
- Supersedes PRs #32-#38 (incremental unpublished SDK changes)
* Add local ExceptionExtensions.IsFatal() helper + restore guards
The SDK made IsFatal() internal in v0.9.0. Add a local copy so sample
exception handling follows the recommended pattern of not catching fatal
exceptions (OOM, StackOverflow, AccessViolation, SEH, ThreadAbort).
* Address PR feedback: fix naming, credential scope, stale references
- Fix _SmtpClient/_AzureBlobClient to _smtpClient/_azureBlobClient (camelCase)
- Register DefaultAzureCredential only in Development environment
- Replace all 'DirectClient SDK' doc references with 'Azure Connectors SDK'
- Add remarks to AzureLogAnalyticsFunctions noting Monitor Logs rename
Co-authored-by: Dobby <dobby@microsoft.com>
* Fix using sort order, response naming, unused field
- Sort using directives: System.* first, then alphabetically (9 files)
- AzureLogAnalyticsFunctions: return workspaces= in response body for
backward compatibility with route naming
- ArmFunctions: remove unused JsonOptions field and System.Text.Json using
Co-authored-by: Dobby <dobby@microsoft.com>
* Add missing Configuration using + extract magic string constant
Co-authored-by: Dobby <dobby@microsoft.com>
* Fix README ARM description + ARM response envelopes
Co-authored-by: Dobby <dobby@microsoft.com>
* Prefix ARM function names + fix PR description accuracy
Co-authored-by: Dobby <dobby@microsoft.com>
---------
Co-authored-by: Dobby <dobby@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update all using directives from Microsoft.Azure.Connectors.DirectClient.{Connector} to Microsoft.Azure.Connectors.Sdk.{Connector} to match the SDK namespace rename.
CI note
CI will fail until the SDK package with the new namespaces is published. This PR serves as reviewer context in the meantime.
Related PRs