Skip to content

Upgrade to Azure.Connectors.Sdk 0.9.0-preview.1#40

Merged
daviburg merged 8 commits intomainfrom
feature/upgrade-sdk-v0.9.0-preview.1
May 9, 2026
Merged

Upgrade to Azure.Connectors.Sdk 0.9.0-preview.1#40
daviburg merged 8 commits intomainfrom
feature/upgrade-sdk-v0.9.0-preview.1

Conversation

@daviburg
Copy link
Copy Markdown
Member

@daviburg daviburg commented May 8, 2026

Summary

Upgrades from Microsoft.Azure.Connectors.Sdk 0.8.0-preview.1 to Azure.Connectors.Sdk 0.9.0-preview.1 (release notes).

Breaking Changes Addressed

Change Before After
Package ID Microsoft.Azure.Connectors.Sdk Azure.Connectors.Sdk
Namespaces Microsoft.Azure.Connectors.DirectClient.* Azure.Connectors.Sdk.* + .Models
Client names SharepointonlineClient SharePointOnlineClient (PascalCase)
Constructors new XxxClient(url, managedIdentityClientId) new XxxClient(url, credential)
Exceptions Office365ConnectorException.StatusCode ConnectorException.Status
IsFatal() SDK-internal ExceptionExtensions.IsFatal() Local ExceptionExtensions.cs helper restores the guard
AzureLogAnalytics Removed Replaced by AzureMonitorLogs

New Capabilities Demonstrated

  • DI extension methodsProgram.cs reduced from ~150 lines to ~30 lines using AddOffice365Client(), AddTeamsClient(), etc.
  • DefaultAzureCredential via DI — single registration used by all connector clients for local dev (Development environment only)
  • ARM connector — newly added with ArmFunctions.cs (4 endpoints)
  • Unified ConnectorException — inherits RequestFailedException, all connectors use the same exception type

Validation

  • Build succeeds against published NuGet package Azure.Connectors.Sdk 0.9.0-preview.1
  • End-to-end tested locally against BTS4 gateway connections (Office365, Teams, OneDrive, MS Graph, Office365Users, AzureBlob)

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
Copilot AI review requested due to automatic review settings May 8, 2026 21:31
@daviburg daviburg requested a review from a team as a code owner May 8, 2026 21:31
@daviburg daviburg self-assigned this May 8, 2026
Comment thread DirectConnector/AzureBlobFunctions.cs Outdated
- 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)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request upgrades the DirectConnector sample to Azure.Connectors.Sdk 0.9.0-preview.1, updating namespaces/client names, switching to the new DI registration extensions, and aligning error handling with the unified ConnectorException.

Changes:

  • Bump the SDK package reference to Azure.Connectors.Sdk 0.9.0-preview.1 and update namespaces/models across all connector samples.
  • Simplify Program.cs by registering connector clients via services.Add*Client(...) extension methods and registering a shared TokenCredential.
  • Replace connector-specific exceptions with ConnectorException and migrate from StatusCode to Status in error handling.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
DirectConnector/SmtpFunctions.cs Switch SMTP client/models to Azure.Connectors.Sdk and update exception handling.
DirectConnector/Program.cs Replace manual client factories with SDK DI extension methods and shared TokenCredential.
DirectConnector/OneDriveFunctions.cs Update OneDrive client/models and exception handling to the new SDK.
DirectConnector/Office365UsersFunctions.cs Update Office365 Users client/models and exception handling to the new SDK.
DirectConnector/MsGraphFunctions.cs Update MS Graph client/models and exception handling to the new SDK.
DirectConnector/MqFunctions.cs Update MQ client/models and exception handling to the new SDK.
DirectConnector/local.settings.json.template Replace Azure Log Analytics config keys with Azure Monitor Logs and add ARM config keys.
DirectConnector/DirectConnector.csproj Swap package reference to Azure.Connectors.Sdk 0.9.0-preview.1.
DirectConnector/ConnectorTriggerMetadataAttribute.cs Update documentation references to the new SDK namespaces.
DirectConnector/ConnectorFunctions.cs Update Office365/SharePoint/Teams clients/models and exception handling to the new SDK.
DirectConnector/AzureLogAnalyticsFunctions.cs Migrate to Azure Monitor Logs client/models and update operations/exception handling.
DirectConnector/AzureBlobFunctions.cs Update Azure Blob client/models and exception handling to the new SDK.
Comments suppressed due to low confidence (1)

DirectConnector/ConnectorFunctions.cs:175

  • Catching all exceptions and converting them into an HTTP 500 response can inadvertently swallow fatal process-level exceptions (OOM, StackOverflow, etc.). Consider reintroducing a fatal-exception filter (e.g., catch (Exception ex) when (!IsFatal(ex))) or rethrowing known-fatal exceptions so the host can terminate appropriately.
        catch (Exception ex)
        {
            this._logger.LogError(ex, "Error in SendEmail.");

            var errorResponse = request.CreateResponse(HttpStatusCode.InternalServerError);

Comment thread DirectConnector/SmtpFunctions.cs
Comment thread DirectConnector/AzureBlobFunctions.cs
Comment thread DirectConnector/Program.cs Outdated
Comment thread DirectConnector/AzureBlobFunctions.cs Outdated
Comment thread DirectConnector/OneDriveFunctions.cs Outdated
Comment thread DirectConnector/MsGraphFunctions.cs Outdated
Comment thread DirectConnector/ConnectorFunctions.cs Outdated
Comment thread DirectConnector/AzureLogAnalyticsFunctions.cs
Comment thread DirectConnector/Program.cs
daviburg and others added 2 commits May 8, 2026 14:37
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).
- 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>
Copilot AI review requested due to automatic review settings May 8, 2026 22:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.

Comment thread DirectConnector/SmtpFunctions.cs Outdated
Comment thread DirectConnector/OneDriveFunctions.cs Outdated
Comment thread DirectConnector/MsGraphFunctions.cs Outdated
Comment thread DirectConnector/Office365UsersFunctions.cs Outdated
Comment thread DirectConnector/MqFunctions.cs Outdated
Comment thread DirectConnector/AzureLogAnalyticsFunctions.cs
Comment thread DirectConnector/AzureBlobFunctions.cs Outdated
Comment thread DirectConnector/ConnectorFunctions.cs Outdated
Comment thread DirectConnector/ArmFunctions.cs Outdated
Comment thread DirectConnector/ArmFunctions.cs Outdated
- 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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread DirectConnector/Program.cs
Comment thread DirectConnector/AzureLogAnalyticsFunctions.cs
Co-authored-by: Dobby <dobby@microsoft.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread DirectConnector/ArmFunctions.cs Outdated
Co-authored-by: Dobby <dobby@microsoft.com>
@daviburg daviburg requested a review from Copilot May 8, 2026 23:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread DirectConnector/ExceptionExtensions.cs
Comment thread DirectConnector/ArmFunctions.cs Outdated
Co-authored-by: Dobby <dobby@microsoft.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@daviburg daviburg merged commit b4bfe91 into main May 9, 2026
11 checks passed
@daviburg daviburg deleted the feature/upgrade-sdk-v0.9.0-preview.1 branch May 9, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants