From eaba92bfafea569c4530053e4f111d1327b6a90e Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Mon, 3 Mar 2025 08:54:36 -0800 Subject: [PATCH] [Governance] Fix outdated references (#48495) * [Governance] Fix outdated references The focus of these changes is to bump outdated references for packages and in code samples that were being flagged by governance and/or as obsolete during runs. --- eng/Packages.Data.props | 15 ++++---- .../src/Azure.CloudMachine.OpenAI.csproj | 2 +- .../src/Azure.CloudMachine.Web.csproj | 2 +- .../src/Azure.CloudMachine.csproj | 2 +- .../Microsoft.WCF.Azure.StorageQueues.csproj | 2 ++ ...osoft.WCF.Azure.StorageQueues.Tests.csproj | 2 ++ ...oft.WCF.Azure.StorageQueues.Samples.csproj | 2 ++ .../samples/sharelink/ShareLink.csproj | 10 +++--- .../README.md | 8 ++--- .../samples/Sample1_Workflows.md | 8 ++--- .../samples/Sample2_SubmitUserRequests.md | 8 ++--- .../samples/Sample3_WorkflowTasks.md | 8 ++--- .../samples/Sample4_WorkflowRuns.md | 8 ++--- .../tests/Samples/Sample1_HelloWorld.cs | 30 +++++----------- .../Samples/Sample2_SubmitUserRequests.cs | 12 +------ .../tests/Samples/Sample3_WorkflowTasks.cs | 12 +------ .../tests/Samples/Sample4_WorkflowRuns.cs | 12 +------ .../tests/WorkflowsClientTestBase.cs | 10 +++--- .../tests/WorkflowsClientTestEnvironment.cs | 34 ------------------- .../SampleDev-JavaScript/package-lock.json | 32 +++++++++-------- .../samples/SampleDev-JavaScript/package.json | 2 +- 21 files changed, 68 insertions(+), 153 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index ae2844053fee..f27f794a2e9f 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -89,7 +89,7 @@ - + @@ -98,8 +98,8 @@ - - + + @@ -383,7 +383,7 @@ - + @@ -411,9 +411,11 @@ - + - + + + @@ -424,5 +426,4 @@ 1.0.0-dev.20250221.1 - diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj index b4af8fe0dfed..b12e228707f6 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj @@ -19,7 +19,7 @@ - + diff --git a/sdk/cloudmachine/Azure.CloudMachine.Web/src/Azure.CloudMachine.Web.csproj b/sdk/cloudmachine/Azure.CloudMachine.Web/src/Azure.CloudMachine.Web.csproj index 70d54cecc233..73cc0e114ad8 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.Web/src/Azure.CloudMachine.Web.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine.Web/src/Azure.CloudMachine.Web.csproj @@ -16,7 +16,7 @@ - + diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj index 8964cdbae4c0..d89eca9408fe 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj @@ -22,7 +22,7 @@ - + diff --git a/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/src/Microsoft.WCF.Azure.StorageQueues.csproj b/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/src/Microsoft.WCF.Azure.StorageQueues.csproj index 7850d8c1799b..144717c5d9a2 100644 --- a/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/src/Microsoft.WCF.Azure.StorageQueues.csproj +++ b/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/src/Microsoft.WCF.Azure.StorageQueues.csproj @@ -19,6 +19,8 @@ + + diff --git a/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/tests/Microsoft.WCF.Azure.StorageQueues.Tests.csproj b/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/tests/Microsoft.WCF.Azure.StorageQueues.Tests.csproj index 0d5beda867f3..f950822cc59c 100644 --- a/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/tests/Microsoft.WCF.Azure.StorageQueues.Tests.csproj +++ b/sdk/extension-wcf/Microsoft.WCF.Azure.StorageQueues/tests/Microsoft.WCF.Azure.StorageQueues.Tests.csproj @@ -25,6 +25,8 @@ + + diff --git a/sdk/extension-wcf/samples/Microsoft.WCF.Azure.StorageQueues.Samples/Microsoft.WCF.Azure.StorageQueues.Samples.csproj b/sdk/extension-wcf/samples/Microsoft.WCF.Azure.StorageQueues.Samples/Microsoft.WCF.Azure.StorageQueues.Samples.csproj index bb0358214602..c805a61265ae 100644 --- a/sdk/extension-wcf/samples/Microsoft.WCF.Azure.StorageQueues.Samples/Microsoft.WCF.Azure.StorageQueues.Samples.csproj +++ b/sdk/extension-wcf/samples/Microsoft.WCF.Azure.StorageQueues.Samples/Microsoft.WCF.Azure.StorageQueues.Samples.csproj @@ -13,6 +13,8 @@ + + diff --git a/sdk/keyvault/samples/sharelink/ShareLink.csproj b/sdk/keyvault/samples/sharelink/ShareLink.csproj index ca992a494cab..1ee8d93a79a2 100644 --- a/sdk/keyvault/samples/sharelink/ShareLink.csproj +++ b/sdk/keyvault/samples/sharelink/ShareLink.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 Azure.Security.KeyVault.Storage $(NoWarn); @@ -16,7 +16,7 @@ true - + @@ -29,11 +29,11 @@ - - + + - + diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/README.md b/sdk/purview/Azure.Analytics.Purview.Workflows/README.md index 705debf43d01..de8f64bcca19 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/README.md @@ -28,13 +28,9 @@ Since the Workflow service uses an Azure Active Directory (AAD) bearer token for ```C# Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); -string clientId = Environment.GetEnvironmentVariable("ClientId"); -string tenantId = Environment.GetEnvironmentVariable("TenantId"); -string username = Environment.GetEnvironmentVariable("Username"); -string password = Environment.GetEnvironmentVariable("Password"); +TokenCredential credential = new DefaultAzureCredential(); -TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); -var client = new WorkflowsClient(endpoint, usernamePasswordCredential); +var client = new WorkflowsClient(endpoint, credential); ``` ## Examples diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample1_Workflows.md b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample1_Workflows.md index c1d1107f6b98..5368ee87bf6a 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample1_Workflows.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample1_Workflows.md @@ -9,13 +9,9 @@ You can set `endpoint`, `username`, `password` etc. based on an environment vari ```C# Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); -string clientId = Environment.GetEnvironmentVariable("ClientId"); -string tenantId = Environment.GetEnvironmentVariable("TenantId"); -string username = Environment.GetEnvironmentVariable("Username"); -string password = Environment.GetEnvironmentVariable("Password"); +TokenCredential credential = new DefaultAzureCredential(); -TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); -var client = new WorkflowsClient(endpoint, usernamePasswordCredential); +var client = new WorkflowsClient(endpoint, credential); ``` ## Create a Workflow diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample2_SubmitUserRequests.md b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample2_SubmitUserRequests.md index 9b7d16a4e391..13f8b3c0dac0 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample2_SubmitUserRequests.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample2_SubmitUserRequests.md @@ -9,13 +9,9 @@ You can set `endpoint`, `username`, `password` etc. based on an environment vari ```C# Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); -string clientId = Environment.GetEnvironmentVariable("ClientId"); -string tenantId = Environment.GetEnvironmentVariable("TenantId"); -string username = Environment.GetEnvironmentVariable("Username"); -string password = Environment.GetEnvironmentVariable("Password"); +TokenCredential credential = new DefaultAzureCredential(); -TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); -var client = new WorkflowsClient(endpoint, usernamePasswordCredential); +var client = new WorkflowsClient(endpoint, credential); ``` ## Submit a user request diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample3_WorkflowTasks.md b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample3_WorkflowTasks.md index eb643abb4eee..52d0186401f6 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample3_WorkflowTasks.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample3_WorkflowTasks.md @@ -9,13 +9,9 @@ You can set `endpoint`, `username`, `password` etc. based on an environment vari ```C# Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); -string clientId = Environment.GetEnvironmentVariable("ClientId"); -string tenantId = Environment.GetEnvironmentVariable("TenantId"); -string username = Environment.GetEnvironmentVariable("Username"); -string password = Environment.GetEnvironmentVariable("Password"); +TokenCredential credential = new DefaultAzureCredential(); -TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); -var client = new WorkflowsClient(endpoint, usernamePasswordCredential); +var client = new WorkflowsClient(endpoint, credential); ``` ## Approve workflow task diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample4_WorkflowRuns.md b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample4_WorkflowRuns.md index 240affdde5c7..9ab986e7f329 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample4_WorkflowRuns.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/samples/Sample4_WorkflowRuns.md @@ -9,13 +9,9 @@ You can set `endpoint`, `username`, `password` etc. based on an environment vari ```C# Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); -string clientId = Environment.GetEnvironmentVariable("ClientId"); -string tenantId = Environment.GetEnvironmentVariable("TenantId"); -string username = Environment.GetEnvironmentVariable("Username"); -string password = Environment.GetEnvironmentVariable("Password"); +TokenCredential credential = new DefaultAzureCredential(); -TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); -var client = new WorkflowsClient(endpoint, usernamePasswordCredential); +var client = new WorkflowsClient(endpoint, credential); ``` ## Cancel a workflow run diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample1_HelloWorld.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample1_HelloWorld.cs index 1bbcd097e9cf..90dc53233295 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample1_HelloWorld.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample1_HelloWorld.cs @@ -21,14 +21,14 @@ public async Task CreateWorkflowClient() { #region Snippet:Azure_Analytics_Purview_Workflows_CreateClient Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); +#if SNIPPET + TokenCredential credential = new DefaultAzureCredential(); +#else + TokenCredential credential = TestEnvironment.Credential; +#endif - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); - var client = new WorkflowsClient(endpoint, usernamePasswordCredential); - #endregion + var client = new WorkflowsClient(endpoint, credential); +#endregion //Perform an operation AsyncPageable workflowList = client.GetWorkflowsAsync(new RequestContext()); @@ -47,13 +47,7 @@ public async Task CreateWorkflowClient() public async Task CreateWorkflow() { Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); - - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId, tenantId, username, password, null); - var client = new WorkflowClient(endpoint, usernamePasswordCredential); + var client = new WorkflowClient(endpoint, TestEnvironment.Credential); #region Snippet:Azure_Analytics_Purview_Workflows_CreateWorkflow Guid workflowId = Guid.NewGuid(); @@ -74,13 +68,7 @@ public async Task CreateWorkflow() public async Task GetWorkflow() { Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); - - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId, tenantId, username, password, null); - var client = new WorkflowClient(endpoint, usernamePasswordCredential); + var client = new WorkflowClient(endpoint, TestEnvironment.Credential); #region Snippet:Azure_Analytics_Purview_Workflows_GetWorkflow // This workflowId represents an existing workflow. The id can be obtained by calling CreateOrReplaceWorkflowAsync API or list workflows by calling GetWorkflowsAsync API. diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample2_SubmitUserRequests.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample2_SubmitUserRequests.cs index 456a79aad802..ca1ca54f1b51 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample2_SubmitUserRequests.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample2_SubmitUserRequests.cs @@ -2,13 +2,9 @@ // Licensed under the MIT License. using System; -using System.IO; -using System.Linq; -using System.Text.Json; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; -using Azure.Identity; using NUnit.Framework; namespace Azure.Analytics.Purview.Workflows.Tests.Samples @@ -20,13 +16,7 @@ public class UserRequestsSamples: SamplesBase public async Task SubmitUserRequest() { Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); - - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); - var client = new UserRequestsClient(endpoint, usernamePasswordCredential); + var client = new UserRequestsClient(endpoint, TestEnvironment.Credential); #region Snippet:Azure_Analytics_Purview_Workflows_SubmitUserRequests diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample3_WorkflowTasks.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample3_WorkflowTasks.cs index fd629ba62b1d..8e10546326d1 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample3_WorkflowTasks.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample3_WorkflowTasks.cs @@ -2,13 +2,9 @@ // Licensed under the MIT License. using System; -using System.IO; -using System.Linq; -using System.Text.Json; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; -using Azure.Identity; using NUnit.Framework; namespace Azure.Analytics.Purview.Workflows.Tests.Samples @@ -20,13 +16,7 @@ public class WorkflowsTasksSamples: SamplesBase public async Task ApproveWorkflowTask() { Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); - - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); - var client = new ApprovalClient(endpoint, usernamePasswordCredential); + var client = new ApprovalClient(endpoint, TestEnvironment.Credential); #region Snippet:Azure_Analytics_Purview_Workflows_ApproveWorkflowTask diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample4_WorkflowRuns.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample4_WorkflowRuns.cs index b4a51f0a20e4..b2fa627f8f66 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample4_WorkflowRuns.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/Samples/Sample4_WorkflowRuns.cs @@ -2,13 +2,9 @@ // Licensed under the MIT License. using System; -using System.IO; -using System.Linq; -using System.Text.Json; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; -using Azure.Identity; using NUnit.Framework; namespace Azure.Analytics.Purview.Workflows.Tests.Samples @@ -20,13 +16,7 @@ public class WorkflowRunsSamples: SamplesBase public async Task CancelWorkflowRun() { Uri endpoint = new Uri(Environment.GetEnvironmentVariable("WORKFLOW_ENDPOINT")); - string clientId = Environment.GetEnvironmentVariable("ClientId"); - string tenantId = Environment.GetEnvironmentVariable("TenantId"); - string username = Environment.GetEnvironmentVariable("Username"); - string password = Environment.GetEnvironmentVariable("Password"); - - TokenCredential usernamePasswordCredential = new UsernamePasswordCredential(clientId,tenantId, username,password, null); - var client = new WorkflowRunClient(endpoint, usernamePasswordCredential); + var client = new WorkflowRunClient(endpoint, TestEnvironment.Credential); #region Snippet:Azure_Analytics_Purview_Workflows_CancelWorkflowRun // This workflowRunId represents an existing workflow run. The id can be obtained by calling GetWorkflowRunsAsync API. diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestBase.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestBase.cs index c37ef12e2eb3..4c0c12d059b7 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestBase.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestBase.cs @@ -24,7 +24,7 @@ public WorkflowClient GetWorkflowClient() return true; }; var options = new PurviewWorkflowServiceClientOptions { Transport = new HttpClientTransport(httpHandler) }; - return InstrumentClient(new WorkflowClient(TestEnvironment.Endpoint, TestEnvironment.UsernamePasswordCredential, InstrumentClientOptions(options))); + return InstrumentClient(new WorkflowClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); } public WorkflowsClient GetWorkflowsClient() @@ -35,7 +35,7 @@ public WorkflowsClient GetWorkflowsClient() return true; }; var options = new PurviewWorkflowServiceClientOptions { Transport = new HttpClientTransport(httpHandler) }; - return InstrumentClient(new WorkflowsClient(TestEnvironment.Endpoint, TestEnvironment.UsernamePasswordCredential, InstrumentClientOptions(options))); + return InstrumentClient(new WorkflowsClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); } public UserRequestsClient GetUserRequestsClient() @@ -46,7 +46,7 @@ public UserRequestsClient GetUserRequestsClient() return true; }; var options = new PurviewWorkflowServiceClientOptions { Transport = new HttpClientTransport(httpHandler) }; - return InstrumentClient(new UserRequestsClient(TestEnvironment.Endpoint, TestEnvironment.UsernamePasswordCredential, InstrumentClientOptions(options))); + return InstrumentClient(new UserRequestsClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); } public WorkflowRunClient GetWorkflowRunClient() @@ -57,7 +57,7 @@ public WorkflowRunClient GetWorkflowRunClient() return true; }; var options = new PurviewWorkflowServiceClientOptions { Transport = new HttpClientTransport(httpHandler) }; - return InstrumentClient(new WorkflowRunClient(TestEnvironment.Endpoint, TestEnvironment.UsernamePasswordCredential, InstrumentClientOptions(options))); + return InstrumentClient(new WorkflowRunClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); } public ApprovalClient GetApprovalClient() @@ -68,7 +68,7 @@ public ApprovalClient GetApprovalClient() return true; }; var options = new PurviewWorkflowServiceClientOptions { Transport = new HttpClientTransport(httpHandler) }; - return InstrumentClient(new ApprovalClient(TestEnvironment.Endpoint, TestEnvironment.UsernamePasswordCredential, InstrumentClientOptions(options))); + return InstrumentClient(new ApprovalClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); } } } diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestEnvironment.cs b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestEnvironment.cs index 0329cb7b967b..9ec186b811af 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestEnvironment.cs +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/tests/WorkflowsClientTestEnvironment.cs @@ -2,46 +2,12 @@ // Licensed under the MIT License. using System; -using Azure.Core; using Azure.Core.TestFramework; -using Azure.Identity; namespace Azure.Analytics.Purview.Workflows.Tests { public class WorkflowsClientTestEnvironment : TestEnvironment { - private TokenCredential _usernamePasswordcredential; - - public WorkflowsClientTestEnvironment() - { - } public Uri Endpoint => new(GetRecordedVariable("WORKFLOW_ENDPOINT")); - - public TokenCredential UsernamePasswordCredential - { - get - { - if (_usernamePasswordcredential != null) - { - return _usernamePasswordcredential; - } - - if (Mode == RecordedTestMode.Playback) - { - _usernamePasswordcredential = new MockCredential(); - } - else - { - _usernamePasswordcredential = new UsernamePasswordCredential( - GetVariable("Username"), - GetVariable("Password"), - GetVariable("TenantId"), - GetVariable("ClientId") - ); - } - - return _usernamePasswordcredential; - } - } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json index 38e4b3cfabc4..de39b325edb5 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json @@ -8,7 +8,7 @@ "name": "sampledev-javascript", "version": "1.0.0", "dependencies": { - "@azure/functions": "^4.0.0" + "@azure/functions": "^4.6.1" }, "devDependencies": { "@types/node": "^20.x", @@ -18,11 +18,12 @@ } }, "node_modules/@azure/functions": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.5.0.tgz", - "integrity": "sha512-WNCiOHMQEZpezxgThD3o2McKEjUEljtQBvdw4X4oE5714eTw76h33kIj0660ZJGEnxYSx4dx18oAbg5kLMs9iQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-4.6.1.tgz", + "integrity": "sha512-Py2Az29yk+A21vHES/rL6iU3ptKB+vVz3sGTjm0jSPFjG4kPbhFLi5vFI7YkCPMGeoD4WMIjHqTAeXvnFrBUBA==", + "license": "MIT", "dependencies": { - "cookie": "^0.6.0", + "cookie": "^0.7.0", "long": "^4.0.0", "undici": "^5.13.0" }, @@ -222,9 +223,10 @@ "dev": true }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -298,10 +300,11 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -782,9 +785,10 @@ } }, "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "version": "5.28.5", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", + "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", + "license": "MIT", "dependencies": { "@fastify/busboy": "^2.0.0" }, diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json index b7426489b64b..ab27753081b0 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json @@ -12,7 +12,7 @@ "test": "echo \"No tests yet...\"" }, "dependencies": { - "@azure/functions": "^4.0.0" + "@azure/functions": "^4.6.1" }, "devDependencies": { "@types/node": "^20.x",