refactor: update for SDK .Models sub-namespace + PascalCase names#38
Closed
refactor: update for SDK .Models sub-namespace + PascalCase names#38
Conversation
Update using statements and type references to match SDK breaking changes: - Add .Models using for model type references - Update SharePoint BlobMetadata type alias to .Models namespace - AzureBlobClient, SharePointOnlineClient, MsGraphGroupsAndUsersClient, OneDriveForBusinessClient names already updated from prior changes Depends on Azure/Connectors-NET-SDK#114
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the DirectConnector sample functions to match Azure Connectors .NET SDK breaking changes by switching connector namespaces to Azure.Connectors.Sdk.*, adding .Models imports, and aligning client type names to PascalCase.
Changes:
- Replaced
Microsoft.Azure.Connectors.DirectClient.*namespaces withAzure.Connectors.Sdk.*across sample functions. - Added
using ...Models;so model types resolve under the new SDK sub-namespace. - Updated several client type names to PascalCase (e.g.,
SharePointOnlineClient,OneDriveForBusinessClient,AzureBlobClient).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DirectConnector/SmtpFunctions.cs | Switch SMTP connector usings to Azure.Connectors.Sdk.Smtp (+ .Models). |
| DirectConnector/Program.cs | Update DI registrations and usings to new connector namespaces + PascalCase client names. |
| DirectConnector/OneDriveFunctions.cs | Update OneDrive connector namespaces/types and refresh logging/doc references. |
| DirectConnector/Office365UsersFunctions.cs | Switch Office365 Users connector usings to Azure.Connectors.Sdk.Office365users (+ .Models). |
| DirectConnector/MsGraphFunctions.cs | Switch MS Graph Groups/Users connector namespaces/types and refresh docs/logging. |
| DirectConnector/MqFunctions.cs | Switch MQ connector usings to Azure.Connectors.Sdk.Mq (+ .Models). |
| DirectConnector/ConnectorTriggerMetadataAttribute.cs | Update XML doc example reference to new SDK namespace. |
| DirectConnector/ConnectorFunctions.cs | Switch Office365/SharePoint/Teams connector namespaces, client names, and SharePoint BlobMetadata alias to .Models. |
| DirectConnector/AzureBlobFunctions.cs | Update Azure Blob connector namespaces/types and refresh docs/logging. |
| using Microsoft.Azure.Functions.Worker.Http; | ||
| using Microsoft.Extensions.Logging; | ||
| using OneDriveBlobMetadata = Microsoft.Azure.Connectors.DirectClient.Onedriveforbusiness.BlobMetadata; | ||
| using OneDriveBlobMetadata = Azure.Connectors.Sdk.OneDriveForBusiness.BlobMetadata; |
| // discovery endpoint. With [JsonExtensionData] on AdditionalProperties, arbitrary properties | ||
| // are now serialized correctly. Populate the dictionary with the expected message fields. | ||
| var messageRequest = new Microsoft.Azure.Connectors.DirectClient.Teams.DynamicPostMessageRequest(); | ||
| var messageRequest = new Azure.Connectors.Sdk.Teams.DynamicPostMessageRequest(); |
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 using statements and type references to match SDK breaking changes from Azure/Connectors-NET-SDK#119:
.Modelsusing for model type referencesBlobMetadatatype alias to.ModelsnamespaceChanges
using {Connector}.Models;for model type accessConnectorFunctions.cs: updated type alias toAzure.Connectors.Sdk.SharePointOnline.Models.BlobMetadataDepends on Azure/Connectors-NET-SDK#119