From b28667fb9186f2672ee5fd13dca05d7f2222e653 Mon Sep 17 00:00:00 2001 From: David Burg Date: Thu, 7 May 2026 10:42:20 -0700 Subject: [PATCH] refactor: update for SDK .Models sub-namespace + PascalCase client names 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 --- DirectConnector/AzureBlobFunctions.cs | 33 ++++++------ DirectConnector/ConnectorFunctions.cs | 43 ++++++++-------- .../ConnectorTriggerMetadataAttribute.cs | 2 +- DirectConnector/MqFunctions.cs | 3 +- DirectConnector/MsGraphFunctions.cs | 27 +++++----- DirectConnector/Office365UsersFunctions.cs | 3 +- DirectConnector/OneDriveFunctions.cs | 41 +++++++-------- DirectConnector/Program.cs | 51 +++++++++++-------- DirectConnector/SmtpFunctions.cs | 3 +- 9 files changed, 112 insertions(+), 94 deletions(-) diff --git a/DirectConnector/AzureBlobFunctions.cs b/DirectConnector/AzureBlobFunctions.cs index 4dc8c38..97257df 100644 --- a/DirectConnector/AzureBlobFunctions.cs +++ b/DirectConnector/AzureBlobFunctions.cs @@ -3,7 +3,8 @@ //------------------------------------------------------------ using System.Net; -using Microsoft.Azure.Connectors.DirectClient.Azureblob; +using Azure.Connectors.Sdk.AzureBlob; +using Azure.Connectors.Sdk.AzureBlob.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; @@ -13,7 +14,7 @@ namespace DirectConnector; /// /// Azure Functions demonstrating Azure Blob Storage operations using the generated -/// from the DirectClient SDK. +/// from the DirectClient SDK. /// /// /// Azure Blob Storage uses key-based auth (accountName + accessKey), not OAuth. @@ -22,18 +23,18 @@ namespace DirectConnector; public class AzureBlobFunctions { private readonly ILogger _logger; - private readonly AzureblobClient _azureBlobClient; + private readonly AzureBlobClient _azureBlobClient; public AzureBlobFunctions( ILogger logger, - AzureblobClient azureBlobClient) + AzureBlobClient azureBlobClient) { this._logger = logger; this._azureBlobClient = azureBlobClient; } /// - /// Gets blob metadata using the generated . + /// Gets blob metadata using the generated . /// Exercises the response type. /// [Function("GetBlobMetadata")] @@ -41,7 +42,7 @@ public async Task GetBlobMetadataAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "blob/metadata")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("GetBlobMetadata: Using generated AzureblobClient."); + this._logger.LogInformation("GetBlobMetadata: Using generated AzureBlobClient."); var storageAccount = request.Query["account"]; var blobPath = request.Query["path"]; @@ -71,7 +72,7 @@ await response .ConfigureAwait(continueOnCapturedContext: false); return response; } - catch (AzureblobConnectorException ex) + catch (AzureBlobConnectorException ex) { this._logger.LogError(ex, "Azure Blob connector error: '{StatusCode}'.", ex.StatusCode); @@ -94,7 +95,7 @@ await errorResponse } /// - /// Downloads blob content using the generated . + /// Downloads blob content using the generated . /// Exercises the byte[] return path. /// [Function("DownloadBlob")] @@ -102,7 +103,7 @@ public async Task DownloadBlobAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "blob/download")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("DownloadBlob: Using generated AzureblobClient byte[] response path."); + this._logger.LogInformation("DownloadBlob: Using generated AzureBlobClient byte[] response path."); var storageAccount = request.Query["account"]; var blobPath = request.Query["path"]; @@ -140,7 +141,7 @@ await response.Body return response; } - catch (AzureblobConnectorException ex) + catch (AzureBlobConnectorException ex) { this._logger.LogError(ex, "Azure Blob connector error: '{StatusCode}'.", ex.StatusCode); @@ -163,7 +164,7 @@ await errorResponse } /// - /// Uploads a blob using the generated . + /// Uploads a blob using the generated . /// Exercises the byte[] input path with response. /// [Function("UploadBlob")] @@ -171,7 +172,7 @@ public async Task UploadBlobAsync( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "blob/upload")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("UploadBlob: Using generated AzureblobClient."); + this._logger.LogInformation("UploadBlob: Using generated AzureBlobClient."); var storageAccount = request.Query["account"]; var folder = request.Query["folder"]; @@ -210,7 +211,7 @@ await response .ConfigureAwait(continueOnCapturedContext: false); return response; } - catch (AzureblobConnectorException ex) + catch (AzureBlobConnectorException ex) { this._logger.LogError(ex, "Azure Blob connector error: '{StatusCode}'.", ex.StatusCode); @@ -233,7 +234,7 @@ await errorResponse } /// - /// Deletes a blob using the generated . + /// Deletes a blob using the generated . /// Exercises the void (no response body) path. /// [Function("DeleteBlob")] @@ -241,7 +242,7 @@ public async Task DeleteBlobAsync( [HttpTrigger(AuthorizationLevel.Function, "delete", Route = "blob/delete")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("DeleteBlob: Using generated AzureblobClient."); + this._logger.LogInformation("DeleteBlob: Using generated AzureBlobClient."); var storageAccount = request.Query["account"]; var blobId = request.Query["id"]; @@ -271,7 +272,7 @@ await response .ConfigureAwait(continueOnCapturedContext: false); return response; } - catch (AzureblobConnectorException ex) + catch (AzureBlobConnectorException ex) { this._logger.LogError(ex, "Azure Blob connector error: '{StatusCode}'.", ex.StatusCode); diff --git a/DirectConnector/ConnectorFunctions.cs b/DirectConnector/ConnectorFunctions.cs index 81b52a1..3e3f3b9 100644 --- a/DirectConnector/ConnectorFunctions.cs +++ b/DirectConnector/ConnectorFunctions.cs @@ -5,19 +5,22 @@ using System.Net; using System.Text; using System.Text.Json; -using Microsoft.Azure.Connectors.DirectClient.Office365; -using Microsoft.Azure.Connectors.DirectClient.Sharepointonline; -using Microsoft.Azure.Connectors.DirectClient.Teams; +using Azure.Connectors.Sdk.Office365; +using Azure.Connectors.Sdk.Office365.Models; +using Azure.Connectors.Sdk.SharePointOnline; +using Azure.Connectors.Sdk.SharePointOnline.Models; +using Azure.Connectors.Sdk.Teams; +using Azure.Connectors.Sdk.Teams.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; using Microsoft.Extensions.Logging; -using SharePointBlobMetadata = Microsoft.Azure.Connectors.DirectClient.Sharepointonline.BlobMetadata; +using SharePointBlobMetadata = Azure.Connectors.Sdk.SharePointOnline.Models.BlobMetadata; namespace DirectConnector; /// -/// Azure Functions that use the generated , , +/// Azure Functions that use the generated , , /// and from the DirectClient SDK. /// /// @@ -56,7 +59,7 @@ public class ConnectorFunctions private readonly ILogger _logger; private readonly Office365Client _office365Client; - private readonly SharepointonlineClient _sharePointClient; + private readonly SharePointOnlineClient _sharePointClient; private readonly TeamsClient _teamsClient; /// @@ -69,7 +72,7 @@ public class ConnectorFunctions public ConnectorFunctions( ILogger logger, Office365Client office365Client, - SharepointonlineClient sharePointClient, + SharePointOnlineClient sharePointClient, TeamsClient teamsClient) { this._logger = logger; @@ -246,7 +249,7 @@ await errorResponse } /// - /// Gets all SharePoint lists and libraries for a site using the generated . + /// Gets all SharePoint lists and libraries for a site using the generated . /// /// The HTTP request containing the site address. /// The cancellation token. @@ -255,7 +258,7 @@ public async Task GetSharePointListsAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "sharepoint/lists")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("GetSharePointLists: Using generated SharepointonlineClient from SDK."); + this._logger.LogInformation("GetSharePointLists: Using generated SharePointOnlineClient from SDK."); var siteAddress = request.Query["site"]; if (string.IsNullOrEmpty(siteAddress)) @@ -290,7 +293,7 @@ await response return response; } - catch (SharepointonlineConnectorException ex) + catch (SharePointOnlineConnectorException ex) { this._logger.LogError(ex, "SharePoint connector error: '{StatusCode}'.", ex.StatusCode); @@ -325,7 +328,7 @@ await errorResponse } /// - /// Lists files in a SharePoint folder using the generated . + /// Lists files in a SharePoint folder using the generated . /// /// /// Exercises the model for folder browsing. @@ -337,7 +340,7 @@ public async Task ListFolderAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "sharepoint/files")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("ListFolder: Using generated SharepointonlineClient from SDK."); + this._logger.LogInformation("ListFolder: Using generated SharePointOnlineClient from SDK."); var siteAddress = request.Query["site"]; if (string.IsNullOrEmpty(siteAddress)) @@ -386,7 +389,7 @@ await response return response; } - catch (SharepointonlineConnectorException ex) + catch (SharePointOnlineConnectorException ex) { this._logger.LogError(ex, "SharePoint connector error: '{StatusCode}'.", ex.StatusCode); @@ -420,7 +423,7 @@ await errorResponse /// Downloads file content from SharePoint as binary bytes. /// /// - /// Exercises the byte[] response path in . + /// Exercises the byte[] response path in . /// The generated CallConnectorAsync detects byte[] as the response type and uses /// ReadAsByteArrayAsync instead of JSON deserialization. /// @@ -431,7 +434,7 @@ public async Task DownloadFileAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "sharepoint/download")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("DownloadFile: Using generated SharepointonlineClient byte[] response path."); + this._logger.LogInformation("DownloadFile: Using generated SharePointOnlineClient byte[] response path."); var siteAddress = request.Query["site"]; var filePath = request.Query["path"]; @@ -471,7 +474,7 @@ await response.Body return response; } - catch (SharepointonlineConnectorException ex) + catch (SharePointOnlineConnectorException ex) { this._logger.LogError(ex, "SharePoint connector error: '{StatusCode}'.", ex.StatusCode); @@ -505,7 +508,7 @@ await errorResponse /// Uploads a file to a SharePoint document library. /// /// - /// Exercises the byte[] input path in . + /// Exercises the byte[] input path in . /// Accepts a JSON body with base64-encoded content or plain text, and uploads it to /// the specified SharePoint folder. /// @@ -516,7 +519,7 @@ public async Task UploadFileAsync( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "sharepoint/upload")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("UploadFile: Using generated SharepointonlineClient byte[] input path."); + this._logger.LogInformation("UploadFile: Using generated SharePointOnlineClient byte[] input path."); try { @@ -593,7 +596,7 @@ await response return response; } - catch (SharepointonlineConnectorException ex) + catch (SharePointOnlineConnectorException ex) { this._logger.LogError(ex, "SharePoint connector error: '{StatusCode}'.", ex.StatusCode); @@ -1178,7 +1181,7 @@ await badRequest // The actual message body properties are determined at runtime by the connector's schema // 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(); messageRequest.AdditionalProperties["recipient"] = JsonSerializer.SerializeToElement( new { diff --git a/DirectConnector/ConnectorTriggerMetadataAttribute.cs b/DirectConnector/ConnectorTriggerMetadataAttribute.cs index fd4ac8e..1e3d69e 100644 --- a/DirectConnector/ConnectorTriggerMetadataAttribute.cs +++ b/DirectConnector/ConnectorTriggerMetadataAttribute.cs @@ -34,7 +34,7 @@ public sealed class ConnectorTriggerMetadataAttribute : Attribute /// /// The trigger operation name. Use constants from the connector's *TriggerOperations class - /// (e.g., ). + /// (e.g., ). /// public string OperationName { get; set; } = ""; diff --git a/DirectConnector/MqFunctions.cs b/DirectConnector/MqFunctions.cs index f5a1918..f439310 100644 --- a/DirectConnector/MqFunctions.cs +++ b/DirectConnector/MqFunctions.cs @@ -4,7 +4,8 @@ using System.Net; using System.Text.Json; -using Microsoft.Azure.Connectors.DirectClient.Mq; +using Azure.Connectors.Sdk.Mq; +using Azure.Connectors.Sdk.Mq.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; diff --git a/DirectConnector/MsGraphFunctions.cs b/DirectConnector/MsGraphFunctions.cs index 7be6cbb..e0313e5 100644 --- a/DirectConnector/MsGraphFunctions.cs +++ b/DirectConnector/MsGraphFunctions.cs @@ -3,7 +3,8 @@ //------------------------------------------------------------ using System.Net; -using Microsoft.Azure.Connectors.DirectClient.Msgraphgroupsanduser; +using Azure.Connectors.Sdk.MsGraphGroupsAndUsers; +using Azure.Connectors.Sdk.MsGraphGroupsAndUsers.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; @@ -13,7 +14,7 @@ namespace DirectConnector; /// /// Azure Functions demonstrating MS Graph Groups & Users operations using the generated -/// from the DirectClient SDK. +/// from the DirectClient SDK. /// /// /// Exercises user listing, group search, and group property retrieval. @@ -21,7 +22,7 @@ namespace DirectConnector; public class MsGraphFunctions { private readonly ILogger _logger; - private readonly MsgraphgroupsanduserClient _msGraphClient; + private readonly MsGraphGroupsAndUsersClient _msGraphClient; /// /// Initializes a new instance of the class. @@ -30,14 +31,14 @@ public class MsGraphFunctions /// The DI-injected MS Graph Groups & Users client (disposed by the host). public MsGraphFunctions( ILogger logger, - MsgraphgroupsanduserClient msGraphClient) + MsGraphGroupsAndUsersClient msGraphClient) { this._logger = logger; this._msGraphClient = msGraphClient; } /// - /// Lists a page of users in the tenant using the generated . + /// Lists a page of users in the tenant using the generated . /// /// The HTTP request. /// The cancellation token. @@ -46,7 +47,7 @@ public async Task ListGraphUsersAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "graph/users")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("ListGraphUsers: Using generated MsgraphgroupsanduserClient from SDK."); + this._logger.LogInformation("ListGraphUsers: Using generated MsGraphGroupsAndUsersClient from SDK."); try { @@ -66,7 +67,7 @@ await response return response; } - catch (MsgraphgroupsanduserConnectorException ex) + catch (MsGraphGroupsAndUsersConnectorException ex) { this._logger.LogError(ex, "MS Graph connector error: '{StatusCode}'.", ex.StatusCode); @@ -97,7 +98,7 @@ await errorResponse } /// - /// Searches for groups by display name using the generated . + /// Searches for groups by display name using the generated . /// /// The HTTP request with optional 'search' query parameter. /// The cancellation token. @@ -106,7 +107,7 @@ public async Task ListGraphGroupsAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "graph/groups")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("ListGraphGroups: Using generated MsgraphgroupsanduserClient from SDK."); + this._logger.LogInformation("ListGraphGroups: Using generated MsGraphGroupsAndUsersClient from SDK."); var rawSearch = request.Query["search"]; var search = string.IsNullOrWhiteSpace(rawSearch) ? null : rawSearch; @@ -130,7 +131,7 @@ await response return response; } - catch (MsgraphgroupsanduserConnectorException ex) + catch (MsGraphGroupsAndUsersConnectorException ex) { this._logger.LogError(ex, "MS Graph connector error: '{StatusCode}'.", ex.StatusCode); @@ -161,7 +162,7 @@ await errorResponse } /// - /// Gets properties of a specific group using the generated . + /// Gets properties of a specific group using the generated . /// /// The HTTP request with 'groupId' query parameter. /// The cancellation token. @@ -170,7 +171,7 @@ public async Task GetGraphGroupPropertiesAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "graph/groups/properties")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("GetGraphGroupProperties: Using generated MsgraphgroupsanduserClient from SDK."); + this._logger.LogInformation("GetGraphGroupProperties: Using generated MsGraphGroupsAndUsersClient from SDK."); var rawGroupId = request.Query["groupId"]; var groupId = rawGroupId?.Trim(); @@ -206,7 +207,7 @@ await response return response; } - catch (MsgraphgroupsanduserConnectorException ex) + catch (MsGraphGroupsAndUsersConnectorException ex) { this._logger.LogError(ex, "MS Graph connector error: '{StatusCode}'.", ex.StatusCode); diff --git a/DirectConnector/Office365UsersFunctions.cs b/DirectConnector/Office365UsersFunctions.cs index d6d4d41..2a3c143 100644 --- a/DirectConnector/Office365UsersFunctions.cs +++ b/DirectConnector/Office365UsersFunctions.cs @@ -3,7 +3,8 @@ //------------------------------------------------------------ using System.Net; -using Microsoft.Azure.Connectors.DirectClient.Office365users; +using Azure.Connectors.Sdk.Office365users; +using Azure.Connectors.Sdk.Office365users.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; diff --git a/DirectConnector/OneDriveFunctions.cs b/DirectConnector/OneDriveFunctions.cs index f46dbdc..44b4d3d 100644 --- a/DirectConnector/OneDriveFunctions.cs +++ b/DirectConnector/OneDriveFunctions.cs @@ -5,18 +5,19 @@ using System.Net; using System.Text; using System.Text.Json; -using Microsoft.Azure.Connectors.DirectClient.Onedriveforbusiness; +using Azure.Connectors.Sdk.OneDriveForBusiness; +using Azure.Connectors.Sdk.OneDriveForBusiness.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; 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; namespace DirectConnector; /// /// Azure Functions demonstrating OneDrive for Business operations using the generated -/// from the DirectClient SDK. +/// from the DirectClient SDK. /// /// /// Exercises folder listing, file download/upload, search, sharing links, @@ -49,7 +50,7 @@ public class OneDriveFunctions }; private readonly ILogger _logger; - private readonly OnedriveforbusinessClient _oneDriveClient; + private readonly OneDriveForBusinessClient _oneDriveClient; /// /// Initializes a new instance of the class. @@ -58,7 +59,7 @@ public class OneDriveFunctions /// The DI-injected OneDrive for Business client (disposed by the host). public OneDriveFunctions( ILogger logger, - OnedriveforbusinessClient oneDriveClient) + OneDriveForBusinessClient oneDriveClient) { this._logger = logger; this._oneDriveClient = oneDriveClient; @@ -74,7 +75,7 @@ public async Task ListOneDriveRootAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "onedrive/root")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("ListOneDriveRoot: Using generated OnedriveforbusinessClient from SDK."); + this._logger.LogInformation("ListOneDriveRoot: Using generated OneDriveForBusinessClient from SDK."); try { @@ -103,7 +104,7 @@ await response return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); @@ -137,7 +138,7 @@ await errorResponse /// Lists files in a specific OneDrive folder. /// /// - /// Exercises which returns an + /// Exercises which returns an /// that automatically follows pagination across all pages. /// /// The HTTP request containing the folder identifier. @@ -147,7 +148,7 @@ public async Task ListOneDriveFolderAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "onedrive/files")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("ListOneDriveFolder: Using generated OnedriveforbusinessClient from SDK."); + this._logger.LogInformation("ListOneDriveFolder: Using generated OneDriveForBusinessClient from SDK."); var folderId = request.Query["folder"]; if (string.IsNullOrEmpty(folderId)) @@ -194,7 +195,7 @@ await response return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); @@ -228,7 +229,7 @@ await errorResponse /// Downloads a file from OneDrive for Business as binary bytes. /// /// - /// Exercises the byte[] response path in . + /// Exercises the byte[] response path in . /// /// The HTTP request containing the file path. /// The cancellation token. @@ -237,7 +238,7 @@ public async Task DownloadOneDriveFileAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "onedrive/download")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("DownloadOneDriveFile: Using generated OnedriveforbusinessClient byte[] response path."); + this._logger.LogInformation("DownloadOneDriveFile: Using generated OneDriveForBusinessClient byte[] response path."); var filePath = request.Query["path"]; if (string.IsNullOrEmpty(filePath)) @@ -272,7 +273,7 @@ await response.Body return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); @@ -306,7 +307,7 @@ await errorResponse /// Uploads a file to OneDrive for Business. /// /// - /// Exercises the byte[] input path in . + /// Exercises the byte[] input path in . /// /// The HTTP request containing upload details. /// The cancellation token. @@ -315,7 +316,7 @@ public async Task UploadOneDriveFileAsync( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "onedrive/upload")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("UploadOneDriveFile: Using generated OnedriveforbusinessClient byte[] input path."); + this._logger.LogInformation("UploadOneDriveFile: Using generated OneDriveForBusinessClient byte[] input path."); try { @@ -391,7 +392,7 @@ await response return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); @@ -431,7 +432,7 @@ public async Task SearchOneDriveFilesAsync( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "onedrive/search")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("SearchOneDriveFiles: Using generated OnedriveforbusinessClient from SDK."); + this._logger.LogInformation("SearchOneDriveFiles: Using generated OneDriveForBusinessClient from SDK."); var query = request.Query["query"]; if (string.IsNullOrEmpty(query)) @@ -477,7 +478,7 @@ await response return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); @@ -517,7 +518,7 @@ public async Task CreateOneDriveShareLinkAsync( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "onedrive/share")] HttpRequestData request, CancellationToken cancellationToken) { - this._logger.LogInformation("CreateOneDriveShareLink: Using generated OnedriveforbusinessClient from SDK."); + this._logger.LogInformation("CreateOneDriveShareLink: Using generated OneDriveForBusinessClient from SDK."); try { @@ -577,7 +578,7 @@ await response return response; } - catch (OnedriveforbusinessConnectorException ex) + catch (OneDriveForBusinessConnectorException ex) { this._logger.LogError(ex, "OneDrive connector error: '{StatusCode}'.", ex.StatusCode); diff --git a/DirectConnector/Program.cs b/DirectConnector/Program.cs index e88984c..8cd2ef8 100644 --- a/DirectConnector/Program.cs +++ b/DirectConnector/Program.cs @@ -3,16 +3,25 @@ //------------------------------------------------------------ using DirectConnector.Configuration; -using Microsoft.Azure.Connectors.DirectClient.Azureblob; +using Azure.Connectors.Sdk.AzureBlob; +using Azure.Connectors.Sdk.AzureBlob.Models; using Microsoft.Azure.Connectors.DirectClient.Azureloganalytics; -using Microsoft.Azure.Connectors.DirectClient.Mq; -using Microsoft.Azure.Connectors.DirectClient.Msgraphgroupsanduser; -using Microsoft.Azure.Connectors.DirectClient.Office365; -using Microsoft.Azure.Connectors.DirectClient.Office365users; -using Microsoft.Azure.Connectors.DirectClient.Onedriveforbusiness; -using Microsoft.Azure.Connectors.DirectClient.Sharepointonline; -using Microsoft.Azure.Connectors.DirectClient.Smtp; -using Microsoft.Azure.Connectors.DirectClient.Teams; +using Azure.Connectors.Sdk.Mq; +using Azure.Connectors.Sdk.Mq.Models; +using Azure.Connectors.Sdk.MsGraphGroupsAndUsers; +using Azure.Connectors.Sdk.MsGraphGroupsAndUsers.Models; +using Azure.Connectors.Sdk.Office365; +using Azure.Connectors.Sdk.Office365.Models; +using Azure.Connectors.Sdk.Office365users; +using Azure.Connectors.Sdk.Office365users.Models; +using Azure.Connectors.Sdk.OneDriveForBusiness; +using Azure.Connectors.Sdk.OneDriveForBusiness.Models; +using Azure.Connectors.Sdk.SharePointOnline; +using Azure.Connectors.Sdk.SharePointOnline.Models; +using Azure.Connectors.Sdk.Smtp; +using Azure.Connectors.Sdk.Smtp.Models; +using Azure.Connectors.Sdk.Teams; +using Azure.Connectors.Sdk.Teams.Models; using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -55,7 +64,7 @@ : new Office365Client(options.Office365.ConnectionRuntimeUrl); }); - services.AddSingleton(serviceProvider => + services.AddSingleton(serviceProvider => { var options = serviceProvider.GetRequiredService>().Value; @@ -63,10 +72,10 @@ // the client relies on DefaultAzureCredential. When ManagedIdentityClientId is non-null // (empty string = system-assigned MSI, non-empty = user-assigned MSI), use the MSI constructor. return options.SharePoint.ManagedIdentityClientId != null - ? new SharepointonlineClient( + ? new SharePointOnlineClient( options.SharePoint.ConnectionRuntimeUrl, options.SharePoint.ManagedIdentityClientId) - : new SharepointonlineClient(options.SharePoint.ConnectionRuntimeUrl); + : new SharePointOnlineClient(options.SharePoint.ConnectionRuntimeUrl); }); services.AddSingleton(serviceProvider => @@ -80,37 +89,37 @@ : new TeamsClient(options.Teams.ConnectionRuntimeUrl); }); - services.AddSingleton(serviceProvider => + services.AddSingleton(serviceProvider => { var options = serviceProvider.GetRequiredService>().Value; return options.OneDrive.ManagedIdentityClientId != null - ? new OnedriveforbusinessClient( + ? new OneDriveForBusinessClient( options.OneDrive.ConnectionRuntimeUrl, options.OneDrive.ManagedIdentityClientId) - : new OnedriveforbusinessClient(options.OneDrive.ConnectionRuntimeUrl); + : new OneDriveForBusinessClient(options.OneDrive.ConnectionRuntimeUrl); }); - services.AddSingleton(serviceProvider => + services.AddSingleton(serviceProvider => { var options = serviceProvider.GetRequiredService>().Value; return options.MsGraph.ManagedIdentityClientId != null - ? new MsgraphgroupsanduserClient( + ? new MsGraphGroupsAndUsersClient( options.MsGraph.ConnectionRuntimeUrl, options.MsGraph.ManagedIdentityClientId) - : new MsgraphgroupsanduserClient(options.MsGraph.ConnectionRuntimeUrl); + : new MsGraphGroupsAndUsersClient(options.MsGraph.ConnectionRuntimeUrl); }); - services.AddSingleton(serviceProvider => + services.AddSingleton(serviceProvider => { var options = serviceProvider.GetRequiredService>().Value; return options.AzureBlob.ManagedIdentityClientId != null - ? new AzureblobClient( + ? new AzureBlobClient( options.AzureBlob.ConnectionRuntimeUrl, options.AzureBlob.ManagedIdentityClientId) - : new AzureblobClient(options.AzureBlob.ConnectionRuntimeUrl); + : new AzureBlobClient(options.AzureBlob.ConnectionRuntimeUrl); }); services.AddSingleton(serviceProvider => diff --git a/DirectConnector/SmtpFunctions.cs b/DirectConnector/SmtpFunctions.cs index d84a1ce..cb58abc 100644 --- a/DirectConnector/SmtpFunctions.cs +++ b/DirectConnector/SmtpFunctions.cs @@ -4,7 +4,8 @@ using System.Net; using System.Text.Json; -using Microsoft.Azure.Connectors.DirectClient.Smtp; +using Azure.Connectors.Sdk.Smtp; +using Azure.Connectors.Sdk.Smtp.Models; using Microsoft.Azure.Connectors.Sdk; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http;