Skip to content

refactor: update for SDK .Models sub-namespace + PascalCase names#38

Closed
daviburg wants to merge 1 commit intomainfrom
feature/codegen-naming
Closed

refactor: update for SDK .Models sub-namespace + PascalCase names#38
daviburg wants to merge 1 commit intomainfrom
feature/codegen-naming

Conversation

@daviburg
Copy link
Copy Markdown
Member

@daviburg daviburg commented May 7, 2026

Summary

Update using statements and type references to match SDK breaking changes from Azure/Connectors-NET-SDK#119:

  • Add .Models using for model type references
  • Update SharePoint BlobMetadata type alias to .Models namespace

Changes

  • All sample function files: added using {Connector}.Models; for model type access
  • ConnectorFunctions.cs: updated type alias to Azure.Connectors.Sdk.SharePointOnline.Models.BlobMetadata

Depends on Azure/Connectors-NET-SDK#119

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
Copilot AI review requested due to automatic review settings May 7, 2026 18:48
@daviburg daviburg requested a review from a team as a code owner May 7, 2026 18:48
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

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 with Azure.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();
daviburg added a commit that referenced this pull request May 8, 2026
- 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)
@daviburg
Copy link
Copy Markdown
Member Author

daviburg commented May 8, 2026

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 daviburg closed this May 8, 2026
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>
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