From 8e4007a555f1c96a6a7c23aff194b1a25ddae1c7 Mon Sep 17 00:00:00 2001 From: Anne Thompson <21269347+annelo-msft@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:31:10 -0700 Subject: [PATCH 01/43] Preparation for release of System.ClientModel 1.2.0 (#46410) * System.ClientModel 1.2.0 * update CHANGELOG --- sdk/core/System.ClientModel/CHANGELOG.md | 10 +++------- .../System.ClientModel/src/System.ClientModel.csproj | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index 18a730420e7b5..0628092e36fe7 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -1,15 +1,11 @@ # Release History -## 1.2.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 1.2.0 (2024-10-03) ### Other Changes +- Upgraded `System.Memory.Data` package dependency to 6.0.0 ([#46134](https://github.com/Azure/azure-sdk-for-net/pull/46134)). + ## 1.1.0 (2024-09-17) ### Other Changes diff --git a/sdk/core/System.ClientModel/src/System.ClientModel.csproj b/sdk/core/System.ClientModel/src/System.ClientModel.csproj index 3ef8c57bea25d..51782d64005e5 100644 --- a/sdk/core/System.ClientModel/src/System.ClientModel.csproj +++ b/sdk/core/System.ClientModel/src/System.ClientModel.csproj @@ -2,7 +2,7 @@ Contains building blocks for clients that call cloud services. - 1.2.0-beta.1 + 1.2.0 1.1.0 enable From 5d7e9d6c009e3f6614aa9e25c6e995a0e6b0c8ae Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Thu, 3 Oct 2024 16:07:35 -0400 Subject: [PATCH 02/43] [Storage] [Blobs] [DataMovement] [Tests] End to End Tests for StartUploadDirectoryAsync & StartDownloadToDirectoryAsync (#46409) * Initial commit * Recorded tests * Moved test over to DataMovement.Blobs * Recorded in DataMovement.Blobs * Fixed minor error with CreateBlobDirectoryTree * Remove Azure.Storage.DataMovement recording --- .../assets.json | 2 +- ...ntainerClientExtensionsIntegrationTests.cs | 446 ++++++++++++++++++ 2 files changed, 447 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json b/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json index 145d6241cb6a4..694a7853886f8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.DataMovement.Blobs", - "Tag": "net/storage/Azure.Storage.DataMovement.Blobs_602492e0c7" + "Tag": "net/storage/Azure.Storage.DataMovement.Blobs_56a707e8fb" } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs new file mode 100644 index 0000000000000..3fbb1b91ea1bb --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +extern alias BaseBlobs; +extern alias DMBlobs; +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Test.Shared; +using BaseBlobs::Azure.Storage.Blobs; +using BaseBlobs::Azure.Storage.Blobs.Specialized; +using BaseBlobs::Azure.Storage.Blobs.Models; +using DMBlobs::Azure.Storage.Blobs; +using DMBlobs::Azure.Storage.DataMovement.Blobs; +using NUnit.Framework; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Azure.Storage.DataMovement.Blobs.Tests +{ + [TestFixture(true, BlobClientOptions.ServiceVersion.V2024_11_04, null)] + [TestFixture(false, BlobClientOptions.ServiceVersion.V2024_11_04, null)] + public class BlobContainerClientExtensionsIntegrationTests : StorageTestBase + { + protected ClientBuilder ClientBuilder { get; } + + protected readonly BlobClientOptions.ServiceVersion _serviceVersion; + + public BlobContainerClientExtensionsIntegrationTests(bool async, BlobClientOptions.ServiceVersion serviceVersion, RecordedTestMode? mode = null) + : base(async, mode) + { + _serviceVersion = serviceVersion; + ClientBuilder = ClientBuilderExtensions.GetNewBlobsClientBuilder(Tenants, _serviceVersion); + } + + private async Task CreateBlockBlobAsync( + BlobContainerClient containerClient, + string blobName, + long size, + BlobUploadOptions options = default) + { + BlockBlobClient blobClient = containerClient.GetBlockBlobClient(blobName); + + using Stream originalStream = await CreateLimitedMemoryStream(size); + await blobClient.UploadAsync(originalStream, options); + return blobClient; + } + + #region StartUploadDirectoryAsyncTests + private async Task CreateTempDirectoryStructureAsync( + string directoryPath, + int size) + { + await CreateRandomFileAsync(directoryPath, "blob0", size: size); + await CreateRandomFileAsync(directoryPath, "blob1", size: size); + + string openSubfolder = CreateRandomDirectory(directoryPath); + await CreateRandomFileAsync(openSubfolder, "blob2", size: size); + string lockedSubfolder = CreateRandomDirectory(directoryPath); + await CreateRandomFileAsync(lockedSubfolder, "blob3", size: size); + } + + private async Task CreateStartUploadDirectoryAsync_WithOptions( + string directoryPath, + BlobContainerClient containerClient, + bool createFailedCondition = false, + DataTransferOptions options = default, + int size = Constants.KB) + { + await CreateTempDirectoryStructureAsync(directoryPath, size); + BlobContainerClientTransferOptions transferOptions = new BlobContainerClientTransferOptions + { + TransferOptions = options, + }; + + // If we want a failure condition to happen + if (createFailedCondition) + { + await CreateBlockBlobAsync( + containerClient: containerClient, + blobName: "blob0", + size: size); + } + + return await containerClient.StartUploadDirectoryAsync(directoryPath, transferOptions); + } + + private async Task CreateStartUploadDirectoryAsync_WithDirectoryPrefix( + string directoryPath, + BlobContainerClient containerClient, + string blobDirectoryPrefix = default, + int size = Constants.KB) + { + await CreateTempDirectoryStructureAsync(directoryPath, size); + return await containerClient.StartUploadDirectoryAsync(directoryPath, blobDirectoryPrefix); + } + + [RecordedTest] + public async Task StartUploadDirectoryAsync_WithOptions() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Act + DataTransfer dataTransfer = await CreateStartUploadDirectoryAsync_WithOptions(directoryPath, containerClient, false, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.IsNotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + var blobItems = await containerClient.GetBlobsAsync().ToListAsync(); + Assert.AreEqual(4, blobItems.Count); + HashSet allBlobNames = new HashSet(); + foreach (var blobItem in blobItems) + { + string blobName = blobItem.Name; + string blobNameSuffix = blobName.Substring(blobName.Length - 5); + allBlobNames.Add(blobNameSuffix); + } + for (int i = 0; i < 4; i++) + { + Assert.IsTrue(allBlobNames.Contains($"blob{i}")); + } + await testEventsRaised.AssertContainerCompletedCheck(4); + } + + [RecordedTest] + public async Task StartUploadDirectoryAsync_WithDirectoryPrefix() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + string blobDirectoryPrefix = "foo"; + + // Act + DataTransfer dataTransfer = await CreateStartUploadDirectoryAsync_WithDirectoryPrefix(directoryPath, containerClient, blobDirectoryPrefix, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await dataTransfer.WaitForCompletionAsync(cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.IsNotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + var blobItems = await containerClient.GetBlobsAsync().ToListAsync(); + Assert.AreEqual(4, blobItems.Count); + HashSet allBlobNames = new HashSet(); + foreach (var blobItem in blobItems) + { + string blobName = blobItem.Name; + string blobNamePrefix = blobName.Substring(0, blobDirectoryPrefix.Length); + Assert.AreEqual(blobNamePrefix, blobDirectoryPrefix); + string blobNameSuffix = blobName.Substring(blobName.Length - 5); + allBlobNames.Add(blobNameSuffix); + } + for (int i = 0; i < 4; i++) + { + Assert.IsTrue(allBlobNames.Contains($"blob{i}")); + } + } + + [RecordedTest] + public async Task StartUploadDirectoryAsync_WithOptions_Failed() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Act + DataTransfer dataTransfer = await CreateStartUploadDirectoryAsync_WithOptions(directoryPath, containerClient, true, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + await testEventsRaised.AssertContainerCompletedWithFailedCheck(1); + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + Assert.AreEqual(true, dataTransfer.TransferStatus.HasFailedItems); + Assert.IsTrue(testEventsRaised.FailedEvents.First().Exception.Message.Contains("BlobAlreadyExists")); + } + + [RecordedTest] + public async Task StartUploadDirectoryAsync_WithOptions_Skipped() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions() + { + CreationPreference = StorageResourceCreationPreference.SkipIfExists + }; + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Act + DataTransfer dataTransfer = await CreateStartUploadDirectoryAsync_WithOptions(directoryPath, containerClient, true, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + await testEventsRaised.AssertContainerCompletedWithSkippedCheck(1); + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + Assert.AreEqual(true, dataTransfer.TransferStatus.HasSkippedItems); + } + #endregion StartUploadDirectoryAsyncTests + + #region StartDownloadToDirectoryAsyncTests + private async Task CreateBlobDirectoryTree( + BlobContainerClient client, + string sourceLocalFolderPath, + string sourceBlobDirectoryName, + int size) + { + string blobName0 = string.Concat(sourceBlobDirectoryName, "/blob0"); + string blobName1 = string.Concat(sourceBlobDirectoryName, "/blob1"); + await CreateBlockBlobAsync(client, blobName0, size); + await CreateBlockBlobAsync(client, blobName1, size); + + string subDirName = "bar"; + CreateRandomDirectory(sourceLocalFolderPath, subDirName); + string blobName2 = string.Concat(sourceBlobDirectoryName, "/", subDirName, "/blob2"); + await CreateBlockBlobAsync(client, blobName2, size); + + string subDirName2 = "pik"; + CreateRandomDirectory(sourceLocalFolderPath, subDirName2); + string blobName3 = string.Concat(sourceBlobDirectoryName, "/", subDirName2, "/blob3"); + await CreateBlockBlobAsync(client, blobName3, size); + } + + private async Task CreateStartDownloadToDirectoryAsync_WithOptions( + string directoryPath, + BlobContainerClient containerClient, + DataTransferOptions options = default, + int size = Constants.KB) + { + string sourceBlobPrefix = "sourceFolder"; + string sourceLocalFolderPath = CreateRandomDirectory(Path.GetTempPath(), sourceBlobPrefix); + await CreateBlobDirectoryTree(containerClient, sourceLocalFolderPath, sourceBlobPrefix, size); + + BlobContainerClientTransferOptions transferOptions = new BlobContainerClientTransferOptions + { + TransferOptions = options, + }; + + return await containerClient.StartDownloadToDirectoryAsync(directoryPath, transferOptions); + } + + private async Task CreateStartDownloadToDirectoryAsync_WithDirectoryPrefix( + string directoryPath, + BlobContainerClient containerClient, + string prefixFilter = default, + int size = Constants.KB) + { + string sourceBlobPrefix = "sourceFolder"; + string sourceLocalFolderPath = CreateRandomDirectory(Path.GetTempPath(), sourceBlobPrefix); + await CreateBlobDirectoryTree(containerClient, sourceLocalFolderPath, sourceBlobPrefix, size); + string blobDirectoryPrefix = string.Concat(sourceBlobPrefix, prefixFilter); + + return await containerClient.StartDownloadToDirectoryAsync(directoryPath, blobDirectoryPrefix); + } + + [RecordedTest] + public async Task StartDownloadToDirectoryAsync_WithOptions() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Act + DataTransfer dataTransfer = await CreateStartDownloadToDirectoryAsync_WithOptions(directoryPath, containerClient, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + string[] allLocalFilePaths = Directory.GetFiles(directoryPath, "*", SearchOption.AllDirectories); + Assert.AreEqual(4, allLocalFilePaths.Length); + HashSet allFileNames = new HashSet(); + foreach (string filePath in allLocalFilePaths) + { + string fileName = Path.GetFileName(filePath); + allFileNames.Add(fileName); + } + for (int i = 0; i < 4; i++) + { + Assert.IsTrue(allFileNames.Contains($"blob{i}")); + } + await testEventsRaised.AssertContainerCompletedCheck(4); + } + + [RecordedTest] + public async Task StartDownloadToDirectoryAsync_WithDirectoryPrefix() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + string prefixFilter = "/pik"; // should only download blob3 based on dir prefix + + // Act + DataTransfer dataTransfer = await CreateStartDownloadToDirectoryAsync_WithDirectoryPrefix(directoryPath, containerClient, prefixFilter, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await dataTransfer.WaitForCompletionAsync(cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + string[] allLocalFilePaths = Directory.GetFiles(directoryPath, "*", SearchOption.AllDirectories); + Assert.AreEqual(1, allLocalFilePaths.Length); + string localFileName = Path.GetFileName(allLocalFilePaths.First()); + Assert.AreEqual("blob3", localFileName); + } + + [RecordedTest] + public async Task StartDownloadToDirectoryAsync_WithOptions_Failed() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Create at least one of the dest files to make it fail + string folderPath = Path.Combine(directoryPath, "sourceFolder"); + Directory.CreateDirectory(folderPath); + File.Create(Path.Combine(folderPath, "blob0")).Close(); + + // Act + DataTransfer dataTransfer = await CreateStartDownloadToDirectoryAsync_WithOptions(directoryPath, containerClient, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + Assert.AreEqual(true, dataTransfer.TransferStatus.HasFailedItems); + Assert.IsTrue(testEventsRaised.FailedEvents.First().Exception.Message.Contains("Cannot overwrite file.")); + await testEventsRaised.AssertContainerCompletedWithFailedCheck(1); + } + + [RecordedTest] + public async Task StartDownloadToDirectoryAsync_WithOptions_Skipped() + { + // Create a temp local directory + using DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string directoryPath = disposingLocalDirectory.DirectoryPath; + + // Create a temp blob container + await using var disposingContainer = await ClientBuilder.GetTestContainerAsync(publicAccessType: PublicAccessType.None); + BlobContainerClient containerClient = disposingContainer.Container; + + DataTransferOptions options = new DataTransferOptions() + { + CreationPreference = StorageResourceCreationPreference.SkipIfExists + }; + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + + // Create at least one of the dest files to make it fail + string folderPath = Path.Combine(directoryPath, "sourceFolder"); + Directory.CreateDirectory(folderPath); + File.Create(Path.Combine(folderPath, "blob0")).Dispose(); + + // Act + DataTransfer dataTransfer = await CreateStartDownloadToDirectoryAsync_WithOptions(directoryPath, containerClient, options, 1); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + dataTransfer, + testEventsRaised, + cancellationTokenSource.Token).ConfigureAwait(false); + + // Assert + Assert.NotNull(dataTransfer); + Assert.IsTrue(dataTransfer.HasCompleted); + Assert.AreEqual(DataTransferState.Completed, dataTransfer.TransferStatus.State); + Assert.AreEqual(true, dataTransfer.TransferStatus.HasSkippedItems); + await testEventsRaised.AssertContainerCompletedWithSkippedCheck(1); + } + #endregion StartDownloadToDirectoryAsyncTests + } +} From 1a1b91b5da60397a3a259fc7e6ec627f9e32a396 Mon Sep 17 00:00:00 2001 From: Anne Thompson <21269347+annelo-msft@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:08:43 -0700 Subject: [PATCH 03/43] Preparation for release of Azure.Core.Experimental 0.1.0-preview.36 (#46412) * Preparation for release of Azure.Core.Experimental 0.1.0-preview.36 * update CHANGELOG --- sdk/core/Azure.Core.Experimental/CHANGELOG.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/core/Azure.Core.Experimental/CHANGELOG.md b/sdk/core/Azure.Core.Experimental/CHANGELOG.md index ce20c63b8702c..e5f53f4dda383 100644 --- a/sdk/core/Azure.Core.Experimental/CHANGELOG.md +++ b/sdk/core/Azure.Core.Experimental/CHANGELOG.md @@ -1,17 +1,15 @@ # Release History -## 0.1.0-preview.36 (Unreleased) - -### Features Added +## 0.1.0-preview.36 (2024-10-03) ### Breaking Changes - Removed the `PopTokenRequestContext` type and added the proof of possession-related properties to `TokenRequestContext` in Azure.Core ([45134](https://github.com/Azure/azure-sdk-for-net/pull/45134)). -### Bugs Fixed - ### Other Changes +- Upgraded `System.Memory.Data` package dependency to 6.0.0 ([#46134](https://github.com/Azure/azure-sdk-for-net/pull/46134)). + ## 0.1.0-preview.35 (2024-09-12) ### Breaking Changes From f5d4fe21e22bd12f44ad5efa2f0d7198a0ea92c8 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen <48961492+amnguye@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:19:28 -0700 Subject: [PATCH 04/43] [Storage] [DataMovement] [Blobs] Stress Scenarios (#46400) * Added separate sln file for Storage Data Movement and start of stress testing for DM Blobs * Fix to Stress Test README * Fix path for .slnf file * WIP * WIP * WIP * WIP * WIP * WIP * WIP - builds * WIP - docker issues * WIP - build issue in docker * WIP - builds locally, not in Docker * WIP - runs until hitting excuting yaml file * WIP - helm won't commit run * WIP - fixing upload scenario test * WIP - helm still not pushing commit; added more options for scenarios * WIP * Cleanup * WIP * More cleanup and some PR Comments * Part 2 PR comments * WIP * WIP * WIP - Created all scenario types and implementation * Cleanup * Update script to include all new scenarios * Cleanup * PR Comments: Updated Create Blob Helper methods; removed file close; short hand * PR comments: Removed unnecessary init transfermanager; reapplied options --- .../stress/generatedValues.yaml | 87 +++++++- .../stress/scenarios-matrix.yaml | 68 ++++++ ...e.Storage.DataMovement.Blobs.Stress.csproj | 1 + .../src/Infrastructure/BlobTestSetupHelper.cs | 78 ++++++- .../src/Infrastructure/TestSetupHelper.cs | 2 - .../stress/src/Scenarios/BlobScenarioBase.cs | 11 +- .../Scenarios/BlobSingleDownloadScenario.cs | 69 ------ .../CopyAppendBlobDirectoryScenario.cs | 35 +++ .../Scenarios/CopyAppendBlobSingleScenario.cs | 34 +++ .../CopyBlobDirectoryScenarioBase.cs | 81 +++++++ .../Scenarios/CopyBlobSingleScenarioBase.cs | 107 +++++++++ .../CopyBlockBlobDirectoryScenario.cs | 35 +++ .../Scenarios/CopyBlockBlobSingleScenario.cs | 34 +++ .../CopyPageBlobDirectoryScenario.cs | 35 +++ .../Scenarios/CopyPageBlobSingleScenario.cs | 34 +++ .../DownloadAppendBlobDirectoryScenario.cs | 33 +++ .../DownloadAppendBlobSingleScenario.cs | 33 +++ .../DownloadBlobDirectoryScenarioBase.cs | 72 ++++++ .../DownloadBlobSingleScenarioBase.cs | 91 ++++++++ .../DownloadBlockBlobDirectoryScenario.cs | 33 +++ .../DownloadBlockBlobSingleScenario.cs | 33 +++ .../DownloadPageBlobDirectoryScenario.cs | 33 +++ .../DownloadPageBlobSingleScenario.cs | 33 +++ .../stress/src/Scenarios/TestScenarioName.cs | 21 +- .../UploadAppendBlobDirectoryScenario.cs | 33 +++ .../UploadAppendBlobSingleScenario.cs | 32 +++ ....cs => UploadBlobDirectoryScenarioBase.cs} | 40 ++-- ...rio.cs => UploadBlobSingleScenarioBase.cs} | 45 ++-- .../UploadBlockBlobDirectoryScenario.cs | 33 +++ .../UploadBlockBlobSingleScenario.cs | 32 +++ .../UploadPageBlobDirectoryScenario.cs | 33 +++ .../Scenarios/UploadPageBlobSingleScenario.cs | 32 +++ .../src/DataMovementBlobStressConstants.cs | 18 ++ .../stress/src/src/Program.cs | 205 +++++++++++++++++- .../stress/templates/stress-test-job.yaml | 3 +- ...re.Storage.DataMovement.Blobs.Tests.csproj | 1 + 36 files changed, 1461 insertions(+), 139 deletions(-) delete mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleDownloadScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobSingleScenario.cs rename sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/{BlobDirectoryUploadScenario.cs => UploadBlobDirectoryScenarioBase.cs} (63%) rename sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/{BlobSingleUploadScenario.cs => UploadBlobSingleScenarioBase.cs} (52%) create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobSingleScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobDirectoryScenario.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobSingleScenario.cs diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/generatedValues.yaml b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/generatedValues.yaml index 924b509a7e1e0..24c98afdb264e 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/generatedValues.yaml +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/generatedValues.yaml @@ -1,7 +1,92 @@ scenarios: - image: Dockerfile imageBuildDir: ../../../.. - testScenario: uploadsingleblockblob Scenario: uploadsingleblockblob + testScenario: uploadsingleblockblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: uploaddirectoryblockBlob + testScenario: uploaddirectoryblockBlob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloadsingleblockblob + testScenario: downloadsingleblockblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloaddirectoryblockblob + testScenario: downloaddirectoryblockblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copysingleblockblob + testScenario: copysingleblockblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copydirectoryblockblob + testScenario: copydirectoryblockblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: uploadsingleappendblob + testScenario: uploadsingleappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: uploaddirectoryappendblob + testScenario: uploaddirectoryappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloadsingleappendblob + testScenario: downloadsingleappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloaddirectoryappendblob + testScenario: downloaddirectoryappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copysingleappendblob + testScenario: copysingleappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copydirectoryappendblob + testScenario: copydirectoryappendblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: uploadsinglepageblob + testScenario: uploadsinglepageblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: uploaddirectorypageblob + testScenario: uploaddirectorypageblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloadsinglepageblob + testScenario: downloadsinglepageblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: downloaddirectorypageblob + testScenario: downloaddirectorypageblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copysinglepageblob + testScenario: copysinglepageblob + imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye +- image: Dockerfile + imageBuildDir: ../../../.. + Scenario: copydirectorypageblob + testScenario: copydirectorypageblob imageTag: stressstorage4okf44ko4zuos.azurecr.io/amnguye/net-stgdm-blobs/dockerfile:amnguye diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/scenarios-matrix.yaml b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/scenarios-matrix.yaml index 7595707741c27..eaff2292115a1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/scenarios-matrix.yaml +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/scenarios-matrix.yaml @@ -6,4 +6,72 @@ matrix: uploadsingleblockblob: testScenario: uploadsingleblockblob image: Dockerfile + imageBuildDir: "../../../.." + uploaddirectoryblockblob: + testScenario: uploaddirectoryblockblob + image: Dockerfile + imageBuildDir: "../../../.." + downloadsingleblockblob: + testScenario: downloadsingleblockblob + image: Dockerfile + imageBuildDir: "../../../.." + downloaddirectoryblockblob: + testScenario: downloaddirectoryblockblob + image: Dockerfile + imageBuildDir: "../../../.." + copysingleblockblob: + testScenario: copysingleblockblob + image: Dockerfile + imageBuildDir: "../../../.." + copydirectoryblockblob: + testScenario: copydirectoryblockblob + image: Dockerfile + imageBuildDir: "../../../.." + uploadsingleappendblob: + testScenario: uploadsingleappendblob + image: Dockerfile + imageBuildDir: "../../../.." + uploaddirectoryappendblob: + testScenario: uploaddirectoryappendblob + image: Dockerfile + imageBuildDir: "../../../.." + downloadsingleappendblob: + testScenario: downloadsingleappendblob + image: Dockerfile + imageBuildDir: "../../../.." + downloaddirectoryappendblob: + testScenario: downloaddirectoryappendblob + image: Dockerfile + imageBuildDir: "../../../.." + copysingleappendblob: + testScenario: copysingleappendblob + image: Dockerfile + imageBuildDir: "../../../.." + copydirectoryappendblob: + testScenario: copydirectoryappendblob + image: Dockerfile + imageBuildDir: "../../../.." + uploadsinglepageblob: + testScenario: uploadsinglepageblob + image: Dockerfile + imageBuildDir: "../../../.." + uploaddirectorypageblob: + testScenario: uploaddirectorypageblob + image: Dockerfile + imageBuildDir: "../../../.." + downloadsinglepageblob: + testScenario: downloadsinglepageblob + image: Dockerfile + imageBuildDir: "../../../.." + downloaddirectorypageblob: + testScenario: downloaddirectorypageblob + image: Dockerfile + imageBuildDir: "../../../.." + copysinglepageblob: + testScenario: copysinglepageblob + image: Dockerfile + imageBuildDir: "../../../.." + copydirectorypageblob: + testScenario: copydirectorypageblob + image: Dockerfile imageBuildDir: "../../../.." \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Azure.Storage.DataMovement.Blobs.Stress.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Azure.Storage.DataMovement.Blobs.Stress.csproj index 25553d42380ba..3d3602d85b43e 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Azure.Storage.DataMovement.Blobs.Stress.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Azure.Storage.DataMovement.Blobs.Stress.csproj @@ -34,6 +34,7 @@ + diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/BlobTestSetupHelper.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/BlobTestSetupHelper.cs index b71e59d9a92c7..69d812380e102 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/BlobTestSetupHelper.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/BlobTestSetupHelper.cs @@ -1,18 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.IO; using System.Threading; using System.Threading.Tasks; +using Azure.Storage.Shared; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized; +using NUnit.Framework; +using Azure.Storage.Blobs.Models; namespace Azure.Storage.DataMovement.Blobs.Stress { public static class BlobTestSetupHelper { - public static async Task CreateDirectoryBlockBlobsAsync( + private const int DefaultBufferSize = 4 * Constants.KB * Constants.KB; + + public static async Task CreateBlobsInDirectoryAsync( BlobContainerClient container, + BlobType blobType, string pathPrefix, int blobCount = 2, long objectLength = Constants.KB * 4, @@ -21,10 +28,27 @@ public static async Task CreateDirectoryBlockBlobsAsync( for (int i = 0; i < blobCount; i++) { string blobName = $"{pathPrefix}/{TestSetupHelper.Randomize("blob")}"; - await CreateBlockBlobAsync( + if (blobType == BlobType.Append) + { + await CreateAppendBlobAsync( + container.GetAppendBlobClient(blobName), + objectLength, + cancellationToken); + } + else if (blobType == BlobType.Page) + { + await CreatePageBlobAsync( + container.GetPageBlobClient(blobName), + objectLength, + cancellationToken); + } + else + { + await CreateBlockBlobAsync( container.GetBlockBlobClient(blobName), objectLength, cancellationToken); + } } } @@ -34,18 +58,52 @@ public static async Task CreateBlockBlobAsync( CancellationToken cancellationToken = default) { using Stream originalStream = await TestSetupHelper.CreateLimitedMemoryStream(objectLength.Value, cancellationToken: cancellationToken); - if (originalStream != default) + var data = new byte[0]; + using (var stream = new MemoryStream(data)) { - await blockBlobClient.UploadAsync(originalStream, cancellationToken: cancellationToken); + await blockBlobClient.UploadAsync( + content: stream, + cancellationToken: cancellationToken); } - else + } + + public static async Task CreateAppendBlobAsync( + AppendBlobClient appendBlobClient, + long? objectLength = Constants.KB * 4, + CancellationToken cancellationToken = default) + { + await appendBlobClient.CreateIfNotExistsAsync(); + if (objectLength.Value > 0) + { + using Stream originalStream = await TestSetupHelper.CreateLimitedMemoryStream(objectLength.Value, cancellationToken: cancellationToken); + long offset = 0; + long blockSize = Math.Min(DefaultBufferSize, objectLength.Value); + while (offset < objectLength.Value) + { + Stream partStream = WindowStream.GetWindow(originalStream, blockSize); + await appendBlobClient.AppendBlockAsync(partStream); + offset += blockSize; + } + } + } + + public static async Task CreatePageBlobAsync( + PageBlobClient pageBlobClient, + long? objectLength = Constants.KB * 4, + CancellationToken cancellationToken = default) + { + Assert.IsTrue(objectLength.Value % (Constants.KB / 2) == 0, "Cannot create page blob that's not a multiple of 512"); + await pageBlobClient.CreateIfNotExistsAsync(objectLength.Value); + if (objectLength.Value > 0) { - var data = new byte[0]; - using (var stream = new MemoryStream(data)) + using Stream originalStream = await TestSetupHelper.CreateLimitedMemoryStream(objectLength.Value, cancellationToken: cancellationToken); + long offset = 0; + long blockSize = Math.Min(DefaultBufferSize, objectLength.Value); + while (offset < objectLength.Value) { - await blockBlobClient.UploadAsync( - content: stream, - cancellationToken: cancellationToken); + Stream partStream = WindowStream.GetWindow(originalStream, blockSize); + await pageBlobClient.UploadPagesAsync(partStream, offset); + offset += blockSize; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs index a3b08eeb6811d..971ffe836a804 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs @@ -72,10 +72,8 @@ public static async Task GetTemporaryFileStorageResourceAsync( string localSourceFile = Path.Combine(prefixPath, fileName); // create a new file and copy contents of stream into it, and then close the FileStream // so the StagedUploadAsync call is not prevented from reading using its FileStream. - Console.Out.Write($"Creating File: {localSourceFile}.."); using (FileStream fileStream = File.Create(localSourceFile)) { - Console.Out.WriteLine("Copying Stream to File.."); await originalStream.CopyToAsync( fileStream, bufferSize, diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs index 43bfb97861516..6b6b98f89de17 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs @@ -14,15 +14,17 @@ namespace Azure.Storage.DataMovement.Blobs.Stress public abstract class BlobScenarioBase : TestScenarioBase { protected internal readonly Uri _destinationBlobUri; + protected internal int _blobSize; protected internal readonly TokenCredential _tokenCredential; protected internal BlobsStorageResourceProvider _blobsStorageResourceProvider; protected internal LocalFilesStorageResourceProvider _localFilesStorageResourceProvider; - protected internal BlobServiceClient _destinationServiceClient; + protected internal BlobServiceClient _blobServiceClient; protected internal readonly TransferManagerOptions _transferManagerOptions; protected internal readonly DataTransferOptions _dataTransferOptions; public BlobScenarioBase( - Uri destinationBlobUri, + Uri blobUri, + int? blobSize, TransferManagerOptions transferManagerOptions, DataTransferOptions dataTransferOptions, TokenCredential tokenCredential, @@ -30,13 +32,14 @@ public BlobScenarioBase( string testRunId) : base(metrics, testRunId) { - _destinationBlobUri = destinationBlobUri; + _destinationBlobUri = blobUri; + _blobSize = blobSize != default ? blobSize.Value : DataMovementBlobStressConstants.DefaultObjectSize; _transferManagerOptions = transferManagerOptions; _dataTransferOptions = dataTransferOptions; _tokenCredential = tokenCredential; _blobsStorageResourceProvider = new BlobsStorageResourceProvider(tokenCredential); _localFilesStorageResourceProvider = new LocalFilesStorageResourceProvider(); - _destinationServiceClient = new BlobServiceClient(destinationBlobUri, tokenCredential); + _blobServiceClient = new BlobServiceClient(blobUri, tokenCredential); } } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleDownloadScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleDownloadScenario.cs deleted file mode 100644 index 725849a76b5ae..0000000000000 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleDownloadScenario.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Storage.Stress; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -using Azure.Storage.DataMovement.Tests; - -namespace Azure.Storage.DataMovement.Blobs.Stress -{ - public class BlobSingleDownloadScenario : BlobScenarioBase - { - private int? _blobSize; - public BlobSingleDownloadScenario( - Uri sourceBlobUri, - int? blobSize, - TransferManagerOptions transferManagerOptions, - DataTransferOptions dataTransferOptions, - TokenCredential tokenCredential, - Metrics metrics, - string testRunId) - : base(sourceBlobUri, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) - { - _blobSize = blobSize; - } - - public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleBlockBlob; - - public override async Task RunTestAsync(CancellationToken cancellationToken) - { - string sourceContainerName = TestSetupHelper.Randomize("container"); - BlobContainerClient sourceContainerClient = _destinationServiceClient.GetBlobContainerClient(sourceContainerName); - await sourceContainerClient.CreateIfNotExistsAsync(); - - DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); - - string blobName = TestSetupHelper.Randomize("blob"); - - // Create Source Storage Resource - BlockBlobClient sourceBlob = sourceContainerClient.GetBlockBlobClient(blobName); - await BlobTestSetupHelper.CreateBlockBlobAsync( - sourceContainerClient.GetBlockBlobClient(blobName), - _blobSize, - cancellationToken); - StorageResource sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); - - // Create Local Destination Storage Resource - StorageResource destinationResource = _localFilesStorageResourceProvider.FromFile(Path.Combine(disposingLocalDirectory.DirectoryPath,blobName)); - - // Start Transfer - TransferManager transferManager = new TransferManager(_transferManagerOptions); - await new TransferValidator() - { - TransferManager = new(_transferManagerOptions) - }.TransferAndVerifyAsync( - sourceResource as StorageResourceItem, - destinationResource as StorageResourceItem, - async cToken => await sourceBlob.OpenReadAsync(default, cToken), - cToken => Task.FromResult(File.OpenRead(sourceResource.Uri.AbsolutePath) as Stream), - options: _dataTransferOptions, - cancellationToken: cancellationToken); - } - } -} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..ce04f95590196 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobDirectoryScenario.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyAppendBlobDirectoryScenario : CopyBlobDirectoryScenarioBase + { + public CopyAppendBlobDirectoryScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryAppendBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobSingleScenario.cs new file mode 100644 index 0000000000000..fae8005dbace2 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyAppendBlobSingleScenario.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyAppendBlobSingleScenario : CopyBlobSingleScenarioBase + { + public CopyAppendBlobSingleScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopySingleAppendBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs new file mode 100644 index 0000000000000..893d5fc0a566a --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Models; +using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public abstract class CopyBlobDirectoryScenarioBase : BlobScenarioBase + { + private int _blobCount; + private readonly BlobServiceClient _sourceServiceClient; + + public CopyBlobDirectoryScenarioBase( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, destinationTokenCredential, metrics, testRunId) + { + _sourceServiceClient = new BlobServiceClient(sourceBlobUri, sourceTokenCredential); + _blobCount = blobCount ?? DataMovementBlobStressConstants.DefaultObjectCount; + } + + public async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken) + { + string pathPrefix = TestSetupHelper.Randomize("dir"); + string sourceContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient sourceContainerClient = _sourceServiceClient.GetBlobContainerClient(sourceContainerName); + await sourceContainerClient.CreateIfNotExistsAsync(); + await BlobTestSetupHelper.CreateBlobsInDirectoryAsync( + sourceContainerClient, + blobType, + pathPrefix, + _blobCount, + _blobSize, + cancellationToken); + + string destinationContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient destinationContainerClient = _blobServiceClient.GetBlobContainerClient(destinationContainerName); + await destinationContainerClient.CreateIfNotExistsAsync(); + + // Create Source Blob Container Storage Resource + StorageResource sourceResource = _blobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobDirectoryPrefix = pathPrefix }); + + // Create Destination Blob Container Storage Resource + StorageResource destinationResource = _blobsStorageResourceProvider.FromClient( + destinationContainerClient, + new() + { + BlobDirectoryPrefix = pathPrefix, + BlobType = new(blobType) + }); + + // Start Transfer + await new TransferValidator() + { + TransferManager = new(_transferManagerOptions) + }.TransferAndVerifyAsync( + sourceResource, + destinationResource, + TransferValidator.GetBlobLister(sourceContainerClient, pathPrefix), + TransferValidator.GetBlobLister(destinationContainerClient, pathPrefix), + _blobCount, + _dataTransferOptions, + cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs new file mode 100644 index 0000000000000..a52013e28dc68 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Blobs.Specialized; +using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public abstract class CopyBlobSingleScenarioBase : BlobScenarioBase + { + private readonly BlobServiceClient _sourceServiceClient; + + public CopyBlobSingleScenarioBase( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, destinationTokenCredential, metrics, testRunId) + { + _sourceServiceClient = new BlobServiceClient(sourceBlobUri, sourceTokenCredential); + } + + public async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken) + { + string sourceContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient sourceContainerClient = _sourceServiceClient.GetBlobContainerClient(sourceContainerName); + await sourceContainerClient.CreateIfNotExistsAsync(); + + string destinationContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient destinationContainerClient = _blobServiceClient.GetBlobContainerClient(destinationContainerName); + await destinationContainerClient.CreateIfNotExistsAsync(); + string blobName = TestSetupHelper.Randomize("blob"); + + // Create Source and Destination Storage Resource + BlobBaseClient sourceBaseBlob; + StorageResource sourceResource; + BlobBaseClient destinationBaseBlob; + StorageResource destinationResource; + if (blobType == BlobType.Append) + { + AppendBlobClient sourceBlob = sourceContainerClient.GetAppendBlobClient(blobName); + await BlobTestSetupHelper.CreateAppendBlobAsync( + sourceContainerClient.GetAppendBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + + AppendBlobClient destinationBlob = destinationContainerClient.GetAppendBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } + else if (blobType == BlobType.Page) + { + PageBlobClient sourceBlob = sourceContainerClient.GetPageBlobClient(blobName); + await BlobTestSetupHelper.CreatePageBlobAsync( + sourceContainerClient.GetPageBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + + PageBlobClient destinationBlob = destinationContainerClient.GetPageBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } + else + { + BlockBlobClient sourceBlob = sourceContainerClient.GetBlockBlobClient(blobName); + await BlobTestSetupHelper.CreateBlockBlobAsync( + sourceContainerClient.GetBlockBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + + BlockBlobClient destinationBlob = destinationContainerClient.GetBlockBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } + + // Start Transfer + await new TransferValidator() + { + TransferManager = new(_transferManagerOptions) + }.TransferAndVerifyAsync( + sourceResource, + destinationResource, + async cToken => await sourceBaseBlob.OpenReadAsync(default, cToken), + async cToken => await destinationBaseBlob.OpenReadAsync(default, cToken), + options: _dataTransferOptions, + cancellationToken: cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..783c45004f110 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobDirectoryScenario.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyBlockBlobDirectoryScenario : CopyBlobDirectoryScenarioBase + { + public CopyBlockBlobDirectoryScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryBlockBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobSingleScenario.cs new file mode 100644 index 0000000000000..906f713106bc4 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlockBlobSingleScenario.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyBlockBlobSingleScenario : CopyBlobSingleScenarioBase + { + public CopyBlockBlobSingleScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopySingleBlockBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..d1776fcd22a49 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobDirectoryScenario.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyPageBlobDirectoryScenario : CopyBlobDirectoryScenarioBase + { + public CopyPageBlobDirectoryScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryPageBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Page, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobSingleScenario.cs new file mode 100644 index 0000000000000..3ff37d142230e --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyPageBlobSingleScenario.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class CopyPageBlobSingleScenario : CopyBlobSingleScenarioBase + { + public CopyPageBlobSingleScenario( + Uri sourceBlobUri, + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential sourceTokenCredential, + TokenCredential destinationTokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, sourceTokenCredential, destinationTokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.CopySinglePageBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Page, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..3f5facb834bd2 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadAppendBlobDirectoryScenario : DownloadBlobDirectoryScenarioBase + { + public DownloadAppendBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) : + base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryAppendBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobSingleScenario.cs new file mode 100644 index 0000000000000..079364cb85042 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadAppendBlobSingleScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadAppendBlobSingleScenario : DownloadBlobSingleScenarioBase + { + public DownloadAppendBlobSingleScenario( + Uri sourceBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleBlockBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs new file mode 100644 index 0000000000000..bfb644feb2f2d --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Models; +using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public abstract class DownloadBlobDirectoryScenarioBase : BlobScenarioBase + { + private int _blobCount; + public DownloadBlobDirectoryScenarioBase( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) : + base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + _blobCount = blobCount ?? DataMovementBlobStressConstants.DefaultObjectCount; + } + + public async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken) + { + // Create Source Blob Container + string sourceContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient sourceContainerClient = _blobServiceClient.GetBlobContainerClient(sourceContainerName); + await sourceContainerClient.CreateIfNotExistsAsync(cancellationToken: cancellationToken); + + // Create Destination Test Local Directory + string pathPrefix = TestSetupHelper.Randomize("dir"); + DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(pathPrefix); + + // Create Blobs in source container + await BlobTestSetupHelper.CreateBlobsInDirectoryAsync( + sourceContainerClient, + blobType, + pathPrefix, + _blobCount, + _blobSize, + cancellationToken); + + // Create Destination Local Storage Resource + StorageResource sourceResource = await TestSetupHelper.GetTemporaryFileStorageResourceAsync(disposingLocalDirectory.DirectoryPath); + + // Create Destination Storage Resource + StorageResource destinationResource = _blobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobDirectoryPrefix = pathPrefix }); + + // Start Transfer + await new TransferValidator() + { + TransferManager = new(_transferManagerOptions) + }.TransferAndVerifyAsync( + sourceResource, + destinationResource, + TransferValidator.GetBlobLister(sourceContainerClient, pathPrefix), + TransferValidator.GetLocalFileLister(disposingLocalDirectory.DirectoryPath), + _blobCount, + _dataTransferOptions, + cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs new file mode 100644 index 0000000000000..58a6f0dbf30ae --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Specialized; +using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public abstract class DownloadBlobSingleScenarioBase : BlobScenarioBase + { + public DownloadBlobSingleScenarioBase( + Uri sourceBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken) + { + string sourceContainerName = TestSetupHelper.Randomize("container"); + BlobContainerClient sourceContainerClient = _blobServiceClient.GetBlobContainerClient(sourceContainerName); + await sourceContainerClient.CreateIfNotExistsAsync(cancellationToken: cancellationToken); + + DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + + string blobName = TestSetupHelper.Randomize("blob"); + + // Create Source Storage Resource + BlobBaseClient sourceBaseBlob; + StorageResource sourceResource; + if (blobType == BlobType.Append) + { + AppendBlobClient sourceBlob = sourceContainerClient.GetAppendBlobClient(blobName); + await BlobTestSetupHelper.CreateAppendBlobAsync( + sourceContainerClient.GetAppendBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + } + else if (blobType == BlobType.Page) + { + PageBlobClient sourceBlob = sourceContainerClient.GetPageBlobClient(blobName); + await BlobTestSetupHelper.CreatePageBlobAsync( + sourceContainerClient.GetPageBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + } + else + { + BlockBlobClient sourceBlob = sourceContainerClient.GetBlockBlobClient(blobName); + await BlobTestSetupHelper.CreateBlockBlobAsync( + sourceContainerClient.GetBlockBlobClient(blobName), + _blobSize, + cancellationToken); + sourceBaseBlob = sourceBlob; + sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + } + + // Create Local Destination Storage Resource + StorageResource destinationResource = _localFilesStorageResourceProvider.FromFile(Path.Combine(disposingLocalDirectory.DirectoryPath, blobName)); + + // Start Transfer + await new TransferValidator() + { + TransferManager = new(_transferManagerOptions) + }.TransferAndVerifyAsync( + sourceResource as StorageResourceItem, + destinationResource as StorageResourceItem, + async cToken => await sourceBaseBlob.OpenReadAsync(default, cToken), + cToken => Task.FromResult(File.OpenRead(sourceResource.Uri.AbsolutePath) as Stream), + options: _dataTransferOptions, + cancellationToken: cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..331ca15ec3026 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadBlockBlobDirectoryScenario : DownloadBlobDirectoryScenarioBase + { + public DownloadBlockBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) : + base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryBlockBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobSingleScenario.cs new file mode 100644 index 0000000000000..6e02ca1a4c473 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlockBlobSingleScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadBlockBlobSingleScenario : DownloadBlobSingleScenarioBase + { + public DownloadBlockBlobSingleScenario( + Uri sourceBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleBlockBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..41ee4a9687b56 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Stress; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadPageBlobDirectoryScenario : DownloadBlobDirectoryScenarioBase + { + public DownloadPageBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) : + base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryPageBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Page, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobSingleScenario.cs new file mode 100644 index 0000000000000..7088f1ce5d0a2 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadPageBlobSingleScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class DownloadPageBlobSingleScenario : DownloadBlobSingleScenarioBase + { + public DownloadPageBlobSingleScenario( + Uri sourceBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(sourceBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSinglePageBlob; + + public override async Task RunTestAsync(CancellationToken cancellationToken) + => await RunTestInternalAsync(BlobType.Page, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/TestScenarioName.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/TestScenarioName.cs index 6c85b5ee64e67..808799e42f5ce 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/TestScenarioName.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/TestScenarioName.cs @@ -5,9 +5,24 @@ namespace Azure.Storage.DataMovement.Blobs.Stress { public enum TestScenarioName { - UploadSingleBlockBlobTest, - UploadDirectoryBlockBlobTest, - DownloadSingleBlockBlobTest, + UploadSingleBlockBlob, + UploadDirectoryBlockBlob, + DownloadSingleBlockBlob, + DownloadDirectoryBlockBlob, + CopySingleBlockBlob, + CopyDirectoryBlockBlob, + UploadSingleAppendBlob, + UploadDirectoryAppendBlob, + DownloadSingleAppendBlob, + DownloadDirectoryAppendBlob, + CopySingleAppendBlob, + CopyDirectoryAppendBlob, + UploadSinglePageBlob, + UploadDirectoryPageBlob, + DownloadSinglePageBlob, + DownloadDirectoryPageBlob, + CopySinglePageBlob, + CopyDirectoryPageBlob, None = default } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..8b7f63f9dddb1 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadAppendBlobDirectoryScenario : UploadBlobDirectoryScenarioBase + { + public UploadAppendBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryAppendBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobSingleScenario.cs new file mode 100644 index 0000000000000..9aaabb5a38850 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadAppendBlobSingleScenario.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadAppendBlobSingleScenario : UploadBlobSingleScenarioBase + { + public UploadAppendBlobSingleScenario( + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleAppendBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken = default) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobDirectoryUploadScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs similarity index 63% rename from sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobDirectoryUploadScenario.cs rename to sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs index b59d2b825234e..9db7441966d14 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobDirectoryUploadScenario.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs @@ -7,15 +7,15 @@ using Azure.Core; using Azure.Storage.Stress; using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Models; using Azure.Storage.DataMovement.Tests; namespace Azure.Storage.DataMovement.Blobs.Stress { - public class BlobDirectoryUploadScenario : BlobScenarioBase + public abstract class UploadBlobDirectoryScenarioBase : BlobScenarioBase { - private int? _blobSize; private int _blobCount; - public BlobDirectoryUploadScenario( + public UploadBlobDirectoryScenarioBase( Uri destinationBlobUri, int? blobSize, int? blobCount, @@ -24,39 +24,39 @@ public BlobDirectoryUploadScenario( TokenCredential tokenCredential, Metrics metrics, string testRunId) - : base(destinationBlobUri, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) { - _blobSize = blobSize; - _blobCount = blobCount != default ? blobCount.Value : 50; + _blobCount = blobCount ?? DataMovementBlobStressConstants.DefaultObjectCount; } - public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryBlockBlob; - - public override async Task RunTestAsync(CancellationToken cancellationToken) + public async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken) { // Create test local directory - DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); + string pathPrefix = TestSetupHelper.Randomize("dir"); + DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(pathPrefix); // Create destination blob container string destinationContainerName = TestSetupHelper.Randomize("container"); - BlobContainerClient destinationContainerClient = _destinationServiceClient.GetBlobContainerClient(destinationContainerName); + BlobContainerClient destinationContainerClient = _blobServiceClient.GetBlobContainerClient(destinationContainerName); await destinationContainerClient.CreateIfNotExistsAsync(); // Create Local Files - await TestSetupHelper.CreateLocalFilesToUploadAsync(disposingLocalDirectory.DirectoryPath, _blobCount, _blobSize); + await TestSetupHelper.CreateLocalFilesToUploadAsync( + disposingLocalDirectory.DirectoryPath, + _blobCount, + _blobSize); // Create Local Source Storage Resource StorageResource sourceResource = await TestSetupHelper.GetTemporaryFileStorageResourceAsync(disposingLocalDirectory.DirectoryPath); // Create Destination Storage Resource - BlobUriBuilder blobUriBuilder = new BlobUriBuilder(_destinationBlobUri) - { - BlobContainerName = destinationContainerName, - }; - StorageResource destinationResource = _blobsStorageResourceProvider.FromContainer(blobUriBuilder.ToUri().AbsoluteUri); - - // Initialize TransferManager - TransferManager transferManager = new TransferManager(); + StorageResource destinationResource = _blobsStorageResourceProvider.FromClient( + destinationContainerClient, + new() + { + BlobDirectoryPrefix = pathPrefix, + BlobType = new(blobType) + }); // Upload await new TransferValidator() diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleUploadScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs similarity index 52% rename from sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleUploadScenario.cs rename to sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs index 540d6a7e450f8..f45c27bfd3f1d 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobSingleUploadScenario.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs @@ -10,32 +10,28 @@ using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized; using Azure.Storage.DataMovement.Tests; +using Azure.Storage.Blobs.Models; namespace Azure.Storage.DataMovement.Blobs.Stress { - public class BlobSingleUploadScenario : BlobScenarioBase + public abstract class UploadBlobSingleScenarioBase : BlobScenarioBase { - private int _blobSize; - public BlobSingleUploadScenario( - Uri destinationBlobUri, + protected UploadBlobSingleScenarioBase( + Uri blobUri, int? blobSize, TransferManagerOptions transferManagerOptions, DataTransferOptions dataTransferOptions, TokenCredential tokenCredential, Metrics metrics, - string testRunId) - : base(destinationBlobUri, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + string testRunId) : base(blobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) { - _blobSize = blobSize.HasValue ? blobSize.Value : 100; } - public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleBlockBlob; - - public override async Task RunTestAsync(CancellationToken cancellationToken) + internal async Task RunTestInternalAsync(BlobType blobType, CancellationToken cancellationToken = default) { DisposingLocalDirectory disposingLocalDirectory = DisposingLocalDirectory.GetTestDirectory(); string destinationContainerName = TestSetupHelper.Randomize("container"); - BlobContainerClient destinationContainerClient = _destinationServiceClient.GetBlobContainerClient(destinationContainerName); + BlobContainerClient destinationContainerClient = _blobServiceClient.GetBlobContainerClient(destinationContainerName); await destinationContainerClient.CreateIfNotExistsAsync(); string blobName = TestSetupHelper.Randomize("blob"); @@ -47,13 +43,26 @@ public override async Task RunTestAsync(CancellationToken cancellationToken) cancellationToken: cancellationToken); // Create Destination Storage Resource - BlobUriBuilder blobUriBuilder = new BlobUriBuilder(_destinationBlobUri) + BlobBaseClient destinationBaseBlob; + StorageResource destinationResource; + if (blobType == BlobType.Append) + { + AppendBlobClient destinationBlob = destinationContainerClient.GetAppendBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } + else if (blobType == BlobType.Page) + { + PageBlobClient destinationBlob = destinationContainerClient.GetPageBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } + else { - BlobContainerName = destinationContainerName, - BlobName = blobName - }; - BlockBlobClient destinationBlob = destinationContainerClient.GetBlockBlobClient(blobName); - StorageResource destinationResource = _blobsStorageResourceProvider.FromBlob(blobUriBuilder.ToUri().AbsoluteUri); + BlockBlobClient destinationBlob = destinationContainerClient.GetBlockBlobClient(blobName); + destinationBaseBlob = destinationBlob; + destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + } // Start Transfer await new TransferValidator() @@ -63,7 +72,7 @@ public override async Task RunTestAsync(CancellationToken cancellationToken) sourceResource, destinationResource, cToken => Task.FromResult(File.OpenRead(sourceResource.Uri.AbsolutePath) as Stream), - async cToken => await destinationBlob.OpenReadAsync(default, cToken), + async cToken => await destinationBaseBlob.OpenReadAsync(default, cToken), options: _dataTransferOptions, cancellationToken: cancellationToken); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..6a884a66875c6 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadBlockBlobDirectoryScenario : UploadBlobDirectoryScenarioBase + { + public UploadBlockBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryBlockBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Block, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobSingleScenario.cs new file mode 100644 index 0000000000000..7d59645355ace --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlockBlobSingleScenario.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadBlockBlobSingleScenario : UploadBlobSingleScenarioBase + { + public UploadBlockBlobSingleScenario( + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleBlockBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken = default) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobDirectoryScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobDirectoryScenario.cs new file mode 100644 index 0000000000000..985610a3e2192 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobDirectoryScenario.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadPageBlobDirectoryScenario : UploadBlobDirectoryScenarioBase + { + public UploadPageBlobDirectoryScenario( + Uri destinationBlobUri, + int? blobSize, + int? blobCount, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, blobCount, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryPageBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken) + => RunTestInternalAsync(BlobType.Page, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobSingleScenario.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobSingleScenario.cs new file mode 100644 index 0000000000000..b70bb2a290cb8 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadPageBlobSingleScenario.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Storage.Stress; +using Azure.Storage.Blobs.Models; + +namespace Azure.Storage.DataMovement.Blobs.Stress +{ + public class UploadPageBlobSingleScenario : UploadBlobSingleScenarioBase + { + public UploadPageBlobSingleScenario( + Uri destinationBlobUri, + int? blobSize, + TransferManagerOptions transferManagerOptions, + DataTransferOptions dataTransferOptions, + TokenCredential tokenCredential, + Metrics metrics, + string testRunId) + : base(destinationBlobUri, blobSize, transferManagerOptions, dataTransferOptions, tokenCredential, metrics, testRunId) + { + } + + public override string Name => DataMovementBlobStressConstants.TestScenarioNameStr.UploadSinglePageBlob; + + public override Task RunTestAsync(CancellationToken cancellationToken = default) + => RunTestInternalAsync(BlobType.Append, cancellationToken); + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/DataMovementBlobStressConstants.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/DataMovementBlobStressConstants.cs index e217a7e0dc5a6..9e4d13bef6145 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/DataMovementBlobStressConstants.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/DataMovementBlobStressConstants.cs @@ -5,6 +5,9 @@ namespace Azure.Storage.DataMovement.Blobs.Stress { internal class DataMovementBlobStressConstants { + public const int DefaultObjectSize = Constants.KB * 4; + public const int DefaultObjectCount = 50; + public static partial class EnvironmentVariables { // Shared Resources @@ -40,6 +43,21 @@ public static partial class TestScenarioNameStr public const string UploadSingleBlockBlob = "uploadsingleblockblob"; public const string UploadDirectoryBlockBlob = "uploaddirectoryblockBlob"; public const string DownloadSingleBlockBlob = "downloadsingleblockblob"; + public const string DownloadDirectoryBlockBlob = "downloaddirectoryblockblob"; + public const string CopySingleBlockBlob = "copysingleblockblob"; + public const string CopyDirectoryBlockBlob = "copydirectoryblockblob"; + public const string UploadSingleAppendBlob = "uploadsingleappendblob"; + public const string UploadDirectoryAppendBlob = "uploaddirectoryappendblob"; + public const string DownloadSingleAppendBlob = "downloadsingleappendblob"; + public const string DownloadDirectoryAppendBlob = "downloaddirectoryappendblob"; + public const string CopySingleAppendBlob = "copysingleappendblob"; + public const string CopyDirectoryAppendBlob = "copydirectoryappendblob"; + public const string UploadSinglePageBlob = "uploadsinglepageblob"; + public const string UploadDirectoryPageBlob = "uploaddirectorypageblob"; + public const string DownloadSinglePageBlob = "downloadsinglepageblob"; + public const string DownloadDirectoryPageBlob = "downloaddirectorypageblob"; + public const string CopySinglePageBlob = "copysinglepageblob"; + public const string CopyDirectoryPageBlob = "copydirectorypageblob"; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/Program.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/Program.cs index d101e67448a64..fd4c16d3af8af 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/Program.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/src/Program.cs @@ -67,7 +67,7 @@ private static async Task RunOptions(Options opts) metrics.Client.Context.GlobalProperties["TestName"] = opts.Test; string guid = Guid.NewGuid().ToString(); - metrics.Client.TrackEvent("Starting a test run."); + metrics.Client.TrackEvent($"Starting a test {testScenarioName} run."); TestScenarioBase testScenario = null; TransferManagerOptions transferManagerOptions = new TransferManagerOptions() @@ -81,8 +81,8 @@ private static async Task RunOptions(Options opts) }; switch (testScenarioName) { - case TestScenarioName.UploadSingleBlockBlobTest: - testScenario = new BlobSingleUploadScenario( + case TestScenarioName.UploadSingleBlockBlob: + testScenario = new UploadBlockBlobSingleScenario( new Uri(blobEndpoint), opts.Size, transferManagerOptions, @@ -91,8 +91,8 @@ private static async Task RunOptions(Options opts) metrics, guid); break; - case TestScenarioName.UploadDirectoryBlockBlobTest: - testScenario = new BlobDirectoryUploadScenario( + case TestScenarioName.UploadDirectoryBlockBlob: + testScenario = new UploadBlockBlobDirectoryScenario( destinationBlobUri: new Uri(blobEndpoint), blobSize: opts.Size, blobCount: opts.Count, @@ -102,8 +102,8 @@ private static async Task RunOptions(Options opts) metrics: metrics, testRunId: guid); break; - case TestScenarioName.DownloadSingleBlockBlobTest: - testScenario = new BlobSingleDownloadScenario( + case TestScenarioName.DownloadSingleBlockBlob: + testScenario = new DownloadBlockBlobSingleScenario( new Uri(blobEndpoint), opts.Size, transferManagerOptions, @@ -112,6 +112,176 @@ private static async Task RunOptions(Options opts) metrics, guid); break; + case TestScenarioName.DownloadDirectoryBlockBlob: + testScenario = new DownloadBlockBlobDirectoryScenario( + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopySingleBlockBlob: + testScenario = new CopyBlockBlobSingleScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopyDirectoryBlockBlob: + testScenario = new CopyBlockBlobDirectoryScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.UploadSingleAppendBlob: + testScenario = new UploadAppendBlobSingleScenario( + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.UploadDirectoryAppendBlob: + testScenario = new UploadAppendBlobDirectoryScenario( + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.DownloadSingleAppendBlob: + testScenario = new DownloadAppendBlobSingleScenario( + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.DownloadDirectoryAppendBlob: + testScenario = new DownloadAppendBlobDirectoryScenario( + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopySingleAppendBlob: + testScenario = new CopyAppendBlobSingleScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopyDirectoryAppendBlob: + testScenario = new CopyAppendBlobDirectoryScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.UploadSinglePageBlob: + testScenario = new UploadPageBlobSingleScenario( + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.UploadDirectoryPageBlob: + testScenario = new UploadPageBlobDirectoryScenario( + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.DownloadSinglePageBlob: + testScenario = new DownloadPageBlobSingleScenario( + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.DownloadDirectoryPageBlob: + testScenario = new DownloadPageBlobDirectoryScenario( + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopySinglePageBlob: + testScenario = new CopyPageBlobSingleScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; + case TestScenarioName.CopyDirectoryPageBlob: + testScenario = new CopyPageBlobDirectoryScenario( + new Uri(blobEndpoint), + new Uri(blobEndpoint), + opts.Size, + opts.Count, + transferManagerOptions, + transferOptions, + tokenCredential, + tokenCredential, + metrics, + guid); + break; default: throw new Exception("No Scenario or Invalid scenario passed"); } @@ -161,9 +331,24 @@ private static async Task RunOptions(Options opts) /// public static TestScenarioName StringToTestScenario(string testScenario) => testScenario switch { - DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleBlockBlob => TestScenarioName.UploadSingleBlockBlobTest, - DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryBlockBlob => TestScenarioName.UploadDirectoryBlockBlobTest, - DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleBlockBlob => TestScenarioName.DownloadSingleBlockBlobTest, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleBlockBlob => TestScenarioName.UploadSingleBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryBlockBlob => TestScenarioName.UploadDirectoryBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleBlockBlob => TestScenarioName.DownloadSingleBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryBlockBlob => TestScenarioName.DownloadDirectoryBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopySingleBlockBlob => TestScenarioName.CopySingleBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryBlockBlob => TestScenarioName.CopyDirectoryBlockBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadSingleAppendBlob => TestScenarioName.UploadSingleAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryAppendBlob => TestScenarioName.UploadDirectoryAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSingleAppendBlob => TestScenarioName.DownloadSingleAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryAppendBlob => TestScenarioName.DownloadDirectoryAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopySingleAppendBlob => TestScenarioName.CopySingleAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryAppendBlob => TestScenarioName.CopyDirectoryAppendBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadSinglePageBlob => TestScenarioName.UploadSinglePageBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.UploadDirectoryPageBlob => TestScenarioName.UploadDirectoryPageBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadSinglePageBlob => TestScenarioName.DownloadSinglePageBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.DownloadDirectoryPageBlob => TestScenarioName.DownloadDirectoryPageBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopySinglePageBlob => TestScenarioName.CopySinglePageBlob, + DataMovementBlobStressConstants.TestScenarioNameStr.CopyDirectoryPageBlob => TestScenarioName.CopyDirectoryPageBlob, _ => throw new ArgumentNullException(), }; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/templates/stress-test-job.yaml b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/templates/stress-test-job.yaml index 5584edb0945a6..e8a083aaeedb0 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/templates/stress-test-job.yaml +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/templates/stress-test-job.yaml @@ -25,12 +25,11 @@ spec: {{- include "stress-test-addons.container-env" . | nindent 6 }} - name: main image: {{ .Stress.imageTag }} - command: ['sh', '-c'] + command: ['dotnet', "Azure.Storage.DataMovement.Stress.dll", "--test", "{{ .Stress.testScenario }}"] args: - | set -xa; set -o pipefail; - keytool -import -alias test -file /mnt/outputs/dev-cert.pfx -keystore ${JAVA_HOME}/lib/security/cacerts -noprompt -keypass changeit -storepass changeit; mkdir -p "$DEBUG_SHARE"; . /mnt/outputs/.env; export AZURE_HTTP_CLIENT_IMPLEMENTATION=com.azure.core.http.netty.NettyAsyncHttpClientProvider; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj index f8b62d0b947e2..58985a8210885 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj @@ -47,6 +47,7 @@ + From 43fc021007689ca13bb372293103ca985af2b0c9 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:11:16 -0700 Subject: [PATCH 05/43] Sync eng/common directory with azure-sdk-tools for PR 9092 (#46413) * Export the subscription data from the service connection * Update deploy-test-resources.yml --------- Co-authored-by: Wes Haggard Co-authored-by: Wes Haggard --- eng/common/TestResources/deploy-test-resources.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index 840acfd9e40b3..a9b224155a111 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -59,6 +59,20 @@ steps: ${{ parameters.SubscriptionConfiguration }} '@ | ConvertFrom-Json -AsHashtable; + $context = Get-AzContext + $subscriptionConfiguration["SubscriptionId"] = $context.Subscription.Id + $subscriptionConfiguration["TenantId"] = $context.Subscription.TenantId + $subscriptionConfiguration["TestApplicationId"] = $context.Account.Id + $subscriptionConfiguration["ProvisionerApplicationId"] = $context.Account.Id + + $principal = Get-AzADServicePrincipal -ApplicationId $context.Account.Id + $subscriptionConfiguration["TestApplicationOid"] = $principal.Id + $subscriptionConfiguration["ProvisionerApplicationOid"] = $principal.Id + + Write-Host ($subscriptionConfiguration | ConvertTo-Json) + # Write the new SubscriptionConfiguration to be used by the remove test resources + Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$($subscriptionConfiguration | ConvertTo-Json -Compress)" + # The subscriptionConfiguration may have ArmTemplateParameters defined, so # pass those in via the ArmTemplateParameters flag, and handle any # additional parameters from the pipelines via AdditionalParameters From 42219dc698e7dd75663347b985d95f4569889d6d Mon Sep 17 00:00:00 2001 From: tg-msft Date: Thu, 3 Oct 2024 15:58:30 -0700 Subject: [PATCH 06/43] Azure.Provisioning: rename `ResourceName` to `IdentifierName` (#46415) * Azure.Provisioning: rename ResourceName to IdentifierName * Validate identifier names --- ...sioning.AppConfiguration.netstandard2.0.cs | 18 +- .../src/Generated/AppConfigurationKeyValue.cs | 22 +- ...pConfigurationPrivateEndpointConnection.cs | 24 +- .../src/Generated/AppConfigurationReplica.cs | 22 +- .../src/Generated/AppConfigurationStore.cs | 36 +- ...ovisioning.AppContainers.netstandard2.0.cs | 54 +-- .../src/Generated/ContainerApp.cs | 22 +- .../src/Generated/ContainerAppAuthConfig.cs | 22 +- .../ContainerAppConnectedEnvironment.cs | 22 +- ...ainerAppConnectedEnvironmentCertificate.cs | 24 +- ...nerAppConnectedEnvironmentDaprComponent.cs | 24 +- ...ContainerAppConnectedEnvironmentStorage.cs | 22 +- .../src/Generated/ContainerAppJob.cs | 22 +- .../ContainerAppManagedCertificate.cs | 22 +- .../ContainerAppManagedEnvironment.cs | 34 +- ...ntainerAppManagedEnvironmentCertificate.cs | 24 +- ...ainerAppManagedEnvironmentDaprComponent.cs | 24 +- .../ContainerAppManagedEnvironmentStorage.cs | 22 +- .../Generated/ContainerAppSourceControl.cs | 22 +- ....Provisioning.AppService.netstandard2.0.cs | 292 ++++++++-------- .../src/Generated/AppCertificate.cs | 22 +- .../src/Generated/AppServiceCertificate.cs | 22 +- .../Generated/AppServiceCertificateOrder.cs | 22 +- .../src/Generated/AppServiceDomain.cs | 22 +- .../src/Generated/AppServiceEnvironment.cs | 22 +- .../src/Generated/AppServicePlan.cs | 22 +- ...vicePlanVirtualNetworkConnectionGateway.cs | 24 +- .../src/Generated/AppServiceSourceControl.cs | 22 +- .../Generated/AseV3NetworkingConfiguration.cs | 22 +- .../Generated/CustomDnsSuffixConfiguration.cs | 22 +- .../Generated/DomainOwnershipIdentifier.cs | 22 +- .../HostingEnvironmentMultiRolePool.cs | 22 +- ...ingEnvironmentPrivateEndpointConnection.cs | 24 +- .../Generated/HostingEnvironmentWorkerPool.cs | 22 +- .../src/Generated/KubeEnvironment.cs | 22 +- .../src/Generated/LogsSiteConfig.cs | 22 +- .../src/Generated/LogsSiteSlotConfig.cs | 22 +- .../src/Generated/PublishingUser.cs | 22 +- ...ScmSiteBasicPublishingCredentialsPolicy.cs | 22 +- ...iteSlotBasicPublishingCredentialsPolicy.cs | 24 +- .../src/Generated/SiteContainer.cs | 22 +- .../src/Generated/SiteDeployment.cs | 22 +- .../SiteDomainOwnershipIdentifier.cs | 22 +- .../src/Generated/SiteExtension.cs | 22 +- .../src/Generated/SiteFunction.cs | 22 +- .../src/Generated/SiteHostNameBinding.cs | 22 +- .../SiteHybridConnectionNamespaceRelay.cs | 22 +- .../src/Generated/SiteInstanceExtension.cs | 22 +- .../src/Generated/SiteNetworkConfig.cs | 22 +- .../SitePrivateEndpointConnection.cs | 22 +- .../src/Generated/SitePublicCertificate.cs | 22 +- .../src/Generated/SiteSlotDeployment.cs | 22 +- .../SiteSlotDomainOwnershipIdentifier.cs | 22 +- .../src/Generated/SiteSlotExtension.cs | 22 +- .../src/Generated/SiteSlotFunction.cs | 22 +- .../src/Generated/SiteSlotHostNameBinding.cs | 22 +- .../SiteSlotHybridConnectionNamespaceRelay.cs | 22 +- .../Generated/SiteSlotInstanceExtension.cs | 22 +- .../src/Generated/SiteSlotNetworkConfig.cs | 22 +- .../SiteSlotPrivateEndpointConnection.cs | 22 +- .../src/Generated/SiteSlotSiteContainer.cs | 22 +- .../SiteSlotVirtualNetworkConnection.cs | 22 +- ...SiteSlotVirtualNetworkConnectionGateway.cs | 22 +- .../Generated/SiteVirtualNetworkConnection.cs | 22 +- .../SiteVirtualNetworkConnectionGateway.cs | 22 +- .../src/Generated/SlotConfigNames.cs | 22 +- .../src/Generated/StaticSite.cs | 22 +- .../Generated/StaticSiteBasicAuthProperty.cs | 22 +- .../StaticSiteBuildDatabaseConnection.cs | 22 +- .../Generated/StaticSiteBuildLinkedBackend.cs | 22 +- .../StaticSiteBuildUserProvidedFunctionApp.cs | 22 +- .../StaticSiteCustomDomainOverview.cs | 22 +- .../Generated/StaticSiteDatabaseConnection.cs | 22 +- .../src/Generated/StaticSiteLinkedBackend.cs | 22 +- .../StaticSitePrivateEndpointConnection.cs | 22 +- .../StaticSiteUserProvidedFunctionApp.cs | 22 +- .../src/Generated/WebSite.cs | 22 +- .../src/Generated/WebSiteConfig.cs | 22 +- .../src/Generated/WebSiteExtension.cs | 22 +- .../WebSiteFtpPublishingCredentialsPolicy.cs | 22 +- .../src/Generated/WebSiteHybridConnection.cs | 22 +- .../src/Generated/WebSitePremierAddon.cs | 22 +- .../src/Generated/WebSitePrivateAccess.cs | 22 +- .../src/Generated/WebSiteSlot.cs | 22 +- .../src/Generated/WebSiteSlotConfig.cs | 22 +- .../src/Generated/WebSiteSlotExtension.cs | 22 +- ...bSiteSlotFtpPublishingCredentialsPolicy.cs | 24 +- .../Generated/WebSiteSlotHybridConnection.cs | 22 +- .../src/Generated/WebSiteSlotPremierAddOn.cs | 22 +- .../src/Generated/WebSiteSlotPrivateAccess.cs | 22 +- .../Generated/WebSiteSlotPublicCertificate.cs | 22 +- .../src/Generated/WebSiteSlotSourceControl.cs | 22 +- .../src/Generated/WebSiteSourceControl.cs | 22 +- ...ning.ApplicationInsights.netstandard2.0.cs | 18 +- .../Generated/ApplicationInsightsComponent.cs | 34 +- .../Generated/ApplicationInsightsWebTest.cs | 22 +- .../Generated/ApplicationInsightsWorkbook.cs | 22 +- .../ApplicationInsightsWorkbookTemplate.cs | 22 +- .../src/Azd.cs | 2 +- ...ioning.CognitiveServices.netstandard2.0.cs | 22 +- .../src/Generated/CognitiveServicesAccount.cs | 36 +- .../CognitiveServicesAccountDeployment.cs | 22 +- .../CognitiveServicesCommitmentPlan.cs | 22 +- .../src/Generated/CommitmentPlan.cs | 22 +- .../CommitmentPlanAccountAssociation.cs | 22 +- ...ovisioning.Communication.netstandard2.0.cs | 16 +- .../src/Generated/CommunicationDomain.cs | 22 +- .../src/Generated/CommunicationService.cs | 24 +- .../src/Generated/EmailService.cs | 22 +- .../src/Generated/SenderUsername.cs | 22 +- ...ioning.ContainerRegistry.netstandard2.0.cs | 38 +- .../Generated/ContainerRegistryAgentPool.cs | 22 +- ...tainerRegistryPrivateEndpointConnection.cs | 24 +- .../Generated/ContainerRegistryReplication.cs | 22 +- .../src/Generated/ContainerRegistryService.cs | 34 +- .../src/Generated/ContainerRegistryTask.cs | 22 +- .../src/Generated/ContainerRegistryTaskRun.cs | 22 +- .../src/Generated/ContainerRegistryToken.cs | 22 +- .../src/Generated/ContainerRegistryWebhook.cs | 22 +- .../src/Generated/ScopeMap.cs | 22 +- ...sioning.ContainerService.netstandard2.0.cs | 26 +- .../src/Generated/AgentPoolSnapshot.cs | 22 +- .../Generated/ContainerServiceAgentPool.cs | 22 +- ...ontainerServiceMaintenanceConfiguration.cs | 24 +- .../ContainerServiceManagedCluster.cs | 34 +- ...ntainerServicePrivateEndpointConnection.cs | 24 +- ...ontainerServiceTrustedAccessRoleBinding.cs | 24 +- ...re.Provisioning.CosmosDB.netstandard2.0.cs | 158 ++++----- .../src/Generated/CassandraCluster.cs | 22 +- .../src/Generated/CassandraDataCenter.cs | 22 +- .../src/Generated/CassandraKeyspace.cs | 22 +- .../CassandraKeyspaceThroughputSetting.cs | 22 +- .../src/Generated/CassandraTable.cs | 22 +- .../CassandraTableThroughputSetting.cs | 22 +- .../src/Generated/CassandraViewGetResult.cs | 22 +- .../CassandraViewThroughputSetting.cs | 22 +- .../src/Generated/CosmosDBAccount.cs | 36 +- .../src/Generated/CosmosDBFirewallRule.cs | 22 +- .../CosmosDBPrivateEndpointConnection.cs | 22 +- .../src/Generated/CosmosDBService.cs | 22 +- .../CosmosDBSqlClientEncryptionKey.cs | 22 +- .../src/Generated/CosmosDBSqlContainer.cs | 22 +- .../CosmosDBSqlContainerThroughputSetting.cs | 22 +- .../src/Generated/CosmosDBSqlDatabase.cs | 22 +- .../CosmosDBSqlDatabaseThroughputSetting.cs | 22 +- .../Generated/CosmosDBSqlRoleAssignment.cs | 22 +- .../Generated/CosmosDBSqlRoleDefinition.cs | 22 +- .../Generated/CosmosDBSqlStoredProcedure.cs | 22 +- .../src/Generated/CosmosDBSqlTrigger.cs | 22 +- .../CosmosDBSqlUserDefinedFunction.cs | 22 +- .../src/Generated/CosmosDBTable.cs | 22 +- .../src/Generated/CosmosDBThroughputPool.cs | 22 +- .../CosmosDBThroughputPoolAccount.cs | 22 +- .../Generated/CosmosTableThroughputSetting.cs | 22 +- .../src/Generated/DataTransferJobGetResult.cs | 22 +- .../src/Generated/GraphResourceGetResult.cs | 22 +- .../src/Generated/GremlinDatabase.cs | 22 +- .../GremlinDatabaseThroughputSetting.cs | 22 +- .../src/Generated/GremlinGraph.cs | 22 +- .../GremlinGraphThroughputSetting.cs | 22 +- .../src/Generated/MongoCluster.cs | 22 +- .../src/Generated/MongoDBCollection.cs | 22 +- .../MongoDBCollectionThroughputSetting.cs | 22 +- .../src/Generated/MongoDBDatabase.cs | 22 +- .../MongoDBDatabaseThroughputSetting.cs | 22 +- .../src/Generated/MongoDBRoleDefinition.cs | 22 +- .../src/Generated/MongoDBUserDefinition.cs | 22 +- .../src/ProvisioningPlan.Deploy.cs | 2 +- ...e.Provisioning.EventGrid.netstandard2.0.cs | 108 +++--- .../src/Generated/CaCertificate.cs | 22 +- .../src/Generated/DomainEventSubscription.cs | 22 +- .../src/Generated/DomainTopic.cs | 22 +- .../Generated/DomainTopicEventSubscription.cs | 22 +- .../src/Generated/EventGridDomain.cs | 22 +- ...ventGridDomainPrivateEndpointConnection.cs | 24 +- .../src/Generated/EventGridNamespace.cs | 22 +- .../EventGridNamespaceClientGroup.cs | 22 +- .../EventGridNamespaceClientResource.cs | 22 +- .../EventGridNamespacePermissionBinding.cs | 22 +- ...rtnerNamespacePrivateEndpointConnection.cs | 24 +- .../src/Generated/EventGridTopic.cs | 22 +- ...EventGridTopicPrivateEndpointConnection.cs | 22 +- .../src/Generated/EventSubscription.cs | 22 +- .../src/Generated/NamespaceTopic.cs | 22 +- .../NamespaceTopicEventSubscription.cs | 22 +- .../src/Generated/PartnerConfiguration.cs | 22 +- .../src/Generated/PartnerDestination.cs | 22 +- .../src/Generated/PartnerNamespace.cs | 22 +- .../src/Generated/PartnerNamespaceChannel.cs | 22 +- .../src/Generated/PartnerRegistration.cs | 22 +- .../src/Generated/PartnerTopic.cs | 22 +- .../PartnerTopicEventSubscription.cs | 22 +- .../src/Generated/SystemTopic.cs | 22 +- .../Generated/SystemTopicEventSubscription.cs | 22 +- .../src/Generated/TopicEventSubscription.cs | 22 +- .../src/Generated/TopicSpace.cs | 22 +- ...e.Provisioning.EventHubs.netstandard2.0.cs | 48 +-- .../src/Generated/EventHub.cs | 22 +- .../Generated/EventHubAuthorizationRule.cs | 24 +- .../Generated/EventHubsApplicationGroup.cs | 22 +- .../src/Generated/EventHubsCluster.cs | 34 +- .../src/Generated/EventHubsConsumerGroup.cs | 22 +- .../Generated/EventHubsDisasterRecovery.cs | 22 +- .../src/Generated/EventHubsNamespace.cs | 34 +- .../EventHubsNamespaceAuthorizationRule.cs | 24 +- .../src/Generated/EventHubsNetworkRuleSet.cs | 22 +- .../EventHubsPrivateEndpointConnection.cs | 22 +- .../src/Generated/EventHubsSchemaGroup.cs | 22 +- ...re.Provisioning.KeyVault.netstandard2.0.cs | 22 +- .../KeyVaultPrivateEndpointConnection.cs | 22 +- .../src/Generated/KeyVaultSecret.cs | 22 +- .../src/Generated/KeyVaultService.cs | 34 +- .../src/Generated/ManagedHsm.cs | 22 +- .../ManagedHsmPrivateEndpointConnection.cs | 22 +- ....Provisioning.Kubernetes.netstandard2.0.cs | 6 +- .../src/Generated/ConnectedCluster.cs | 34 +- ....KubernetesConfiguration.netstandard2.0.cs | 16 +- .../Generated/KubernetesClusterExtension.cs | 34 +- .../Generated/KubernetesFluxConfiguration.cs | 34 +- .../KubernetesSourceControlConfiguration.cs | 22 +- ...ning.OperationalInsights.netstandard2.0.cs | 44 +-- .../src/Generated/LogAnalyticsQuery.cs | 22 +- .../src/Generated/LogAnalyticsQueryPack.cs | 22 +- .../Generated/OperationalInsightsCluster.cs | 22 +- .../OperationalInsightsDataExport.cs | 22 +- .../OperationalInsightsDataSource.cs | 22 +- .../OperationalInsightsLinkedService.cs | 22 +- ...perationalInsightsLinkedStorageAccounts.cs | 24 +- .../OperationalInsightsSavedSearch.cs | 22 +- .../src/Generated/OperationalInsightsTable.cs | 22 +- .../Generated/OperationalInsightsWorkspace.cs | 24 +- .../src/Generated/StorageInsight.cs | 22 +- ....Provisioning.PostgreSql.netstandard2.0.cs | 60 ++-- .../src/Generated/PostgreSqlConfiguration.cs | 22 +- .../src/Generated/PostgreSqlDatabase.cs | 22 +- .../src/Generated/PostgreSqlFirewallRule.cs | 22 +- .../src/Generated/PostgreSqlFlexibleServer.cs | 22 +- ...xibleServerActiveDirectoryAdministrator.cs | 24 +- .../PostgreSqlFlexibleServerConfiguration.cs | 22 +- .../PostgreSqlFlexibleServerDatabase.cs | 22 +- .../PostgreSqlFlexibleServerFirewallRule.cs | 22 +- .../src/Generated/PostgreSqlMigration.cs | 22 +- .../PostgreSqlPrivateEndpointConnection.cs | 22 +- .../src/Generated/PostgreSqlServer.cs | 22 +- .../PostgreSqlServerAdministrator.cs | 22 +- .../src/Generated/PostgreSqlServerKey.cs | 22 +- .../PostgreSqlServerSecurityAlertPolicy.cs | 22 +- .../Generated/PostgreSqlVirtualNetworkRule.cs | 22 +- .../tests/BasicPostgreSqlTests.cs | 2 +- ...Azure.Provisioning.Redis.netstandard2.0.cs | 30 +- .../src/Generated/RedisCacheAccessPolicy.cs | 22 +- .../RedisCacheAccessPolicyAssignment.cs | 22 +- .../src/Generated/RedisFirewallRule.cs | 22 +- .../RedisLinkedServerWithProperty.cs | 22 +- .../src/Generated/RedisPatchSchedule.cs | 22 +- .../RedisPrivateEndpointConnection.cs | 22 +- .../src/Generated/RedisResource.cs | 36 +- ...zure.Provisioning.Search.netstandard2.0.cs | 14 +- .../SearchPrivateEndpointConnection.cs | 22 +- .../src/Generated/SearchService.cs | 34 +- .../SharedSearchServicePrivateLink.cs | 22 +- ....Provisioning.ServiceBus.netstandard2.0.cs | 50 +-- .../src/Generated/MigrationConfiguration.cs | 22 +- .../Generated/ServiceBusDisasterRecovery.cs | 22 +- .../src/Generated/ServiceBusNamespace.cs | 34 +- .../ServiceBusNamespaceAuthorizationRule.cs | 24 +- .../src/Generated/ServiceBusNetworkRuleSet.cs | 22 +- .../ServiceBusPrivateEndpointConnection.cs | 22 +- .../src/Generated/ServiceBusQueue.cs | 22 +- .../ServiceBusQueueAuthorizationRule.cs | 24 +- .../src/Generated/ServiceBusRule.cs | 22 +- .../src/Generated/ServiceBusSubscription.cs | 22 +- .../src/Generated/ServiceBusTopic.cs | 22 +- .../ServiceBusTopicAuthorizationRule.cs | 24 +- ...ure.Provisioning.SignalR.netstandard2.0.cs | 22 +- .../src/Generated/SignalRCustomCertificate.cs | 22 +- .../src/Generated/SignalRCustomDomain.cs | 22 +- .../SignalRPrivateEndpointConnection.cs | 22 +- .../src/Generated/SignalRService.cs | 36 +- .../src/Generated/SignalRSharedPrivateLink.cs | 22 +- .../Azure.Provisioning.Sql.netstandard2.0.cs | 330 +++++++++--------- .../BackupShortTermRetentionPolicy.cs | 22 +- .../src/Generated/DataMaskingPolicy.cs | 22 +- .../DatabaseAdvancedThreatProtection.cs | 22 +- .../Generated/DistributedAvailabilityGroup.cs | 22 +- .../src/Generated/ElasticPool.cs | 22 +- .../src/Generated/EncryptionProtector.cs | 22 +- .../ExtendedDatabaseBlobAuditingPolicy.cs | 22 +- .../ExtendedServerBlobAuditingPolicy.cs | 22 +- .../src/Generated/FailoverGroup.cs | 22 +- .../src/Generated/GeoBackupPolicy.cs | 22 +- .../src/Generated/IPv6FirewallRule.cs | 22 +- .../src/Generated/InstanceFailoverGroup.cs | 22 +- .../src/Generated/InstancePool.cs | 22 +- .../src/Generated/LedgerDigestUpload.cs | 22 +- ...ogicalDatabaseTransparentDataEncryption.cs | 24 +- .../src/Generated/LongTermRetentionPolicy.cs | 22 +- .../ManagedBackupShortTermRetentionPolicy.cs | 22 +- .../src/Generated/ManagedDatabase.cs | 22 +- ...ManagedDatabaseAdvancedThreatProtection.cs | 22 +- .../ManagedDatabaseSecurityAlertPolicy.cs | 22 +- .../ManagedDatabaseSensitivityLabel.cs | 22 +- .../ManagedDatabaseVulnerabilityAssessment.cs | 22 +- ...baseVulnerabilityAssessmentRuleBaseline.cs | 24 +- .../src/Generated/ManagedInstance.cs | 22 +- .../Generated/ManagedInstanceAdministrator.cs | 22 +- ...ManagedInstanceAdvancedThreatProtection.cs | 22 +- ...anagedInstanceAzureADOnlyAuthentication.cs | 24 +- .../src/Generated/ManagedInstanceDtc.cs | 22 +- .../ManagedInstanceEncryptionProtector.cs | 22 +- .../src/Generated/ManagedInstanceKey.cs | 22 +- .../ManagedInstanceLongTermRetentionPolicy.cs | 22 +- ...anagedInstancePrivateEndpointConnection.cs | 24 +- ...anagedInstanceServerConfigurationOption.cs | 24 +- .../ManagedInstanceServerTrustCertificate.cs | 22 +- .../ManagedInstanceStartStopSchedule.cs | 22 +- .../ManagedInstanceVulnerabilityAssessment.cs | 22 +- .../Generated/ManagedLedgerDigestUpload.cs | 22 +- ...DroppedDbBackupShortTermRetentionPolicy.cs | 24 +- .../src/Generated/ManagedServerDnsAlias.cs | 22 +- .../ManagedServerSecurityAlertPolicy.cs | 22 +- .../ManagedTransparentDataEncryption.cs | 22 +- .../src/Generated/OutboundFirewallRule.cs | 22 +- .../ServerAdvancedThreatProtection.cs | 22 +- .../src/Generated/SqlAgentConfiguration.cs | 22 +- .../src/Generated/SqlDatabase.cs | 22 +- .../SqlDatabaseBlobAuditingPolicy.cs | 22 +- .../SqlDatabaseSecurityAlertPolicy.cs | 22 +- .../Generated/SqlDatabaseSensitivityLabel.cs | 22 +- ...abaseSqlVulnerabilityAssessmentBaseline.cs | 24 +- ...eSqlVulnerabilityAssessmentBaselineRule.cs | 24 +- .../SqlDatabaseVulnerabilityAssessment.cs | 22 +- ...baseVulnerabilityAssessmentRuleBaseline.cs | 24 +- .../src/Generated/SqlFirewallRule.cs | 22 +- .../Generated/SqlPrivateEndpointConnection.cs | 22 +- .../src/Generated/SqlServer.cs | 34 +- .../SqlServerAzureADAdministrator.cs | 22 +- .../SqlServerAzureADOnlyAuthentication.cs | 22 +- .../Generated/SqlServerBlobAuditingPolicy.cs | 22 +- .../Generated/SqlServerCommunicationLink.cs | 22 +- .../Generated/SqlServerConnectionPolicy.cs | 22 +- .../SqlServerDatabaseRestorePoint.cs | 22 +- .../SqlServerDevOpsAuditingSetting.cs | 22 +- .../src/Generated/SqlServerDnsAlias.cs | 22 +- .../src/Generated/SqlServerJob.cs | 22 +- .../src/Generated/SqlServerJobAgent.cs | 22 +- .../src/Generated/SqlServerJobCredential.cs | 22 +- .../src/Generated/SqlServerJobExecution.cs | 22 +- .../src/Generated/SqlServerJobStep.cs | 22 +- .../src/Generated/SqlServerJobTargetGroup.cs | 22 +- .../src/Generated/SqlServerKey.cs | 22 +- .../Generated/SqlServerSecurityAlertPolicy.cs | 22 +- .../SqlServerSqlVulnerabilityAssessment.cs | 22 +- ...erverSqlVulnerabilityAssessmentBaseline.cs | 24 +- ...rSqlVulnerabilityAssessmentBaselineRule.cs | 24 +- .../src/Generated/SqlServerTrustGroup.cs | 22 +- .../Generated/SqlServerVirtualNetworkRule.cs | 22 +- .../SqlServerVulnerabilityAssessment.cs | 22 +- .../src/Generated/SyncAgent.cs | 22 +- .../src/Generated/SyncGroup.cs | 22 +- .../src/Generated/SyncMember.cs | 22 +- .../src/Generated/WorkloadClassifier.cs | 22 +- .../src/Generated/WorkloadGroup.cs | 22 +- ...ure.Provisioning.Storage.netstandard2.0.cs | 66 ++-- .../src/BlobService.cs | 6 +- .../src/Generated/BlobContainer.cs | 22 +- .../src/Generated/BlobInventoryPolicy.cs | 22 +- .../src/Generated/BlobService.cs | 22 +- .../src/Generated/EncryptionScope.cs | 22 +- .../src/Generated/FileService.cs | 22 +- .../src/Generated/FileShare.cs | 22 +- .../src/Generated/ImmutabilityPolicy.cs | 22 +- .../src/Generated/ObjectReplicationPolicy.cs | 22 +- .../src/Generated/QueueService.cs | 22 +- .../src/Generated/StorageAccount.cs | 36 +- .../src/Generated/StorageAccountLocalUser.cs | 24 +- .../StorageAccountManagementPolicy.cs | 22 +- .../StoragePrivateEndpointConnection.cs | 22 +- .../src/Generated/StorageQueue.cs | 22 +- .../src/Generated/StorageTable.cs | 22 +- .../src/Generated/TableService.cs | 22 +- .../tests/BasicStorageTests.cs | 2 +- ...e.Provisioning.WebPubSub.netstandard2.0.cs | 18 +- .../src/Generated/WebPubSubHub.cs | 22 +- .../WebPubSubPrivateEndpointConnection.cs | 22 +- .../src/Generated/WebPubSubService.cs | 36 +- .../Generated/WebPubSubSharedPrivateLink.cs | 22 +- .../api/Azure.Provisioning.netstandard2.0.cs | 110 +++--- .../AuthorizationRoleDefinition.cs | 2 +- .../src/Authorization/RoleAssignment.cs | 2 +- .../src/BicepDictionaryOfT.cs | 2 +- .../Azure.Provisioning/src/BicepListOfT.cs | 2 +- .../Azure.Provisioning/src/BicepValueOfT.cs | 2 +- .../src/Expressions/BicepFunction.cs | 2 +- .../src/Generated/ArmApplication.cs | 22 +- .../src/Generated/ArmApplicationDefinition.cs | 22 +- .../src/Generated/ArmDeployment.cs | 24 +- .../src/Generated/ArmDeploymentScript.cs | 22 +- .../Generated/AuthorizationRoleDefinition.cs | 22 +- .../Generated/FederatedIdentityCredential.cs | 22 +- .../src/Generated/GenericResource.cs | 22 +- .../src/Generated/JitRequest.cs | 22 +- .../src/Generated/ManagementGroup.cs | 22 +- .../ManagementGroupPolicyDefinition.cs | 22 +- .../ManagementGroupPolicySetDefinition.cs | 22 +- .../Generated/ManagementGroupSubscription.cs | 22 +- .../src/Generated/ManagementLock.cs | 22 +- .../src/Generated/PolicyAssignment.cs | 22 +- .../src/Generated/ResourceGroup.cs | 24 +- .../src/Generated/RoleAssignment.cs | 22 +- .../RoleAssignmentScheduleRequest.cs | 22 +- .../RoleEligibilityScheduleRequest.cs | 22 +- .../RoleManagementPolicyAssignment.cs | 22 +- .../src/Generated/Subscription.cs | 13 +- .../Generated/SubscriptionPolicyDefinition.cs | 22 +- .../SubscriptionPolicySetDefinition.cs | 22 +- .../src/Generated/TagResource.cs | 22 +- .../src/Generated/TemplateSpec.cs | 22 +- .../src/Generated/TemplateSpecVersion.cs | 22 +- .../src/Generated/Tenant.cs | 13 +- .../src/Generated/UserAssignedIdentity.cs | 22 +- .../src/Primitives/BicepValueReference.cs | 2 +- .../Primitives/LocationPropertyResolver.cs | 6 +- .../src/Primitives/ModuleImport.cs | 4 +- .../src/Primitives/ProvisioningConstruct.cs | 53 ++- .../src/Primitives/Resource.cs | 12 +- .../ResourceNamePropertyResolver.cs | 10 +- .../src/Primitives/ResourceReference.cs | 2 +- .../src/ProvisioningOutput.cs | 12 +- .../src/ProvisioningParameter.cs | 12 +- .../src/ProvisioningVariable.cs | 12 +- .../Azure.Provisioning/tests/SampleTests.cs | 21 +- .../Generator/src/Model/Resource.cs | 32 +- 433 files changed, 7289 insertions(+), 3305 deletions(-) diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/api/Azure.Provisioning.AppConfiguration.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/api/Azure.Provisioning.AppConfiguration.netstandard2.0.cs index a68d6dde6b778..56e63438a0577 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/api/Azure.Provisioning.AppConfiguration.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/api/Azure.Provisioning.AppConfiguration.netstandard2.0.cs @@ -32,7 +32,7 @@ public enum AppConfigurationCreateMode } public partial class AppConfigurationKeyValue : Azure.Provisioning.Primitives.Resource { - public AppConfigurationKeyValue(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppConfigurationKeyValue(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ContentType { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -45,7 +45,7 @@ public partial class AppConfigurationKeyValue : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Value { get { throw null; } set { } } - public static Azure.Provisioning.AppConfiguration.AppConfigurationKeyValue FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppConfiguration.AppConfigurationKeyValue FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_05_01; @@ -61,7 +61,7 @@ public AppConfigurationKeyVaultProperties() { } } public partial class AppConfigurationPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public AppConfigurationPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppConfigurationPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -69,7 +69,7 @@ public partial class AppConfigurationPrivateEndpointConnection : Azure.Provision public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppConfiguration.AppConfigurationPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppConfiguration.AppConfigurationPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_10_01; @@ -119,7 +119,7 @@ public enum AppConfigurationPublicNetworkAccess } public partial class AppConfigurationReplica : Azure.Provisioning.Primitives.Resource { - public AppConfigurationReplica(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppConfigurationReplica(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Endpoint { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -127,7 +127,7 @@ public partial class AppConfigurationReplica : Azure.Provisioning.Primitives.Res public Azure.Provisioning.AppConfiguration.AppConfigurationStore? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppConfiguration.AppConfigurationReplica FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppConfiguration.AppConfigurationReplica FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -146,7 +146,7 @@ public enum AppConfigurationReplicaProvisioningState } public partial class AppConfigurationStore : Azure.Provisioning.Primitives.Resource { - public AppConfigurationStore(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppConfigurationStore(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue CreateMode { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisableLocalAuth { get { throw null; } set { } } @@ -164,9 +164,9 @@ public partial class AppConfigurationStore : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue SoftDeleteRetentionInDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppConfiguration.AppConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppConfiguration.AppConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppConfiguration.AppConfigurationBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.AppConfiguration.AppConfigurationStore FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppConfiguration.AppConfigurationStore FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.BicepList GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationKeyValue.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationKeyValue.cs index b5e9ee96c5c74..2fe7e5547b929 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationKeyValue.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationKeyValue.cs @@ -103,10 +103,15 @@ public partial class AppConfigurationKeyValue : Resource /// /// Creates a new AppConfigurationKeyValue. /// - /// Name of the AppConfigurationKeyValue. + /// + /// The the Bicep identifier name of the AppConfigurationKeyValue resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationKeyValue. - public AppConfigurationKeyValue(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.AppConfiguration/configurationStores/keyValues", resourceVersion ?? "2024-05-01") + public AppConfigurationKeyValue(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.AppConfiguration/configurationStores/keyValues", resourceVersion ?? "2024-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _contentType = BicepValue.DefineProperty(this, "ContentType", ["properties", "contentType"]); @@ -146,9 +151,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppConfigurationKeyValue. /// - /// Name of the AppConfigurationKeyValue. + /// + /// The the Bicep identifier name of the AppConfigurationKeyValue resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationKeyValue. /// The existing AppConfigurationKeyValue resource. - public static AppConfigurationKeyValue FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppConfigurationKeyValue FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnection.cs index d462d983cc3a7..99145fd3efb0a 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnection.cs @@ -63,10 +63,16 @@ public partial class AppConfigurationPrivateEndpointConnection : Resource /// /// Creates a new AppConfigurationPrivateEndpointConnection. /// - /// Name of the AppConfigurationPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// AppConfigurationPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppConfigurationPrivateEndpointConnection. - public AppConfigurationPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.AppConfiguration/configurationStores/privateEndpointConnections", resourceVersion ?? "2024-05-01") + public AppConfigurationPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.AppConfiguration/configurationStores/privateEndpointConnections", resourceVersion ?? "2024-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -112,9 +118,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// AppConfigurationPrivateEndpointConnection. /// - /// Name of the AppConfigurationPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// AppConfigurationPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppConfigurationPrivateEndpointConnection. /// The existing AppConfigurationPrivateEndpointConnection resource. - public static AppConfigurationPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppConfigurationPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationReplica.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationReplica.cs index ab5c021ba3f6e..0f1952598b519 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationReplica.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationReplica.cs @@ -63,10 +63,15 @@ public partial class AppConfigurationReplica : Resource /// /// Creates a new AppConfigurationReplica. /// - /// Name of the AppConfigurationReplica. + /// + /// The the Bicep identifier name of the AppConfigurationReplica resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationReplica. - public AppConfigurationReplica(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.AppConfiguration/configurationStores/replicas", resourceVersion ?? "2024-05-01") + public AppConfigurationReplica(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.AppConfiguration/configurationStores/replicas", resourceVersion ?? "2024-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"]); @@ -96,11 +101,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppConfigurationReplica. /// - /// Name of the AppConfigurationReplica. + /// + /// The the Bicep identifier name of the AppConfigurationReplica resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationReplica. /// The existing AppConfigurationReplica resource. - public static AppConfigurationReplica FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppConfigurationReplica FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this AppConfigurationReplica resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationStore.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationStore.cs index 86a084651f973..e5b86080ef72e 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationStore.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Generated/AppConfigurationStore.cs @@ -131,10 +131,15 @@ public partial class AppConfigurationStore : Resource /// /// Creates a new AppConfigurationStore. /// - /// Name of the AppConfigurationStore. + /// + /// The the Bicep identifier name of the AppConfigurationStore resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationStore. - public AppConfigurationStore(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.AppConfiguration/configurationStores", resourceVersion ?? "2024-05-01") + public AppConfigurationStore(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.AppConfiguration/configurationStores", resourceVersion ?? "2024-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -189,11 +194,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppConfigurationStore. /// - /// Name of the AppConfigurationStore. + /// + /// The the Bicep identifier name of the AppConfigurationStore resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppConfigurationStore. /// The existing AppConfigurationStore resource. - public static AppConfigurationStore FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppConfigurationStore FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this AppConfigurationStore resource. @@ -210,7 +220,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => public BicepList GetKeys() => BicepList.FromExpression( AppConfigurationStoreApiKey.FromExpression, - new MemberExpression(new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys")), "keys")); + new MemberExpression(new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys")), "keys")); /// /// Creates a role assignment for a user-assigned identity that grants @@ -220,10 +230,10 @@ public BicepList GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(AppConfigurationBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{AppConfigurationBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{AppConfigurationBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -236,13 +246,13 @@ public RoleAssignment CreateRoleAssignment(AppConfigurationBuiltInRole role, Use /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(AppConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{AppConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(AppConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{AppConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/api/Azure.Provisioning.AppContainers.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/api/Azure.Provisioning.AppContainers.netstandard2.0.cs index 9ece311efd3d7..852b189f04f34 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/api/Azure.Provisioning.AppContainers.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/api/Azure.Provisioning.AppContainers.netstandard2.0.cs @@ -30,7 +30,7 @@ public AppContainerResources() { } } public partial class ContainerApp : Azure.Provisioning.Primitives.Resource { - public ContainerApp(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerApp(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Configuration { get { throw null; } set { } } public Azure.Provisioning.BicepValue CustomDomainVerificationId { get { throw null; } } public Azure.Provisioning.BicepValue EnvironmentId { get { throw null; } set { } } @@ -51,7 +51,7 @@ public partial class ContainerApp : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Template { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadProfileName { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerApp FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerApp FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -94,7 +94,7 @@ public ContainerAppAppleRegistrationConfiguration() { } } public partial class ContainerAppAuthConfig : Azure.Provisioning.Primitives.Resource { - public ContainerAppAuthConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppAuthConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EncryptionSettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue GlobalValidation { get { throw null; } set { } } public Azure.Provisioning.BicepValue HttpSettings { get { throw null; } set { } } @@ -105,7 +105,7 @@ public partial class ContainerAppAuthConfig : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.AppContainers.ContainerApp? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Platform { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppContainers.ContainerAppAuthConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppAuthConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -209,7 +209,7 @@ public ContainerAppConfiguration() { } } public partial class ContainerAppConnectedEnvironment : Azure.Provisioning.Primitives.Resource { - public ContainerAppConnectedEnvironment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppConnectedEnvironment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CustomDomainConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue DaprAIConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue DefaultDomain { get { throw null; } } @@ -222,7 +222,7 @@ public partial class ContainerAppConnectedEnvironment : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue StaticIP { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_10_01; @@ -233,7 +233,7 @@ public static partial class ResourceVersions } public partial class ContainerAppConnectedEnvironmentCertificate : Azure.Provisioning.Primitives.Resource { - public ContainerAppConnectedEnvironmentCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppConnectedEnvironmentCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -241,7 +241,7 @@ public partial class ContainerAppConnectedEnvironmentCertificate : Azure.Provisi public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_10_01; @@ -252,7 +252,7 @@ public static partial class ResourceVersions } public partial class ContainerAppConnectedEnvironmentDaprComponent : Azure.Provisioning.Primitives.Resource { - public ContainerAppConnectedEnvironmentDaprComponent(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppConnectedEnvironmentDaprComponent(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ComponentType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IgnoreErrors { get { throw null; } set { } } @@ -265,7 +265,7 @@ public partial class ContainerAppConnectedEnvironmentDaprComponent : Azure.Provi public Azure.Provisioning.BicepValue SecretStoreComponent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentDaprComponent FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentDaprComponent FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_10_01; @@ -287,13 +287,13 @@ public enum ContainerAppConnectedEnvironmentProvisioningState } public partial class ContainerAppConnectedEnvironmentStorage : Azure.Provisioning.Primitives.Resource { - public ContainerAppConnectedEnvironmentStorage(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppConnectedEnvironmentStorage(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectedEnvironmentStorageAzureFile { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironment? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentStorage FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppConnectedEnvironmentStorage FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_10_01; @@ -613,7 +613,7 @@ public ContainerAppIPSecurityRestrictionRule() { } } public partial class ContainerAppJob : Azure.Provisioning.Primitives.Resource { - public ContainerAppJob(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppJob(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Configuration { get { throw null; } set { } } public Azure.Provisioning.BicepValue EnvironmentId { get { throw null; } set { } } public Azure.Provisioning.BicepValue EventStreamEndpoint { get { throw null; } } @@ -627,7 +627,7 @@ public partial class ContainerAppJob : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Template { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadProfileName { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppJob FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppJob FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2023_05_01; @@ -720,7 +720,7 @@ public ContainerAppLogsConfiguration() { } } public partial class ContainerAppManagedCertificate : Azure.Provisioning.Primitives.Resource { - public ContainerAppManagedCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppManagedCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -728,7 +728,7 @@ public partial class ContainerAppManagedCertificate : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppManagedCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppManagedCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2023_05_01; @@ -738,7 +738,7 @@ public static partial class ResourceVersions } public partial class ContainerAppManagedEnvironment : Azure.Provisioning.Primitives.Resource { - public ContainerAppManagedEnvironment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppManagedEnvironment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AppLogsConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue CustomDomainConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue DaprAIConnectionString { get { throw null; } set { } } @@ -762,9 +762,9 @@ public partial class ContainerAppManagedEnvironment : Azure.Provisioning.Primiti public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue VnetConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepList WorkloadProfiles { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppContainers.AppContainersBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppContainers.AppContainersBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.AppContainers.AppContainersBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -776,7 +776,7 @@ public static partial class ResourceVersions } public partial class ContainerAppManagedEnvironmentCertificate : Azure.Provisioning.Primitives.Resource { - public ContainerAppManagedEnvironmentCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppManagedEnvironmentCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -784,7 +784,7 @@ public partial class ContainerAppManagedEnvironmentCertificate : Azure.Provision public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -796,7 +796,7 @@ public static partial class ResourceVersions } public partial class ContainerAppManagedEnvironmentDaprComponent : Azure.Provisioning.Primitives.Resource { - public ContainerAppManagedEnvironmentDaprComponent(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppManagedEnvironmentDaprComponent(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ComponentType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IgnoreErrors { get { throw null; } set { } } @@ -809,7 +809,7 @@ public partial class ContainerAppManagedEnvironmentDaprComponent : Azure.Provisi public Azure.Provisioning.BicepValue SecretStoreComponent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentDaprComponent FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentDaprComponent FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -826,13 +826,13 @@ public enum ContainerAppManagedEnvironmentOutBoundType } public partial class ContainerAppManagedEnvironmentStorage : Azure.Provisioning.Primitives.Resource { - public ContainerAppManagedEnvironmentStorage(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppManagedEnvironmentStorage(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue ManagedEnvironmentStorageAzureFile { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.AppContainers.ContainerAppManagedEnvironment? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentStorage FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppManagedEnvironmentStorage FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -974,7 +974,7 @@ public ContainerAppServiceBind() { } } public partial class ContainerAppSourceControl : Azure.Provisioning.Primitives.Resource { - public ContainerAppSourceControl(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerAppSourceControl(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Branch { get { throw null; } set { } } public Azure.Provisioning.BicepValue GitHubActionConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -983,7 +983,7 @@ public partial class ContainerAppSourceControl : Azure.Provisioning.Primitives.R public Azure.Provisioning.AppContainers.ContainerApp? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue RepoUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppContainers.ContainerAppSourceControl FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppContainers.ContainerAppSourceControl FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerApp.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerApp.cs index 8007d69fba236..d088abc6b7b95 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerApp.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerApp.cs @@ -148,10 +148,15 @@ public partial class ContainerApp : Resource /// /// Creates a new ContainerApp. /// - /// Name of the ContainerApp. + /// + /// The the Bicep identifier name of the ContainerApp resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerApp. - public ContainerApp(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/containerApps", resourceVersion ?? "2024-03-01") + public ContainerApp(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/containerApps", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -209,11 +214,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerApp. /// - /// Name of the ContainerApp. + /// + /// The the Bicep identifier name of the ContainerApp resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerApp. /// The existing ContainerApp resource. - public static ContainerApp FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerApp FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerApp resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppAuthConfig.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppAuthConfig.cs index b52fea0fc72ae..b3e5ec0390b95 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppAuthConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppAuthConfig.cs @@ -88,10 +88,15 @@ public partial class ContainerAppAuthConfig : Resource /// /// Creates a new ContainerAppAuthConfig. /// - /// Name of the ContainerAppAuthConfig. + /// + /// The the Bicep identifier name of the ContainerAppAuthConfig resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerAppAuthConfig. - public ContainerAppAuthConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/containerApps/authConfigs", resourceVersion ?? "2024-03-01") + public ContainerAppAuthConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/containerApps/authConfigs", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _encryptionSettings = BicepValue.DefineProperty(this, "EncryptionSettings", ["properties", "encryptionSettings"]); @@ -139,9 +144,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppAuthConfig. /// - /// Name of the ContainerAppAuthConfig. + /// + /// The the Bicep identifier name of the ContainerAppAuthConfig resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerAppAuthConfig. /// The existing ContainerAppAuthConfig resource. - public static ContainerAppAuthConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppAuthConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironment.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironment.cs index ccb46f5b3319e..9041a6950a9f6 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironment.cs @@ -95,10 +95,15 @@ public partial class ContainerAppConnectedEnvironment : Resource /// /// Creates a new ContainerAppConnectedEnvironment. /// - /// Name of the ContainerAppConnectedEnvironment. + /// + /// The the Bicep identifier name of the ContainerAppConnectedEnvironment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppConnectedEnvironment. - public ContainerAppConnectedEnvironment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/connectedEnvironments", resourceVersion ?? "2024-03-01") + public ContainerAppConnectedEnvironment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/connectedEnvironments", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -143,9 +148,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppConnectedEnvironment. /// - /// Name of the ContainerAppConnectedEnvironment. + /// + /// The the Bicep identifier name of the ContainerAppConnectedEnvironment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppConnectedEnvironment. /// The existing ContainerAppConnectedEnvironment resource. - public static ContainerAppConnectedEnvironment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppConnectedEnvironment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificate.cs index 2a371b0b93c71..86bf90009c2d3 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificate.cs @@ -63,10 +63,16 @@ public partial class ContainerAppConnectedEnvironmentCertificate : Resource /// /// Creates a new ContainerAppConnectedEnvironmentCertificate. /// - /// Name of the ContainerAppConnectedEnvironmentCertificate. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentCertificate resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppConnectedEnvironmentCertificate. - public ContainerAppConnectedEnvironmentCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/connectedEnvironments/certificates", resourceVersion ?? "2024-03-01") + public ContainerAppConnectedEnvironmentCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/connectedEnvironments/certificates", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -107,9 +113,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppConnectedEnvironmentCertificate. /// - /// Name of the ContainerAppConnectedEnvironmentCertificate. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentCertificate resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppConnectedEnvironmentCertificate. /// The existing ContainerAppConnectedEnvironmentCertificate resource. - public static ContainerAppConnectedEnvironmentCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppConnectedEnvironmentCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponent.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponent.cs index 80733fd2dbb65..c2e9424a10c18 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponent.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponent.cs @@ -93,10 +93,16 @@ public partial class ContainerAppConnectedEnvironmentDaprComponent : Resource /// /// Creates a new ContainerAppConnectedEnvironmentDaprComponent. /// - /// Name of the ContainerAppConnectedEnvironmentDaprComponent. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentDaprComponent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppConnectedEnvironmentDaprComponent. - public ContainerAppConnectedEnvironmentDaprComponent(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/connectedEnvironments/daprComponents", resourceVersion ?? "2024-03-01") + public ContainerAppConnectedEnvironmentDaprComponent(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/connectedEnvironments/daprComponents", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _componentType = BicepValue.DefineProperty(this, "ComponentType", ["properties", "componentType"]); @@ -143,9 +149,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppConnectedEnvironmentDaprComponent. /// - /// Name of the ContainerAppConnectedEnvironmentDaprComponent. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentDaprComponent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppConnectedEnvironmentDaprComponent. /// The existing ContainerAppConnectedEnvironmentDaprComponent resource. - public static ContainerAppConnectedEnvironmentDaprComponent FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppConnectedEnvironmentDaprComponent FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorage.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorage.cs index d059cf47ce61e..2dc42da4d437c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorage.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorage.cs @@ -50,10 +50,15 @@ public partial class ContainerAppConnectedEnvironmentStorage : Resource /// /// Creates a new ContainerAppConnectedEnvironmentStorage. /// - /// Name of the ContainerAppConnectedEnvironmentStorage. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentStorage resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ContainerAppConnectedEnvironmentStorage. - public ContainerAppConnectedEnvironmentStorage(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/connectedEnvironments/storages", resourceVersion ?? "2024-03-01") + public ContainerAppConnectedEnvironmentStorage(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/connectedEnvironments/storages", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectedEnvironmentStorageAzureFile = BicepValue.DefineProperty(this, "ConnectedEnvironmentStorageAzureFile", ["properties", "azureFile"]); @@ -92,9 +97,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppConnectedEnvironmentStorage. /// - /// Name of the ContainerAppConnectedEnvironmentStorage. + /// + /// The the Bicep identifier name of the + /// ContainerAppConnectedEnvironmentStorage resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ContainerAppConnectedEnvironmentStorage. /// The existing ContainerAppConnectedEnvironmentStorage resource. - public static ContainerAppConnectedEnvironmentStorage FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppConnectedEnvironmentStorage FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppJob.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppJob.cs index fba9d6bfcef38..36a4552f6bbb2 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppJob.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppJob.cs @@ -100,10 +100,15 @@ public partial class ContainerAppJob : Resource /// /// Creates a new ContainerAppJob. /// - /// Name of the ContainerAppJob. + /// + /// The the Bicep identifier name of the ContainerAppJob resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ContainerAppJob. - public ContainerAppJob(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/jobs", resourceVersion ?? "2024-03-01") + public ContainerAppJob(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/jobs", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -144,9 +149,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppJob. /// - /// Name of the ContainerAppJob. + /// + /// The the Bicep identifier name of the ContainerAppJob resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ContainerAppJob. /// The existing ContainerAppJob resource. - public static ContainerAppJob FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppJob FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedCertificate.cs index a3b80fc640748..43ec61b277108 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedCertificate.cs @@ -63,10 +63,15 @@ public partial class ContainerAppManagedCertificate : Resource /// /// Creates a new ContainerAppManagedCertificate. /// - /// Name of the ContainerAppManagedCertificate. + /// + /// The the Bicep identifier name of the ContainerAppManagedCertificate + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedCertificate. - public ContainerAppManagedCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/managedEnvironments/managedCertificates", resourceVersion ?? "2024-03-01") + public ContainerAppManagedCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/managedEnvironments/managedCertificates", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -101,9 +106,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppManagedCertificate. /// - /// Name of the ContainerAppManagedCertificate. + /// + /// The the Bicep identifier name of the ContainerAppManagedCertificate + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedCertificate. /// The existing ContainerAppManagedCertificate resource. - public static ContainerAppManagedCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppManagedCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironment.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironment.cs index 06a76991811a0..0ae780b498340 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironment.cs @@ -170,10 +170,15 @@ public partial class ContainerAppManagedEnvironment : Resource /// /// Creates a new ContainerAppManagedEnvironment. /// - /// Name of the ContainerAppManagedEnvironment. + /// + /// The the Bicep identifier name of the ContainerAppManagedEnvironment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedEnvironment. - public ContainerAppManagedEnvironment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/managedEnvironments", resourceVersion ?? "2024-03-01") + public ContainerAppManagedEnvironment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/managedEnvironments", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -234,11 +239,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppManagedEnvironment. /// - /// Name of the ContainerAppManagedEnvironment. + /// + /// The the Bicep identifier name of the ContainerAppManagedEnvironment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedEnvironment. /// The existing ContainerAppManagedEnvironment resource. - public static ContainerAppManagedEnvironment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppManagedEnvironment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Creates a role assignment for a user-assigned identity that grants @@ -248,10 +258,10 @@ public static ContainerAppManagedEnvironment FromExisting(string resourceName, s /// The . /// The . public RoleAssignment CreateRoleAssignment(AppContainersBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{AppContainersBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{AppContainersBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -264,13 +274,13 @@ public RoleAssignment CreateRoleAssignment(AppContainersBuiltInRole role, UserAs /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(AppContainersBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{AppContainersBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(AppContainersBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{AppContainersBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificate.cs index 9411fdd85203f..75f6a20688e47 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificate.cs @@ -63,10 +63,16 @@ public partial class ContainerAppManagedEnvironmentCertificate : Resource /// /// Creates a new ContainerAppManagedEnvironmentCertificate. /// - /// Name of the ContainerAppManagedEnvironmentCertificate. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentCertificate resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppManagedEnvironmentCertificate. - public ContainerAppManagedEnvironmentCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/managedEnvironments/certificates", resourceVersion ?? "2024-03-01") + public ContainerAppManagedEnvironmentCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/managedEnvironments/certificates", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -112,9 +118,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppManagedEnvironmentCertificate. /// - /// Name of the ContainerAppManagedEnvironmentCertificate. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentCertificate resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppManagedEnvironmentCertificate. /// The existing ContainerAppManagedEnvironmentCertificate resource. - public static ContainerAppManagedEnvironmentCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppManagedEnvironmentCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponent.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponent.cs index ed7b5a03da44d..37c13cab51089 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponent.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponent.cs @@ -93,10 +93,16 @@ public partial class ContainerAppManagedEnvironmentDaprComponent : Resource /// /// Creates a new ContainerAppManagedEnvironmentDaprComponent. /// - /// Name of the ContainerAppManagedEnvironmentDaprComponent. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentDaprComponent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppManagedEnvironmentDaprComponent. - public ContainerAppManagedEnvironmentDaprComponent(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/managedEnvironments/daprComponents", resourceVersion ?? "2024-03-01") + public ContainerAppManagedEnvironmentDaprComponent(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/managedEnvironments/daprComponents", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _componentType = BicepValue.DefineProperty(this, "ComponentType", ["properties", "componentType"]); @@ -147,9 +153,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppManagedEnvironmentDaprComponent. /// - /// Name of the ContainerAppManagedEnvironmentDaprComponent. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentDaprComponent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerAppManagedEnvironmentDaprComponent. /// The existing ContainerAppManagedEnvironmentDaprComponent resource. - public static ContainerAppManagedEnvironmentDaprComponent FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppManagedEnvironmentDaprComponent FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorage.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorage.cs index 53fb8568480f1..c1874fcfccfaa 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorage.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorage.cs @@ -50,10 +50,15 @@ public partial class ContainerAppManagedEnvironmentStorage : Resource /// /// Creates a new ContainerAppManagedEnvironmentStorage. /// - /// Name of the ContainerAppManagedEnvironmentStorage. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentStorage resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedEnvironmentStorage. - public ContainerAppManagedEnvironmentStorage(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/managedEnvironments/storages", resourceVersion ?? "2024-03-01") + public ContainerAppManagedEnvironmentStorage(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/managedEnvironments/storages", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _managedEnvironmentStorageAzureFile = BicepValue.DefineProperty(this, "ManagedEnvironmentStorageAzureFile", ["properties", "azureFile"]); @@ -97,9 +102,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerAppManagedEnvironmentStorage. /// - /// Name of the ContainerAppManagedEnvironmentStorage. + /// + /// The the Bicep identifier name of the + /// ContainerAppManagedEnvironmentStorage resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ContainerAppManagedEnvironmentStorage. /// The existing ContainerAppManagedEnvironmentStorage resource. - public static ContainerAppManagedEnvironmentStorage FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppManagedEnvironmentStorage FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppSourceControl.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppSourceControl.cs index 96a0b2df9c365..72b41dc571ef2 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppSourceControl.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Generated/ContainerAppSourceControl.cs @@ -70,10 +70,15 @@ public partial class ContainerAppSourceControl : Resource /// /// Creates a new ContainerAppSourceControl. /// - /// Name of the ContainerAppSourceControl. + /// + /// The the Bicep identifier name of the ContainerAppSourceControl + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppSourceControl. - public ContainerAppSourceControl(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.App/containerApps/sourcecontrols", resourceVersion ?? "2024-03-01") + public ContainerAppSourceControl(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.App/containerApps/sourcecontrols", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _branch = BicepValue.DefineProperty(this, "Branch", ["properties", "branch"]); @@ -119,9 +124,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerAppSourceControl. /// - /// Name of the ContainerAppSourceControl. + /// + /// The the Bicep identifier name of the ContainerAppSourceControl + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerAppSourceControl. /// The existing ContainerAppSourceControl resource. - public static ContainerAppSourceControl FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerAppSourceControl FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/api/Azure.Provisioning.AppService.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.AppService/api/Azure.Provisioning.AppService.netstandard2.0.cs index 2d1e0a5202b87..a2aebcde7a00c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/api/Azure.Provisioning.AppService.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/api/Azure.Provisioning.AppService.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Provisioning.AppService { public partial class AppCertificate : Azure.Provisioning.Primitives.Resource { - public AppCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CanonicalName { get { throw null; } set { } } public Azure.Provisioning.BicepValue CerBlob { get { throw null; } } public Azure.Provisioning.BicepValue DomainValidationMethod { get { throw null; } set { } } @@ -30,7 +30,7 @@ public partial class AppCertificate : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue ThumbprintString { get { throw null; } } - public static Azure.Provisioning.AppService.AppCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -143,7 +143,7 @@ public AppServiceBlobStorageHttpLogsConfig() { } } public partial class AppServiceCertificate : Azure.Provisioning.Primitives.Resource { - public AppServiceCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServiceCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue KeyVaultId { get { throw null; } set { } } public Azure.Provisioning.BicepValue KeyVaultSecretName { get { throw null; } set { } } @@ -154,7 +154,7 @@ public partial class AppServiceCertificate : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServiceCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServiceCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_08_01; @@ -196,7 +196,7 @@ public enum AppServiceCertificateNotRenewableReason } public partial class AppServiceCertificateOrder : Azure.Provisioning.Primitives.Resource { - public AppServiceCertificateOrder(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServiceCertificateOrder(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AppServiceCertificateNotRenewableReasons { get { throw null; } } public Azure.Provisioning.BicepDictionary Certificates { get { throw null; } set { } } public Azure.Provisioning.BicepValue Contact { get { throw null; } } @@ -223,7 +223,7 @@ public partial class AppServiceCertificateOrder : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue ValidityInYears { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServiceCertificateOrder FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServiceCertificateOrder FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_08_01; @@ -264,7 +264,7 @@ public enum AppServiceDnsType } public partial class AppServiceDomain : Azure.Provisioning.Primitives.Resource { - public AppServiceDomain(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServiceDomain(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AuthCode { get { throw null; } set { } } public Azure.Provisioning.BicepValue Consent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ContactAdmin { get { throw null; } set { } } @@ -291,7 +291,7 @@ public partial class AppServiceDomain : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TargetDnsType { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServiceDomain FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServiceDomain FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -339,7 +339,7 @@ public enum AppServiceDomainStatus } public partial class AppServiceEnvironment : Azure.Provisioning.Primitives.Resource { - public AppServiceEnvironment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServiceEnvironment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList ClusterSettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue CustomDnsSuffixConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue DedicatedHostCount { get { throw null; } set { } } @@ -366,7 +366,7 @@ public partial class AppServiceEnvironment : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue UpgradePreference { get { throw null; } set { } } public Azure.Provisioning.BicepList UserWhitelistedIPRanges { get { throw null; } set { } } public Azure.Provisioning.BicepValue VirtualNetwork { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServiceEnvironment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServiceEnvironment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -475,7 +475,7 @@ public AppServiceNameValuePair() { } } public partial class AppServicePlan : Azure.Provisioning.Primitives.Resource { - public AppServicePlan(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServicePlan(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ExtendedLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue FreeOfferExpireOn { get { throw null; } set { } } public Azure.Provisioning.BicepValue GeoRegion { get { throw null; } } @@ -507,7 +507,7 @@ public partial class AppServicePlan : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue TargetWorkerCount { get { throw null; } set { } } public Azure.Provisioning.BicepValue TargetWorkerSizeId { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkerTierName { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServicePlan FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServicePlan FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -550,14 +550,14 @@ public enum AppServicePlanStatus } public partial class AppServicePlanVirtualNetworkConnectionGateway : Azure.Provisioning.Primitives.Resource { - public AppServicePlanVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServicePlanVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VnetName { get { throw null; } set { } } public Azure.Provisioning.BicepValue VpnPackageUri { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServicePlanVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServicePlanVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum AppServiceResourceType { @@ -594,7 +594,7 @@ public AppServiceSkuDescription() { } } public partial class AppServiceSourceControl : Azure.Provisioning.Primitives.Resource { - public AppServiceSourceControl(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AppServiceSourceControl(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ExpireOn { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -603,7 +603,7 @@ public partial class AppServiceSourceControl : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Token { get { throw null; } set { } } public Azure.Provisioning.BicepValue TokenSecret { get { throw null; } set { } } - public static Azure.Provisioning.AppService.AppServiceSourceControl FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AppServiceSourceControl FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -768,7 +768,7 @@ public enum ArtifactStorageType } public partial class AseV3NetworkingConfiguration : Azure.Provisioning.Primitives.Resource { - public AseV3NetworkingConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AseV3NetworkingConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowNewPrivateEndpointConnections { get { throw null; } set { } } public Azure.Provisioning.BicepList ExternalInboundIPAddresses { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -782,7 +782,7 @@ public partial class AseV3NetworkingConfiguration : Azure.Provisioning.Primitive public Azure.Provisioning.AppService.AppServiceEnvironment? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList WindowsOutboundIPAddresses { get { throw null; } } - public static Azure.Provisioning.AppService.AseV3NetworkingConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.AseV3NetworkingConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -959,7 +959,7 @@ public ContainerAppsConfiguration() { } } public partial class CustomDnsSuffixConfiguration : Azure.Provisioning.Primitives.Resource { - public CustomDnsSuffixConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CustomDnsSuffixConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CertificateUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue DnsSuffix { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -970,7 +970,7 @@ public partial class CustomDnsSuffixConfiguration : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue ProvisioningDetails { get { throw null; } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.CustomDnsSuffixConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.CustomDnsSuffixConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1049,14 +1049,14 @@ public enum DomainNotRenewableReason } public partial class DomainOwnershipIdentifier : Azure.Provisioning.Primitives.Resource { - public DomainOwnershipIdentifier(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DomainOwnershipIdentifier(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue OwnershipId { get { throw null; } set { } } public Azure.Provisioning.AppService.AppServiceDomain? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.DomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.DomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -1201,7 +1201,7 @@ public GitHubActionContainerConfiguration() { } } public partial class HostingEnvironmentMultiRolePool : Azure.Provisioning.Primitives.Resource { - public HostingEnvironmentMultiRolePool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public HostingEnvironmentMultiRolePool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ComputeMode { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList InstanceNames { get { throw null; } } @@ -1213,7 +1213,7 @@ public partial class HostingEnvironmentMultiRolePool : Azure.Provisioning.Primit public Azure.Provisioning.BicepValue WorkerCount { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkerSize { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkerSizeId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.HostingEnvironmentMultiRolePool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.HostingEnvironmentMultiRolePool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1250,7 +1250,7 @@ public static partial class ResourceVersions } public partial class HostingEnvironmentPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public HostingEnvironmentPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public HostingEnvironmentPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPAddresses { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -1260,7 +1260,7 @@ public partial class HostingEnvironmentPrivateEndpointConnection : Azure.Provisi public Azure.Provisioning.BicepValue PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.HostingEnvironmentPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.HostingEnvironmentPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1312,7 +1312,7 @@ public enum HostingEnvironmentStatus } public partial class HostingEnvironmentWorkerPool : Azure.Provisioning.Primitives.Resource { - public HostingEnvironmentWorkerPool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public HostingEnvironmentWorkerPool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ComputeMode { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList InstanceNames { get { throw null; } } @@ -1324,7 +1324,7 @@ public partial class HostingEnvironmentWorkerPool : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue WorkerCount { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkerSize { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkerSizeId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.HostingEnvironmentWorkerPool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.HostingEnvironmentWorkerPool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1399,7 +1399,7 @@ public enum KeyVaultSecretStatus } public partial class KubeEnvironment : Azure.Provisioning.Primitives.Resource { - public KubeEnvironment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KubeEnvironment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AksResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue AppLogsConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue ArcConfiguration { get { throw null; } set { } } @@ -1417,7 +1417,7 @@ public partial class KubeEnvironment : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StaticIP { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.AppService.KubeEnvironment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.KubeEnvironment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_03_01; @@ -1459,7 +1459,7 @@ public LogAnalyticsConfiguration() { } } public partial class LogsSiteConfig : Azure.Provisioning.Primitives.Resource { - public LogsSiteConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LogsSiteConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationLogs { get { throw null; } set { } } public Azure.Provisioning.BicepValue HttpLogs { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1469,7 +1469,7 @@ public partial class LogsSiteConfig : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.LogsSiteConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.LogsSiteConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1507,7 +1507,7 @@ public static partial class ResourceVersions } public partial class LogsSiteSlotConfig : Azure.Provisioning.Primitives.Resource { - public LogsSiteSlotConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LogsSiteSlotConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationLogs { get { throw null; } set { } } public Azure.Provisioning.BicepValue HttpLogs { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1517,7 +1517,7 @@ public partial class LogsSiteSlotConfig : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.LogsSiteSlotConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.LogsSiteSlotConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1608,7 +1608,7 @@ public enum PublicCertificateLocation } public partial class PublishingUser : Azure.Provisioning.Primitives.Resource { - public PublishingUser(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PublishingUser(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -1618,7 +1618,7 @@ public partial class PublishingUser : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue PublishingUserName { get { throw null; } set { } } public Azure.Provisioning.BicepValue ScmUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.PublishingUser FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.PublishingUser FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1728,14 +1728,14 @@ public ResponseMessageEnvelopeRemotePrivateEndpointConnection() { } } public partial class ScmSiteBasicPublishingCredentialsPolicy : Azure.Provisioning.Primitives.Resource { - public ScmSiteBasicPublishingCredentialsPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ScmSiteBasicPublishingCredentialsPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Allow { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.ScmSiteBasicPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.ScmSiteBasicPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1773,14 +1773,14 @@ public static partial class ResourceVersions } public partial class ScmSiteSlotBasicPublishingCredentialsPolicy : Azure.Provisioning.Primitives.Resource { - public ScmSiteSlotBasicPublishingCredentialsPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ScmSiteSlotBasicPublishingCredentialsPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Allow { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.ScmSiteSlotBasicPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.ScmSiteSlotBasicPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1912,7 +1912,7 @@ public SiteConfigProperties() { } } public partial class SiteContainer : Azure.Provisioning.Primitives.Resource { - public SiteContainer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteContainer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AuthType { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList EnvironmentVariables { get { throw null; } set { } } @@ -1930,7 +1930,7 @@ public partial class SiteContainer : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue UserManagedIdentityClientId { get { throw null; } set { } } public Azure.Provisioning.BicepValue UserName { get { throw null; } set { } } public Azure.Provisioning.BicepList VolumeMounts { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteContainer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteContainer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1988,7 +1988,7 @@ public enum SiteDefaultAction } public partial class SiteDeployment : Azure.Provisioning.Primitives.Resource { - public SiteDeployment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteDeployment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Author { get { throw null; } set { } } public Azure.Provisioning.BicepValue AuthorEmail { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } set { } } @@ -2002,7 +2002,7 @@ public partial class SiteDeployment : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StartOn { get { throw null; } set { } } public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteDeployment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteDeployment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2050,14 +2050,14 @@ public SiteDnsConfig() { } } public partial class SiteDomainOwnershipIdentifier : Azure.Provisioning.Primitives.Resource { - public SiteDomainOwnershipIdentifier(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteDomainOwnershipIdentifier(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Value { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteDomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteDomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2095,7 +2095,7 @@ public static partial class ResourceVersions } public partial class SiteExtension : Azure.Provisioning.Primitives.Resource { - public SiteExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue DBType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } } @@ -2113,7 +2113,7 @@ public partial class SiteExtension : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SkipAppData { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2156,7 +2156,7 @@ public enum SiteExtensionType } public partial class SiteFunction : Azure.Provisioning.Primitives.Resource { - public SiteFunction(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteFunction(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Config { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConfigHref { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary Files { get { throw null; } set { } } @@ -2175,7 +2175,7 @@ public partial class SiteFunction : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TestData { get { throw null; } set { } } public Azure.Provisioning.BicepValue TestDataHref { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteFunction FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteFunction FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2213,7 +2213,7 @@ public static partial class ResourceVersions } public partial class SiteHostNameBinding : Azure.Provisioning.Primitives.Resource { - public SiteHostNameBinding(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteHostNameBinding(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AzureResourceName { get { throw null; } set { } } public Azure.Provisioning.BicepValue AzureResourceType { get { throw null; } set { } } public Azure.Provisioning.BicepValue CustomHostNameDnsRecordType { get { throw null; } set { } } @@ -2228,7 +2228,7 @@ public partial class SiteHostNameBinding : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue ThumbprintString { get { throw null; } set { } } public Azure.Provisioning.BicepValue VirtualIP { get { throw null; } } - public static Azure.Provisioning.AppService.SiteHostNameBinding FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteHostNameBinding FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -2259,7 +2259,7 @@ public static partial class ResourceVersions } public partial class SiteHybridConnectionNamespaceRelay : Azure.Provisioning.Primitives.Resource { - public SiteHybridConnectionNamespaceRelay(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteHybridConnectionNamespaceRelay(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Hostname { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2272,11 +2272,11 @@ public partial class SiteHybridConnectionNamespaceRelay : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue ServiceBusNamespace { get { throw null; } set { } } public Azure.Provisioning.BicepValue ServiceBusSuffix { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteHybridConnectionNamespaceRelay FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteHybridConnectionNamespaceRelay FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SiteInstanceExtension : Azure.Provisioning.Primitives.Resource { - public SiteInstanceExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteInstanceExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue DBType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } } @@ -2293,7 +2293,7 @@ public partial class SiteInstanceExtension : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue SkipAppData { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteInstanceExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteInstanceExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SiteLimits : Azure.Provisioning.Primitives.ProvisioningConstruct { @@ -2321,7 +2321,7 @@ public SiteMachineKey() { } } public partial class SiteNetworkConfig : Azure.Provisioning.Primitives.Resource { - public SiteNetworkConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteNetworkConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsSwiftSupported { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2329,7 +2329,7 @@ public partial class SiteNetworkConfig : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SubnetResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteNetworkConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteNetworkConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -2360,7 +2360,7 @@ public static partial class ResourceVersions } public partial class SitePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public SitePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SitePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPAddresses { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2370,7 +2370,7 @@ public partial class SitePrivateEndpointConnection : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SitePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SitePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -2410,7 +2410,7 @@ public static partial class ResourceVersions } public partial class SitePublicCertificate : Azure.Provisioning.Primitives.Resource { - public SitePublicCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SitePublicCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Blob { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2419,7 +2419,7 @@ public partial class SitePublicCertificate : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue PublicCertificateLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue ThumbprintString { get { throw null; } } - public static Azure.Provisioning.AppService.SitePublicCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SitePublicCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2457,7 +2457,7 @@ public static partial class ResourceVersions } public partial class SiteSlotDeployment : Azure.Provisioning.Primitives.Resource { - public SiteSlotDeployment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotDeployment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Author { get { throw null; } set { } } public Azure.Provisioning.BicepValue AuthorEmail { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } set { } } @@ -2471,7 +2471,7 @@ public partial class SiteSlotDeployment : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StartOn { get { throw null; } set { } } public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotDeployment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotDeployment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2509,14 +2509,14 @@ public static partial class ResourceVersions } public partial class SiteSlotDomainOwnershipIdentifier : Azure.Provisioning.Primitives.Resource { - public SiteSlotDomainOwnershipIdentifier(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotDomainOwnershipIdentifier(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Value { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteSlotDomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotDomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2554,7 +2554,7 @@ public static partial class ResourceVersions } public partial class SiteSlotExtension : Azure.Provisioning.Primitives.Resource { - public SiteSlotExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue DBType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } } @@ -2572,7 +2572,7 @@ public partial class SiteSlotExtension : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SkipAppData { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2610,7 +2610,7 @@ public static partial class ResourceVersions } public partial class SiteSlotFunction : Azure.Provisioning.Primitives.Resource { - public SiteSlotFunction(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotFunction(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Config { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConfigHref { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary Files { get { throw null; } set { } } @@ -2629,7 +2629,7 @@ public partial class SiteSlotFunction : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TestData { get { throw null; } set { } } public Azure.Provisioning.BicepValue TestDataHref { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteSlotFunction FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotFunction FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2667,7 +2667,7 @@ public static partial class ResourceVersions } public partial class SiteSlotHostNameBinding : Azure.Provisioning.Primitives.Resource { - public SiteSlotHostNameBinding(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotHostNameBinding(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AzureResourceName { get { throw null; } set { } } public Azure.Provisioning.BicepValue AzureResourceType { get { throw null; } set { } } public Azure.Provisioning.BicepValue CustomHostNameDnsRecordType { get { throw null; } set { } } @@ -2682,7 +2682,7 @@ public partial class SiteSlotHostNameBinding : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue ThumbprintString { get { throw null; } set { } } public Azure.Provisioning.BicepValue VirtualIP { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotHostNameBinding FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotHostNameBinding FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -2713,7 +2713,7 @@ public static partial class ResourceVersions } public partial class SiteSlotHybridConnectionNamespaceRelay : Azure.Provisioning.Primitives.Resource { - public SiteSlotHybridConnectionNamespaceRelay(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotHybridConnectionNamespaceRelay(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Hostname { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2726,11 +2726,11 @@ public partial class SiteSlotHybridConnectionNamespaceRelay : Azure.Provisioning public Azure.Provisioning.BicepValue ServiceBusNamespace { get { throw null; } set { } } public Azure.Provisioning.BicepValue ServiceBusSuffix { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotHybridConnectionNamespaceRelay FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotHybridConnectionNamespaceRelay FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SiteSlotInstanceExtension : Azure.Provisioning.Primitives.Resource { - public SiteSlotInstanceExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotInstanceExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue DBType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Deployer { get { throw null; } } @@ -2747,11 +2747,11 @@ public partial class SiteSlotInstanceExtension : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue SkipAppData { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotInstanceExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotInstanceExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SiteSlotNetworkConfig : Azure.Provisioning.Primitives.Resource { - public SiteSlotNetworkConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotNetworkConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsSwiftSupported { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2759,7 +2759,7 @@ public partial class SiteSlotNetworkConfig : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SubnetResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotNetworkConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotNetworkConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_02_01; @@ -2790,7 +2790,7 @@ public static partial class ResourceVersions } public partial class SiteSlotPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public SiteSlotPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPAddresses { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -2800,7 +2800,7 @@ public partial class SiteSlotPrivateEndpointConnection : Azure.Provisioning.Prim public Azure.Provisioning.BicepValue PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SiteSlotPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2838,7 +2838,7 @@ public static partial class ResourceVersions } public partial class SiteSlotSiteContainer : Azure.Provisioning.Primitives.Resource { - public SiteSlotSiteContainer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotSiteContainer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AuthType { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList EnvironmentVariables { get { throw null; } set { } } @@ -2856,7 +2856,7 @@ public partial class SiteSlotSiteContainer : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue UserManagedIdentityClientId { get { throw null; } set { } } public Azure.Provisioning.BicepValue UserName { get { throw null; } set { } } public Azure.Provisioning.BicepList VolumeMounts { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteSlotSiteContainer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotSiteContainer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2894,7 +2894,7 @@ public static partial class ResourceVersions } public partial class SiteSlotVirtualNetworkConnection : Azure.Provisioning.Primitives.Resource { - public SiteSlotVirtualNetworkConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotVirtualNetworkConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CertBlob { get { throw null; } set { } } public Azure.Provisioning.BicepValue CertThumbprintString { get { throw null; } } public Azure.Provisioning.BicepValue DnsServers { get { throw null; } set { } } @@ -2907,7 +2907,7 @@ public partial class SiteSlotVirtualNetworkConnection : Azure.Provisioning.Primi public Azure.Provisioning.BicepList Routes { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VnetResourceId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteSlotVirtualNetworkConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotVirtualNetworkConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2945,7 +2945,7 @@ public static partial class ResourceVersions } public partial class SiteSlotVirtualNetworkConnectionGateway : Azure.Provisioning.Primitives.Resource { - public SiteSlotVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteSlotVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -2953,7 +2953,7 @@ public partial class SiteSlotVirtualNetworkConnectionGateway : Azure.Provisionin public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VnetName { get { throw null; } set { } } public Azure.Provisioning.BicepValue VpnPackageUri { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteSlotVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteSlotVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2991,7 +2991,7 @@ public static partial class ResourceVersions } public partial class SiteVirtualNetworkConnection : Azure.Provisioning.Primitives.Resource { - public SiteVirtualNetworkConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteVirtualNetworkConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CertBlob { get { throw null; } set { } } public Azure.Provisioning.BicepValue CertThumbprintString { get { throw null; } } public Azure.Provisioning.BicepValue DnsServers { get { throw null; } set { } } @@ -3004,7 +3004,7 @@ public partial class SiteVirtualNetworkConnection : Azure.Provisioning.Primitive public Azure.Provisioning.BicepList Routes { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VnetResourceId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteVirtualNetworkConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteVirtualNetworkConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3042,7 +3042,7 @@ public static partial class ResourceVersions } public partial class SiteVirtualNetworkConnectionGateway : Azure.Provisioning.Primitives.Resource { - public SiteVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SiteVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -3050,7 +3050,7 @@ public partial class SiteVirtualNetworkConnectionGateway : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VnetName { get { throw null; } set { } } public Azure.Provisioning.BicepValue VpnPackageUri { get { throw null; } set { } } - public static Azure.Provisioning.AppService.SiteVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SiteVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3088,7 +3088,7 @@ public static partial class ResourceVersions } public partial class SlotConfigNames : Azure.Provisioning.Primitives.Resource { - public SlotConfigNames(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SlotConfigNames(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AppSettingNames { get { throw null; } set { } } public Azure.Provisioning.BicepList AzureStorageConfigNames { get { throw null; } set { } } public Azure.Provisioning.BicepList ConnectionStringNames { get { throw null; } set { } } @@ -3097,7 +3097,7 @@ public partial class SlotConfigNames : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.SlotConfigNames FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.SlotConfigNames FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3155,7 +3155,7 @@ public enum StagingEnvironmentPolicy } public partial class StaticSite : Azure.Provisioning.Primitives.Resource { - public StaticSite(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSite(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowConfigFileUpdates { get { throw null; } set { } } public Azure.Provisioning.BicepValue Branch { get { throw null; } set { } } public Azure.Provisioning.BicepValue BuildProperties { get { throw null; } set { } } @@ -3182,7 +3182,7 @@ public partial class StaticSite : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TemplateProperties { get { throw null; } set { } } public Azure.Provisioning.BicepList UserProvidedFunctionApps { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSite FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSite FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3208,7 +3208,7 @@ public enum StaticSiteBasicAuthName } public partial class StaticSiteBasicAuthProperty : Azure.Provisioning.Primitives.Resource { - public StaticSiteBasicAuthProperty(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteBasicAuthProperty(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicableEnvironmentsMode { get { throw null; } set { } } public Azure.Provisioning.BicepList Environments { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -3219,7 +3219,7 @@ public partial class StaticSiteBasicAuthProperty : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue SecretState { get { throw null; } } public Azure.Provisioning.BicepValue SecretUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteBasicAuthProperty FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteBasicAuthProperty FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3240,7 +3240,7 @@ public static partial class ResourceVersions } public partial class StaticSiteBuildDatabaseConnection : Azure.Provisioning.Primitives.Resource { - public StaticSiteBuildDatabaseConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteBuildDatabaseConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList ConfigurationFiles { get { throw null; } } public Azure.Provisioning.BicepValue ConnectionIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } @@ -3250,7 +3250,7 @@ public partial class StaticSiteBuildDatabaseConnection : Azure.Provisioning.Prim public Azure.Provisioning.BicepValue Region { get { throw null; } set { } } public Azure.Provisioning.BicepValue ResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteBuildDatabaseConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteBuildDatabaseConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3271,7 +3271,7 @@ public static partial class ResourceVersions } public partial class StaticSiteBuildLinkedBackend : Azure.Provisioning.Primitives.Resource { - public StaticSiteBuildLinkedBackend(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteBuildLinkedBackend(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue BackendResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -3280,7 +3280,7 @@ public partial class StaticSiteBuildLinkedBackend : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue Region { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteBuildLinkedBackend FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteBuildLinkedBackend FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3313,7 +3313,7 @@ public StaticSiteBuildProperties() { } } public partial class StaticSiteBuildUserProvidedFunctionApp : Azure.Provisioning.Primitives.Resource { - public StaticSiteBuildUserProvidedFunctionApp(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteBuildUserProvidedFunctionApp(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue FunctionAppRegion { get { throw null; } set { } } public Azure.Provisioning.BicepValue FunctionAppResourceId { get { throw null; } set { } } @@ -3321,7 +3321,7 @@ public partial class StaticSiteBuildUserProvidedFunctionApp : Azure.Provisioning public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteBuildUserProvidedFunctionApp FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteBuildUserProvidedFunctionApp FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_12_01; @@ -3338,7 +3338,7 @@ public static partial class ResourceVersions } public partial class StaticSiteCustomDomainOverview : Azure.Provisioning.Primitives.Resource { - public StaticSiteCustomDomainOverview(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteCustomDomainOverview(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue DomainName { get { throw null; } } public Azure.Provisioning.BicepValue ErrorMessage { get { throw null; } } @@ -3350,7 +3350,7 @@ public partial class StaticSiteCustomDomainOverview : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue ValidationMethod { get { throw null; } set { } } public Azure.Provisioning.BicepValue ValidationToken { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteCustomDomainOverview FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteCustomDomainOverview FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3371,7 +3371,7 @@ public static partial class ResourceVersions } public partial class StaticSiteDatabaseConnection : Azure.Provisioning.Primitives.Resource { - public StaticSiteDatabaseConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteDatabaseConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList ConfigurationFiles { get { throw null; } } public Azure.Provisioning.BicepValue ConnectionIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConnectionString { get { throw null; } set { } } @@ -3382,7 +3382,7 @@ public partial class StaticSiteDatabaseConnection : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue Region { get { throw null; } set { } } public Azure.Provisioning.BicepValue ResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteDatabaseConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteDatabaseConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3419,7 +3419,7 @@ public StaticSiteDatabaseConnectionOverview() { } } public partial class StaticSiteLinkedBackend : Azure.Provisioning.Primitives.Resource { - public StaticSiteLinkedBackend(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteLinkedBackend(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue BackendResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -3429,7 +3429,7 @@ public partial class StaticSiteLinkedBackend : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue Region { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteLinkedBackend FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteLinkedBackend FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3458,7 +3458,7 @@ public StaticSiteLinkedBackendInfo() { } } public partial class StaticSitePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public StaticSitePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSitePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPAddresses { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -3468,7 +3468,7 @@ public partial class StaticSitePrivateEndpointConnection : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSitePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSitePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_08_01; @@ -3498,7 +3498,7 @@ public StaticSiteTemplate() { } } public partial class StaticSiteUserProvidedFunctionApp : Azure.Provisioning.Primitives.Resource { - public StaticSiteUserProvidedFunctionApp(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StaticSiteUserProvidedFunctionApp(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue FunctionAppRegion { get { throw null; } set { } } public Azure.Provisioning.BicepValue FunctionAppResourceId { get { throw null; } set { } } @@ -3507,7 +3507,7 @@ public partial class StaticSiteUserProvidedFunctionApp : Azure.Provisioning.Prim public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.AppService.StaticSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.StaticSiteUserProvidedFunctionApp FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.StaticSiteUserProvidedFunctionApp FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_12_01; @@ -3593,7 +3593,7 @@ public WebAppPushSettings() { } } public partial class WebSite : Azure.Provisioning.Primitives.Resource { - public WebSite(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSite(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AppServicePlanId { get { throw null; } set { } } public Azure.Provisioning.BicepValue AvailabilityState { get { throw null; } } public Azure.Provisioning.BicepValue ClientCertExclusionPaths { get { throw null; } set { } } @@ -3654,7 +3654,7 @@ public partial class WebSite : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue UsageState { get { throw null; } } public Azure.Provisioning.BicepValue VirtualNetworkSubnetId { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadProfileName { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSite FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSite FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -3700,7 +3700,7 @@ public enum WebSiteAvailabilityState } public partial class WebSiteConfig : Azure.Provisioning.Primitives.Resource { - public WebSiteConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AcrUserManagedIdentityId { get { throw null; } set { } } public Azure.Provisioning.BicepValue AllowIPSecurityRestrictionsForScmToUseMain { get { throw null; } set { } } public Azure.Provisioning.BicepValue ApiDefinitionUri { get { throw null; } set { } } @@ -3778,7 +3778,7 @@ public partial class WebSiteConfig : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue WebsiteTimeZone { get { throw null; } set { } } public Azure.Provisioning.BicepValue WindowsFxVersion { get { throw null; } set { } } public Azure.Provisioning.BicepValue XManagedServiceIdentityId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSiteConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3816,7 +3816,7 @@ public static partial class ResourceVersions } public partial class WebSiteExtension : Azure.Provisioning.Primitives.Resource { - public WebSiteExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Authors { get { throw null; } } public Azure.Provisioning.BicepValue Comment { get { throw null; } } public Azure.Provisioning.BicepValue Description { get { throw null; } } @@ -3842,7 +3842,7 @@ public partial class WebSiteExtension : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Title { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3880,14 +3880,14 @@ public static partial class ResourceVersions } public partial class WebSiteFtpPublishingCredentialsPolicy : Azure.Provisioning.Primitives.Resource { - public WebSiteFtpPublishingCredentialsPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteFtpPublishingCredentialsPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Allow { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteFtpPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteFtpPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3925,7 +3925,7 @@ public static partial class ResourceVersions } public partial class WebSiteHybridConnection : Azure.Provisioning.Primitives.Resource { - public WebSiteHybridConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteHybridConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue BiztalkUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue EntityConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue EntityName { get { throw null; } set { } } @@ -3937,7 +3937,7 @@ public partial class WebSiteHybridConnection : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue Port { get { throw null; } set { } } public Azure.Provisioning.BicepValue ResourceConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteHybridConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteHybridConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -3975,7 +3975,7 @@ public static partial class ResourceVersions } public partial class WebSitePremierAddon : Azure.Provisioning.Primitives.Resource { - public WebSitePremierAddon(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSitePremierAddon(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -3988,7 +3988,7 @@ public partial class WebSitePremierAddon : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Vendor { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSitePremierAddon FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSitePremierAddon FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_04_01; @@ -4017,7 +4017,7 @@ public static partial class ResourceVersions } public partial class WebSitePrivateAccess : Azure.Provisioning.Primitives.Resource { - public WebSitePrivateAccess(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSitePrivateAccess(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -4025,7 +4025,7 @@ public partial class WebSitePrivateAccess : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList VirtualNetworks { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSitePrivateAccess FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSitePrivateAccess FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4063,7 +4063,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlot : Azure.Provisioning.Primitives.Resource { - public WebSiteSlot(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlot(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AppServicePlanId { get { throw null; } set { } } public Azure.Provisioning.BicepValue AvailabilityState { get { throw null; } } public Azure.Provisioning.BicepValue ClientCertExclusionPaths { get { throw null; } set { } } @@ -4125,7 +4125,7 @@ public partial class WebSiteSlot : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue UsageState { get { throw null; } } public Azure.Provisioning.BicepValue VirtualNetworkSubnetId { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadProfileName { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSiteSlot FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlot FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -4165,7 +4165,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotConfig : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotConfig(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotConfig(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AcrUserManagedIdentityId { get { throw null; } set { } } public Azure.Provisioning.BicepValue AllowIPSecurityRestrictionsForScmToUseMain { get { throw null; } set { } } public Azure.Provisioning.BicepValue ApiDefinitionUri { get { throw null; } set { } } @@ -4243,7 +4243,7 @@ public partial class WebSiteSlotConfig : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue WebsiteTimeZone { get { throw null; } set { } } public Azure.Provisioning.BicepValue WindowsFxVersion { get { throw null; } set { } } public Azure.Provisioning.BicepValue XManagedServiceIdentityId { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSiteSlotConfig FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotConfig FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4281,7 +4281,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotExtension : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Authors { get { throw null; } } public Azure.Provisioning.BicepValue Comment { get { throw null; } } public Azure.Provisioning.BicepValue Description { get { throw null; } } @@ -4307,7 +4307,7 @@ public partial class WebSiteSlotExtension : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Title { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSlotExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4345,14 +4345,14 @@ public static partial class ResourceVersions } public partial class WebSiteSlotFtpPublishingCredentialsPolicy : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotFtpPublishingCredentialsPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotFtpPublishingCredentialsPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Allow { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSlotFtpPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotFtpPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4390,7 +4390,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotHybridConnection : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotHybridConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotHybridConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue BiztalkUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue EntityConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue EntityName { get { throw null; } set { } } @@ -4402,7 +4402,7 @@ public partial class WebSiteSlotHybridConnection : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue Port { get { throw null; } set { } } public Azure.Provisioning.BicepValue ResourceConnectionString { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSlotHybridConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotHybridConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4440,7 +4440,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotPremierAddOn : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotPremierAddOn(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotPremierAddOn(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -4453,7 +4453,7 @@ public partial class WebSiteSlotPremierAddOn : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Vendor { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSiteSlotPremierAddOn FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotPremierAddOn FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4491,7 +4491,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotPrivateAccess : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotPrivateAccess(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotPrivateAccess(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -4499,7 +4499,7 @@ public partial class WebSiteSlotPrivateAccess : Azure.Provisioning.Primitives.Re public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList VirtualNetworks { get { throw null; } set { } } - public static Azure.Provisioning.AppService.WebSiteSlotPrivateAccess FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotPrivateAccess FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4537,7 +4537,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotPublicCertificate : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotPublicCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotPublicCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Blob { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -4546,7 +4546,7 @@ public partial class WebSiteSlotPublicCertificate : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue PublicCertificateLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue ThumbprintString { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSlotPublicCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotPublicCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4584,7 +4584,7 @@ public static partial class ResourceVersions } public partial class WebSiteSlotSourceControl : Azure.Provisioning.Primitives.Resource { - public WebSiteSlotSourceControl(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSlotSourceControl(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Branch { get { throw null; } set { } } public Azure.Provisioning.BicepValue GitHubActionConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -4597,7 +4597,7 @@ public partial class WebSiteSlotSourceControl : Azure.Provisioning.Primitives.Re public Azure.Provisioning.AppService.WebSiteSlot? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue RepoUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSlotSourceControl FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSlotSourceControl FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -4635,7 +4635,7 @@ public static partial class ResourceVersions } public partial class WebSiteSourceControl : Azure.Provisioning.Primitives.Resource { - public WebSiteSourceControl(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebSiteSourceControl(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Branch { get { throw null; } set { } } public Azure.Provisioning.BicepValue GitHubActionConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -4648,7 +4648,7 @@ public partial class WebSiteSourceControl : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.AppService.WebSite? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue RepoUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.AppService.WebSiteSourceControl FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.AppService.WebSiteSourceControl FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppCertificate.cs index b06252810aac8..e5277a442916b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppCertificate.cs @@ -186,10 +186,15 @@ public partial class AppCertificate : Resource /// /// Creates a new AppCertificate. /// - /// Name of the AppCertificate. + /// + /// The the Bicep identifier name of the AppCertificate resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppCertificate. - public AppCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/certificates", resourceVersion ?? "2024-04-01") + public AppCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/certificates", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -359,11 +364,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppCertificate. /// - /// Name of the AppCertificate. + /// + /// The the Bicep identifier name of the AppCertificate resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppCertificate. /// The existing AppCertificate resource. - public static AppCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this AppCertificate resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificate.cs index 0c64314c03237..952dc01312ffc 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificate.cs @@ -81,10 +81,15 @@ public partial class AppServiceCertificate : Resource /// /// Creates a new AppServiceCertificate. /// - /// Name of the AppServiceCertificate. + /// + /// The the Bicep identifier name of the AppServiceCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceCertificate. - public AppServiceCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CertificateRegistration/certificateOrders/certificates", resourceVersion ?? "2024-04-01") + public AppServiceCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CertificateRegistration/certificateOrders/certificates", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -187,9 +192,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServiceCertificate. /// - /// Name of the AppServiceCertificate. + /// + /// The the Bicep identifier name of the AppServiceCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceCertificate. /// The existing AppServiceCertificate resource. - public static AppServiceCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServiceCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificateOrder.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificateOrder.cs index 4bcf1455b04a6..dfba17405a8e6 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificateOrder.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceCertificateOrder.cs @@ -181,10 +181,15 @@ public partial class AppServiceCertificateOrder : Resource /// /// Creates a new AppServiceCertificateOrder. /// - /// Name of the AppServiceCertificateOrder. + /// + /// The the Bicep identifier name of the AppServiceCertificateOrder + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AppServiceCertificateOrder. - public AppServiceCertificateOrder(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CertificateRegistration/certificateOrders", resourceVersion ?? "2024-04-01") + public AppServiceCertificateOrder(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CertificateRegistration/certificateOrders", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -303,9 +308,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServiceCertificateOrder. /// - /// Name of the AppServiceCertificateOrder. + /// + /// The the Bicep identifier name of the AppServiceCertificateOrder + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AppServiceCertificateOrder. /// The existing AppServiceCertificateOrder resource. - public static AppServiceCertificateOrder FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServiceCertificateOrder FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceDomain.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceDomain.cs index b09122fcf74d6..0d7f58a8a6492 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceDomain.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceDomain.cs @@ -183,10 +183,15 @@ public partial class AppServiceDomain : Resource /// /// Creates a new AppServiceDomain. /// - /// Name of the AppServiceDomain. + /// + /// The the Bicep identifier name of the AppServiceDomain resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the AppServiceDomain. - public AppServiceDomain(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DomainRegistration/domains", resourceVersion ?? "2024-04-01") + public AppServiceDomain(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DomainRegistration/domains", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -310,9 +315,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServiceDomain. /// - /// Name of the AppServiceDomain. + /// + /// The the Bicep identifier name of the AppServiceDomain resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the AppServiceDomain. /// The existing AppServiceDomain resource. - public static AppServiceDomain FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServiceDomain FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceEnvironment.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceEnvironment.cs index e6eab0dcbfbc1..b049669594df2 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceEnvironment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceEnvironment.cs @@ -184,10 +184,15 @@ public partial class AppServiceEnvironment : Resource /// /// Creates a new AppServiceEnvironment. /// - /// Name of the AppServiceEnvironment. + /// + /// The the Bicep identifier name of the AppServiceEnvironment resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceEnvironment. - public AppServiceEnvironment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments", resourceVersion ?? "2024-04-01") + public AppServiceEnvironment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -381,9 +386,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServiceEnvironment. /// - /// Name of the AppServiceEnvironment. + /// + /// The the Bicep identifier name of the AppServiceEnvironment resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceEnvironment. /// The existing AppServiceEnvironment resource. - public static AppServiceEnvironment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServiceEnvironment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlan.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlan.cs index 2a126db938e54..66ec3ce668fc7 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlan.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlan.cs @@ -225,10 +225,15 @@ public partial class AppServicePlan : Resource /// /// Creates a new AppServicePlan. /// - /// Name of the AppServicePlan. + /// + /// The the Bicep identifier name of the AppServicePlan resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppServicePlan. - public AppServicePlan(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/serverfarms", resourceVersion ?? "2024-04-01") + public AppServicePlan(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/serverfarms", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -412,11 +417,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServicePlan. /// - /// Name of the AppServicePlan. + /// + /// The the Bicep identifier name of the AppServicePlan resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppServicePlan. /// The existing AppServicePlan resource. - public static AppServicePlan FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServicePlan FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this AppServicePlan resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionGateway.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionGateway.cs index 1fcd3f0afc652..3cb36bcaa4878 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionGateway.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionGateway.cs @@ -56,10 +56,16 @@ public partial class AppServicePlanVirtualNetworkConnectionGateway : Resource /// /// Creates a new AppServicePlanVirtualNetworkConnectionGateway. /// - /// Name of the AppServicePlanVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// AppServicePlanVirtualNetworkConnectionGateway resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppServicePlanVirtualNetworkConnectionGateway. - public AppServicePlanVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/serverfarms/virtualNetworkConnections/gateways", resourceVersion) + public AppServicePlanVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/serverfarms/virtualNetworkConnections/gateways", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -73,9 +79,15 @@ public AppServicePlanVirtualNetworkConnectionGateway(string resourceName, string /// Creates a reference to an existing /// AppServicePlanVirtualNetworkConnectionGateway. /// - /// Name of the AppServicePlanVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// AppServicePlanVirtualNetworkConnectionGateway resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the AppServicePlanVirtualNetworkConnectionGateway. /// The existing AppServicePlanVirtualNetworkConnectionGateway resource. - public static AppServicePlanVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServicePlanVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceSourceControl.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceSourceControl.cs index 0f45960f9d572..b13d47bf7f0ac 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceSourceControl.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AppServiceSourceControl.cs @@ -68,10 +68,15 @@ public partial class AppServiceSourceControl : Resource /// /// Creates a new AppServiceSourceControl. /// - /// Name of the AppServiceSourceControl. + /// + /// The the Bicep identifier name of the AppServiceSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceSourceControl. - public AppServiceSourceControl(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sourcecontrols", resourceVersion ?? "2024-04-01") + public AppServiceSourceControl(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sourcecontrols", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _expireOn = BicepValue.DefineProperty(this, "ExpireOn", ["properties", "expirationTime"]); @@ -222,9 +227,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AppServiceSourceControl. /// - /// Name of the AppServiceSourceControl. + /// + /// The the Bicep identifier name of the AppServiceSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the AppServiceSourceControl. /// The existing AppServiceSourceControl resource. - public static AppServiceSourceControl FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AppServiceSourceControl FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AseV3NetworkingConfiguration.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AseV3NetworkingConfiguration.cs index d64942afda567..f72b994bf3f87 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AseV3NetworkingConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/AseV3NetworkingConfiguration.cs @@ -101,10 +101,15 @@ public partial class AseV3NetworkingConfiguration : Resource /// /// Creates a new AseV3NetworkingConfiguration. /// - /// Name of the AseV3NetworkingConfiguration. + /// + /// The the Bicep identifier name of the AseV3NetworkingConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AseV3NetworkingConfiguration. - public AseV3NetworkingConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments/configurations", resourceVersion ?? "2024-04-01") + public AseV3NetworkingConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments/configurations", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allowNewPrivateEndpointConnections = BicepValue.DefineProperty(this, "AllowNewPrivateEndpointConnections", ["properties", "allowNewPrivateEndpointConnections"]); @@ -285,9 +290,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AseV3NetworkingConfiguration. /// - /// Name of the AseV3NetworkingConfiguration. + /// + /// The the Bicep identifier name of the AseV3NetworkingConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AseV3NetworkingConfiguration. /// The existing AseV3NetworkingConfiguration resource. - public static AseV3NetworkingConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AseV3NetworkingConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/CustomDnsSuffixConfiguration.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/CustomDnsSuffixConfiguration.cs index 622ddb0db127c..d72d4addfb2c7 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/CustomDnsSuffixConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/CustomDnsSuffixConfiguration.cs @@ -85,10 +85,15 @@ public partial class CustomDnsSuffixConfiguration : Resource /// /// Creates a new CustomDnsSuffixConfiguration. /// - /// Name of the CustomDnsSuffixConfiguration. + /// + /// The the Bicep identifier name of the CustomDnsSuffixConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CustomDnsSuffixConfiguration. - public CustomDnsSuffixConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments/configurations", resourceVersion ?? "2024-04-01") + public CustomDnsSuffixConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments/configurations", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _certificateUri = BicepValue.DefineProperty(this, "CertificateUri", ["properties", "certificateUrl"]); @@ -266,9 +271,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CustomDnsSuffixConfiguration. /// - /// Name of the CustomDnsSuffixConfiguration. + /// + /// The the Bicep identifier name of the CustomDnsSuffixConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CustomDnsSuffixConfiguration. /// The existing CustomDnsSuffixConfiguration resource. - public static CustomDnsSuffixConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CustomDnsSuffixConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/DomainOwnershipIdentifier.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/DomainOwnershipIdentifier.cs index f82ee592ce227..0928f61d54094 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/DomainOwnershipIdentifier.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/DomainOwnershipIdentifier.cs @@ -56,10 +56,15 @@ public partial class DomainOwnershipIdentifier : Resource /// /// Creates a new DomainOwnershipIdentifier. /// - /// Name of the DomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the DomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DomainOwnershipIdentifier. - public DomainOwnershipIdentifier(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DomainRegistration/domains/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") + public DomainOwnershipIdentifier(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DomainRegistration/domains/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -163,9 +168,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DomainOwnershipIdentifier. /// - /// Name of the DomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the DomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DomainOwnershipIdentifier. /// The existing DomainOwnershipIdentifier resource. - public static DomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentMultiRolePool.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentMultiRolePool.cs index 44e250c5a7c02..f6a3e06a76290 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentMultiRolePool.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentMultiRolePool.cs @@ -87,10 +87,15 @@ public partial class HostingEnvironmentMultiRolePool : Resource /// /// Creates a new HostingEnvironmentMultiRolePool. /// - /// Name of the HostingEnvironmentMultiRolePool. + /// + /// The the Bicep identifier name of the HostingEnvironmentMultiRolePool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the HostingEnvironmentMultiRolePool. - public HostingEnvironmentMultiRolePool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments/multiRolePools", resourceVersion ?? "2024-04-01") + public HostingEnvironmentMultiRolePool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments/multiRolePools", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _computeMode = BicepValue.DefineProperty(this, "ComputeMode", ["properties", "computeMode"]); @@ -264,9 +269,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing HostingEnvironmentMultiRolePool. /// - /// Name of the HostingEnvironmentMultiRolePool. + /// + /// The the Bicep identifier name of the HostingEnvironmentMultiRolePool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the HostingEnvironmentMultiRolePool. /// The existing HostingEnvironmentMultiRolePool resource. - public static HostingEnvironmentMultiRolePool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static HostingEnvironmentMultiRolePool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentPrivateEndpointConnection.cs index 4d421aa551b90..897a316c295c0 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentPrivateEndpointConnection.cs @@ -76,10 +76,16 @@ public partial class HostingEnvironmentPrivateEndpointConnection : Resource /// /// Creates a new HostingEnvironmentPrivateEndpointConnection. /// - /// Name of the HostingEnvironmentPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// HostingEnvironmentPrivateEndpointConnection resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the HostingEnvironmentPrivateEndpointConnection. - public HostingEnvironmentPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments/privateEndpointConnections", resourceVersion ?? "2024-04-01") + public HostingEnvironmentPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments/privateEndpointConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _iPAddresses = BicepList.DefineProperty(this, "IPAddresses", ["properties", "ipAddresses"]); @@ -257,9 +263,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// HostingEnvironmentPrivateEndpointConnection. /// - /// Name of the HostingEnvironmentPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// HostingEnvironmentPrivateEndpointConnection resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the HostingEnvironmentPrivateEndpointConnection. /// The existing HostingEnvironmentPrivateEndpointConnection resource. - public static HostingEnvironmentPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static HostingEnvironmentPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentWorkerPool.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentWorkerPool.cs index aecf2de07d170..1abfe2dc9c086 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentWorkerPool.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/HostingEnvironmentWorkerPool.cs @@ -87,10 +87,15 @@ public partial class HostingEnvironmentWorkerPool : Resource /// /// Creates a new HostingEnvironmentWorkerPool. /// - /// Name of the HostingEnvironmentWorkerPool. + /// + /// The the Bicep identifier name of the HostingEnvironmentWorkerPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the HostingEnvironmentWorkerPool. - public HostingEnvironmentWorkerPool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/hostingEnvironments/workerPools", resourceVersion ?? "2024-04-01") + public HostingEnvironmentWorkerPool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/hostingEnvironments/workerPools", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _computeMode = BicepValue.DefineProperty(this, "ComputeMode", ["properties", "computeMode"]); @@ -264,9 +269,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing HostingEnvironmentWorkerPool. /// - /// Name of the HostingEnvironmentWorkerPool. + /// + /// The the Bicep identifier name of the HostingEnvironmentWorkerPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the HostingEnvironmentWorkerPool. /// The existing HostingEnvironmentWorkerPool resource. - public static HostingEnvironmentWorkerPool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static HostingEnvironmentWorkerPool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/KubeEnvironment.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/KubeEnvironment.cs index d1c19bc9c6247..3a8a4dbd1ef3b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/KubeEnvironment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/KubeEnvironment.cs @@ -129,10 +129,15 @@ public partial class KubeEnvironment : Resource /// /// Creates a new KubeEnvironment. /// - /// Name of the KubeEnvironment. + /// + /// The the Bicep identifier name of the KubeEnvironment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the KubeEnvironment. - public KubeEnvironment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/kubeEnvironments", resourceVersion ?? "2021-03-01") + public KubeEnvironment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/kubeEnvironments", resourceVersion ?? "2021-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -167,9 +172,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing KubeEnvironment. /// - /// Name of the KubeEnvironment. + /// + /// The the Bicep identifier name of the KubeEnvironment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the KubeEnvironment. /// The existing KubeEnvironment resource. - public static KubeEnvironment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KubeEnvironment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteConfig.cs index cfc87552b3126..c25d38e2a2d22 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteConfig.cs @@ -76,10 +76,15 @@ public partial class LogsSiteConfig : Resource /// /// Creates a new LogsSiteConfig. /// - /// Name of the LogsSiteConfig. + /// + /// The the Bicep identifier name of the LogsSiteConfig resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the LogsSiteConfig. - public LogsSiteConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") + public LogsSiteConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _applicationLogs = BicepValue.DefineProperty(this, "ApplicationLogs", ["properties", "applicationLogs"]); @@ -256,9 +261,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LogsSiteConfig. /// - /// Name of the LogsSiteConfig. + /// + /// The the Bicep identifier name of the LogsSiteConfig resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the LogsSiteConfig. /// The existing LogsSiteConfig resource. - public static LogsSiteConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LogsSiteConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteSlotConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteSlotConfig.cs index f0d46f70d9b2e..d680566fd83cd 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteSlotConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/LogsSiteSlotConfig.cs @@ -76,10 +76,15 @@ public partial class LogsSiteSlotConfig : Resource /// /// Creates a new LogsSiteSlotConfig. /// - /// Name of the LogsSiteSlotConfig. + /// + /// The the Bicep identifier name of the LogsSiteSlotConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LogsSiteSlotConfig. - public LogsSiteSlotConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/config", resourceVersion ?? "2024-04-01") + public LogsSiteSlotConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/config", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _applicationLogs = BicepValue.DefineProperty(this, "ApplicationLogs", ["properties", "applicationLogs"]); @@ -256,9 +261,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LogsSiteSlotConfig. /// - /// Name of the LogsSiteSlotConfig. + /// + /// The the Bicep identifier name of the LogsSiteSlotConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LogsSiteSlotConfig. /// The existing LogsSiteSlotConfig resource. - public static LogsSiteSlotConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LogsSiteSlotConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/PublishingUser.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/PublishingUser.cs index d3b160f5973f1..07898255f42b7 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/PublishingUser.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/PublishingUser.cs @@ -74,10 +74,15 @@ public partial class PublishingUser : Resource /// /// Creates a new PublishingUser. /// - /// Name of the PublishingUser. + /// + /// The the Bicep identifier name of the PublishingUser resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the PublishingUser. - public PublishingUser(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/publishingUsers", resourceVersion ?? "2024-04-01") + public PublishingUser(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/publishingUsers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -229,9 +234,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PublishingUser. /// - /// Name of the PublishingUser. + /// + /// The the Bicep identifier name of the PublishingUser resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the PublishingUser. /// The existing PublishingUser resource. - public static PublishingUser FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PublishingUser FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteBasicPublishingCredentialsPolicy.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteBasicPublishingCredentialsPolicy.cs index 38e093183cb0b..5349cb8ef7093 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteBasicPublishingCredentialsPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteBasicPublishingCredentialsPolicy.cs @@ -57,10 +57,15 @@ public partial class ScmSiteBasicPublishingCredentialsPolicy : Resource /// /// Creates a new ScmSiteBasicPublishingCredentialsPolicy. /// - /// Name of the ScmSiteBasicPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// ScmSiteBasicPublishingCredentialsPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ScmSiteBasicPublishingCredentialsPolicy. - public ScmSiteBasicPublishingCredentialsPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") + public ScmSiteBasicPublishingCredentialsPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allow = BicepValue.DefineProperty(this, "Allow", ["properties", "allow"]); @@ -235,9 +240,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ScmSiteBasicPublishingCredentialsPolicy. /// - /// Name of the ScmSiteBasicPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// ScmSiteBasicPublishingCredentialsPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ScmSiteBasicPublishingCredentialsPolicy. /// The existing ScmSiteBasicPublishingCredentialsPolicy resource. - public static ScmSiteBasicPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ScmSiteBasicPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteSlotBasicPublishingCredentialsPolicy.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteSlotBasicPublishingCredentialsPolicy.cs index 0421974be0fe4..79b455d6dfde9 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteSlotBasicPublishingCredentialsPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/ScmSiteSlotBasicPublishingCredentialsPolicy.cs @@ -57,10 +57,16 @@ public partial class ScmSiteSlotBasicPublishingCredentialsPolicy : Resource /// /// Creates a new ScmSiteSlotBasicPublishingCredentialsPolicy. /// - /// Name of the ScmSiteSlotBasicPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// ScmSiteSlotBasicPublishingCredentialsPolicy resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ScmSiteSlotBasicPublishingCredentialsPolicy. - public ScmSiteSlotBasicPublishingCredentialsPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") + public ScmSiteSlotBasicPublishingCredentialsPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allow = BicepValue.DefineProperty(this, "Allow", ["properties", "allow"]); @@ -235,9 +241,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ScmSiteSlotBasicPublishingCredentialsPolicy. /// - /// Name of the ScmSiteSlotBasicPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// ScmSiteSlotBasicPublishingCredentialsPolicy resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ScmSiteSlotBasicPublishingCredentialsPolicy. /// The existing ScmSiteSlotBasicPublishingCredentialsPolicy resource. - public static ScmSiteSlotBasicPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ScmSiteSlotBasicPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteContainer.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteContainer.cs index 7b0dbcea9bba5..5afd833e19550 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteContainer.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteContainer.cs @@ -124,10 +124,15 @@ public partial class SiteContainer : Resource /// /// Creates a new SiteContainer. /// - /// Name of the SiteContainer. + /// + /// The the Bicep identifier name of the SiteContainer resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteContainer. - public SiteContainer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/sitecontainers", resourceVersion ?? "2024-04-01") + public SiteContainer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/sitecontainers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _authType = BicepValue.DefineProperty(this, "AuthType", ["properties", "authType"]); @@ -312,9 +317,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteContainer. /// - /// Name of the SiteContainer. + /// + /// The the Bicep identifier name of the SiteContainer resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteContainer. /// The existing SiteContainer resource. - public static SiteContainer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteContainer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDeployment.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDeployment.cs index 4beb68ef6d606..9ec68cde76601 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDeployment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDeployment.cs @@ -98,10 +98,15 @@ public partial class SiteDeployment : Resource /// /// Creates a new SiteDeployment. /// - /// Name of the SiteDeployment. + /// + /// The the Bicep identifier name of the SiteDeployment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteDeployment. - public SiteDeployment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/deployments", resourceVersion ?? "2024-04-01") + public SiteDeployment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/deployments", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _author = BicepValue.DefineProperty(this, "Author", ["properties", "author"]); @@ -282,9 +287,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteDeployment. /// - /// Name of the SiteDeployment. + /// + /// The the Bicep identifier name of the SiteDeployment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteDeployment. /// The existing SiteDeployment resource. - public static SiteDeployment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteDeployment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDomainOwnershipIdentifier.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDomainOwnershipIdentifier.cs index 28b2512c733b8..e98415583b977 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDomainOwnershipIdentifier.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteDomainOwnershipIdentifier.cs @@ -56,10 +56,15 @@ public partial class SiteDomainOwnershipIdentifier : Resource /// /// Creates a new SiteDomainOwnershipIdentifier. /// - /// Name of the SiteDomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the SiteDomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteDomainOwnershipIdentifier. - public SiteDomainOwnershipIdentifier(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") + public SiteDomainOwnershipIdentifier(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -233,9 +238,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteDomainOwnershipIdentifier. /// - /// Name of the SiteDomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the SiteDomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteDomainOwnershipIdentifier. /// The existing SiteDomainOwnershipIdentifier resource. - public static SiteDomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteDomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteExtension.cs index 106cb199cf4aa..b0a56bf9cc465 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteExtension.cs @@ -129,10 +129,15 @@ public partial class SiteExtension : Resource /// /// Creates a new SiteExtension. /// - /// Name of the SiteExtension. + /// + /// The the Bicep identifier name of the SiteExtension resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteExtension. - public SiteExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/extensions", resourceVersion ?? "2024-04-01") + public SiteExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/extensions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _connectionString = BicepValue.DefineProperty(this, "ConnectionString", ["properties", "connectionString"]); @@ -317,9 +322,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteExtension. /// - /// Name of the SiteExtension. + /// + /// The the Bicep identifier name of the SiteExtension resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteExtension. /// The existing SiteExtension resource. - public static SiteExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteFunction.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteFunction.cs index 246c7da464bcf..83f9129c76946 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteFunction.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteFunction.cs @@ -142,10 +142,15 @@ public partial class SiteFunction : Resource /// /// Creates a new SiteFunction. /// - /// Name of the SiteFunction. + /// + /// The the Bicep identifier name of the SiteFunction resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteFunction. - public SiteFunction(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/functions", resourceVersion ?? "2024-04-01") + public SiteFunction(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/functions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _config = BicepValue.DefineProperty(this, "Config", ["properties", "config"]); @@ -331,9 +336,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteFunction. /// - /// Name of the SiteFunction. + /// + /// The the Bicep identifier name of the SiteFunction resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SiteFunction. /// The existing SiteFunction resource. - public static SiteFunction FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteFunction FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHostNameBinding.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHostNameBinding.cs index 650afbe339cc4..e72916864e933 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHostNameBinding.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHostNameBinding.cs @@ -104,10 +104,15 @@ public partial class SiteHostNameBinding : Resource /// /// Creates a new SiteHostNameBinding. /// - /// Name of the SiteHostNameBinding. + /// + /// The the Bicep identifier name of the SiteHostNameBinding resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteHostNameBinding. - public SiteHostNameBinding(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/hostNameBindings", resourceVersion ?? "2024-04-01") + public SiteHostNameBinding(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/hostNameBindings", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _azureResourceName = BicepValue.DefineProperty(this, "AzureResourceName", ["properties", "azureResourceName"]); @@ -254,9 +259,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteHostNameBinding. /// - /// Name of the SiteHostNameBinding. + /// + /// The the Bicep identifier name of the SiteHostNameBinding resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteHostNameBinding. /// The existing SiteHostNameBinding resource. - public static SiteHostNameBinding FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteHostNameBinding FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHybridConnectionNamespaceRelay.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHybridConnectionNamespaceRelay.cs index f79c5b0b2315b..b7ec765e8cf70 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHybridConnectionNamespaceRelay.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteHybridConnectionNamespaceRelay.cs @@ -96,10 +96,15 @@ public partial class SiteHybridConnectionNamespaceRelay : Resource /// /// Creates a new SiteHybridConnectionNamespaceRelay. /// - /// Name of the SiteHybridConnectionNamespaceRelay. + /// + /// The the Bicep identifier name of the SiteHybridConnectionNamespaceRelay + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteHybridConnectionNamespaceRelay. - public SiteHybridConnectionNamespaceRelay(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/hybridConnectionNamespaces/relays", resourceVersion) + public SiteHybridConnectionNamespaceRelay(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/hybridConnectionNamespaces/relays", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _relayName = BicepValue.DefineProperty(this, "RelayName", ["properties", "relayName"], isRequired: true); @@ -118,9 +123,14 @@ public SiteHybridConnectionNamespaceRelay(string resourceName, string? resourceV /// /// Creates a reference to an existing SiteHybridConnectionNamespaceRelay. /// - /// Name of the SiteHybridConnectionNamespaceRelay. + /// + /// The the Bicep identifier name of the SiteHybridConnectionNamespaceRelay + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteHybridConnectionNamespaceRelay. /// The existing SiteHybridConnectionNamespaceRelay resource. - public static SiteHybridConnectionNamespaceRelay FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteHybridConnectionNamespaceRelay FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteInstanceExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteInstanceExtension.cs index be2b01b0319d9..cd59e30245bc1 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteInstanceExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteInstanceExtension.cs @@ -123,10 +123,15 @@ public partial class SiteInstanceExtension : Resource /// /// Creates a new SiteInstanceExtension. /// - /// Name of the SiteInstanceExtension. + /// + /// The the Bicep identifier name of the SiteInstanceExtension resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteInstanceExtension. - public SiteInstanceExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/instances/extensions", resourceVersion) + public SiteInstanceExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/instances/extensions", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _connectionString = BicepValue.DefineProperty(this, "ConnectionString", ["properties", "connectionString"]); @@ -149,9 +154,14 @@ public SiteInstanceExtension(string resourceName, string? resourceVersion = defa /// /// Creates a reference to an existing SiteInstanceExtension. /// - /// Name of the SiteInstanceExtension. + /// + /// The the Bicep identifier name of the SiteInstanceExtension resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteInstanceExtension. /// The existing SiteInstanceExtension resource. - public static SiteInstanceExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteInstanceExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteNetworkConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteNetworkConfig.cs index 874be79e140ed..962ff6da4b188 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteNetworkConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteNetworkConfig.cs @@ -65,10 +65,15 @@ public partial class SiteNetworkConfig : Resource /// /// Creates a new SiteNetworkConfig. /// - /// Name of the SiteNetworkConfig. + /// + /// The the Bicep identifier name of the SiteNetworkConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteNetworkConfig. - public SiteNetworkConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/networkConfig", resourceVersion ?? "2024-04-01") + public SiteNetworkConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/networkConfig", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isSwiftSupported = BicepValue.DefineProperty(this, "IsSwiftSupported", ["properties", "swiftSupported"]); @@ -208,9 +213,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteNetworkConfig. /// - /// Name of the SiteNetworkConfig. + /// + /// The the Bicep identifier name of the SiteNetworkConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteNetworkConfig. /// The existing SiteNetworkConfig resource. - public static SiteNetworkConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteNetworkConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePrivateEndpointConnection.cs index 8ee058a0d1408..e053f330d0fdb 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePrivateEndpointConnection.cs @@ -77,10 +77,15 @@ public partial class SitePrivateEndpointConnection : Resource /// /// Creates a new SitePrivateEndpointConnection. /// - /// Name of the SitePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SitePrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SitePrivateEndpointConnection. - public SitePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/privateEndpointConnections", resourceVersion ?? "2024-04-01") + public SitePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/privateEndpointConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _iPAddresses = BicepList.DefineProperty(this, "IPAddresses", ["properties", "ipAddresses"]); @@ -257,11 +262,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SitePrivateEndpointConnection. /// - /// Name of the SitePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SitePrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SitePrivateEndpointConnection. /// The existing SitePrivateEndpointConnection resource. - public static SitePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SitePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SitePrivateEndpointConnection diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePublicCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePublicCertificate.cs index 42fa58fbe57ad..2122d361f157b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePublicCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SitePublicCertificate.cs @@ -68,10 +68,15 @@ public partial class SitePublicCertificate : Resource /// /// Creates a new SitePublicCertificate. /// - /// Name of the SitePublicCertificate. + /// + /// The the Bicep identifier name of the SitePublicCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SitePublicCertificate. - public SitePublicCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/publicCertificates", resourceVersion ?? "2024-04-01") + public SitePublicCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/publicCertificates", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _blob = BicepValue.DefineProperty(this, "Blob", ["properties", "blob"]); @@ -247,9 +252,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SitePublicCertificate. /// - /// Name of the SitePublicCertificate. + /// + /// The the Bicep identifier name of the SitePublicCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SitePublicCertificate. /// The existing SitePublicCertificate resource. - public static SitePublicCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SitePublicCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDeployment.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDeployment.cs index 44a9a9bac1008..87f997412ca8c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDeployment.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDeployment.cs @@ -98,10 +98,15 @@ public partial class SiteSlotDeployment : Resource /// /// Creates a new SiteSlotDeployment. /// - /// Name of the SiteSlotDeployment. + /// + /// The the Bicep identifier name of the SiteSlotDeployment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotDeployment. - public SiteSlotDeployment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/deployments", resourceVersion ?? "2024-04-01") + public SiteSlotDeployment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/deployments", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _author = BicepValue.DefineProperty(this, "Author", ["properties", "author"]); @@ -282,9 +287,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotDeployment. /// - /// Name of the SiteSlotDeployment. + /// + /// The the Bicep identifier name of the SiteSlotDeployment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotDeployment. /// The existing SiteSlotDeployment resource. - public static SiteSlotDeployment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotDeployment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDomainOwnershipIdentifier.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDomainOwnershipIdentifier.cs index 5ffe1060066b7..bec717f386003 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDomainOwnershipIdentifier.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotDomainOwnershipIdentifier.cs @@ -56,10 +56,15 @@ public partial class SiteSlotDomainOwnershipIdentifier : Resource /// /// Creates a new SiteSlotDomainOwnershipIdentifier. /// - /// Name of the SiteSlotDomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the SiteSlotDomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotDomainOwnershipIdentifier. - public SiteSlotDomainOwnershipIdentifier(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") + public SiteSlotDomainOwnershipIdentifier(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/domainOwnershipIdentifiers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -233,9 +238,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotDomainOwnershipIdentifier. /// - /// Name of the SiteSlotDomainOwnershipIdentifier. + /// + /// The the Bicep identifier name of the SiteSlotDomainOwnershipIdentifier + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotDomainOwnershipIdentifier. /// The existing SiteSlotDomainOwnershipIdentifier resource. - public static SiteSlotDomainOwnershipIdentifier FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotDomainOwnershipIdentifier FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotExtension.cs index d1bdbc415f1c4..31045178e3574 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotExtension.cs @@ -129,10 +129,15 @@ public partial class SiteSlotExtension : Resource /// /// Creates a new SiteSlotExtension. /// - /// Name of the SiteSlotExtension. + /// + /// The the Bicep identifier name of the SiteSlotExtension resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotExtension. - public SiteSlotExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/extensions", resourceVersion ?? "2024-04-01") + public SiteSlotExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/extensions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _connectionString = BicepValue.DefineProperty(this, "ConnectionString", ["properties", "connectionString"]); @@ -317,9 +322,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotExtension. /// - /// Name of the SiteSlotExtension. + /// + /// The the Bicep identifier name of the SiteSlotExtension resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotExtension. /// The existing SiteSlotExtension resource. - public static SiteSlotExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotFunction.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotFunction.cs index 078a373dfe4a1..a3fc3151188a4 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotFunction.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotFunction.cs @@ -142,10 +142,15 @@ public partial class SiteSlotFunction : Resource /// /// Creates a new SiteSlotFunction. /// - /// Name of the SiteSlotFunction. + /// + /// The the Bicep identifier name of the SiteSlotFunction resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotFunction. - public SiteSlotFunction(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/functions", resourceVersion ?? "2024-04-01") + public SiteSlotFunction(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/functions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _config = BicepValue.DefineProperty(this, "Config", ["properties", "config"]); @@ -331,9 +336,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotFunction. /// - /// Name of the SiteSlotFunction. + /// + /// The the Bicep identifier name of the SiteSlotFunction resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SiteSlotFunction. /// The existing SiteSlotFunction resource. - public static SiteSlotFunction FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotFunction FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHostNameBinding.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHostNameBinding.cs index 91cbbc4cdaab2..fbc5d884f849c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHostNameBinding.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHostNameBinding.cs @@ -104,10 +104,15 @@ public partial class SiteSlotHostNameBinding : Resource /// /// Creates a new SiteSlotHostNameBinding. /// - /// Name of the SiteSlotHostNameBinding. + /// + /// The the Bicep identifier name of the SiteSlotHostNameBinding resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotHostNameBinding. - public SiteSlotHostNameBinding(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/hostNameBindings", resourceVersion ?? "2024-04-01") + public SiteSlotHostNameBinding(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/hostNameBindings", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _azureResourceName = BicepValue.DefineProperty(this, "AzureResourceName", ["properties", "azureResourceName"]); @@ -254,9 +259,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotHostNameBinding. /// - /// Name of the SiteSlotHostNameBinding. + /// + /// The the Bicep identifier name of the SiteSlotHostNameBinding resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotHostNameBinding. /// The existing SiteSlotHostNameBinding resource. - public static SiteSlotHostNameBinding FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotHostNameBinding FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHybridConnectionNamespaceRelay.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHybridConnectionNamespaceRelay.cs index b40bc76ace578..b5e9c2b463b06 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHybridConnectionNamespaceRelay.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotHybridConnectionNamespaceRelay.cs @@ -96,10 +96,15 @@ public partial class SiteSlotHybridConnectionNamespaceRelay : Resource /// /// Creates a new SiteSlotHybridConnectionNamespaceRelay. /// - /// Name of the SiteSlotHybridConnectionNamespaceRelay. + /// + /// The the Bicep identifier name of the + /// SiteSlotHybridConnectionNamespaceRelay resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteSlotHybridConnectionNamespaceRelay. - public SiteSlotHybridConnectionNamespaceRelay(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/hybridConnectionNamespaces/relays", resourceVersion) + public SiteSlotHybridConnectionNamespaceRelay(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/hybridConnectionNamespaces/relays", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _relayName = BicepValue.DefineProperty(this, "RelayName", ["properties", "relayName"], isRequired: true); @@ -119,9 +124,14 @@ public SiteSlotHybridConnectionNamespaceRelay(string resourceName, string? resou /// Creates a reference to an existing /// SiteSlotHybridConnectionNamespaceRelay. /// - /// Name of the SiteSlotHybridConnectionNamespaceRelay. + /// + /// The the Bicep identifier name of the + /// SiteSlotHybridConnectionNamespaceRelay resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteSlotHybridConnectionNamespaceRelay. /// The existing SiteSlotHybridConnectionNamespaceRelay resource. - public static SiteSlotHybridConnectionNamespaceRelay FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotHybridConnectionNamespaceRelay FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotInstanceExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotInstanceExtension.cs index 09d0595fbd930..965252250734c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotInstanceExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotInstanceExtension.cs @@ -123,10 +123,15 @@ public partial class SiteSlotInstanceExtension : Resource /// /// Creates a new SiteSlotInstanceExtension. /// - /// Name of the SiteSlotInstanceExtension. + /// + /// The the Bicep identifier name of the SiteSlotInstanceExtension + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotInstanceExtension. - public SiteSlotInstanceExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/instances/extensions", resourceVersion) + public SiteSlotInstanceExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/instances/extensions", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _connectionString = BicepValue.DefineProperty(this, "ConnectionString", ["properties", "connectionString"]); @@ -149,9 +154,14 @@ public SiteSlotInstanceExtension(string resourceName, string? resourceVersion = /// /// Creates a reference to an existing SiteSlotInstanceExtension. /// - /// Name of the SiteSlotInstanceExtension. + /// + /// The the Bicep identifier name of the SiteSlotInstanceExtension + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotInstanceExtension. /// The existing SiteSlotInstanceExtension resource. - public static SiteSlotInstanceExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotInstanceExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotNetworkConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotNetworkConfig.cs index 1a232952ca9eb..384b10e391f1e 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotNetworkConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotNetworkConfig.cs @@ -65,10 +65,15 @@ public partial class SiteSlotNetworkConfig : Resource /// /// Creates a new SiteSlotNetworkConfig. /// - /// Name of the SiteSlotNetworkConfig. + /// + /// The the Bicep identifier name of the SiteSlotNetworkConfig resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotNetworkConfig. - public SiteSlotNetworkConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/networkConfig", resourceVersion ?? "2024-04-01") + public SiteSlotNetworkConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/networkConfig", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isSwiftSupported = BicepValue.DefineProperty(this, "IsSwiftSupported", ["properties", "swiftSupported"]); @@ -208,9 +213,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotNetworkConfig. /// - /// Name of the SiteSlotNetworkConfig. + /// + /// The the Bicep identifier name of the SiteSlotNetworkConfig resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotNetworkConfig. /// The existing SiteSlotNetworkConfig resource. - public static SiteSlotNetworkConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotNetworkConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotPrivateEndpointConnection.cs index 6d49d481b6399..3d33ad3d90525 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotPrivateEndpointConnection.cs @@ -76,10 +76,15 @@ public partial class SiteSlotPrivateEndpointConnection : Resource /// /// Creates a new SiteSlotPrivateEndpointConnection. /// - /// Name of the SiteSlotPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SiteSlotPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotPrivateEndpointConnection. - public SiteSlotPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/privateEndpointConnections", resourceVersion ?? "2024-04-01") + public SiteSlotPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/privateEndpointConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _iPAddresses = BicepList.DefineProperty(this, "IPAddresses", ["properties", "ipAddresses"]); @@ -256,9 +261,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotPrivateEndpointConnection. /// - /// Name of the SiteSlotPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SiteSlotPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotPrivateEndpointConnection. /// The existing SiteSlotPrivateEndpointConnection resource. - public static SiteSlotPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotSiteContainer.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotSiteContainer.cs index 9c8aab7124528..12c1c6eae3575 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotSiteContainer.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotSiteContainer.cs @@ -124,10 +124,15 @@ public partial class SiteSlotSiteContainer : Resource /// /// Creates a new SiteSlotSiteContainer. /// - /// Name of the SiteSlotSiteContainer. + /// + /// The the Bicep identifier name of the SiteSlotSiteContainer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotSiteContainer. - public SiteSlotSiteContainer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/sitecontainers", resourceVersion ?? "2024-04-01") + public SiteSlotSiteContainer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/sitecontainers", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _authType = BicepValue.DefineProperty(this, "AuthType", ["properties", "authType"]); @@ -312,9 +317,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotSiteContainer. /// - /// Name of the SiteSlotSiteContainer. + /// + /// The the Bicep identifier name of the SiteSlotSiteContainer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SiteSlotSiteContainer. /// The existing SiteSlotSiteContainer resource. - public static SiteSlotSiteContainer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotSiteContainer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnection.cs index 01bd62da89cb6..83c1288395dc0 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnection.cs @@ -96,10 +96,15 @@ public partial class SiteSlotVirtualNetworkConnection : Resource /// /// Creates a new SiteSlotVirtualNetworkConnection. /// - /// Name of the SiteSlotVirtualNetworkConnection. + /// + /// The the Bicep identifier name of the SiteSlotVirtualNetworkConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotVirtualNetworkConnection. - public SiteSlotVirtualNetworkConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/virtualNetworkConnections", resourceVersion ?? "2024-04-01") + public SiteSlotVirtualNetworkConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/virtualNetworkConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _certBlob = BicepValue.DefineProperty(this, "CertBlob", ["properties", "certBlob"]); @@ -279,9 +284,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteSlotVirtualNetworkConnection. /// - /// Name of the SiteSlotVirtualNetworkConnection. + /// + /// The the Bicep identifier name of the SiteSlotVirtualNetworkConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteSlotVirtualNetworkConnection. /// The existing SiteSlotVirtualNetworkConnection resource. - public static SiteSlotVirtualNetworkConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotVirtualNetworkConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnectionGateway.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnectionGateway.cs index a605f373159ac..5a4150cd8909d 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnectionGateway.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteSlotVirtualNetworkConnectionGateway.cs @@ -63,10 +63,15 @@ public partial class SiteSlotVirtualNetworkConnectionGateway : Resource /// /// Creates a new SiteSlotVirtualNetworkConnectionGateway. /// - /// Name of the SiteSlotVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// SiteSlotVirtualNetworkConnectionGateway resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteSlotVirtualNetworkConnectionGateway. - public SiteSlotVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/virtualNetworkConnections/gateways", resourceVersion ?? "2024-04-01") + public SiteSlotVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/virtualNetworkConnections/gateways", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -242,9 +247,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// SiteSlotVirtualNetworkConnectionGateway. /// - /// Name of the SiteSlotVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// SiteSlotVirtualNetworkConnectionGateway resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteSlotVirtualNetworkConnectionGateway. /// The existing SiteSlotVirtualNetworkConnectionGateway resource. - public static SiteSlotVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteSlotVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnection.cs index b150e0ef0cf3f..39063611591de 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnection.cs @@ -96,10 +96,15 @@ public partial class SiteVirtualNetworkConnection : Resource /// /// Creates a new SiteVirtualNetworkConnection. /// - /// Name of the SiteVirtualNetworkConnection. + /// + /// The the Bicep identifier name of the SiteVirtualNetworkConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteVirtualNetworkConnection. - public SiteVirtualNetworkConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/virtualNetworkConnections", resourceVersion ?? "2024-04-01") + public SiteVirtualNetworkConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/virtualNetworkConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _certBlob = BicepValue.DefineProperty(this, "CertBlob", ["properties", "certBlob"]); @@ -279,9 +284,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteVirtualNetworkConnection. /// - /// Name of the SiteVirtualNetworkConnection. + /// + /// The the Bicep identifier name of the SiteVirtualNetworkConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SiteVirtualNetworkConnection. /// The existing SiteVirtualNetworkConnection resource. - public static SiteVirtualNetworkConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteVirtualNetworkConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnectionGateway.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnectionGateway.cs index ce205be49ddb6..3deb407098bcc 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnectionGateway.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SiteVirtualNetworkConnectionGateway.cs @@ -63,10 +63,15 @@ public partial class SiteVirtualNetworkConnectionGateway : Resource /// /// Creates a new SiteVirtualNetworkConnectionGateway. /// - /// Name of the SiteVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// SiteVirtualNetworkConnectionGateway resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteVirtualNetworkConnectionGateway. - public SiteVirtualNetworkConnectionGateway(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/virtualNetworkConnections/gateways", resourceVersion ?? "2024-04-01") + public SiteVirtualNetworkConnectionGateway(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/virtualNetworkConnections/gateways", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -241,9 +246,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SiteVirtualNetworkConnectionGateway. /// - /// Name of the SiteVirtualNetworkConnectionGateway. + /// + /// The the Bicep identifier name of the + /// SiteVirtualNetworkConnectionGateway resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SiteVirtualNetworkConnectionGateway. /// The existing SiteVirtualNetworkConnectionGateway resource. - public static SiteVirtualNetworkConnectionGateway FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SiteVirtualNetworkConnectionGateway FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SlotConfigNames.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SlotConfigNames.cs index 390b1fb0d73d8..e7da065c8f7a5 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SlotConfigNames.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/SlotConfigNames.cs @@ -69,10 +69,15 @@ public partial class SlotConfigNames : Resource /// /// Creates a new SlotConfigNames. /// - /// Name of the SlotConfigNames. + /// + /// The the Bicep identifier name of the SlotConfigNames resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SlotConfigNames. - public SlotConfigNames(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") + public SlotConfigNames(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _appSettingNames = BicepList.DefineProperty(this, "AppSettingNames", ["properties", "appSettingNames"]); @@ -248,9 +253,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SlotConfigNames. /// - /// Name of the SlotConfigNames. + /// + /// The the Bicep identifier name of the SlotConfigNames resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SlotConfigNames. /// The existing SlotConfigNames resource. - public static SlotConfigNames FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SlotConfigNames FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSite.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSite.cs index 528898766e674..81f62c5c78280 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSite.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSite.cs @@ -186,10 +186,15 @@ public partial class StaticSite : Resource /// /// Creates a new StaticSite. /// - /// Name of the StaticSite. + /// + /// The the Bicep identifier name of the StaticSite resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StaticSite. - public StaticSite(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites", resourceVersion ?? "2024-04-01") + public StaticSite(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -298,9 +303,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSite. /// - /// Name of the StaticSite. + /// + /// The the Bicep identifier name of the StaticSite resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StaticSite. /// The existing StaticSite resource. - public static StaticSite FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSite FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBasicAuthProperty.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBasicAuthProperty.cs index a1e56f9ae28b3..e1d8f5c23228b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBasicAuthProperty.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBasicAuthProperty.cs @@ -83,10 +83,15 @@ public partial class StaticSiteBasicAuthProperty : Resource /// /// Creates a new StaticSiteBasicAuthProperty. /// - /// Name of the StaticSiteBasicAuthProperty. + /// + /// The the Bicep identifier name of the StaticSiteBasicAuthProperty + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBasicAuthProperty. - public StaticSiteBasicAuthProperty(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/basicAuth", resourceVersion ?? "2024-04-01") + public StaticSiteBasicAuthProperty(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/basicAuth", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _applicableEnvironmentsMode = BicepValue.DefineProperty(this, "ApplicableEnvironmentsMode", ["properties", "applicableEnvironmentsMode"]); @@ -179,9 +184,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteBasicAuthProperty. /// - /// Name of the StaticSiteBasicAuthProperty. + /// + /// The the Bicep identifier name of the StaticSiteBasicAuthProperty + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBasicAuthProperty. /// The existing StaticSiteBasicAuthProperty resource. - public static StaticSiteBasicAuthProperty FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteBasicAuthProperty FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildDatabaseConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildDatabaseConnection.cs index 86abfe0e63df0..d750623204099 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildDatabaseConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildDatabaseConnection.cs @@ -79,10 +79,15 @@ public partial class StaticSiteBuildDatabaseConnection : Resource /// /// Creates a new StaticSiteBuildDatabaseConnection. /// - /// Name of the StaticSiteBuildDatabaseConnection. + /// + /// The the Bicep identifier name of the StaticSiteBuildDatabaseConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildDatabaseConnection. - public StaticSiteBuildDatabaseConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/builds/databaseConnections", resourceVersion ?? "2024-04-01") + public StaticSiteBuildDatabaseConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/builds/databaseConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionIdentity = BicepValue.DefineProperty(this, "ConnectionIdentity", ["properties", "connectionIdentity"]); @@ -174,9 +179,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteBuildDatabaseConnection. /// - /// Name of the StaticSiteBuildDatabaseConnection. + /// + /// The the Bicep identifier name of the StaticSiteBuildDatabaseConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildDatabaseConnection. /// The existing StaticSiteBuildDatabaseConnection resource. - public static StaticSiteBuildDatabaseConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteBuildDatabaseConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildLinkedBackend.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildLinkedBackend.cs index 3310a7a3f86cd..0f1e7d1d32340 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildLinkedBackend.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildLinkedBackend.cs @@ -68,10 +68,15 @@ public partial class StaticSiteBuildLinkedBackend : Resource /// /// Creates a new StaticSiteBuildLinkedBackend. /// - /// Name of the StaticSiteBuildLinkedBackend. + /// + /// The the Bicep identifier name of the StaticSiteBuildLinkedBackend + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildLinkedBackend. - public StaticSiteBuildLinkedBackend(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/builds/linkedBackends", resourceVersion ?? "2024-04-01") + public StaticSiteBuildLinkedBackend(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/builds/linkedBackends", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _backendResourceId = BicepValue.DefineProperty(this, "BackendResourceId", ["properties", "backendResourceId"]); @@ -162,9 +167,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteBuildLinkedBackend. /// - /// Name of the StaticSiteBuildLinkedBackend. + /// + /// The the Bicep identifier name of the StaticSiteBuildLinkedBackend + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildLinkedBackend. /// The existing StaticSiteBuildLinkedBackend resource. - public static StaticSiteBuildLinkedBackend FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteBuildLinkedBackend FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildUserProvidedFunctionApp.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildUserProvidedFunctionApp.cs index 89b2842951cc8..5f8b04ea83efa 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildUserProvidedFunctionApp.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteBuildUserProvidedFunctionApp.cs @@ -63,10 +63,15 @@ public partial class StaticSiteBuildUserProvidedFunctionApp : Resource /// /// Creates a new StaticSiteBuildUserProvidedFunctionApp. /// - /// Name of the StaticSiteBuildUserProvidedFunctionApp. + /// + /// The the Bicep identifier name of the + /// StaticSiteBuildUserProvidedFunctionApp resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildUserProvidedFunctionApp. - public StaticSiteBuildUserProvidedFunctionApp(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/builds/userProvidedFunctionApps", resourceVersion ?? "2024-04-01") + public StaticSiteBuildUserProvidedFunctionApp(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/builds/userProvidedFunctionApps", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _functionAppRegion = BicepValue.DefineProperty(this, "FunctionAppRegion", ["properties", "functionAppRegion"]); @@ -137,9 +142,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// StaticSiteBuildUserProvidedFunctionApp. /// - /// Name of the StaticSiteBuildUserProvidedFunctionApp. + /// + /// The the Bicep identifier name of the + /// StaticSiteBuildUserProvidedFunctionApp resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the StaticSiteBuildUserProvidedFunctionApp. /// The existing StaticSiteBuildUserProvidedFunctionApp resource. - public static StaticSiteBuildUserProvidedFunctionApp FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteBuildUserProvidedFunctionApp FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteCustomDomainOverview.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteCustomDomainOverview.cs index 60cdbbb53cb5b..a09e1ea70d788 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteCustomDomainOverview.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteCustomDomainOverview.cs @@ -87,10 +87,15 @@ public partial class StaticSiteCustomDomainOverview : Resource /// /// Creates a new StaticSiteCustomDomainOverview. /// - /// Name of the StaticSiteCustomDomainOverview. + /// + /// The the Bicep identifier name of the StaticSiteCustomDomainOverview + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteCustomDomainOverview. - public StaticSiteCustomDomainOverview(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/customDomains", resourceVersion ?? "2024-04-01") + public StaticSiteCustomDomainOverview(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/customDomains", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -184,9 +189,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteCustomDomainOverview. /// - /// Name of the StaticSiteCustomDomainOverview. + /// + /// The the Bicep identifier name of the StaticSiteCustomDomainOverview + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteCustomDomainOverview. /// The existing StaticSiteCustomDomainOverview resource. - public static StaticSiteCustomDomainOverview FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteCustomDomainOverview FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteDatabaseConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteDatabaseConnection.cs index eb3c256d4a7d1..284a5090aaa3a 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteDatabaseConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteDatabaseConnection.cs @@ -85,10 +85,15 @@ public partial class StaticSiteDatabaseConnection : Resource /// /// Creates a new StaticSiteDatabaseConnection. /// - /// Name of the StaticSiteDatabaseConnection. + /// + /// The the Bicep identifier name of the StaticSiteDatabaseConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteDatabaseConnection. - public StaticSiteDatabaseConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/databaseConnections", resourceVersion ?? "2024-04-01") + public StaticSiteDatabaseConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/databaseConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionIdentity = BicepValue.DefineProperty(this, "ConnectionIdentity", ["properties", "connectionIdentity"]); @@ -181,9 +186,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteDatabaseConnection. /// - /// Name of the StaticSiteDatabaseConnection. + /// + /// The the Bicep identifier name of the StaticSiteDatabaseConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteDatabaseConnection. /// The existing StaticSiteDatabaseConnection resource. - public static StaticSiteDatabaseConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteDatabaseConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteLinkedBackend.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteLinkedBackend.cs index 155c09b67e3d7..7b771e2e624a4 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteLinkedBackend.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteLinkedBackend.cs @@ -74,10 +74,15 @@ public partial class StaticSiteLinkedBackend : Resource /// /// Creates a new StaticSiteLinkedBackend. /// - /// Name of the StaticSiteLinkedBackend. + /// + /// The the Bicep identifier name of the StaticSiteLinkedBackend resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the StaticSiteLinkedBackend. - public StaticSiteLinkedBackend(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/linkedBackends", resourceVersion ?? "2024-04-01") + public StaticSiteLinkedBackend(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/linkedBackends", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _backendResourceId = BicepValue.DefineProperty(this, "BackendResourceId", ["properties", "backendResourceId"]); @@ -169,9 +174,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteLinkedBackend. /// - /// Name of the StaticSiteLinkedBackend. + /// + /// The the Bicep identifier name of the StaticSiteLinkedBackend resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the StaticSiteLinkedBackend. /// The existing StaticSiteLinkedBackend resource. - public static StaticSiteLinkedBackend FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteLinkedBackend FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSitePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSitePrivateEndpointConnection.cs index 66ddf094ae21d..25c310c88f012 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSitePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSitePrivateEndpointConnection.cs @@ -76,10 +76,15 @@ public partial class StaticSitePrivateEndpointConnection : Resource /// /// Creates a new StaticSitePrivateEndpointConnection. /// - /// Name of the StaticSitePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// StaticSitePrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the StaticSitePrivateEndpointConnection. - public StaticSitePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/privateEndpointConnections", resourceVersion ?? "2024-04-01") + public StaticSitePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/privateEndpointConnections", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _iPAddresses = BicepList.DefineProperty(this, "IPAddresses", ["properties", "ipAddresses"]); @@ -171,9 +176,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSitePrivateEndpointConnection. /// - /// Name of the StaticSitePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// StaticSitePrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the StaticSitePrivateEndpointConnection. /// The existing StaticSitePrivateEndpointConnection resource. - public static StaticSitePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSitePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteUserProvidedFunctionApp.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteUserProvidedFunctionApp.cs index 691e7dc07c782..8a5dc43450415 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteUserProvidedFunctionApp.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/StaticSiteUserProvidedFunctionApp.cs @@ -69,10 +69,15 @@ public partial class StaticSiteUserProvidedFunctionApp : Resource /// /// Creates a new StaticSiteUserProvidedFunctionApp. /// - /// Name of the StaticSiteUserProvidedFunctionApp. + /// + /// The the Bicep identifier name of the StaticSiteUserProvidedFunctionApp + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteUserProvidedFunctionApp. - public StaticSiteUserProvidedFunctionApp(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/staticSites/userProvidedFunctionApps", resourceVersion ?? "2024-04-01") + public StaticSiteUserProvidedFunctionApp(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/staticSites/userProvidedFunctionApps", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _functionAppRegion = BicepValue.DefineProperty(this, "FunctionAppRegion", ["properties", "functionAppRegion"]); @@ -143,9 +148,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StaticSiteUserProvidedFunctionApp. /// - /// Name of the StaticSiteUserProvidedFunctionApp. + /// + /// The the Bicep identifier name of the StaticSiteUserProvidedFunctionApp + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StaticSiteUserProvidedFunctionApp. /// The existing StaticSiteUserProvidedFunctionApp resource. - public static StaticSiteUserProvidedFunctionApp FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StaticSiteUserProvidedFunctionApp FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSite.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSite.cs index 0285dcc193a93..36c8f2e771968 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSite.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSite.cs @@ -422,10 +422,15 @@ public partial class WebSite : Resource /// /// Creates a new WebSite. /// - /// Name of the WebSite. + /// + /// The the Bicep identifier name of the WebSite resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSite. - public WebSite(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites", resourceVersion ?? "2024-04-01") + public WebSite(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -653,11 +658,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSite. /// - /// Name of the WebSite. + /// + /// The the Bicep identifier name of the WebSite resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSite. /// The existing WebSite resource. - public static WebSite FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSite FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this WebSite resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteConfig.cs index 6e5ddfb2ed321..24aa4471e2a3b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteConfig.cs @@ -514,10 +514,15 @@ public partial class WebSiteConfig : Resource /// /// Creates a new WebSiteConfig. /// - /// Name of the WebSiteConfig. + /// + /// The the Bicep identifier name of the WebSiteConfig resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteConfig. - public WebSiteConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") + public WebSiteConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/config", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _acrUserManagedIdentityId = BicepValue.DefineProperty(this, "AcrUserManagedIdentityId", ["properties", "acrUserManagedIdentityID"]); @@ -762,9 +767,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteConfig. /// - /// Name of the WebSiteConfig. + /// + /// The the Bicep identifier name of the WebSiteConfig resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteConfig. /// The existing WebSiteConfig resource. - public static WebSiteConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteExtension.cs index 6a29e3f784938..aaad81714a2c1 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteExtension.cs @@ -172,10 +172,15 @@ public partial class WebSiteExtension : Resource /// /// Creates a new WebSiteExtension. /// - /// Name of the WebSiteExtension. + /// + /// The the Bicep identifier name of the WebSiteExtension resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebSiteExtension. - public WebSiteExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/siteextensions", resourceVersion ?? "2024-04-01") + public WebSiteExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/siteextensions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _authors = BicepList.DefineProperty(this, "Authors", ["properties", "authors"], isOutput: true); @@ -368,9 +373,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteExtension. /// - /// Name of the WebSiteExtension. + /// + /// The the Bicep identifier name of the WebSiteExtension resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebSiteExtension. /// The existing WebSiteExtension resource. - public static WebSiteExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteFtpPublishingCredentialsPolicy.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteFtpPublishingCredentialsPolicy.cs index c1a0b978092d9..f9a838dc048d1 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteFtpPublishingCredentialsPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteFtpPublishingCredentialsPolicy.cs @@ -57,10 +57,15 @@ public partial class WebSiteFtpPublishingCredentialsPolicy : Resource /// /// Creates a new WebSiteFtpPublishingCredentialsPolicy. /// - /// Name of the WebSiteFtpPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// WebSiteFtpPublishingCredentialsPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the WebSiteFtpPublishingCredentialsPolicy. - public WebSiteFtpPublishingCredentialsPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") + public WebSiteFtpPublishingCredentialsPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allow = BicepValue.DefineProperty(this, "Allow", ["properties", "allow"]); @@ -235,9 +240,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// WebSiteFtpPublishingCredentialsPolicy. /// - /// Name of the WebSiteFtpPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// WebSiteFtpPublishingCredentialsPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the WebSiteFtpPublishingCredentialsPolicy. /// The existing WebSiteFtpPublishingCredentialsPolicy resource. - public static WebSiteFtpPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteFtpPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteHybridConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteHybridConnection.cs index 43e0ddc406c40..e71e3e96d71c7 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteHybridConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteHybridConnection.cs @@ -86,10 +86,15 @@ public partial class WebSiteHybridConnection : Resource /// /// Creates a new WebSiteHybridConnection. /// - /// Name of the WebSiteHybridConnection. + /// + /// The the Bicep identifier name of the WebSiteHybridConnection resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteHybridConnection. - public WebSiteHybridConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/hybridconnection", resourceVersion ?? "2024-04-01") + public WebSiteHybridConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/hybridconnection", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _biztalkUri = BicepValue.DefineProperty(this, "BiztalkUri", ["properties", "biztalkUri"]); @@ -268,9 +273,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteHybridConnection. /// - /// Name of the WebSiteHybridConnection. + /// + /// The the Bicep identifier name of the WebSiteHybridConnection resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteHybridConnection. /// The existing WebSiteHybridConnection resource. - public static WebSiteHybridConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteHybridConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePremierAddon.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePremierAddon.cs index 48352ab3fc9e2..e7c57e40aa982 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePremierAddon.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePremierAddon.cs @@ -93,10 +93,15 @@ public partial class WebSitePremierAddon : Resource /// /// Creates a new WebSitePremierAddon. /// - /// Name of the WebSitePremierAddon. + /// + /// The the Bicep identifier name of the WebSitePremierAddon resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSitePremierAddon. - public WebSitePremierAddon(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/premieraddons", resourceVersion ?? "2024-04-01") + public WebSitePremierAddon(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/premieraddons", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSitePremierAddon. /// - /// Name of the WebSitePremierAddon. + /// + /// The the Bicep identifier name of the WebSitePremierAddon resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSitePremierAddon. /// The existing WebSitePremierAddon resource. - public static WebSitePremierAddon FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSitePremierAddon FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePrivateAccess.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePrivateAccess.cs index b9ebe589f8866..4c0fb12b89f17 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePrivateAccess.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSitePrivateAccess.cs @@ -63,10 +63,15 @@ public partial class WebSitePrivateAccess : Resource /// /// Creates a new WebSitePrivateAccess. /// - /// Name of the WebSitePrivateAccess. + /// + /// The the Bicep identifier name of the WebSitePrivateAccess resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSitePrivateAccess. - public WebSitePrivateAccess(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/privateAccess", resourceVersion ?? "2024-04-01") + public WebSitePrivateAccess(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/privateAccess", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isEnabled = BicepValue.DefineProperty(this, "IsEnabled", ["properties", "enabled"]); @@ -241,9 +246,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSitePrivateAccess. /// - /// Name of the WebSitePrivateAccess. + /// + /// The the Bicep identifier name of the WebSitePrivateAccess resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSitePrivateAccess. /// The existing WebSitePrivateAccess resource. - public static WebSitePrivateAccess FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSitePrivateAccess FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlot.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlot.cs index 61f4a9ee26d58..dc077a4bfa4d6 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlot.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlot.cs @@ -427,10 +427,15 @@ public partial class WebSiteSlot : Resource /// /// Creates a new WebSiteSlot. /// - /// Name of the WebSiteSlot. + /// + /// The the Bicep identifier name of the WebSiteSlot resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteSlot. - public WebSiteSlot(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots", resourceVersion ?? "2024-04-01") + public WebSiteSlot(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -659,11 +664,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlot. /// - /// Name of the WebSiteSlot. + /// + /// The the Bicep identifier name of the WebSiteSlot resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteSlot. /// The existing WebSiteSlot resource. - public static WebSiteSlot FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlot FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this WebSiteSlot resource. diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotConfig.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotConfig.cs index d4ac8ef0a0bd8..4b67006b2bd6e 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotConfig.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotConfig.cs @@ -514,10 +514,15 @@ public partial class WebSiteSlotConfig : Resource /// /// Creates a new WebSiteSlotConfig. /// - /// Name of the WebSiteSlotConfig. + /// + /// The the Bicep identifier name of the WebSiteSlotConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebSiteSlotConfig. - public WebSiteSlotConfig(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/config", resourceVersion ?? "2024-04-01") + public WebSiteSlotConfig(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/config", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _acrUserManagedIdentityId = BicepValue.DefineProperty(this, "AcrUserManagedIdentityId", ["properties", "acrUserManagedIdentityID"]); @@ -762,9 +767,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotConfig. /// - /// Name of the WebSiteSlotConfig. + /// + /// The the Bicep identifier name of the WebSiteSlotConfig resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebSiteSlotConfig. /// The existing WebSiteSlotConfig resource. - public static WebSiteSlotConfig FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotConfig FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotExtension.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotExtension.cs index 41b508364b3e1..9ec683a2d8ee6 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotExtension.cs @@ -172,10 +172,15 @@ public partial class WebSiteSlotExtension : Resource /// /// Creates a new WebSiteSlotExtension. /// - /// Name of the WebSiteSlotExtension. + /// + /// The the Bicep identifier name of the WebSiteSlotExtension resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotExtension. - public WebSiteSlotExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/siteextensions", resourceVersion ?? "2024-04-01") + public WebSiteSlotExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/siteextensions", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _authors = BicepList.DefineProperty(this, "Authors", ["properties", "authors"], isOutput: true); @@ -368,9 +373,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotExtension. /// - /// Name of the WebSiteSlotExtension. + /// + /// The the Bicep identifier name of the WebSiteSlotExtension resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotExtension. /// The existing WebSiteSlotExtension resource. - public static WebSiteSlotExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotFtpPublishingCredentialsPolicy.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotFtpPublishingCredentialsPolicy.cs index d9190d194b5c5..f7f2a5c6ea93a 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotFtpPublishingCredentialsPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotFtpPublishingCredentialsPolicy.cs @@ -57,10 +57,16 @@ public partial class WebSiteSlotFtpPublishingCredentialsPolicy : Resource /// /// Creates a new WebSiteSlotFtpPublishingCredentialsPolicy. /// - /// Name of the WebSiteSlotFtpPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// WebSiteSlotFtpPublishingCredentialsPolicy resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteSlotFtpPublishingCredentialsPolicy. - public WebSiteSlotFtpPublishingCredentialsPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") + public WebSiteSlotFtpPublishingCredentialsPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allow = BicepValue.DefineProperty(this, "Allow", ["properties", "allow"]); @@ -235,9 +241,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// WebSiteSlotFtpPublishingCredentialsPolicy. /// - /// Name of the WebSiteSlotFtpPublishingCredentialsPolicy. + /// + /// The the Bicep identifier name of the + /// WebSiteSlotFtpPublishingCredentialsPolicy resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebSiteSlotFtpPublishingCredentialsPolicy. /// The existing WebSiteSlotFtpPublishingCredentialsPolicy resource. - public static WebSiteSlotFtpPublishingCredentialsPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotFtpPublishingCredentialsPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotHybridConnection.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotHybridConnection.cs index d8ce715d718b8..a2cad556e36a8 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotHybridConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotHybridConnection.cs @@ -86,10 +86,15 @@ public partial class WebSiteSlotHybridConnection : Resource /// /// Creates a new WebSiteSlotHybridConnection. /// - /// Name of the WebSiteSlotHybridConnection. + /// + /// The the Bicep identifier name of the WebSiteSlotHybridConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebSiteSlotHybridConnection. - public WebSiteSlotHybridConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/hybridconnection", resourceVersion ?? "2024-04-01") + public WebSiteSlotHybridConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/hybridconnection", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _biztalkUri = BicepValue.DefineProperty(this, "BiztalkUri", ["properties", "biztalkUri"]); @@ -268,9 +273,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotHybridConnection. /// - /// Name of the WebSiteSlotHybridConnection. + /// + /// The the Bicep identifier name of the WebSiteSlotHybridConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebSiteSlotHybridConnection. /// The existing WebSiteSlotHybridConnection resource. - public static WebSiteSlotHybridConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotHybridConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPremierAddOn.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPremierAddOn.cs index 4b0f57dffc526..fe953c94746b6 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPremierAddOn.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPremierAddOn.cs @@ -93,10 +93,15 @@ public partial class WebSiteSlotPremierAddOn : Resource /// /// Creates a new WebSiteSlotPremierAddOn. /// - /// Name of the WebSiteSlotPremierAddOn. + /// + /// The the Bicep identifier name of the WebSiteSlotPremierAddOn resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotPremierAddOn. - public WebSiteSlotPremierAddOn(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/premieraddons", resourceVersion ?? "2024-04-01") + public WebSiteSlotPremierAddOn(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/premieraddons", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -276,9 +281,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotPremierAddOn. /// - /// Name of the WebSiteSlotPremierAddOn. + /// + /// The the Bicep identifier name of the WebSiteSlotPremierAddOn resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotPremierAddOn. /// The existing WebSiteSlotPremierAddOn resource. - public static WebSiteSlotPremierAddOn FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotPremierAddOn FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPrivateAccess.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPrivateAccess.cs index 2f8ffb20b440e..3c07ba411641a 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPrivateAccess.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPrivateAccess.cs @@ -63,10 +63,15 @@ public partial class WebSiteSlotPrivateAccess : Resource /// /// Creates a new WebSiteSlotPrivateAccess. /// - /// Name of the WebSiteSlotPrivateAccess. + /// + /// The the Bicep identifier name of the WebSiteSlotPrivateAccess resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotPrivateAccess. - public WebSiteSlotPrivateAccess(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/privateAccess", resourceVersion ?? "2024-04-01") + public WebSiteSlotPrivateAccess(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/privateAccess", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isEnabled = BicepValue.DefineProperty(this, "IsEnabled", ["properties", "enabled"]); @@ -241,9 +246,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotPrivateAccess. /// - /// Name of the WebSiteSlotPrivateAccess. + /// + /// The the Bicep identifier name of the WebSiteSlotPrivateAccess resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotPrivateAccess. /// The existing WebSiteSlotPrivateAccess resource. - public static WebSiteSlotPrivateAccess FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotPrivateAccess FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPublicCertificate.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPublicCertificate.cs index 8705d3694d963..5c947480a7b79 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPublicCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotPublicCertificate.cs @@ -68,10 +68,15 @@ public partial class WebSiteSlotPublicCertificate : Resource /// /// Creates a new WebSiteSlotPublicCertificate. /// - /// Name of the WebSiteSlotPublicCertificate. + /// + /// The the Bicep identifier name of the WebSiteSlotPublicCertificate + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebSiteSlotPublicCertificate. - public WebSiteSlotPublicCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/publicCertificates", resourceVersion ?? "2024-04-01") + public WebSiteSlotPublicCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/publicCertificates", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _blob = BicepValue.DefineProperty(this, "Blob", ["properties", "blob"]); @@ -247,9 +252,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotPublicCertificate. /// - /// Name of the WebSiteSlotPublicCertificate. + /// + /// The the Bicep identifier name of the WebSiteSlotPublicCertificate + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebSiteSlotPublicCertificate. /// The existing WebSiteSlotPublicCertificate resource. - public static WebSiteSlotPublicCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotPublicCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotSourceControl.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotSourceControl.cs index fd27f46ca2069..08974f7e4e1a4 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotSourceControl.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSlotSourceControl.cs @@ -96,10 +96,15 @@ public partial class WebSiteSlotSourceControl : Resource /// /// Creates a new WebSiteSlotSourceControl. /// - /// Name of the WebSiteSlotSourceControl. + /// + /// The the Bicep identifier name of the WebSiteSlotSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotSourceControl. - public WebSiteSlotSourceControl(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/slots/sourcecontrols", resourceVersion ?? "2024-04-01") + public WebSiteSlotSourceControl(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/slots/sourcecontrols", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _branch = BicepValue.DefineProperty(this, "Branch", ["properties", "branch"]); @@ -279,9 +284,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSlotSourceControl. /// - /// Name of the WebSiteSlotSourceControl. + /// + /// The the Bicep identifier name of the WebSiteSlotSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSlotSourceControl. /// The existing WebSiteSlotSourceControl resource. - public static WebSiteSlotSourceControl FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSlotSourceControl FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSourceControl.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSourceControl.cs index 5f143907b561a..6789e10b952e2 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSourceControl.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Generated/WebSiteSourceControl.cs @@ -96,10 +96,15 @@ public partial class WebSiteSourceControl : Resource /// /// Creates a new WebSiteSourceControl. /// - /// Name of the WebSiteSourceControl. + /// + /// The the Bicep identifier name of the WebSiteSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSourceControl. - public WebSiteSourceControl(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Web/sites/sourcecontrols", resourceVersion ?? "2024-04-01") + public WebSiteSourceControl(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Web/sites/sourcecontrols", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _branch = BicepValue.DefineProperty(this, "Branch", ["properties", "branch"]); @@ -279,9 +284,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebSiteSourceControl. /// - /// Name of the WebSiteSourceControl. + /// + /// The the Bicep identifier name of the WebSiteSourceControl resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the WebSiteSourceControl. /// The existing WebSiteSourceControl resource. - public static WebSiteSourceControl FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebSiteSourceControl FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/api/Azure.Provisioning.ApplicationInsights.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/api/Azure.Provisioning.ApplicationInsights.netstandard2.0.cs index 04d28b7ade832..f3018f55a84c7 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/api/Azure.Provisioning.ApplicationInsights.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/api/Azure.Provisioning.ApplicationInsights.netstandard2.0.cs @@ -34,7 +34,7 @@ public enum ApplicationInsightsApplicationType } public partial class ApplicationInsightsComponent : Azure.Provisioning.Primitives.Resource { - public ApplicationInsightsComponent(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ApplicationInsightsComponent(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AppId { get { throw null; } } public Azure.Provisioning.BicepValue ApplicationId { get { throw null; } } public Azure.Provisioning.BicepValue ApplicationType { get { throw null; } set { } } @@ -67,9 +67,9 @@ public partial class ApplicationInsightsComponent : Azure.Provisioning.Primitive public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } } public Azure.Provisioning.BicepValue WorkspaceResourceId { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ApplicationInsights.ApplicationInsightsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ApplicationInsights.ApplicationInsightsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ApplicationInsights.ApplicationInsightsBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsComponent FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsComponent FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -88,7 +88,7 @@ public enum ApplicationInsightsPublicNetworkAccessType } public partial class ApplicationInsightsWebTest : Azure.Provisioning.Primitives.Resource { - public ApplicationInsightsWebTest(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ApplicationInsightsWebTest(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue FrequencyInSeconds { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -108,7 +108,7 @@ public partial class ApplicationInsightsWebTest : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue WebTest { get { throw null; } set { } } public Azure.Provisioning.BicepValue WebTestKind { get { throw null; } set { } } public Azure.Provisioning.BicepValue WebTestName { get { throw null; } set { } } - public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWebTest FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWebTest FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -119,7 +119,7 @@ public static partial class ResourceVersions } public partial class ApplicationInsightsWorkbook : Azure.Provisioning.Primitives.Resource { - public ApplicationInsightsWorkbook(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ApplicationInsightsWorkbook(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Category { get { throw null; } set { } } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } @@ -138,7 +138,7 @@ public partial class ApplicationInsightsWorkbook : Azure.Provisioning.Primitives public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UserId { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWorkbook FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWorkbook FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_02_12; @@ -151,7 +151,7 @@ public static partial class ResourceVersions } public partial class ApplicationInsightsWorkbookTemplate : Azure.Provisioning.Primitives.Resource { - public ApplicationInsightsWorkbookTemplate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ApplicationInsightsWorkbookTemplate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Author { get { throw null; } set { } } public Azure.Provisioning.BicepList Galleries { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -162,7 +162,7 @@ public partial class ApplicationInsightsWorkbookTemplate : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TemplateData { get { throw null; } set { } } - public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWorkbookTemplate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ApplicationInsights.ApplicationInsightsWorkbookTemplate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_11_20; diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsComponent.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsComponent.cs index 1373c043773ce..4d9cd154f9b7d 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsComponent.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsComponent.cs @@ -240,10 +240,15 @@ public partial class ApplicationInsightsComponent : Resource /// /// Creates a new ApplicationInsightsComponent. /// - /// Name of the ApplicationInsightsComponent. + /// + /// The the Bicep identifier name of the ApplicationInsightsComponent + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsComponent. - public ApplicationInsightsComponent(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Insights/components", resourceVersion ?? "2020-02-02") + public ApplicationInsightsComponent(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Insights/components", resourceVersion ?? "2020-02-02") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"], isRequired: true); @@ -313,11 +318,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ApplicationInsightsComponent. /// - /// Name of the ApplicationInsightsComponent. + /// + /// The the Bicep identifier name of the ApplicationInsightsComponent + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsComponent. /// The existing ApplicationInsightsComponent resource. - public static ApplicationInsightsComponent FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ApplicationInsightsComponent FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ApplicationInsightsComponent @@ -336,10 +346,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(ApplicationInsightsBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{ApplicationInsightsBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{ApplicationInsightsBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -352,13 +362,13 @@ public RoleAssignment CreateRoleAssignment(ApplicationInsightsBuiltInRole role, /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(ApplicationInsightsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{ApplicationInsightsBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(ApplicationInsightsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{ApplicationInsightsBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWebTest.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWebTest.cs index 5b746b79f77d7..eaa6e951125c2 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWebTest.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWebTest.cs @@ -143,10 +143,15 @@ public partial class ApplicationInsightsWebTest : Resource /// /// Creates a new ApplicationInsightsWebTest. /// - /// Name of the ApplicationInsightsWebTest. + /// + /// The the Bicep identifier name of the ApplicationInsightsWebTest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWebTest. - public ApplicationInsightsWebTest(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Insights/webtests", resourceVersion ?? "2022-06-15") + public ApplicationInsightsWebTest(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Insights/webtests", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -198,9 +203,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ApplicationInsightsWebTest. /// - /// Name of the ApplicationInsightsWebTest. + /// + /// The the Bicep identifier name of the ApplicationInsightsWebTest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWebTest. /// The existing ApplicationInsightsWebTest resource. - public static ApplicationInsightsWebTest FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ApplicationInsightsWebTest FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbook.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbook.cs index 0be1dda03dd9d..0df8b507f561e 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbook.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbook.cs @@ -134,10 +134,15 @@ public partial class ApplicationInsightsWorkbook : Resource /// /// Creates a new ApplicationInsightsWorkbook. /// - /// Name of the ApplicationInsightsWorkbook. + /// + /// The the Bicep identifier name of the ApplicationInsightsWorkbook + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWorkbook. - public ApplicationInsightsWorkbook(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Insights/workbooks", resourceVersion ?? "2023-06-01") + public ApplicationInsightsWorkbook(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Insights/workbooks", resourceVersion ?? "2023-06-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -198,9 +203,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ApplicationInsightsWorkbook. /// - /// Name of the ApplicationInsightsWorkbook. + /// + /// The the Bicep identifier name of the ApplicationInsightsWorkbook + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWorkbook. /// The existing ApplicationInsightsWorkbook resource. - public static ApplicationInsightsWorkbook FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ApplicationInsightsWorkbook FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbookTemplate.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbookTemplate.cs index 9bf422a1aee53..acb23fca729dd 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbookTemplate.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Generated/ApplicationInsightsWorkbookTemplate.cs @@ -96,10 +96,15 @@ public partial class ApplicationInsightsWorkbookTemplate : Resource /// /// Creates a new ApplicationInsightsWorkbookTemplate. /// - /// Name of the ApplicationInsightsWorkbookTemplate. + /// + /// The the Bicep identifier name of the + /// ApplicationInsightsWorkbookTemplate resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWorkbookTemplate. - public ApplicationInsightsWorkbookTemplate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Insights/workbooktemplates", resourceVersion ?? "2020-11-20") + public ApplicationInsightsWorkbookTemplate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Insights/workbooktemplates", resourceVersion ?? "2020-11-20") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -127,9 +132,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ApplicationInsightsWorkbookTemplate. /// - /// Name of the ApplicationInsightsWorkbookTemplate. + /// + /// The the Bicep identifier name of the + /// ApplicationInsightsWorkbookTemplate resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ApplicationInsightsWorkbookTemplate. /// The existing ApplicationInsightsWorkbookTemplate resource. - public static ApplicationInsightsWorkbookTemplate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ApplicationInsightsWorkbookTemplate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azd.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azd.cs index 08b5cf09c5c13..61d3ccdd5c5e8 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azd.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azd.cs @@ -42,7 +42,7 @@ internal static void Init(string infraDirectory, CloudMachineInfrastructure cmi) ModuleImport import = new("cm", $"cm.bicep") { Name = "cm", - Scope = new IdentifierExpression(rg.ResourceName) + Scope = new IdentifierExpression(rg.IdentifierName) }; import.Parameters.Add(nameof(location), location); import.Parameters.Add(nameof(principalId), principalId); diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/api/Azure.Provisioning.CognitiveServices.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/api/Azure.Provisioning.CognitiveServices.netstandard2.0.cs index 5578d6a767354..ee03c021da210 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/api/Azure.Provisioning.CognitiveServices.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/api/Azure.Provisioning.CognitiveServices.netstandard2.0.cs @@ -14,7 +14,7 @@ public enum AbusePenaltyAction } public partial class CognitiveServicesAccount : Azure.Provisioning.Primitives.Resource { - public CognitiveServicesAccount(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CognitiveServicesAccount(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } @@ -25,9 +25,9 @@ public partial class CognitiveServicesAccount : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.CognitiveServices.CognitiveServicesAccount FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CognitiveServices.CognitiveServicesAccount FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.CognitiveServices.ServiceAccountApiKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -45,7 +45,7 @@ public static partial class ResourceVersions } public partial class CognitiveServicesAccountDeployment : Azure.Provisioning.Primitives.Resource { - public CognitiveServicesAccountDeployment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CognitiveServicesAccountDeployment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -53,7 +53,7 @@ public partial class CognitiveServicesAccountDeployment : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CognitiveServices.CognitiveServicesAccountDeployment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CognitiveServices.CognitiveServicesAccountDeployment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_18; @@ -200,7 +200,7 @@ public CognitiveServicesCapacityConfig() { } } public partial class CognitiveServicesCommitmentPlan : Azure.Provisioning.Primitives.Resource { - public CognitiveServicesCommitmentPlan(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CognitiveServicesCommitmentPlan(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -210,7 +210,7 @@ public partial class CognitiveServicesCommitmentPlan : Azure.Provisioning.Primit public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CognitiveServices.CognitiveServicesCommitmentPlan FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CognitiveServices.CognitiveServicesCommitmentPlan FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_12_01; @@ -352,7 +352,7 @@ public CommitmentPeriod() { } } public partial class CommitmentPlan : Azure.Provisioning.Primitives.Resource { - public CommitmentPlan(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CommitmentPlan(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -363,7 +363,7 @@ public partial class CommitmentPlan : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CognitiveServices.CommitmentPlan FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CognitiveServices.CommitmentPlan FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_18; @@ -378,14 +378,14 @@ public static partial class ResourceVersions } public partial class CommitmentPlanAccountAssociation : Azure.Provisioning.Primitives.Resource { - public CommitmentPlanAccountAssociation(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CommitmentPlanAccountAssociation(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccountId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.CognitiveServices.CognitiveServicesCommitmentPlan? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CognitiveServices.CommitmentPlanAccountAssociation FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CognitiveServices.CommitmentPlanAccountAssociation FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_12_01; diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccount.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccount.cs index 806462f28d011..ab29989a14bd4 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccount.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccount.cs @@ -86,10 +86,15 @@ public partial class CognitiveServicesAccount : Resource /// /// Creates a new CognitiveServicesAccount. /// - /// Name of the CognitiveServicesAccount. + /// + /// The the Bicep identifier name of the CognitiveServicesAccount resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CognitiveServicesAccount. - public CognitiveServicesAccount(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CognitiveServices/accounts", resourceVersion ?? "2024-10-01") + public CognitiveServicesAccount(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CognitiveServices/accounts", resourceVersion ?? "2024-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -152,11 +157,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing CognitiveServicesAccount. /// - /// Name of the CognitiveServicesAccount. + /// + /// The the Bicep identifier name of the CognitiveServicesAccount resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CognitiveServicesAccount. /// The existing CognitiveServicesAccount resource. - public static CognitiveServicesAccount FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CognitiveServicesAccount FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this CognitiveServicesAccount resource. @@ -172,7 +182,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this CognitiveServicesAccount resource. public ServiceAccountApiKeys GetKeys() => ServiceAccountApiKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); /// /// Creates a role assignment for a user-assigned identity that grants @@ -182,10 +192,10 @@ public ServiceAccountApiKeys GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(CognitiveServicesBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{CognitiveServicesBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{CognitiveServicesBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -198,13 +208,13 @@ public RoleAssignment CreateRoleAssignment(CognitiveServicesBuiltInRole role, Us /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(CognitiveServicesBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{CognitiveServicesBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(CognitiveServicesBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{CognitiveServicesBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccountDeployment.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccountDeployment.cs index 065c9b6f4cea3..bb74ea5b07125 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccountDeployment.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesAccountDeployment.cs @@ -65,10 +65,15 @@ public partial class CognitiveServicesAccountDeployment : Resource /// /// Creates a new CognitiveServicesAccountDeployment. /// - /// Name of the CognitiveServicesAccountDeployment. + /// + /// The the Bicep identifier name of the CognitiveServicesAccountDeployment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CognitiveServicesAccountDeployment. - public CognitiveServicesAccountDeployment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CognitiveServices/accounts/deployments", resourceVersion ?? "2024-10-01") + public CognitiveServicesAccountDeployment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CognitiveServices/accounts/deployments", resourceVersion ?? "2024-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"]); @@ -128,9 +133,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CognitiveServicesAccountDeployment. /// - /// Name of the CognitiveServicesAccountDeployment. + /// + /// The the Bicep identifier name of the CognitiveServicesAccountDeployment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CognitiveServicesAccountDeployment. /// The existing CognitiveServicesAccountDeployment resource. - public static CognitiveServicesAccountDeployment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CognitiveServicesAccountDeployment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlan.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlan.cs index 59baceb08ed05..12d8f20c72bef 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlan.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlan.cs @@ -77,10 +77,15 @@ public partial class CognitiveServicesCommitmentPlan : Resource /// /// Creates a new CognitiveServicesCommitmentPlan. /// - /// Name of the CognitiveServicesCommitmentPlan. + /// + /// The the Bicep identifier name of the CognitiveServicesCommitmentPlan + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CognitiveServicesCommitmentPlan. - public CognitiveServicesCommitmentPlan(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CognitiveServices/commitmentPlans", resourceVersion ?? "2024-10-01") + public CognitiveServicesCommitmentPlan(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CognitiveServices/commitmentPlans", resourceVersion ?? "2024-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -117,9 +122,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CognitiveServicesCommitmentPlan. /// - /// Name of the CognitiveServicesCommitmentPlan. + /// + /// The the Bicep identifier name of the CognitiveServicesCommitmentPlan + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CognitiveServicesCommitmentPlan. /// The existing CognitiveServicesCommitmentPlan resource. - public static CognitiveServicesCommitmentPlan FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CognitiveServicesCommitmentPlan FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlan.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlan.cs index 0b8202b7d6e76..5ad22f77c9987 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlan.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlan.cs @@ -83,10 +83,15 @@ public partial class CommitmentPlan : Resource /// /// Creates a new CommitmentPlan. /// - /// Name of the CommitmentPlan. + /// + /// The the Bicep identifier name of the CommitmentPlan resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CommitmentPlan. - public CommitmentPlan(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CognitiveServices/accounts/commitmentPlans", resourceVersion ?? "2024-10-01") + public CommitmentPlan(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CognitiveServices/accounts/commitmentPlans", resourceVersion ?? "2024-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"]); @@ -149,9 +154,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CommitmentPlan. /// - /// Name of the CommitmentPlan. + /// + /// The the Bicep identifier name of the CommitmentPlan resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CommitmentPlan. /// The existing CommitmentPlan resource. - public static CommitmentPlan FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CommitmentPlan FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlanAccountAssociation.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlanAccountAssociation.cs index 426e08e4a1908..51daa9c0475d3 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlanAccountAssociation.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Generated/CommitmentPlanAccountAssociation.cs @@ -58,10 +58,15 @@ public partial class CommitmentPlanAccountAssociation : Resource /// /// Creates a new CommitmentPlanAccountAssociation. /// - /// Name of the CommitmentPlanAccountAssociation. + /// + /// The the Bicep identifier name of the CommitmentPlanAccountAssociation + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CommitmentPlanAccountAssociation. - public CommitmentPlanAccountAssociation(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.CognitiveServices/commitmentPlans/accountAssociations", resourceVersion ?? "2024-10-01") + public CommitmentPlanAccountAssociation(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.CognitiveServices/commitmentPlans/accountAssociations", resourceVersion ?? "2024-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _accountId = BicepValue.DefineProperty(this, "AccountId", ["properties", "accountId"]); @@ -95,9 +100,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CommitmentPlanAccountAssociation. /// - /// Name of the CommitmentPlanAccountAssociation. + /// + /// The the Bicep identifier name of the CommitmentPlanAccountAssociation + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CommitmentPlanAccountAssociation. /// The existing CommitmentPlanAccountAssociation resource. - public static CommitmentPlanAccountAssociation FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CommitmentPlanAccountAssociation FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Communication/api/Azure.Provisioning.Communication.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Communication/api/Azure.Provisioning.Communication.netstandard2.0.cs index 26f146a24a4bf..5c747f27d1727 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/api/Azure.Provisioning.Communication.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/api/Azure.Provisioning.Communication.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Provisioning.Communication { public partial class CommunicationDomain : Azure.Provisioning.Primitives.Resource { - public CommunicationDomain(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CommunicationDomain(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataLocation { get { throw null; } } public Azure.Provisioning.BicepValue DomainManagement { get { throw null; } set { } } public Azure.Provisioning.BicepValue FromSenderDomain { get { throw null; } } @@ -17,7 +17,7 @@ public partial class CommunicationDomain : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue UserEngagementTracking { get { throw null; } set { } } public Azure.Provisioning.BicepValue VerificationRecords { get { throw null; } } public Azure.Provisioning.BicepValue VerificationStates { get { throw null; } } - public static Azure.Provisioning.Communication.CommunicationDomain FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Communication.CommunicationDomain FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2023_03_31; @@ -27,7 +27,7 @@ public static partial class ResourceVersions } public partial class CommunicationService : Azure.Provisioning.Primitives.Resource { - public CommunicationService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CommunicationService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue HostName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -41,7 +41,7 @@ public partial class CommunicationService : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.Communication.CommunicationService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Communication.CommunicationService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.Communication.CommunicationServiceKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -140,7 +140,7 @@ public DomainVerificationStatusRecord() { } } public partial class EmailService : Azure.Provisioning.Primitives.Resource { - public EmailService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EmailService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -148,7 +148,7 @@ public partial class EmailService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Communication.EmailService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Communication.EmailService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2023_03_31; @@ -170,7 +170,7 @@ public enum EmailServicesProvisioningState } public partial class SenderUsername : Azure.Provisioning.Primitives.Resource { - public SenderUsername(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SenderUsername(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataLocation { get { throw null; } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -179,7 +179,7 @@ public partial class SenderUsername : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Username { get { throw null; } set { } } - public static Azure.Provisioning.Communication.SenderUsername FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Communication.SenderUsername FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2023_03_31; diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationDomain.cs b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationDomain.cs index 40b3a1b000d00..d76ee3c33bf2d 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationDomain.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationDomain.cs @@ -105,10 +105,15 @@ public partial class CommunicationDomain : Resource /// /// Creates a new CommunicationDomain. /// - /// Name of the CommunicationDomain. + /// + /// The the Bicep identifier name of the CommunicationDomain resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CommunicationDomain. - public CommunicationDomain(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Communication/emailServices/domains", resourceVersion ?? "2023-04-01") + public CommunicationDomain(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Communication/emailServices/domains", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -150,9 +155,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CommunicationDomain. /// - /// Name of the CommunicationDomain. + /// + /// The the Bicep identifier name of the CommunicationDomain resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CommunicationDomain. /// The existing CommunicationDomain resource. - public static CommunicationDomain FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CommunicationDomain FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationService.cs b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationService.cs index 043b317e14372..1b447a0fcf6b3 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationService.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/CommunicationService.cs @@ -103,10 +103,15 @@ public partial class CommunicationService : Resource /// /// Creates a new CommunicationService. /// - /// Name of the CommunicationService. + /// + /// The the Bicep identifier name of the CommunicationService resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CommunicationService. - public CommunicationService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Communication/communicationServices", resourceVersion ?? "2023-04-01") + public CommunicationService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Communication/communicationServices", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -152,11 +157,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing CommunicationService. /// - /// Name of the CommunicationService. + /// + /// The the Bicep identifier name of the CommunicationService resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CommunicationService. /// The existing CommunicationService resource. - public static CommunicationService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CommunicationService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this CommunicationService resource. @@ -172,5 +182,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this CommunicationService resource. public CommunicationServiceKeys GetKeys() => CommunicationServiceKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/EmailService.cs b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/EmailService.cs index fa8ba7c5f9061..ce3fedbc58d8c 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/EmailService.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/EmailService.cs @@ -63,10 +63,15 @@ public partial class EmailService : Resource /// /// Creates a new EmailService. /// - /// Name of the EmailService. + /// + /// The the Bicep identifier name of the EmailService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EmailService. - public EmailService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Communication/emailServices", resourceVersion ?? "2023-04-01") + public EmailService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Communication/emailServices", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -101,9 +106,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EmailService. /// - /// Name of the EmailService. + /// + /// The the Bicep identifier name of the EmailService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EmailService. /// The existing EmailService resource. - public static EmailService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EmailService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/SenderUsername.cs b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/SenderUsername.cs index 0c901d72a0b22..aa7d0332780d4 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/SenderUsername.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Generated/SenderUsername.cs @@ -69,10 +69,15 @@ public partial class SenderUsername : Resource /// /// Creates a new SenderUsername. /// - /// Name of the SenderUsername. + /// + /// The the Bicep identifier name of the SenderUsername resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SenderUsername. - public SenderUsername(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Communication/emailServices/domains/senderUsernames", resourceVersion ?? "2023-04-01") + public SenderUsername(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Communication/emailServices/domains/senderUsernames", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _displayName = BicepValue.DefineProperty(this, "DisplayName", ["properties", "displayName"]); @@ -108,9 +113,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SenderUsername. /// - /// Name of the SenderUsername. + /// + /// The the Bicep identifier name of the SenderUsername resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SenderUsername. /// The existing SenderUsername resource. - public static SenderUsername FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SenderUsername FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/api/Azure.Provisioning.ContainerRegistry.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/api/Azure.Provisioning.ContainerRegistry.netstandard2.0.cs index 0a203fc514a08..3735b61c13a0d 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/api/Azure.Provisioning.ContainerRegistry.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/api/Azure.Provisioning.ContainerRegistry.netstandard2.0.cs @@ -7,7 +7,7 @@ public enum ActionsRequiredForPrivateLinkServiceConsumer } public partial class ContainerRegistryAgentPool : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryAgentPool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryAgentPool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Count { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -19,7 +19,7 @@ public partial class ContainerRegistryAgentPool : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Tier { get { throw null; } set { } } public Azure.Provisioning.BicepValue VirtualNetworkSubnetResourceId { get { throw null; } set { } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryAgentPool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryAgentPool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01_preview; @@ -277,7 +277,7 @@ public enum ContainerRegistryPolicyStatus } public partial class ContainerRegistryPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -285,7 +285,7 @@ public partial class ContainerRegistryPrivateEndpointConnection : Azure.Provisio public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_09_01; @@ -334,7 +334,7 @@ public enum ContainerRegistryPublicNetworkAccess } public partial class ContainerRegistryReplication : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryReplication(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryReplication(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsRegionEndpointEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -345,7 +345,7 @@ public partial class ContainerRegistryReplication : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue ZoneRedundancy { get { throw null; } set { } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryReplication FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryReplication FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -447,7 +447,7 @@ public enum ContainerRegistrySecretObjectType } public partial class ContainerRegistryService : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList DataEndpointHostNames { get { throw null; } } public Azure.Provisioning.BicepValue Encryption { get { throw null; } set { } } @@ -469,9 +469,9 @@ public partial class ContainerRegistryService : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue ZoneRedundancy { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerRegistry.ContainerRegistryBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerRegistry.ContainerRegistryBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerRegistry.ContainerRegistryBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -533,7 +533,7 @@ public enum ContainerRegistrySourceTriggerEvent } public partial class ContainerRegistryTask : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryTask(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryTask(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AgentCpu { get { throw null; } set { } } public Azure.Provisioning.BicepValue AgentPoolName { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } @@ -553,7 +553,7 @@ public partial class ContainerRegistryTask : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TimeoutInSeconds { get { throw null; } set { } } public Azure.Provisioning.BicepValue Trigger { get { throw null; } set { } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryTask FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryTask FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -572,7 +572,7 @@ public ContainerRegistryTaskOverridableValue() { } } public partial class ContainerRegistryTaskRun : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryTaskRun(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryTaskRun(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ForceUpdateTag { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } @@ -583,7 +583,7 @@ public partial class ContainerRegistryTaskRun : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue RunRequest { get { throw null; } set { } } public Azure.Provisioning.BicepValue RunResult { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryTaskRun FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryTaskRun FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01_preview; @@ -622,7 +622,7 @@ public ContainerRegistryTimerTriggerDescriptor() { } } public partial class ContainerRegistryToken : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryToken(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryToken(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Credentials { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -632,7 +632,7 @@ public partial class ContainerRegistryToken : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue ScopeMapId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryToken FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryToken FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -714,7 +714,7 @@ public enum ContainerRegistryUpdateTriggerPayloadType } public partial class ContainerRegistryWebhook : Azure.Provisioning.Primitives.Resource { - public ContainerRegistryWebhook(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerRegistryWebhook(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Actions { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary CustomHeaders { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -727,7 +727,7 @@ public partial class ContainerRegistryWebhook : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.ContainerRegistry.ContainerRegistryWebhook FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ContainerRegistryWebhook FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -774,7 +774,7 @@ public CustomRegistryCredentials() { } } public partial class ScopeMap : Azure.Provisioning.Primitives.Resource { - public ScopeMap(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ScopeMap(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Actions { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } @@ -784,7 +784,7 @@ public partial class ScopeMap : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue ScopeMapType { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerRegistry.ScopeMap FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerRegistry.ScopeMap FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryAgentPool.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryAgentPool.cs index b40ccf51d1897..3a0b20c8fb41f 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryAgentPool.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryAgentPool.cs @@ -87,10 +87,15 @@ public partial class ContainerRegistryAgentPool : Resource /// /// Creates a new ContainerRegistryAgentPool. /// - /// Name of the ContainerRegistryAgentPool. + /// + /// The the Bicep identifier name of the ContainerRegistryAgentPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerRegistryAgentPool. - public ContainerRegistryAgentPool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/agentPools", resourceVersion ?? "2019-06-01-preview") + public ContainerRegistryAgentPool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/agentPools", resourceVersion ?? "2019-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -119,9 +124,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryAgentPool. /// - /// Name of the ContainerRegistryAgentPool. + /// + /// The the Bicep identifier name of the ContainerRegistryAgentPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerRegistryAgentPool. /// The existing ContainerRegistryAgentPool resource. - public static ContainerRegistryAgentPool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryAgentPool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnection.cs index a72861e0f6df7..bca3bba732e28 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnection.cs @@ -63,10 +63,16 @@ public partial class ContainerRegistryPrivateEndpointConnection : Resource /// /// Creates a new ContainerRegistryPrivateEndpointConnection. /// - /// Name of the ContainerRegistryPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ContainerRegistryPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerRegistryPrivateEndpointConnection. - public ContainerRegistryPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/privateEndpointConnections", resourceVersion ?? "2023-07-01") + public ContainerRegistryPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/privateEndpointConnections", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -107,9 +113,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerRegistryPrivateEndpointConnection. /// - /// Name of the ContainerRegistryPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ContainerRegistryPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerRegistryPrivateEndpointConnection. /// The existing ContainerRegistryPrivateEndpointConnection resource. - public static ContainerRegistryPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryReplication.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryReplication.cs index a756cbeafbaf4..55c3a319a9a04 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryReplication.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryReplication.cs @@ -87,10 +87,15 @@ public partial class ContainerRegistryReplication : Resource /// /// Creates a new ContainerRegistryReplication. /// - /// Name of the ContainerRegistryReplication. + /// + /// The the Bicep identifier name of the ContainerRegistryReplication + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerRegistryReplication. - public ContainerRegistryReplication(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/replications", resourceVersion ?? "2023-07-01") + public ContainerRegistryReplication(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/replications", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -143,11 +148,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryReplication. /// - /// Name of the ContainerRegistryReplication. + /// + /// The the Bicep identifier name of the ContainerRegistryReplication + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerRegistryReplication. /// The existing ContainerRegistryReplication resource. - public static ContainerRegistryReplication FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryReplication FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerRegistryReplication diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryService.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryService.cs index 394effc28f6f1..34a40b78613e1 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryService.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryService.cs @@ -156,10 +156,15 @@ public partial class ContainerRegistryService : Resource /// /// Creates a new ContainerRegistryService. /// - /// Name of the ContainerRegistryService. + /// + /// The the Bicep identifier name of the ContainerRegistryService resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryService. - public ContainerRegistryService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries", resourceVersion ?? "2023-07-01") + public ContainerRegistryService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -228,11 +233,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryService. /// - /// Name of the ContainerRegistryService. + /// + /// The the Bicep identifier name of the ContainerRegistryService resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryService. /// The existing ContainerRegistryService resource. - public static ContainerRegistryService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerRegistryService resource. @@ -250,10 +260,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(ContainerRegistryBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{ContainerRegistryBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{ContainerRegistryBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -266,13 +276,13 @@ public RoleAssignment CreateRoleAssignment(ContainerRegistryBuiltInRole role, Us /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(ContainerRegistryBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{ContainerRegistryBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(ContainerRegistryBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{ContainerRegistryBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTask.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTask.cs index b685eca18615b..cca671e59e3a6 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTask.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTask.cs @@ -148,10 +148,15 @@ public partial class ContainerRegistryTask : Resource /// /// Creates a new ContainerRegistryTask. /// - /// Name of the ContainerRegistryTask. + /// + /// The the Bicep identifier name of the ContainerRegistryTask resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryTask. - public ContainerRegistryTask(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/tasks", resourceVersion ?? "2019-04-01") + public ContainerRegistryTask(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/tasks", resourceVersion ?? "2019-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -198,11 +203,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryTask. /// - /// Name of the ContainerRegistryTask. + /// + /// The the Bicep identifier name of the ContainerRegistryTask resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryTask. /// The existing ContainerRegistryTask resource. - public static ContainerRegistryTask FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryTask FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerRegistryTask resource. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTaskRun.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTaskRun.cs index 919708541ddd0..fa07d637f6af1 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTaskRun.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryTaskRun.cs @@ -92,10 +92,15 @@ public partial class ContainerRegistryTaskRun : Resource /// /// Creates a new ContainerRegistryTaskRun. /// - /// Name of the ContainerRegistryTaskRun. + /// + /// The the Bicep identifier name of the ContainerRegistryTaskRun resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryTaskRun. - public ContainerRegistryTaskRun(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/taskRuns", resourceVersion ?? "2019-06-01-preview") + public ContainerRegistryTaskRun(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/taskRuns", resourceVersion ?? "2019-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _forceUpdateTag = BicepValue.DefineProperty(this, "ForceUpdateTag", ["properties", "forceUpdateTag"]); @@ -123,9 +128,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryTaskRun. /// - /// Name of the ContainerRegistryTaskRun. + /// + /// The the Bicep identifier name of the ContainerRegistryTaskRun resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryTaskRun. /// The existing ContainerRegistryTaskRun resource. - public static ContainerRegistryTaskRun FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryTaskRun FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryToken.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryToken.cs index a19e5c14ee83b..d4b77df591766 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryToken.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryToken.cs @@ -77,10 +77,15 @@ public partial class ContainerRegistryToken : Resource /// /// Creates a new ContainerRegistryToken. /// - /// Name of the ContainerRegistryToken. + /// + /// The the Bicep identifier name of the ContainerRegistryToken resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryToken. - public ContainerRegistryToken(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/tokens", resourceVersion ?? "2023-07-01") + public ContainerRegistryToken(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/tokens", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _credentials = BicepValue.DefineProperty(this, "Credentials", ["properties", "credentials"]); @@ -117,11 +122,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryToken. /// - /// Name of the ContainerRegistryToken. + /// + /// The the Bicep identifier name of the ContainerRegistryToken resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryToken. /// The existing ContainerRegistryToken resource. - public static ContainerRegistryToken FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryToken FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerRegistryToken resource. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryWebhook.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryWebhook.cs index 74773f238c15a..4df105766f640 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryWebhook.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ContainerRegistryWebhook.cs @@ -100,10 +100,15 @@ public partial class ContainerRegistryWebhook : Resource /// /// Creates a new ContainerRegistryWebhook. /// - /// Name of the ContainerRegistryWebhook. + /// + /// The the Bicep identifier name of the ContainerRegistryWebhook resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryWebhook. - public ContainerRegistryWebhook(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/webhooks", resourceVersion ?? "2023-07-01") + public ContainerRegistryWebhook(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/webhooks", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -158,11 +163,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerRegistryWebhook. /// - /// Name of the ContainerRegistryWebhook. + /// + /// The the Bicep identifier name of the ContainerRegistryWebhook resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ContainerRegistryWebhook. /// The existing ContainerRegistryWebhook resource. - public static ContainerRegistryWebhook FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerRegistryWebhook FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerRegistryWebhook resource. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ScopeMap.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ScopeMap.cs index d62248b00a3fc..446d72b1bed47 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ScopeMap.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Generated/ScopeMap.cs @@ -78,10 +78,15 @@ public partial class ScopeMap : Resource /// /// Creates a new ScopeMap. /// - /// Name of the ScopeMap. + /// + /// The the Bicep identifier name of the ScopeMap resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ScopeMap. - public ScopeMap(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerRegistry/registries/scopeMaps", resourceVersion ?? "2023-07-01") + public ScopeMap(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerRegistry/registries/scopeMaps", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _actions = BicepList.DefineProperty(this, "Actions", ["properties", "actions"]); @@ -118,11 +123,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ScopeMap. /// - /// Name of the ScopeMap. + /// + /// The the Bicep identifier name of the ScopeMap resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ScopeMap. /// The existing ScopeMap resource. - public static ScopeMap FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ScopeMap FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ScopeMap resource. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/api/Azure.Provisioning.ContainerService.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/api/Azure.Provisioning.ContainerService.netstandard2.0.cs index 7d32574945e7a..f7fdcc9a4c76c 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/api/Azure.Provisioning.ContainerService.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/api/Azure.Provisioning.ContainerService.netstandard2.0.cs @@ -28,7 +28,7 @@ public AgentPoolNetworkProfile() { } } public partial class AgentPoolSnapshot : Azure.Provisioning.Primitives.Resource { - public AgentPoolSnapshot(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AgentPoolSnapshot(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreationDataSourceResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue EnableFips { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -42,7 +42,7 @@ public partial class AgentPoolSnapshot : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue VmSize { get { throw null; } } - public static Azure.Provisioning.ContainerService.AgentPoolSnapshot FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.AgentPoolSnapshot FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_08_01; @@ -101,7 +101,7 @@ public enum AutoScaleExpander } public partial class ContainerServiceAgentPool : Azure.Provisioning.Primitives.Resource { - public ContainerServiceAgentPool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerServiceAgentPool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AvailabilityZones { get { throw null; } set { } } public Azure.Provisioning.BicepValue CapacityReservationGroupId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Count { get { throw null; } set { } } @@ -149,7 +149,7 @@ public partial class ContainerServiceAgentPool : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue VmSize { get { throw null; } set { } } public Azure.Provisioning.BicepValue VnetSubnetId { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadRuntime { get { throw null; } set { } } - public static Azure.Provisioning.ContainerService.ContainerServiceAgentPool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.ContainerServiceAgentPool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -266,7 +266,7 @@ public ContainerServiceMaintenanceAbsoluteMonthlySchedule() { } } public partial class ContainerServiceMaintenanceConfiguration : Azure.Provisioning.Primitives.Resource { - public ContainerServiceMaintenanceConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerServiceMaintenanceConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue MaintenanceWindow { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -274,7 +274,7 @@ public partial class ContainerServiceMaintenanceConfiguration : Azure.Provisioni public Azure.Provisioning.ContainerService.ContainerServiceManagedCluster? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList TimesInWeek { get { throw null; } set { } } - public static Azure.Provisioning.ContainerService.ContainerServiceMaintenanceConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.ContainerServiceMaintenanceConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_08_31; @@ -371,7 +371,7 @@ public ContainerServiceMaintenanceWindow() { } } public partial class ContainerServiceManagedCluster : Azure.Provisioning.Primitives.Resource { - public ContainerServiceManagedCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerServiceManagedCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AadProfile { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary AddonProfiles { get { throw null; } set { } } public Azure.Provisioning.BicepList AgentPoolProfiles { get { throw null; } set { } } @@ -419,9 +419,9 @@ public partial class ContainerServiceManagedCluster : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue UpgradeOverrideSettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue WindowsProfile { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkloadAutoScalerProfile { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerService.ContainerServiceBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerService.ContainerServiceBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ContainerService.ContainerServiceBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.ContainerService.ContainerServiceManagedCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.ContainerServiceManagedCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -560,7 +560,7 @@ public enum ContainerServiceOutboundType } public partial class ContainerServicePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public ContainerServicePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerServicePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -568,7 +568,7 @@ public partial class ContainerServicePrivateEndpointConnection : Azure.Provision public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerService.ContainerServicePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.ContainerServicePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_08_31; @@ -684,7 +684,7 @@ public ContainerServiceTimeSpan() { } } public partial class ContainerServiceTrustedAccessRoleBinding : Azure.Provisioning.Primitives.Resource { - public ContainerServiceTrustedAccessRoleBinding(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ContainerServiceTrustedAccessRoleBinding(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.ContainerService.ContainerServiceManagedCluster? Parent { get { throw null; } set { } } @@ -692,7 +692,7 @@ public partial class ContainerServiceTrustedAccessRoleBinding : Azure.Provisioni public Azure.Provisioning.BicepList Roles { get { throw null; } set { } } public Azure.Provisioning.BicepValue SourceResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ContainerService.ContainerServiceTrustedAccessRoleBinding FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ContainerService.ContainerServiceTrustedAccessRoleBinding FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_08_31; diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/AgentPoolSnapshot.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/AgentPoolSnapshot.cs index cc5877b8e7dc4..d82900b0d904e 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/AgentPoolSnapshot.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/AgentPoolSnapshot.cs @@ -102,10 +102,15 @@ public partial class AgentPoolSnapshot : Resource /// /// Creates a new AgentPoolSnapshot. /// - /// Name of the AgentPoolSnapshot. + /// + /// The the Bicep identifier name of the AgentPoolSnapshot resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the AgentPoolSnapshot. - public AgentPoolSnapshot(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/snapshots", resourceVersion ?? "2024-08-01") + public AgentPoolSnapshot(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/snapshots", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -281,9 +286,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AgentPoolSnapshot. /// - /// Name of the AgentPoolSnapshot. + /// + /// The the Bicep identifier name of the AgentPoolSnapshot resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the AgentPoolSnapshot. /// The existing AgentPoolSnapshot resource. - public static AgentPoolSnapshot FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AgentPoolSnapshot FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceAgentPool.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceAgentPool.cs index 1450cb05fc9e8..c874a4741bd85 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceAgentPool.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceAgentPool.cs @@ -367,10 +367,15 @@ public partial class ContainerServiceAgentPool : Resource /// /// Creates a new ContainerServiceAgentPool. /// - /// Name of the ContainerServiceAgentPool. + /// + /// The the Bicep identifier name of the ContainerServiceAgentPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerServiceAgentPool. - public ContainerServiceAgentPool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/managedClusters/agentPools", resourceVersion ?? "2024-08-01") + public ContainerServiceAgentPool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/managedClusters/agentPools", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _availabilityZones = BicepList.DefineProperty(this, "AvailabilityZones", ["properties", "availabilityZones"]); @@ -685,11 +690,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerServiceAgentPool. /// - /// Name of the ContainerServiceAgentPool. + /// + /// The the Bicep identifier name of the ContainerServiceAgentPool + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerServiceAgentPool. /// The existing ContainerServiceAgentPool resource. - public static ContainerServiceAgentPool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerServiceAgentPool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerServiceAgentPool resource. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceMaintenanceConfiguration.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceMaintenanceConfiguration.cs index db2ea17d20df3..f355a6923ba3b 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceMaintenanceConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceMaintenanceConfiguration.cs @@ -64,10 +64,16 @@ public partial class ContainerServiceMaintenanceConfiguration : Resource /// /// Creates a new ContainerServiceMaintenanceConfiguration. /// - /// Name of the ContainerServiceMaintenanceConfiguration. + /// + /// The the Bicep identifier name of the + /// ContainerServiceMaintenanceConfiguration resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServiceMaintenanceConfiguration. - public ContainerServiceMaintenanceConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/managedClusters/maintenanceConfigurations", resourceVersion ?? "2024-08-01") + public ContainerServiceMaintenanceConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/managedClusters/maintenanceConfigurations", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _maintenanceWindow = BicepValue.DefineProperty(this, "MaintenanceWindow", ["properties", "maintenanceWindow"]); @@ -343,9 +349,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerServiceMaintenanceConfiguration. /// - /// Name of the ContainerServiceMaintenanceConfiguration. + /// + /// The the Bicep identifier name of the + /// ContainerServiceMaintenanceConfiguration resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServiceMaintenanceConfiguration. /// The existing ContainerServiceMaintenanceConfiguration resource. - public static ContainerServiceMaintenanceConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerServiceMaintenanceConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceManagedCluster.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceManagedCluster.cs index d65e57ffb5b87..e347d125ca449 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceManagedCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceManagedCluster.cs @@ -341,10 +341,15 @@ public partial class ContainerServiceManagedCluster : Resource /// /// Creates a new ContainerServiceManagedCluster. /// - /// Name of the ContainerServiceManagedCluster. + /// + /// The the Bicep identifier name of the ContainerServiceManagedCluster + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerServiceManagedCluster. - public ContainerServiceManagedCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/managedClusters", resourceVersion ?? "2024-08-01") + public ContainerServiceManagedCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/managedClusters", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -659,11 +664,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ContainerServiceManagedCluster. /// - /// Name of the ContainerServiceManagedCluster. + /// + /// The the Bicep identifier name of the ContainerServiceManagedCluster + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ContainerServiceManagedCluster. /// The existing ContainerServiceManagedCluster resource. - public static ContainerServiceManagedCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerServiceManagedCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ContainerServiceManagedCluster @@ -682,10 +692,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(ContainerServiceBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{ContainerServiceBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{ContainerServiceBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -698,13 +708,13 @@ public RoleAssignment CreateRoleAssignment(ContainerServiceBuiltInRole role, Use /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(ContainerServiceBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{ContainerServiceBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(ContainerServiceBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{ContainerServiceBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServicePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServicePrivateEndpointConnection.cs index 876c2bddfc1ec..a967c09a21190 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServicePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServicePrivateEndpointConnection.cs @@ -63,10 +63,16 @@ public partial class ContainerServicePrivateEndpointConnection : Resource /// /// Creates a new ContainerServicePrivateEndpointConnection. /// - /// Name of the ContainerServicePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ContainerServicePrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServicePrivateEndpointConnection. - public ContainerServicePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/managedClusters/privateEndpointConnections", resourceVersion ?? "2024-08-01") + public ContainerServicePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/managedClusters/privateEndpointConnections", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -342,9 +348,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerServicePrivateEndpointConnection. /// - /// Name of the ContainerServicePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ContainerServicePrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServicePrivateEndpointConnection. /// The existing ContainerServicePrivateEndpointConnection resource. - public static ContainerServicePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerServicePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBinding.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBinding.cs index 4b55598a0f635..c48ad5e21368f 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBinding.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBinding.cs @@ -66,10 +66,16 @@ public partial class ContainerServiceTrustedAccessRoleBinding : Resource /// /// Creates a new ContainerServiceTrustedAccessRoleBinding. /// - /// Name of the ContainerServiceTrustedAccessRoleBinding. + /// + /// The the Bicep identifier name of the + /// ContainerServiceTrustedAccessRoleBinding resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServiceTrustedAccessRoleBinding. - public ContainerServiceTrustedAccessRoleBinding(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings", resourceVersion ?? "2024-08-01") + public ContainerServiceTrustedAccessRoleBinding(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _roles = BicepList.DefineProperty(this, "Roles", ["properties", "roles"], isRequired: true); @@ -345,9 +351,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ContainerServiceTrustedAccessRoleBinding. /// - /// Name of the ContainerServiceTrustedAccessRoleBinding. + /// + /// The the Bicep identifier name of the + /// ContainerServiceTrustedAccessRoleBinding resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ContainerServiceTrustedAccessRoleBinding. /// The existing ContainerServiceTrustedAccessRoleBinding resource. - public static ContainerServiceTrustedAccessRoleBinding FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ContainerServiceTrustedAccessRoleBinding FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/api/Azure.Provisioning.CosmosDB.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/api/Azure.Provisioning.CosmosDB.netstandard2.0.cs index 277e430a0d842..49a0360eaebaf 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/api/Azure.Provisioning.CosmosDB.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/api/Azure.Provisioning.CosmosDB.netstandard2.0.cs @@ -73,7 +73,7 @@ public CassandraCertificate() { } } public partial class CassandraCluster : Azure.Provisioning.Primitives.Resource { - public CassandraCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -81,7 +81,7 @@ public partial class CassandraCluster : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_10_15; @@ -153,13 +153,13 @@ public CassandraColumn() { } } public partial class CassandraDataCenter : Azure.Provisioning.Primitives.Resource { - public CassandraDataCenter(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraDataCenter(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.CosmosDB.CassandraCluster? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CassandraDataCenter FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraDataCenter FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_10_15; @@ -210,7 +210,7 @@ public CassandraError() { } } public partial class CassandraKeyspace : Azure.Provisioning.Primitives.Resource { - public CassandraKeyspace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraKeyspace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -221,7 +221,7 @@ public partial class CassandraKeyspace : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ResourceKeyspaceName { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraKeyspace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraKeyspace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -260,7 +260,7 @@ public CassandraKeyspacePropertiesConfig() { } } public partial class CassandraKeyspaceThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CassandraKeyspaceThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraKeyspaceThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -269,7 +269,7 @@ public partial class CassandraKeyspaceThroughputSetting : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraKeyspaceThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraKeyspaceThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -323,7 +323,7 @@ public CassandraSchema() { } } public partial class CassandraTable : Azure.Provisioning.Primitives.Resource { - public CassandraTable(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraTable(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -333,7 +333,7 @@ public partial class CassandraTable : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraTable FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraTable FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -380,7 +380,7 @@ public CassandraTableResourceInfo() { } } public partial class CassandraTableThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CassandraTableThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraTableThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -389,7 +389,7 @@ public partial class CassandraTableThroughputSetting : Azure.Provisioning.Primit public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraTableThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraTableThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -435,7 +435,7 @@ public CassandraViewGetPropertiesResource() { } } public partial class CassandraViewGetResult : Azure.Provisioning.Primitives.Resource { - public CassandraViewGetResult(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraViewGetResult(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -445,7 +445,7 @@ public partial class CassandraViewGetResult : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraViewGetResult FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraViewGetResult FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -484,7 +484,7 @@ public CassandraViewResource() { } } public partial class CassandraViewThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CassandraViewThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CassandraViewThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -493,7 +493,7 @@ public partial class CassandraViewThroughputSetting : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CassandraViewThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CassandraViewThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -578,7 +578,7 @@ public CosmosCassandraDataTransferDataSourceSink() { } } public partial class CosmosDBAccount : Azure.Provisioning.Primitives.Resource { - public CosmosDBAccount(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBAccount(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AnalyticalStorageSchemaType { get { throw null; } set { } } public Azure.Provisioning.BicepValue ApiServerVersion { get { throw null; } set { } } public Azure.Provisioning.BicepValue BackupPolicy { get { throw null; } set { } } @@ -630,9 +630,9 @@ public partial class CosmosDBAccount : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepList VirtualNetworkRules { get { throw null; } set { } } public Azure.Provisioning.BicepList WriteLocations { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CosmosDB.CosmosDBBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CosmosDB.CosmosDBBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.CosmosDB.CosmosDBBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.CosmosDB.CosmosDBAccount FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBAccount FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.CosmosDB.CosmosDBAccountKeyList GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -823,7 +823,7 @@ public CosmosDBFailoverPolicy() { } } public partial class CosmosDBFirewallRule : Azure.Provisioning.Primitives.Resource { - public CosmosDBFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -831,7 +831,7 @@ public partial class CosmosDBFirewallRule : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue StartIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_07_01; @@ -902,7 +902,7 @@ public CosmosDBPathIndexes() { } } public partial class CosmosDBPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public CosmosDBPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue GroupId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -911,7 +911,7 @@ public partial class CosmosDBPrivateEndpointConnection : Azure.Provisioning.Prim public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -988,7 +988,7 @@ public enum CosmosDBServerVersion } public partial class CosmosDBService : Azure.Provisioning.Primitives.Resource { - public CosmosDBService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue InstanceCount { get { throw null; } set { } } public Azure.Provisioning.BicepValue InstanceSize { get { throw null; } set { } } @@ -997,7 +997,7 @@ public partial class CosmosDBService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Properties { get { throw null; } } public Azure.Provisioning.BicepValue ServiceType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1072,13 +1072,13 @@ public enum CosmosDBSpatialType } public partial class CosmosDBSqlClientEncryptionKey : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlClientEncryptionKey(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlClientEncryptionKey(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.CosmosDB.CosmosDBSqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlClientEncryptionKey FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlClientEncryptionKey FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1126,7 +1126,7 @@ public CosmosDBSqlClientEncryptionKeyResourceInfo() { } } public partial class CosmosDBSqlContainer : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlContainer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlContainer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1136,7 +1136,7 @@ public partial class CosmosDBSqlContainer : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlContainer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlContainer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1191,7 +1191,7 @@ public CosmosDBSqlContainerResourceInfo() { } } public partial class CosmosDBSqlContainerThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlContainerThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlContainerThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1200,7 +1200,7 @@ public partial class CosmosDBSqlContainerThroughputSetting : Azure.Provisioning. public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlContainerThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlContainerThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1233,7 +1233,7 @@ public static partial class ResourceVersions } public partial class CosmosDBSqlDatabase : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1243,7 +1243,7 @@ public partial class CosmosDBSqlDatabase : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1289,7 +1289,7 @@ public CosmosDBSqlDatabaseResourceInfo() { } } public partial class CosmosDBSqlDatabaseThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlDatabaseThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlDatabaseThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1298,7 +1298,7 @@ public partial class CosmosDBSqlDatabaseThroughputSetting : Azure.Provisioning.P public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1331,7 +1331,7 @@ public static partial class ResourceVersions } public partial class CosmosDBSqlRoleAssignment : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlRoleAssignment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlRoleAssignment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.CosmosDB.CosmosDBAccount? Parent { get { throw null; } set { } } @@ -1339,7 +1339,7 @@ public partial class CosmosDBSqlRoleAssignment : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue RoleDefinitionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Scope { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlRoleAssignment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlRoleAssignment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1372,7 +1372,7 @@ public static partial class ResourceVersions } public partial class CosmosDBSqlRoleDefinition : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlRoleDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlRoleDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AssignableScopes { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -1381,7 +1381,7 @@ public partial class CosmosDBSqlRoleDefinition : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue RoleDefinitionType { get { throw null; } set { } } public Azure.Provisioning.BicepValue RoleName { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlRoleDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlRoleDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1425,7 +1425,7 @@ public CosmosDBSqlRolePermission() { } } public partial class CosmosDBSqlStoredProcedure : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlStoredProcedure(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlStoredProcedure(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1435,7 +1435,7 @@ public partial class CosmosDBSqlStoredProcedure : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlStoredProcedure FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlStoredProcedure FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1474,7 +1474,7 @@ public CosmosDBSqlStoredProcedureResourceInfo() { } } public partial class CosmosDBSqlTrigger : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlTrigger(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlTrigger(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1484,7 +1484,7 @@ public partial class CosmosDBSqlTrigger : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlTrigger FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlTrigger FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1538,7 +1538,7 @@ public enum CosmosDBSqlTriggerType } public partial class CosmosDBSqlUserDefinedFunction : Azure.Provisioning.Primitives.Resource { - public CosmosDBSqlUserDefinedFunction(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBSqlUserDefinedFunction(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1548,7 +1548,7 @@ public partial class CosmosDBSqlUserDefinedFunction : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBSqlUserDefinedFunction FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBSqlUserDefinedFunction FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1599,7 +1599,7 @@ public enum CosmosDBStatus } public partial class CosmosDBTable : Azure.Provisioning.Primitives.Resource { - public CosmosDBTable(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBTable(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1609,7 +1609,7 @@ public partial class CosmosDBTable : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBTable FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBTable FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1662,7 +1662,7 @@ public CosmosDBTableResourceInfo() { } } public partial class CosmosDBThroughputPool : Azure.Provisioning.Primitives.Resource { - public CosmosDBThroughputPool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBThroughputPool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue MaxThroughput { get { throw null; } set { } } @@ -1670,7 +1670,7 @@ public partial class CosmosDBThroughputPool : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosDBThroughputPool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBThroughputPool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_02_15_preview; @@ -1678,7 +1678,7 @@ public static partial class ResourceVersions } public partial class CosmosDBThroughputPoolAccount : Azure.Provisioning.Primitives.Resource { - public CosmosDBThroughputPoolAccount(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosDBThroughputPoolAccount(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccountInstanceId { get { throw null; } } public Azure.Provisioning.BicepValue AccountLocation { get { throw null; } set { } } public Azure.Provisioning.BicepValue AccountResourceIdentifier { get { throw null; } set { } } @@ -1687,7 +1687,7 @@ public partial class CosmosDBThroughputPoolAccount : Azure.Provisioning.Primitiv public Azure.Provisioning.CosmosDB.CosmosDBThroughputPool? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.CosmosDBThroughputPoolAccount FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosDBThroughputPoolAccount FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_02_15_preview; @@ -1718,7 +1718,7 @@ public CosmosSqlDataTransferDataSourceSink() { } } public partial class CosmosTableThroughputSetting : Azure.Provisioning.Primitives.Resource { - public CosmosTableThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CosmosTableThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1727,7 +1727,7 @@ public partial class CosmosTableThroughputSetting : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.CosmosTableThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.CosmosTableThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1778,7 +1778,7 @@ public DataTransferDataSourceSink() { } } public partial class DataTransferJobGetResult : Azure.Provisioning.Primitives.Resource { - public DataTransferJobGetResult(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DataTransferJobGetResult(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Destination { get { throw null; } } public Azure.Provisioning.BicepValue Duration { get { throw null; } } public Azure.Provisioning.BicepValue Error { get { throw null; } } @@ -1795,7 +1795,7 @@ public partial class DataTransferJobGetResult : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TotalCount { get { throw null; } } public Azure.Provisioning.BicepValue WorkerCount { get { throw null; } } - public static Azure.Provisioning.CosmosDB.DataTransferJobGetResult FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.DataTransferJobGetResult FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -1992,7 +1992,7 @@ public GraphResourceGetPropertiesOptions() { } } public partial class GraphResourceGetResult : Azure.Provisioning.Primitives.Resource { - public GraphResourceGetResult(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GraphResourceGetResult(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2002,7 +2002,7 @@ public partial class GraphResourceGetResult : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue ResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.GraphResourceGetResult FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.GraphResourceGetResult FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2035,7 +2035,7 @@ public static partial class ResourceVersions } public partial class GremlinDatabase : Azure.Provisioning.Primitives.Resource { - public GremlinDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GremlinDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2045,7 +2045,7 @@ public partial class GremlinDatabase : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.GremlinDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.GremlinDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2097,7 +2097,7 @@ public GremlinDatabaseRestoreResourceInfo() { } } public partial class GremlinDatabaseThroughputSetting : Azure.Provisioning.Primitives.Resource { - public GremlinDatabaseThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GremlinDatabaseThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2106,7 +2106,7 @@ public partial class GremlinDatabaseThroughputSetting : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.GremlinDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.GremlinDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2139,7 +2139,7 @@ public static partial class ResourceVersions } public partial class GremlinGraph : Azure.Provisioning.Primitives.Resource { - public GremlinGraph(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GremlinGraph(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2149,7 +2149,7 @@ public partial class GremlinGraph : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.GremlinGraph FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.GremlinGraph FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2201,7 +2201,7 @@ public GremlinGraphResourceInfo() { } } public partial class GremlinGraphThroughputSetting : Azure.Provisioning.Primitives.Resource { - public GremlinGraphThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GremlinGraphThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2210,7 +2210,7 @@ public partial class GremlinGraphThroughputSetting : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.GremlinGraphThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.GremlinGraphThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2262,7 +2262,7 @@ public MaterializedViewsBuilderServiceProperties() { } } public partial class MongoCluster : Azure.Provisioning.Primitives.Resource { - public MongoCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorLogin { get { throw null; } set { } } public Azure.Provisioning.BicepValue AdministratorLoginPassword { get { throw null; } set { } } public Azure.Provisioning.BicepValue ClusterStatus { get { throw null; } } @@ -2278,7 +2278,7 @@ public partial class MongoCluster : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ServerVersion { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_07_01; @@ -2302,7 +2302,7 @@ public enum MongoClusterStatus } public partial class MongoDBCollection : Azure.Provisioning.Primitives.Resource { - public MongoDBCollection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBCollection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2312,7 +2312,7 @@ public partial class MongoDBCollection : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoDBCollection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBCollection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2361,7 +2361,7 @@ public MongoDBCollectionResourceInfo() { } } public partial class MongoDBCollectionThroughputSetting : Azure.Provisioning.Primitives.Resource { - public MongoDBCollectionThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBCollectionThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2370,7 +2370,7 @@ public partial class MongoDBCollectionThroughputSetting : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoDBCollectionThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBCollectionThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2403,7 +2403,7 @@ public static partial class ResourceVersions } public partial class MongoDBDatabase : Azure.Provisioning.Primitives.Resource { - public MongoDBDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2413,7 +2413,7 @@ public partial class MongoDBDatabase : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoDBDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2459,7 +2459,7 @@ public MongoDBDatabaseResourceInfo() { } } public partial class MongoDBDatabaseThroughputSetting : Azure.Provisioning.Primitives.Resource { - public MongoDBDatabaseThroughputSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBDatabaseThroughputSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2468,7 +2468,7 @@ public partial class MongoDBDatabaseThroughputSetting : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue Resource { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoDBDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2531,7 +2531,7 @@ public MongoDBRole() { } } public partial class MongoDBRoleDefinition : Azure.Provisioning.Primitives.Resource { - public MongoDBRoleDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBRoleDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DatabaseName { get { throw null; } set { } } public Azure.Provisioning.BicepValue DefinitionType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2541,7 +2541,7 @@ public partial class MongoDBRoleDefinition : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue RoleName { get { throw null; } set { } } public Azure.Provisioning.BicepList Roles { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.CosmosDB.MongoDBRoleDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBRoleDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -2579,7 +2579,7 @@ public enum MongoDBRoleDefinitionType } public partial class MongoDBUserDefinition : Azure.Provisioning.Primitives.Resource { - public MongoDBUserDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MongoDBUserDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CustomData { get { throw null; } set { } } public Azure.Provisioning.BicepValue DatabaseName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2590,7 +2590,7 @@ public partial class MongoDBUserDefinition : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepList Roles { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UserName { get { throw null; } set { } } - public static Azure.Provisioning.CosmosDB.MongoDBUserDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.CosmosDB.MongoDBUserDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraCluster.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraCluster.cs index 9d920af341aa9..fa579c8a82172 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraCluster.cs @@ -64,10 +64,15 @@ public partial class CassandraCluster : Resource /// /// Creates a new CassandraCluster. /// - /// Name of the CassandraCluster. + /// + /// The the Bicep identifier name of the CassandraCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CassandraCluster. - public CassandraCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/cassandraClusters", resourceVersion ?? "2024-08-15") + public CassandraCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/cassandraClusters", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -142,9 +147,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraCluster. /// - /// Name of the CassandraCluster. + /// + /// The the Bicep identifier name of the CassandraCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CassandraCluster. /// The existing CassandraCluster resource. - public static CassandraCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraDataCenter.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraDataCenter.cs index 87efb6d488a4d..6e1de3ef4d6f4 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraDataCenter.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraDataCenter.cs @@ -51,10 +51,15 @@ public partial class CassandraDataCenter : Resource /// /// Creates a new CassandraDataCenter. /// - /// Name of the CassandraDataCenter. + /// + /// The the Bicep identifier name of the CassandraDataCenter resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CassandraDataCenter. - public CassandraDataCenter(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/cassandraClusters/dataCenters", resourceVersion ?? "2024-08-15") + public CassandraDataCenter(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/cassandraClusters/dataCenters", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"]); @@ -127,9 +132,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraDataCenter. /// - /// Name of the CassandraDataCenter. + /// + /// The the Bicep identifier name of the CassandraDataCenter resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CassandraDataCenter. /// The existing CassandraDataCenter resource. - public static CassandraDataCenter FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraDataCenter FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspace.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspace.cs index 6b148d5fc5088..d2c4271219f14 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspace.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspace.cs @@ -83,10 +83,15 @@ public partial class CassandraKeyspace : Resource /// /// Creates a new CassandraKeyspace. /// - /// Name of the CassandraKeyspace. + /// + /// The the Bicep identifier name of the CassandraKeyspace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CassandraKeyspace. - public CassandraKeyspace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces", resourceVersion ?? "2024-08-15") + public CassandraKeyspace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -239,9 +244,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraKeyspace. /// - /// Name of the CassandraKeyspace. + /// + /// The the Bicep identifier name of the CassandraKeyspace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CassandraKeyspace. /// The existing CassandraKeyspace resource. - public static CassandraKeyspace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraKeyspace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspaceThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspaceThroughputSetting.cs index 27c29c4e67717..ad393755a5cc6 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspaceThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraKeyspaceThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CassandraKeyspaceThroughputSetting : Resource /// /// Creates a new CassandraKeyspaceThroughputSetting. /// - /// Name of the CassandraKeyspaceThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraKeyspaceThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraKeyspaceThroughputSetting. - public CassandraKeyspaceThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/throughputSettings", resourceVersion ?? "2024-08-15") + public CassandraKeyspaceThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraKeyspaceThroughputSetting. /// - /// Name of the CassandraKeyspaceThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraKeyspaceThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraKeyspaceThroughputSetting. /// The existing CassandraKeyspaceThroughputSetting resource. - public static CassandraKeyspaceThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraKeyspaceThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTable.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTable.cs index aa9a10e42ba7e..057eb12171436 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTable.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTable.cs @@ -76,10 +76,15 @@ public partial class CassandraTable : Resource /// /// Creates a new CassandraTable. /// - /// Name of the CassandraTable. + /// + /// The the Bicep identifier name of the CassandraTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CassandraTable. - public CassandraTable(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables", resourceVersion ?? "2024-08-15") + public CassandraTable(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraTable. /// - /// Name of the CassandraTable. + /// + /// The the Bicep identifier name of the CassandraTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CassandraTable. /// The existing CassandraTable resource. - public static CassandraTable FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraTable FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTableThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTableThroughputSetting.cs index 6880f3bc5783c..d0d49950761c8 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTableThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraTableThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CassandraTableThroughputSetting : Resource /// /// Creates a new CassandraTableThroughputSetting. /// - /// Name of the CassandraTableThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraTableThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraTableThroughputSetting. - public CassandraTableThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables/throughputSettings", resourceVersion ?? "2024-08-15") + public CassandraTableThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/tables/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraTableThroughputSetting. /// - /// Name of the CassandraTableThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraTableThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraTableThroughputSetting. /// The existing CassandraTableThroughputSetting resource. - public static CassandraTableThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraTableThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewGetResult.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewGetResult.cs index 8b482403cd98f..f156128f99c32 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewGetResult.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewGetResult.cs @@ -76,10 +76,15 @@ public partial class CassandraViewGetResult : Resource /// /// Creates a new CassandraViewGetResult. /// - /// Name of the CassandraViewGetResult. + /// + /// The the Bicep identifier name of the CassandraViewGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CassandraViewGetResult. - public CassandraViewGetResult(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views", resourceVersion ?? "2024-08-15") + public CassandraViewGetResult(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraViewGetResult. /// - /// Name of the CassandraViewGetResult. + /// + /// The the Bicep identifier name of the CassandraViewGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CassandraViewGetResult. /// The existing CassandraViewGetResult resource. - public static CassandraViewGetResult FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraViewGetResult FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewThroughputSetting.cs index bc69593b7956a..2d3c0cd480229 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CassandraViewThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CassandraViewThroughputSetting : Resource /// /// Creates a new CassandraViewThroughputSetting. /// - /// Name of the CassandraViewThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraViewThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraViewThroughputSetting. - public CassandraViewThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings", resourceVersion ?? "2024-08-15") + public CassandraViewThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CassandraViewThroughputSetting. /// - /// Name of the CassandraViewThroughputSetting. + /// + /// The the Bicep identifier name of the CassandraViewThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CassandraViewThroughputSetting. /// The existing CassandraViewThroughputSetting resource. - public static CassandraViewThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CassandraViewThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBAccount.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBAccount.cs index 7b32a4d23ddc9..fa2e46602a7dd 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBAccount.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBAccount.cs @@ -378,10 +378,15 @@ public partial class CosmosDBAccount : Resource /// /// Creates a new CosmosDBAccount. /// - /// Name of the CosmosDBAccount. + /// + /// The the Bicep identifier name of the CosmosDBAccount resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBAccount. - public CosmosDBAccount(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts", resourceVersion ?? "2024-08-15") + public CosmosDBAccount(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -575,11 +580,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBAccount. /// - /// Name of the CosmosDBAccount. + /// + /// The the Bicep identifier name of the CosmosDBAccount resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBAccount. /// The existing CosmosDBAccount resource. - public static CosmosDBAccount FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBAccount FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this CosmosDBAccount resource. @@ -595,7 +605,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this CosmosDBAccount resource. public CosmosDBAccountKeyList GetKeys() => CosmosDBAccountKeyList.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); /// /// Creates a role assignment for a user-assigned identity that grants @@ -605,10 +615,10 @@ public CosmosDBAccountKeyList GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(CosmosDBBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{CosmosDBBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{CosmosDBBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -621,13 +631,13 @@ public RoleAssignment CreateRoleAssignment(CosmosDBBuiltInRole role, UserAssigne /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(CosmosDBBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{CosmosDBBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(CosmosDBBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{CosmosDBBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBFirewallRule.cs index 25e7386371bb9..ec0120566ab46 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBFirewallRule.cs @@ -64,10 +64,15 @@ public partial class CosmosDBFirewallRule : Resource /// /// Creates a new CosmosDBFirewallRule. /// - /// Name of the CosmosDBFirewallRule. + /// + /// The the Bicep identifier name of the CosmosDBFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBFirewallRule. - public CosmosDBFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/mongoClusters/firewallRules", resourceVersion ?? "2024-07-01") + public CosmosDBFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/mongoClusters/firewallRules", resourceVersion ?? "2024-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIPAddress = BicepValue.DefineProperty(this, "EndIPAddress", ["properties", "endIpAddress"], isRequired: true); @@ -92,9 +97,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBFirewallRule. /// - /// Name of the CosmosDBFirewallRule. + /// + /// The the Bicep identifier name of the CosmosDBFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBFirewallRule. /// The existing CosmosDBFirewallRule resource. - public static CosmosDBFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnection.cs index c2fe639e7990f..e2b1947fa4307 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnection.cs @@ -68,10 +68,15 @@ public partial class CosmosDBPrivateEndpointConnection : Resource /// /// Creates a new CosmosDBPrivateEndpointConnection. /// - /// Name of the CosmosDBPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the CosmosDBPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBPrivateEndpointConnection. - public CosmosDBPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/privateEndpointConnections", resourceVersion ?? "2024-08-15") + public CosmosDBPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/privateEndpointConnections", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -222,9 +227,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBPrivateEndpointConnection. /// - /// Name of the CosmosDBPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the CosmosDBPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBPrivateEndpointConnection. /// The existing CosmosDBPrivateEndpointConnection resource. - public static CosmosDBPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBService.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBService.cs index a1d5d59b8fa95..041ac10735531 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBService.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBService.cs @@ -79,10 +79,15 @@ public partial class CosmosDBService : Resource /// /// Creates a new CosmosDBService. /// - /// Name of the CosmosDBService. + /// + /// The the Bicep identifier name of the CosmosDBService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBService. - public CosmosDBService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/services", resourceVersion ?? "2024-08-15") + public CosmosDBService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/services", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _instanceCount = BicepValue.DefineProperty(this, "InstanceCount", ["properties", "instanceCount"]); @@ -233,9 +238,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBService. /// - /// Name of the CosmosDBService. + /// + /// The the Bicep identifier name of the CosmosDBService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBService. /// The existing CosmosDBService resource. - public static CosmosDBService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKey.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKey.cs index 826a8f4803c0d..ab5f55c41b73f 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKey.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKey.cs @@ -50,10 +50,15 @@ public partial class CosmosDBSqlClientEncryptionKey : Resource /// /// Creates a new CosmosDBSqlClientEncryptionKey. /// - /// Name of the CosmosDBSqlClientEncryptionKey. + /// + /// The the Bicep identifier name of the CosmosDBSqlClientEncryptionKey + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlClientEncryptionKey. - public CosmosDBSqlClientEncryptionKey(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKeys", resourceVersion ?? "2024-08-15") + public CosmosDBSqlClientEncryptionKey(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/clientEncryptionKeys", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _resource = BicepValue.DefineProperty(this, "Resource", ["properties", "resource"], isRequired: true); @@ -201,9 +206,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlClientEncryptionKey. /// - /// Name of the CosmosDBSqlClientEncryptionKey. + /// + /// The the Bicep identifier name of the CosmosDBSqlClientEncryptionKey + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlClientEncryptionKey. /// The existing CosmosDBSqlClientEncryptionKey resource. - public static CosmosDBSqlClientEncryptionKey FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlClientEncryptionKey FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainer.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainer.cs index e4d4b60deae52..c46b1a61f1dd3 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainer.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainer.cs @@ -76,10 +76,15 @@ public partial class CosmosDBSqlContainer : Resource /// /// Creates a new CosmosDBSqlContainer. /// - /// Name of the CosmosDBSqlContainer. + /// + /// The the Bicep identifier name of the CosmosDBSqlContainer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBSqlContainer. - public CosmosDBSqlContainer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", resourceVersion ?? "2024-08-15") + public CosmosDBSqlContainer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlContainer. /// - /// Name of the CosmosDBSqlContainer. + /// + /// The the Bicep identifier name of the CosmosDBSqlContainer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBSqlContainer. /// The existing CosmosDBSqlContainer resource. - public static CosmosDBSqlContainer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlContainer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSetting.cs index 12d8922da42a2..b29989075ab91 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CosmosDBSqlContainerThroughputSetting : Resource /// /// Creates a new CosmosDBSqlContainerThroughputSetting. /// - /// Name of the CosmosDBSqlContainerThroughputSetting. + /// + /// The the Bicep identifier name of the + /// CosmosDBSqlContainerThroughputSetting resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlContainerThroughputSetting. - public CosmosDBSqlContainerThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings", resourceVersion ?? "2024-08-15") + public CosmosDBSqlContainerThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -224,9 +229,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// CosmosDBSqlContainerThroughputSetting. /// - /// Name of the CosmosDBSqlContainerThroughputSetting. + /// + /// The the Bicep identifier name of the + /// CosmosDBSqlContainerThroughputSetting resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlContainerThroughputSetting. /// The existing CosmosDBSqlContainerThroughputSetting resource. - public static CosmosDBSqlContainerThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlContainerThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabase.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabase.cs index 465f9a0c0555e..19e345588539a 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabase.cs @@ -76,10 +76,15 @@ public partial class CosmosDBSqlDatabase : Resource /// /// Creates a new CosmosDBSqlDatabase. /// - /// Name of the CosmosDBSqlDatabase. + /// + /// The the Bicep identifier name of the CosmosDBSqlDatabase resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBSqlDatabase. - public CosmosDBSqlDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", resourceVersion ?? "2024-08-15") + public CosmosDBSqlDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlDatabase. /// - /// Name of the CosmosDBSqlDatabase. + /// + /// The the Bicep identifier name of the CosmosDBSqlDatabase resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBSqlDatabase. /// The existing CosmosDBSqlDatabase resource. - public static CosmosDBSqlDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSetting.cs index cc728719e5108..ff7f43e078b62 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CosmosDBSqlDatabaseThroughputSetting : Resource /// /// Creates a new CosmosDBSqlDatabaseThroughputSetting. /// - /// Name of the CosmosDBSqlDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the + /// CosmosDBSqlDatabaseThroughputSetting resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlDatabaseThroughputSetting. - public CosmosDBSqlDatabaseThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings", resourceVersion ?? "2024-08-15") + public CosmosDBSqlDatabaseThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlDatabaseThroughputSetting. /// - /// Name of the CosmosDBSqlDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the + /// CosmosDBSqlDatabaseThroughputSetting resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlDatabaseThroughputSetting. /// The existing CosmosDBSqlDatabaseThroughputSetting resource. - public static CosmosDBSqlDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleAssignment.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleAssignment.cs index e8c9173afb70a..29225f8cd7166 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleAssignment.cs @@ -66,10 +66,15 @@ public partial class CosmosDBSqlRoleAssignment : Resource /// /// Creates a new CosmosDBSqlRoleAssignment. /// - /// Name of the CosmosDBSqlRoleAssignment. + /// + /// The the Bicep identifier name of the CosmosDBSqlRoleAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlRoleAssignment. - public CosmosDBSqlRoleAssignment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", resourceVersion ?? "2024-08-15") + public CosmosDBSqlRoleAssignment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _principalId = BicepValue.DefineProperty(this, "PrincipalId", ["properties", "principalId"]); @@ -219,9 +224,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlRoleAssignment. /// - /// Name of the CosmosDBSqlRoleAssignment. + /// + /// The the Bicep identifier name of the CosmosDBSqlRoleAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlRoleAssignment. /// The existing CosmosDBSqlRoleAssignment resource. - public static CosmosDBSqlRoleAssignment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlRoleAssignment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleDefinition.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleDefinition.cs index 008ac97706569..e26bd56d2be11 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlRoleDefinition.cs @@ -75,10 +75,15 @@ public partial class CosmosDBSqlRoleDefinition : Resource /// /// Creates a new CosmosDBSqlRoleDefinition. /// - /// Name of the CosmosDBSqlRoleDefinition. + /// + /// The the Bicep identifier name of the CosmosDBSqlRoleDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlRoleDefinition. - public CosmosDBSqlRoleDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions", resourceVersion ?? "2024-08-15") + public CosmosDBSqlRoleDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _assignableScopes = BicepList.DefineProperty(this, "AssignableScopes", ["properties", "assignableScopes"]); @@ -229,9 +234,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlRoleDefinition. /// - /// Name of the CosmosDBSqlRoleDefinition. + /// + /// The the Bicep identifier name of the CosmosDBSqlRoleDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlRoleDefinition. /// The existing CosmosDBSqlRoleDefinition resource. - public static CosmosDBSqlRoleDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlRoleDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlStoredProcedure.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlStoredProcedure.cs index ede89e968bfe4..90461fe66e91b 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlStoredProcedure.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlStoredProcedure.cs @@ -76,10 +76,15 @@ public partial class CosmosDBSqlStoredProcedure : Resource /// /// Creates a new CosmosDBSqlStoredProcedure. /// - /// Name of the CosmosDBSqlStoredProcedure. + /// + /// The the Bicep identifier name of the CosmosDBSqlStoredProcedure + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlStoredProcedure. - public CosmosDBSqlStoredProcedure(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/storedProcedures", resourceVersion ?? "2024-08-15") + public CosmosDBSqlStoredProcedure(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/storedProcedures", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlStoredProcedure. /// - /// Name of the CosmosDBSqlStoredProcedure. + /// + /// The the Bicep identifier name of the CosmosDBSqlStoredProcedure + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlStoredProcedure. /// The existing CosmosDBSqlStoredProcedure resource. - public static CosmosDBSqlStoredProcedure FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlStoredProcedure FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlTrigger.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlTrigger.cs index 94945e8264691..b6aa22636b41b 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlTrigger.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlTrigger.cs @@ -76,10 +76,15 @@ public partial class CosmosDBSqlTrigger : Resource /// /// Creates a new CosmosDBSqlTrigger. /// - /// Name of the CosmosDBSqlTrigger. + /// + /// The the Bicep identifier name of the CosmosDBSqlTrigger resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBSqlTrigger. - public CosmosDBSqlTrigger(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers", resourceVersion ?? "2024-08-15") + public CosmosDBSqlTrigger(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlTrigger. /// - /// Name of the CosmosDBSqlTrigger. + /// + /// The the Bicep identifier name of the CosmosDBSqlTrigger resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the CosmosDBSqlTrigger. /// The existing CosmosDBSqlTrigger resource. - public static CosmosDBSqlTrigger FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlTrigger FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunction.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunction.cs index 1115d9e91a111..56e34ca85f5f2 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunction.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunction.cs @@ -76,10 +76,15 @@ public partial class CosmosDBSqlUserDefinedFunction : Resource /// /// Creates a new CosmosDBSqlUserDefinedFunction. /// - /// Name of the CosmosDBSqlUserDefinedFunction. + /// + /// The the Bicep identifier name of the CosmosDBSqlUserDefinedFunction + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlUserDefinedFunction. - public CosmosDBSqlUserDefinedFunction(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/userDefinedFunctions", resourceVersion ?? "2024-08-15") + public CosmosDBSqlUserDefinedFunction(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/userDefinedFunctions", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBSqlUserDefinedFunction. /// - /// Name of the CosmosDBSqlUserDefinedFunction. + /// + /// The the Bicep identifier name of the CosmosDBSqlUserDefinedFunction + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBSqlUserDefinedFunction. /// The existing CosmosDBSqlUserDefinedFunction resource. - public static CosmosDBSqlUserDefinedFunction FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBSqlUserDefinedFunction FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBTable.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBTable.cs index dbf811c19bada..95c5d10d4c267 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBTable.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBTable.cs @@ -76,10 +76,15 @@ public partial class CosmosDBTable : Resource /// /// Creates a new CosmosDBTable. /// - /// Name of the CosmosDBTable. + /// + /// The the Bicep identifier name of the CosmosDBTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CosmosDBTable. - public CosmosDBTable(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/tables", resourceVersion ?? "2024-08-15") + public CosmosDBTable(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/tables", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBTable. /// - /// Name of the CosmosDBTable. + /// + /// The the Bicep identifier name of the CosmosDBTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CosmosDBTable. /// The existing CosmosDBTable resource. - public static CosmosDBTable FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBTable FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPool.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPool.cs index 46af42edcf41a..84d3ced51c3d8 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPool.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPool.cs @@ -63,10 +63,15 @@ public partial class CosmosDBThroughputPool : Resource /// /// Creates a new CosmosDBThroughputPool. /// - /// Name of the CosmosDBThroughputPool. + /// + /// The the Bicep identifier name of the CosmosDBThroughputPool resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBThroughputPool. - public CosmosDBThroughputPool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/throughputPools", resourceVersion ?? "2024-02-15-preview") + public CosmosDBThroughputPool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/throughputPools", resourceVersion ?? "2024-02-15-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBThroughputPool. /// - /// Name of the CosmosDBThroughputPool. + /// + /// The the Bicep identifier name of the CosmosDBThroughputPool resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the CosmosDBThroughputPool. /// The existing CosmosDBThroughputPool resource. - public static CosmosDBThroughputPool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBThroughputPool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPoolAccount.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPoolAccount.cs index d4080eb08071f..00096fa9f3c50 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPoolAccount.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosDBThroughputPoolAccount.cs @@ -69,10 +69,15 @@ public partial class CosmosDBThroughputPoolAccount : Resource /// /// Creates a new CosmosDBThroughputPoolAccount. /// - /// Name of the CosmosDBThroughputPoolAccount. + /// + /// The the Bicep identifier name of the CosmosDBThroughputPoolAccount + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBThroughputPoolAccount. - public CosmosDBThroughputPoolAccount(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/throughputPools/throughputPoolAccounts", resourceVersion ?? "2024-02-15-preview") + public CosmosDBThroughputPoolAccount(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/throughputPools/throughputPoolAccounts", resourceVersion ?? "2024-02-15-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _accountLocation = BicepValue.DefineProperty(this, "AccountLocation", ["properties", "accountLocation"]); @@ -98,9 +103,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosDBThroughputPoolAccount. /// - /// Name of the CosmosDBThroughputPoolAccount. + /// + /// The the Bicep identifier name of the CosmosDBThroughputPoolAccount + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosDBThroughputPoolAccount. /// The existing CosmosDBThroughputPoolAccount resource. - public static CosmosDBThroughputPoolAccount FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosDBThroughputPoolAccount FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosTableThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosTableThroughputSetting.cs index c34a3068c383e..f6dee381803a7 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosTableThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/CosmosTableThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class CosmosTableThroughputSetting : Resource /// /// Creates a new CosmosTableThroughputSetting. /// - /// Name of the CosmosTableThroughputSetting. + /// + /// The the Bicep identifier name of the CosmosTableThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosTableThroughputSetting. - public CosmosTableThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/tables/throughputSettings", resourceVersion ?? "2024-08-15") + public CosmosTableThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/tables/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CosmosTableThroughputSetting. /// - /// Name of the CosmosTableThroughputSetting. + /// + /// The the Bicep identifier name of the CosmosTableThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the CosmosTableThroughputSetting. /// The existing CosmosTableThroughputSetting resource. - public static CosmosTableThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CosmosTableThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/DataTransferJobGetResult.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/DataTransferJobGetResult.cs index a6371d25fa290..f4b13010ccca3 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/DataTransferJobGetResult.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/DataTransferJobGetResult.cs @@ -138,10 +138,15 @@ public partial class DataTransferJobGetResult : Resource /// /// Creates a new DataTransferJobGetResult. /// - /// Name of the DataTransferJobGetResult. + /// + /// The the Bicep identifier name of the DataTransferJobGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the DataTransferJobGetResult. - public DataTransferJobGetResult(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", resourceVersion ?? "2024-08-15") + public DataTransferJobGetResult(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"], isRequired: true); @@ -300,9 +305,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DataTransferJobGetResult. /// - /// Name of the DataTransferJobGetResult. + /// + /// The the Bicep identifier name of the DataTransferJobGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the DataTransferJobGetResult. /// The existing DataTransferJobGetResult resource. - public static DataTransferJobGetResult FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DataTransferJobGetResult FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GraphResourceGetResult.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GraphResourceGetResult.cs index 3525ef6fbff46..768ca82f107f5 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GraphResourceGetResult.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GraphResourceGetResult.cs @@ -76,10 +76,15 @@ public partial class GraphResourceGetResult : Resource /// /// Creates a new GraphResourceGetResult. /// - /// Name of the GraphResourceGetResult. + /// + /// The the Bicep identifier name of the GraphResourceGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the GraphResourceGetResult. - public GraphResourceGetResult(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/graphs", resourceVersion ?? "2024-08-15") + public GraphResourceGetResult(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/graphs", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GraphResourceGetResult. /// - /// Name of the GraphResourceGetResult. + /// + /// The the Bicep identifier name of the GraphResourceGetResult resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the GraphResourceGetResult. /// The existing GraphResourceGetResult resource. - public static GraphResourceGetResult FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GraphResourceGetResult FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabase.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabase.cs index bbebf16fe5915..0eb286c88fb26 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabase.cs @@ -76,10 +76,15 @@ public partial class GremlinDatabase : Resource /// /// Creates a new GremlinDatabase. /// - /// Name of the GremlinDatabase. + /// + /// The the Bicep identifier name of the GremlinDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GremlinDatabase. - public GremlinDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases", resourceVersion ?? "2024-08-15") + public GremlinDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GremlinDatabase. /// - /// Name of the GremlinDatabase. + /// + /// The the Bicep identifier name of the GremlinDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GremlinDatabase. /// The existing GremlinDatabase resource. - public static GremlinDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GremlinDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabaseThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabaseThroughputSetting.cs index 00e45e222335f..fb8e1d33b5193 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabaseThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinDatabaseThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class GremlinDatabaseThroughputSetting : Resource /// /// Creates a new GremlinDatabaseThroughputSetting. /// - /// Name of the GremlinDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the GremlinDatabaseThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the GremlinDatabaseThroughputSetting. - public GremlinDatabaseThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings", resourceVersion ?? "2024-08-15") + public GremlinDatabaseThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GremlinDatabaseThroughputSetting. /// - /// Name of the GremlinDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the GremlinDatabaseThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the GremlinDatabaseThroughputSetting. /// The existing GremlinDatabaseThroughputSetting resource. - public static GremlinDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GremlinDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraph.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraph.cs index 5e6ee285a13e6..33f7b31e7a1c5 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraph.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraph.cs @@ -76,10 +76,15 @@ public partial class GremlinGraph : Resource /// /// Creates a new GremlinGraph. /// - /// Name of the GremlinGraph. + /// + /// The the Bicep identifier name of the GremlinGraph resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the GremlinGraph. - public GremlinGraph(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs", resourceVersion ?? "2024-08-15") + public GremlinGraph(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GremlinGraph. /// - /// Name of the GremlinGraph. + /// + /// The the Bicep identifier name of the GremlinGraph resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the GremlinGraph. /// The existing GremlinGraph resource. - public static GremlinGraph FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GremlinGraph FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraphThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraphThroughputSetting.cs index 5df64b28f2809..d2f4c484b91b2 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraphThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/GremlinGraphThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class GremlinGraphThroughputSetting : Resource /// /// Creates a new GremlinGraphThroughputSetting. /// - /// Name of the GremlinGraphThroughputSetting. + /// + /// The the Bicep identifier name of the GremlinGraphThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the GremlinGraphThroughputSetting. - public GremlinGraphThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/throughputSettings", resourceVersion ?? "2024-08-15") + public GremlinGraphThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GremlinGraphThroughputSetting. /// - /// Name of the GremlinGraphThroughputSetting. + /// + /// The the Bicep identifier name of the GremlinGraphThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the GremlinGraphThroughputSetting. /// The existing GremlinGraphThroughputSetting resource. - public static GremlinGraphThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GremlinGraphThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoCluster.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoCluster.cs index 2db4943f37493..a605313e986ad 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoCluster.cs @@ -112,10 +112,15 @@ public partial class MongoCluster : Resource /// /// Creates a new MongoCluster. /// - /// Name of the MongoCluster. + /// + /// The the Bicep identifier name of the MongoCluster resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the MongoCluster. - public MongoCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/mongoClusters", resourceVersion ?? "2024-07-01") + public MongoCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/mongoClusters", resourceVersion ?? "2024-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -148,9 +153,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoCluster. /// - /// Name of the MongoCluster. + /// + /// The the Bicep identifier name of the MongoCluster resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the MongoCluster. /// The existing MongoCluster resource. - public static MongoCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollection.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollection.cs index 6610353073e1e..a37072420d8a5 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollection.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollection.cs @@ -76,10 +76,15 @@ public partial class MongoDBCollection : Resource /// /// Creates a new MongoDBCollection. /// - /// Name of the MongoDBCollection. + /// + /// The the Bicep identifier name of the MongoDBCollection resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the MongoDBCollection. - public MongoDBCollection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections", resourceVersion ?? "2024-08-15") + public MongoDBCollection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBCollection. /// - /// Name of the MongoDBCollection. + /// + /// The the Bicep identifier name of the MongoDBCollection resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the MongoDBCollection. /// The existing MongoDBCollection resource. - public static MongoDBCollection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBCollection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollectionThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollectionThroughputSetting.cs index 4ea3dceb2f2ab..6f90f7c90be40 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollectionThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBCollectionThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class MongoDBCollectionThroughputSetting : Resource /// /// Creates a new MongoDBCollectionThroughputSetting. /// - /// Name of the MongoDBCollectionThroughputSetting. + /// + /// The the Bicep identifier name of the MongoDBCollectionThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the MongoDBCollectionThroughputSetting. - public MongoDBCollectionThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections/throughputSettings", resourceVersion ?? "2024-08-15") + public MongoDBCollectionThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBCollectionThroughputSetting. /// - /// Name of the MongoDBCollectionThroughputSetting. + /// + /// The the Bicep identifier name of the MongoDBCollectionThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the MongoDBCollectionThroughputSetting. /// The existing MongoDBCollectionThroughputSetting resource. - public static MongoDBCollectionThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBCollectionThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabase.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabase.cs index 0cdaea5373c8f..73ed1dd5cb470 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabase.cs @@ -76,10 +76,15 @@ public partial class MongoDBDatabase : Resource /// /// Creates a new MongoDBDatabase. /// - /// Name of the MongoDBDatabase. + /// + /// The the Bicep identifier name of the MongoDBDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the MongoDBDatabase. - public MongoDBDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases", resourceVersion ?? "2024-08-15") + public MongoDBDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -231,9 +236,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBDatabase. /// - /// Name of the MongoDBDatabase. + /// + /// The the Bicep identifier name of the MongoDBDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the MongoDBDatabase. /// The existing MongoDBDatabase resource. - public static MongoDBDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabaseThroughputSetting.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabaseThroughputSetting.cs index 72754570bac86..cf221522f6ed0 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabaseThroughputSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBDatabaseThroughputSetting.cs @@ -69,10 +69,15 @@ public partial class MongoDBDatabaseThroughputSetting : Resource /// /// Creates a new MongoDBDatabaseThroughputSetting. /// - /// Name of the MongoDBDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the MongoDBDatabaseThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the MongoDBDatabaseThroughputSetting. - public MongoDBDatabaseThroughputSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings", resourceVersion ?? "2024-08-15") + public MongoDBDatabaseThroughputSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -223,9 +228,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBDatabaseThroughputSetting. /// - /// Name of the MongoDBDatabaseThroughputSetting. + /// + /// The the Bicep identifier name of the MongoDBDatabaseThroughputSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the MongoDBDatabaseThroughputSetting. /// The existing MongoDBDatabaseThroughputSetting resource. - public static MongoDBDatabaseThroughputSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBDatabaseThroughputSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBRoleDefinition.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBRoleDefinition.cs index b1e58ba94d727..e66fadcf3c568 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBRoleDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBRoleDefinition.cs @@ -80,10 +80,15 @@ public partial class MongoDBRoleDefinition : Resource /// /// Creates a new MongoDBRoleDefinition. /// - /// Name of the MongoDBRoleDefinition. + /// + /// The the Bicep identifier name of the MongoDBRoleDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MongoDBRoleDefinition. - public MongoDBRoleDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions", resourceVersion ?? "2024-08-15") + public MongoDBRoleDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _databaseName = BicepValue.DefineProperty(this, "DatabaseName", ["properties", "databaseName"]); @@ -235,9 +240,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBRoleDefinition. /// - /// Name of the MongoDBRoleDefinition. + /// + /// The the Bicep identifier name of the MongoDBRoleDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MongoDBRoleDefinition. /// The existing MongoDBRoleDefinition resource. - public static MongoDBRoleDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBRoleDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBUserDefinition.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBUserDefinition.cs index 882e932921716..c58e74fddd42d 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBUserDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Generated/MongoDBUserDefinition.cs @@ -84,10 +84,15 @@ public partial class MongoDBUserDefinition : Resource /// /// Creates a new MongoDBUserDefinition. /// - /// Name of the MongoDBUserDefinition. + /// + /// The the Bicep identifier name of the MongoDBUserDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MongoDBUserDefinition. - public MongoDBUserDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions", resourceVersion ?? "2024-08-15") + public MongoDBUserDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions", resourceVersion ?? "2024-08-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _customData = BicepValue.DefineProperty(this, "CustomData", ["properties", "customData"]); @@ -240,9 +245,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MongoDBUserDefinition. /// - /// Name of the MongoDBUserDefinition. + /// + /// The the Bicep identifier name of the MongoDBUserDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MongoDBUserDefinition. /// The existing MongoDBUserDefinition resource. - public static MongoDBUserDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MongoDBUserDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/src/ProvisioningPlan.Deploy.cs b/sdk/provisioning/Azure.Provisioning.Deployment/src/ProvisioningPlan.Deploy.cs index 4f82cb4ae4e0d..379545de623f2 100644 --- a/sdk/provisioning/Azure.Provisioning.Deployment/src/ProvisioningPlan.Deploy.cs +++ b/sdk/provisioning/Azure.Provisioning.Deployment/src/ProvisioningPlan.Deploy.cs @@ -224,7 +224,7 @@ private static ProvisioningDeployment ProcessDeploymentInternal(ProvisioningPlan // Patch up output references foreach (ProvisioningOutput output in plan.Infrastructure.GetResources().OfType()) { - if (outputs.TryGetValue(output.ResourceName, out object? value) && + if (outputs.TryGetValue(output.IdentifierName, out object? value) && value is not null) { output.Value = value; diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/api/Azure.Provisioning.EventGrid.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/api/Azure.Provisioning.EventGrid.netstandard2.0.cs index ffedff8983b5e..27a68614fbe4c 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/api/Azure.Provisioning.EventGrid.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/api/Azure.Provisioning.EventGrid.netstandard2.0.cs @@ -40,7 +40,7 @@ public BoolEqualsFilter() { } } public partial class CaCertificate : Azure.Provisioning.Primitives.Resource { - public CaCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public CaCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue EncodedCertificate { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExpiryTimeInUtc { get { throw null; } } @@ -50,7 +50,7 @@ public partial class CaCertificate : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.EventGrid.EventGridNamespace? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.CaCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.CaCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -187,7 +187,7 @@ public DeliveryWithResourceIdentity() { } } public partial class DomainEventSubscription : Azure.Provisioning.Primitives.Resource { - public DomainEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DomainEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -203,7 +203,7 @@ public partial class DomainEventSubscription : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.DomainEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.DomainEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01; @@ -215,13 +215,13 @@ public static partial class ResourceVersions } public partial class DomainTopic : Azure.Provisioning.Primitives.Resource { - public DomainTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DomainTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.EventGrid.EventGridDomain? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.DomainTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.DomainTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -235,7 +235,7 @@ public static partial class ResourceVersions } public partial class DomainTopicEventSubscription : Azure.Provisioning.Primitives.Resource { - public DomainTopicEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DomainTopicEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -251,7 +251,7 @@ public partial class DomainTopicEventSubscription : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.DomainTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.DomainTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01; @@ -315,7 +315,7 @@ public enum EventDeliverySchema } public partial class EventGridDomain : Azure.Provisioning.Primitives.Resource { - public EventGridDomain(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridDomain(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AutoCreateTopicWithFirstSubscription { get { throw null; } set { } } public Azure.Provisioning.BicepValue AutoDeleteTopicWithLastSubscription { get { throw null; } set { } } public Azure.Provisioning.BicepValue DataResidencyBoundary { get { throw null; } set { } } @@ -337,7 +337,7 @@ public partial class EventGridDomain : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SkuName { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.EventGridDomain FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridDomain FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -351,7 +351,7 @@ public static partial class ResourceVersions } public partial class EventGridDomainPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public EventGridDomainPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridDomainPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -360,7 +360,7 @@ public partial class EventGridDomainPrivateEndpointConnection : Azure.Provisioni public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventGridDomainPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridDomainPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01; @@ -416,7 +416,7 @@ public EventGridJsonInputSchemaMapping() { } } public partial class EventGridNamespace : Azure.Provisioning.Primitives.Resource { - public EventGridNamespace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridNamespace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepList InboundIPRules { get { throw null; } set { } } @@ -432,7 +432,7 @@ public partial class EventGridNamespace : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TopicsConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue TopicSpacesConfiguration { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.EventGridNamespace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridNamespace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -440,7 +440,7 @@ public static partial class ResourceVersions } public partial class EventGridNamespaceClientGroup : Azure.Provisioning.Primitives.Resource { - public EventGridNamespaceClientGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridNamespaceClientGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -448,7 +448,7 @@ public partial class EventGridNamespaceClientGroup : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue Query { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventGridNamespaceClientGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridNamespaceClientGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -466,7 +466,7 @@ public enum EventGridNamespaceClientProvisioningState } public partial class EventGridNamespaceClientResource : Azure.Provisioning.Primitives.Resource { - public EventGridNamespaceClientResource(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridNamespaceClientResource(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepDictionary Attributes { get { throw null; } set { } } public Azure.Provisioning.BicepValue AuthenticationName { get { throw null; } set { } } public Azure.Provisioning.BicepValue ClientCertificateAuthentication { get { throw null; } set { } } @@ -477,7 +477,7 @@ public partial class EventGridNamespaceClientResource : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventGridNamespaceClientResource FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridNamespaceClientResource FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -490,7 +490,7 @@ public enum EventGridNamespaceClientState } public partial class EventGridNamespacePermissionBinding : Azure.Provisioning.Primitives.Resource { - public EventGridNamespacePermissionBinding(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridNamespacePermissionBinding(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ClientGroupName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -500,7 +500,7 @@ public partial class EventGridNamespacePermissionBinding : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TopicSpaceName { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.EventGridNamespacePermissionBinding FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridNamespacePermissionBinding FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -515,7 +515,7 @@ public EventGridPartnerContent() { } } public partial class EventGridPartnerNamespacePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public EventGridPartnerNamespacePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridPartnerNamespacePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -524,7 +524,7 @@ public partial class EventGridPartnerNamespacePrivateEndpointConnection : Azure. public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventGridPartnerNamespacePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridPartnerNamespacePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -582,7 +582,7 @@ public enum EventGridSkuName } public partial class EventGridTopic : Azure.Provisioning.Primitives.Resource { - public EventGridTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataResidencyBoundary { get { throw null; } set { } } public Azure.Provisioning.BicepValue Endpoint { get { throw null; } } public Azure.Provisioning.BicepValue EventTypeInfo { get { throw null; } set { } } @@ -604,7 +604,7 @@ public partial class EventGridTopic : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SkuName { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.EventGridTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -620,7 +620,7 @@ public static partial class ResourceVersions } public partial class EventGridTopicPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public EventGridTopicPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventGridTopicPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -629,7 +629,7 @@ public partial class EventGridTopicPrivateEndpointConnection : Azure.Provisionin public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventGridTopicPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventGridTopicPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_01_01; @@ -663,7 +663,7 @@ public enum EventInputSchema } public partial class EventSubscription : Azure.Provisioning.Primitives.Resource { - public EventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -678,7 +678,7 @@ public partial class EventSubscription : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.EventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.EventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -817,7 +817,7 @@ public NamespaceSku() { } } public partial class NamespaceTopic : Azure.Provisioning.Primitives.Resource { - public NamespaceTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public NamespaceTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EventRetentionInDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue InputSchema { get { throw null; } set { } } @@ -826,7 +826,7 @@ public partial class NamespaceTopic : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue PublisherType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.NamespaceTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.NamespaceTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -834,7 +834,7 @@ public static partial class ResourceVersions } public partial class NamespaceTopicEventSubscription : Azure.Provisioning.Primitives.Resource { - public NamespaceTopicEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public NamespaceTopicEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeliveryConfiguration { get { throw null; } set { } } public Azure.Provisioning.BicepValue EventDeliverySchema { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExpireOn { get { throw null; } set { } } @@ -844,7 +844,7 @@ public partial class NamespaceTopicEventSubscription : Azure.Provisioning.Primit public Azure.Provisioning.EventGrid.NamespaceTopic? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.NamespaceTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.NamespaceTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -960,7 +960,7 @@ public PartnerClientAuthentication() { } } public partial class PartnerConfiguration : Azure.Provisioning.Primitives.Resource { - public PartnerConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -968,7 +968,7 @@ public partial class PartnerConfiguration : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.PartnerConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -986,7 +986,7 @@ public enum PartnerConfigurationProvisioningState } public partial class PartnerDestination : Azure.Provisioning.Primitives.Resource { - public PartnerDestination(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerDestination(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ActivationState { get { throw null; } set { } } public Azure.Provisioning.BicepValue EndpointBaseUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue EndpointServiceContext { get { throw null; } set { } } @@ -999,7 +999,7 @@ public partial class PartnerDestination : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.PartnerDestination FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerDestination FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; @@ -1036,7 +1036,7 @@ public PartnerEventSubscriptionDestination() { } } public partial class PartnerNamespace : Azure.Provisioning.Primitives.Resource { - public PartnerNamespace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerNamespace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Endpoint { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList InboundIPRules { get { throw null; } set { } } @@ -1051,7 +1051,7 @@ public partial class PartnerNamespace : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue PublicNetworkAccess { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.PartnerNamespace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerNamespace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -1060,7 +1060,7 @@ public static partial class ResourceVersions } public partial class PartnerNamespaceChannel : Azure.Provisioning.Primitives.Resource { - public PartnerNamespaceChannel(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerNamespaceChannel(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ChannelType { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExpireOnIfNotActivated { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1072,7 +1072,7 @@ public partial class PartnerNamespaceChannel : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ReadinessState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventGrid.PartnerNamespaceChannel FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerNamespaceChannel FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -1106,7 +1106,7 @@ public enum PartnerNamespaceProvisioningState } public partial class PartnerRegistration : Azure.Provisioning.Primitives.Resource { - public PartnerRegistration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerRegistration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -1114,7 +1114,7 @@ public partial class PartnerRegistration : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.PartnerRegistration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerRegistration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -1132,7 +1132,7 @@ public enum PartnerRegistrationProvisioningState } public partial class PartnerTopic : Azure.Provisioning.Primitives.Resource { - public PartnerTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ActivationState { get { throw null; } set { } } public Azure.Provisioning.BicepValue EventTypeInfo { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExpireOnIfNotActivated { get { throw null; } set { } } @@ -1147,7 +1147,7 @@ public partial class PartnerTopic : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Source { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.PartnerTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -1162,7 +1162,7 @@ public enum PartnerTopicActivationState } public partial class PartnerTopicEventSubscription : Azure.Provisioning.Primitives.Resource { - public PartnerTopicEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PartnerTopicEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -1178,7 +1178,7 @@ public partial class PartnerTopicEventSubscription : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.PartnerTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.PartnerTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_06_15; @@ -1423,7 +1423,7 @@ public enum SubscriptionProvisioningState } public partial class SystemTopic : Azure.Provisioning.Primitives.Resource { - public SystemTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SystemTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -1434,7 +1434,7 @@ public partial class SystemTopic : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TopicType { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.SystemTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.SystemTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_12_01; @@ -1444,7 +1444,7 @@ public static partial class ResourceVersions } public partial class SystemTopicEventSubscription : Azure.Provisioning.Primitives.Resource { - public SystemTopicEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SystemTopicEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -1460,7 +1460,7 @@ public partial class SystemTopicEventSubscription : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.SystemTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.SystemTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_12_01; @@ -1479,7 +1479,7 @@ public enum TlsVersion } public partial class TopicEventSubscription : Azure.Provisioning.Primitives.Resource { - public TopicEventSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TopicEventSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DeadLetterDestination { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeadLetterWithResourceIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeliveryWithResourceIdentity { get { throw null; } set { } } @@ -1495,7 +1495,7 @@ public partial class TopicEventSubscription : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue RetryPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Topic { get { throw null; } } - public static Azure.Provisioning.EventGrid.TopicEventSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.TopicEventSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_01_01; @@ -1515,7 +1515,7 @@ public TopicsConfiguration() { } } public partial class TopicSpace : Azure.Provisioning.Primitives.Resource { - public TopicSpace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TopicSpace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -1523,7 +1523,7 @@ public partial class TopicSpace : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList TopicTemplates { get { throw null; } set { } } - public static Azure.Provisioning.EventGrid.TopicSpace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventGrid.TopicSpace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_06_01_preview; diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/CaCertificate.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/CaCertificate.cs index e54a84894260c..32e6fbd14b71b 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/CaCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/CaCertificate.cs @@ -74,10 +74,15 @@ public partial class CaCertificate : Resource /// /// Creates a new CaCertificate. /// - /// Name of the CaCertificate. + /// + /// The the Bicep identifier name of the CaCertificate resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CaCertificate. - public CaCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/caCertificates", resourceVersion ?? "2024-06-01-preview") + public CaCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/caCertificates", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -104,9 +109,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing CaCertificate. /// - /// Name of the CaCertificate. + /// + /// The the Bicep identifier name of the CaCertificate resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the CaCertificate. /// The existing CaCertificate resource. - public static CaCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static CaCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainEventSubscription.cs index f57622c3a48ba..ea0e1d94a376b 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainEventSubscription.cs @@ -150,10 +150,15 @@ public partial class DomainEventSubscription : Resource /// /// Creates a new DomainEventSubscription. /// - /// Name of the DomainEventSubscription. + /// + /// The the Bicep identifier name of the DomainEventSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the DomainEventSubscription. - public DomainEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/domains/eventSubscriptions", resourceVersion ?? "2022-06-15") + public DomainEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/domains/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -206,9 +211,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DomainEventSubscription. /// - /// Name of the DomainEventSubscription. + /// + /// The the Bicep identifier name of the DomainEventSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the DomainEventSubscription. /// The existing DomainEventSubscription resource. - public static DomainEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DomainEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopic.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopic.cs index 8a1dc8a65f372..ea9f8572d99e9 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopic.cs @@ -51,10 +51,15 @@ public partial class DomainTopic : Resource /// /// Creates a new DomainTopic. /// - /// Name of the DomainTopic. + /// + /// The the Bicep identifier name of the DomainTopic resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the DomainTopic. - public DomainTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/domains/topics", resourceVersion ?? "2022-06-15") + public DomainTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/domains/topics", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _id = BicepValue.DefineProperty(this, "Id", ["id"], isOutput: true); @@ -97,11 +102,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing DomainTopic. /// - /// Name of the DomainTopic. + /// + /// The the Bicep identifier name of the DomainTopic resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the DomainTopic. /// The existing DomainTopic resource. - public static DomainTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DomainTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this DomainTopic resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopicEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopicEventSubscription.cs index c8ec275a6df88..a7295ef9ec831 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopicEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/DomainTopicEventSubscription.cs @@ -150,10 +150,15 @@ public partial class DomainTopicEventSubscription : Resource /// /// Creates a new DomainTopicEventSubscription. /// - /// Name of the DomainTopicEventSubscription. + /// + /// The the Bicep identifier name of the DomainTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DomainTopicEventSubscription. - public DomainTopicEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/domains/topics/eventSubscriptions", resourceVersion ?? "2022-06-15") + public DomainTopicEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/domains/topics/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -206,9 +211,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DomainTopicEventSubscription. /// - /// Name of the DomainTopicEventSubscription. + /// + /// The the Bicep identifier name of the DomainTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DomainTopicEventSubscription. /// The existing DomainTopicEventSubscription resource. - public static DomainTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DomainTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomain.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomain.cs index d63dd0e7d4850..71354f9624de9 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomain.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomain.cs @@ -195,10 +195,15 @@ public partial class EventGridDomain : Resource /// /// Creates a new EventGridDomain. /// - /// Name of the EventGridDomain. + /// + /// The the Bicep identifier name of the EventGridDomain resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventGridDomain. - public EventGridDomain(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/domains", resourceVersion ?? "2022-06-15") + public EventGridDomain(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/domains", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -257,11 +262,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridDomain. /// - /// Name of the EventGridDomain. + /// + /// The the Bicep identifier name of the EventGridDomain resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventGridDomain. /// The existing EventGridDomain resource. - public static EventGridDomain FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridDomain FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventGridDomain resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomainPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomainPrivateEndpointConnection.cs index ed4e11019415e..86b3c71460801 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomainPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridDomainPrivateEndpointConnection.cs @@ -69,10 +69,16 @@ public partial class EventGridDomainPrivateEndpointConnection : Resource /// /// Creates a new EventGridDomainPrivateEndpointConnection. /// - /// Name of the EventGridDomainPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridDomainPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridDomainPrivateEndpointConnection. - public EventGridDomainPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/domains/privateEndpointConnections", resourceVersion ?? "2022-06-15") + public EventGridDomainPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/domains/privateEndpointConnections", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -119,9 +125,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// EventGridDomainPrivateEndpointConnection. /// - /// Name of the EventGridDomainPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridDomainPrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridDomainPrivateEndpointConnection. /// The existing EventGridDomainPrivateEndpointConnection resource. - public static EventGridDomainPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridDomainPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespace.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespace.cs index 080649e07a2b4..c43753c0ea91d 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespace.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespace.cs @@ -124,10 +124,15 @@ public partial class EventGridNamespace : Resource /// /// Creates a new EventGridNamespace. /// - /// Name of the EventGridNamespace. + /// + /// The the Bicep identifier name of the EventGridNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventGridNamespace. - public EventGridNamespace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces", resourceVersion ?? "2024-06-01-preview") + public EventGridNamespace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -160,9 +165,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridNamespace. /// - /// Name of the EventGridNamespace. + /// + /// The the Bicep identifier name of the EventGridNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventGridNamespace. /// The existing EventGridNamespace resource. - public static EventGridNamespace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridNamespace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientGroup.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientGroup.cs index 158e4e22bd989..3db28fa82b183 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientGroup.cs @@ -63,10 +63,15 @@ public partial class EventGridNamespaceClientGroup : Resource /// /// Creates a new EventGridNamespaceClientGroup. /// - /// Name of the EventGridNamespaceClientGroup. + /// + /// The the Bicep identifier name of the EventGridNamespaceClientGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventGridNamespaceClientGroup. - public EventGridNamespaceClientGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/clientGroups", resourceVersion ?? "2024-06-01-preview") + public EventGridNamespaceClientGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/clientGroups", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridNamespaceClientGroup. /// - /// Name of the EventGridNamespaceClientGroup. + /// + /// The the Bicep identifier name of the EventGridNamespaceClientGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventGridNamespaceClientGroup. /// The existing EventGridNamespaceClientGroup resource. - public static EventGridNamespaceClientGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridNamespaceClientGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientResource.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientResource.cs index b1ba5319f616d..7d26975caf17e 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientResource.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespaceClientResource.cs @@ -99,10 +99,15 @@ public partial class EventGridNamespaceClientResource : Resource /// /// Creates a new EventGridNamespaceClientResource. /// - /// Name of the EventGridNamespaceClientResource. + /// + /// The the Bicep identifier name of the EventGridNamespaceClientResource + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventGridNamespaceClientResource. - public EventGridNamespaceClientResource(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/clients", resourceVersion ?? "2024-06-01-preview") + public EventGridNamespaceClientResource(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/clients", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _attributes = BicepDictionary.DefineProperty(this, "Attributes", ["properties", "attributes"]); @@ -130,9 +135,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridNamespaceClientResource. /// - /// Name of the EventGridNamespaceClientResource. + /// + /// The the Bicep identifier name of the EventGridNamespaceClientResource + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventGridNamespaceClientResource. /// The existing EventGridNamespaceClientResource resource. - public static EventGridNamespaceClientResource FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridNamespaceClientResource FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespacePermissionBinding.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespacePermissionBinding.cs index cf2c0f327abf0..b7655853edda9 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespacePermissionBinding.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridNamespacePermissionBinding.cs @@ -78,10 +78,15 @@ public partial class EventGridNamespacePermissionBinding : Resource /// /// Creates a new EventGridNamespacePermissionBinding. /// - /// Name of the EventGridNamespacePermissionBinding. + /// + /// The the Bicep identifier name of the + /// EventGridNamespacePermissionBinding resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventGridNamespacePermissionBinding. - public EventGridNamespacePermissionBinding(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/permissionBindings", resourceVersion ?? "2024-06-01-preview") + public EventGridNamespacePermissionBinding(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/permissionBindings", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _clientGroupName = BicepValue.DefineProperty(this, "ClientGroupName", ["properties", "clientGroupName"]); @@ -108,9 +113,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridNamespacePermissionBinding. /// - /// Name of the EventGridNamespacePermissionBinding. + /// + /// The the Bicep identifier name of the + /// EventGridNamespacePermissionBinding resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventGridNamespacePermissionBinding. /// The existing EventGridNamespacePermissionBinding resource. - public static EventGridNamespacePermissionBinding FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridNamespacePermissionBinding FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridPartnerNamespacePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridPartnerNamespacePrivateEndpointConnection.cs index a82ee5076381b..84e5d75672a06 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridPartnerNamespacePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridPartnerNamespacePrivateEndpointConnection.cs @@ -69,10 +69,16 @@ public partial class EventGridPartnerNamespacePrivateEndpointConnection : Resour /// /// Creates a new EventGridPartnerNamespacePrivateEndpointConnection. /// - /// Name of the EventGridPartnerNamespacePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridPartnerNamespacePrivateEndpointConnection resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridPartnerNamespacePrivateEndpointConnection. - public EventGridPartnerNamespacePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerNamespaces/privateEndpointConnections", resourceVersion ?? "2022-06-15") + public EventGridPartnerNamespacePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerNamespaces/privateEndpointConnections", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -105,9 +111,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// EventGridPartnerNamespacePrivateEndpointConnection. /// - /// Name of the EventGridPartnerNamespacePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridPartnerNamespacePrivateEndpointConnection resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridPartnerNamespacePrivateEndpointConnection. /// The existing EventGridPartnerNamespacePrivateEndpointConnection resource. - public static EventGridPartnerNamespacePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridPartnerNamespacePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopic.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopic.cs index ba19cceb0cd6b..b3122c4220584 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopic.cs @@ -167,10 +167,15 @@ public partial class EventGridTopic : Resource /// /// Creates a new EventGridTopic. /// - /// Name of the EventGridTopic. + /// + /// The the Bicep identifier name of the EventGridTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridTopic. - public EventGridTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/topics", resourceVersion ?? "2022-06-15") + public EventGridTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/topics", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -239,11 +244,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventGridTopic. /// - /// Name of the EventGridTopic. + /// + /// The the Bicep identifier name of the EventGridTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventGridTopic. /// The existing EventGridTopic resource. - public static EventGridTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventGridTopic resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopicPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopicPrivateEndpointConnection.cs index 90f435dbc8340..12b1a58973c88 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopicPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventGridTopicPrivateEndpointConnection.cs @@ -69,10 +69,15 @@ public partial class EventGridTopicPrivateEndpointConnection : Resource /// /// Creates a new EventGridTopicPrivateEndpointConnection. /// - /// Name of the EventGridTopicPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridTopicPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventGridTopicPrivateEndpointConnection. - public EventGridTopicPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/topics/privateEndpointConnections", resourceVersion ?? "2022-06-15") + public EventGridTopicPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/topics/privateEndpointConnections", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -129,9 +134,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// EventGridTopicPrivateEndpointConnection. /// - /// Name of the EventGridTopicPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// EventGridTopicPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventGridTopicPrivateEndpointConnection. /// The existing EventGridTopicPrivateEndpointConnection resource. - public static EventGridTopicPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventGridTopicPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventSubscription.cs index 1880dee310a88..24d7ee4bc2ac2 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/EventSubscription.cs @@ -145,10 +145,15 @@ public partial class EventSubscription : Resource /// /// Creates a new EventSubscription. /// - /// Name of the EventSubscription. + /// + /// The the Bicep identifier name of the EventSubscription resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventSubscription. - public EventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/eventSubscriptions", resourceVersion ?? "2022-06-15") + public EventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -210,11 +215,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventSubscription. /// - /// Name of the EventSubscription. + /// + /// The the Bicep identifier name of the EventSubscription resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventSubscription. /// The existing EventSubscription resource. - public static EventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventSubscription resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopic.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopic.cs index 54eb26a12759e..9abcbc0183fb7 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopic.cs @@ -71,10 +71,15 @@ public partial class NamespaceTopic : Resource /// /// Creates a new NamespaceTopic. /// - /// Name of the NamespaceTopic. + /// + /// The the Bicep identifier name of the NamespaceTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the NamespaceTopic. - public NamespaceTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/topics", resourceVersion ?? "2024-06-01-preview") + public NamespaceTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/topics", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _eventRetentionInDays = BicepValue.DefineProperty(this, "EventRetentionInDays", ["properties", "eventRetentionInDays"]); @@ -100,9 +105,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing NamespaceTopic. /// - /// Name of the NamespaceTopic. + /// + /// The the Bicep identifier name of the NamespaceTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the NamespaceTopic. /// The existing NamespaceTopic resource. - public static NamespaceTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static NamespaceTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopicEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopicEventSubscription.cs index 1e78743186be6..7cc0197478ee2 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopicEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/NamespaceTopicEventSubscription.cs @@ -77,10 +77,15 @@ public partial class NamespaceTopicEventSubscription : Resource /// /// Creates a new NamespaceTopicEventSubscription. /// - /// Name of the NamespaceTopicEventSubscription. + /// + /// The the Bicep identifier name of the NamespaceTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the NamespaceTopicEventSubscription. - public NamespaceTopicEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/topics/eventSubscriptions", resourceVersion ?? "2024-06-01-preview") + public NamespaceTopicEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/topics/eventSubscriptions", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deliveryConfiguration = BicepValue.DefineProperty(this, "DeliveryConfiguration", ["properties", "deliveryConfiguration"]); @@ -107,9 +112,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing NamespaceTopicEventSubscription. /// - /// Name of the NamespaceTopicEventSubscription. + /// + /// The the Bicep identifier name of the NamespaceTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the NamespaceTopicEventSubscription. /// The existing NamespaceTopicEventSubscription resource. - public static NamespaceTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static NamespaceTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerConfiguration.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerConfiguration.cs index cf60f68fdd53e..9b29bc28728d7 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerConfiguration.cs @@ -63,10 +63,15 @@ public partial class PartnerConfiguration : Resource /// /// Creates a new PartnerConfiguration. /// - /// Name of the PartnerConfiguration. + /// + /// The the Bicep identifier name of the PartnerConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerConfiguration. - public PartnerConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerConfigurations", resourceVersion ?? "2022-06-15") + public PartnerConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerConfigurations", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -96,9 +101,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerConfiguration. /// - /// Name of the PartnerConfiguration. + /// + /// The the Bicep identifier name of the PartnerConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerConfiguration. /// The existing PartnerConfiguration resource. - public static PartnerConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerDestination.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerDestination.cs index 1656c82011df2..35492f110d5eb 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerDestination.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerDestination.cs @@ -95,10 +95,15 @@ public partial class PartnerDestination : Resource /// /// Creates a new PartnerDestination. /// - /// Name of the PartnerDestination. + /// + /// The the Bicep identifier name of the PartnerDestination resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PartnerDestination. - public PartnerDestination(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerDestinations", resourceVersion ?? "2024-06-01-preview") + public PartnerDestination(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerDestinations", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -128,9 +133,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerDestination. /// - /// Name of the PartnerDestination. + /// + /// The the Bicep identifier name of the PartnerDestination resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PartnerDestination. /// The existing PartnerDestination resource. - public static PartnerDestination FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerDestination FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespace.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespace.cs index e5adff60a7e45..d194cfd0018ab 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespace.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespace.cs @@ -120,10 +120,15 @@ public partial class PartnerNamespace : Resource /// /// Creates a new PartnerNamespace. /// - /// Name of the PartnerNamespace. + /// + /// The the Bicep identifier name of the PartnerNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PartnerNamespace. - public PartnerNamespace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerNamespaces", resourceVersion ?? "2022-06-15") + public PartnerNamespace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerNamespaces", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -160,9 +165,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerNamespace. /// - /// Name of the PartnerNamespace. + /// + /// The the Bicep identifier name of the PartnerNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PartnerNamespace. /// The existing PartnerNamespace resource. - public static PartnerNamespace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerNamespace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespaceChannel.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespaceChannel.cs index 3f46e5e56c2ef..2474e0e2cbbf8 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespaceChannel.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerNamespaceChannel.cs @@ -101,10 +101,15 @@ public partial class PartnerNamespaceChannel : Resource /// /// Creates a new PartnerNamespaceChannel. /// - /// Name of the PartnerNamespaceChannel. + /// + /// The the Bicep identifier name of the PartnerNamespaceChannel resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerNamespaceChannel. - public PartnerNamespaceChannel(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerNamespaces/channels", resourceVersion ?? "2022-06-15") + public PartnerNamespaceChannel(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerNamespaces/channels", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _channelType = BicepValue.DefineProperty(this, "ChannelType", ["properties", "channelType"]); @@ -138,9 +143,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerNamespaceChannel. /// - /// Name of the PartnerNamespaceChannel. + /// + /// The the Bicep identifier name of the PartnerNamespaceChannel resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerNamespaceChannel. /// The existing PartnerNamespaceChannel resource. - public static PartnerNamespaceChannel FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerNamespaceChannel FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerRegistration.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerRegistration.cs index 5f8f2a8a0761b..5d062ce71ced3 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerRegistration.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerRegistration.cs @@ -65,10 +65,15 @@ public partial class PartnerRegistration : Resource /// /// Creates a new PartnerRegistration. /// - /// Name of the PartnerRegistration. + /// + /// The the Bicep identifier name of the PartnerRegistration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerRegistration. - public PartnerRegistration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerRegistrations", resourceVersion ?? "2022-06-15") + public PartnerRegistration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerRegistrations", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -98,9 +103,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerRegistration. /// - /// Name of the PartnerRegistration. + /// + /// The the Bicep identifier name of the PartnerRegistration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PartnerRegistration. /// The existing PartnerRegistration resource. - public static PartnerRegistration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerRegistration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopic.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopic.cs index 2ec2f818407f9..95bd514b9b8c2 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopic.cs @@ -112,10 +112,15 @@ public partial class PartnerTopic : Resource /// /// Creates a new PartnerTopic. /// - /// Name of the PartnerTopic. + /// + /// The the Bicep identifier name of the PartnerTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the PartnerTopic. - public PartnerTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerTopics", resourceVersion ?? "2022-06-15") + public PartnerTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerTopics", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -152,9 +157,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerTopic. /// - /// Name of the PartnerTopic. + /// + /// The the Bicep identifier name of the PartnerTopic resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the PartnerTopic. /// The existing PartnerTopic resource. - public static PartnerTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopicEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopicEventSubscription.cs index 7c9354ddd7d83..cf9473207dc3f 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopicEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/PartnerTopicEventSubscription.cs @@ -150,10 +150,15 @@ public partial class PartnerTopicEventSubscription : Resource /// /// Creates a new PartnerTopicEventSubscription. /// - /// Name of the PartnerTopicEventSubscription. + /// + /// The the Bicep identifier name of the PartnerTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PartnerTopicEventSubscription. - public PartnerTopicEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/partnerTopics/eventSubscriptions", resourceVersion ?? "2022-06-15") + public PartnerTopicEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/partnerTopics/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -191,9 +196,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PartnerTopicEventSubscription. /// - /// Name of the PartnerTopicEventSubscription. + /// + /// The the Bicep identifier name of the PartnerTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PartnerTopicEventSubscription. /// The existing PartnerTopicEventSubscription resource. - public static PartnerTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PartnerTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopic.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopic.cs index c10e6c71a642a..d2153cbb387b8 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopic.cs @@ -81,10 +81,15 @@ public partial class SystemTopic : Resource /// /// Creates a new SystemTopic. /// - /// Name of the SystemTopic. + /// + /// The the Bicep identifier name of the SystemTopic resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SystemTopic. - public SystemTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/systemTopics", resourceVersion ?? "2022-06-15") + public SystemTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/systemTopics", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -122,9 +127,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SystemTopic. /// - /// Name of the SystemTopic. + /// + /// The the Bicep identifier name of the SystemTopic resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SystemTopic. /// The existing SystemTopic resource. - public static SystemTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SystemTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopicEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopicEventSubscription.cs index 5a3871121f35e..cfe8d9dede755 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopicEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/SystemTopicEventSubscription.cs @@ -150,10 +150,15 @@ public partial class SystemTopicEventSubscription : Resource /// /// Creates a new SystemTopicEventSubscription. /// - /// Name of the SystemTopicEventSubscription. + /// + /// The the Bicep identifier name of the SystemTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SystemTopicEventSubscription. - public SystemTopicEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/systemTopics/eventSubscriptions", resourceVersion ?? "2022-06-15") + public SystemTopicEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/systemTopics/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -196,9 +201,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SystemTopicEventSubscription. /// - /// Name of the SystemTopicEventSubscription. + /// + /// The the Bicep identifier name of the SystemTopicEventSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SystemTopicEventSubscription. /// The existing SystemTopicEventSubscription resource. - public static SystemTopicEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SystemTopicEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicEventSubscription.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicEventSubscription.cs index 0fb6cebb571f8..5d6d0ce2d73a7 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicEventSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicEventSubscription.cs @@ -150,10 +150,15 @@ public partial class TopicEventSubscription : Resource /// /// Creates a new TopicEventSubscription. /// - /// Name of the TopicEventSubscription. + /// + /// The the Bicep identifier name of the TopicEventSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the TopicEventSubscription. - public TopicEventSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/topics/eventSubscriptions", resourceVersion ?? "2022-06-15") + public TopicEventSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/topics/eventSubscriptions", resourceVersion ?? "2022-06-15") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _deadLetterDestination = BicepValue.DefineProperty(this, "DeadLetterDestination", ["properties", "deadLetterDestination"]); @@ -216,9 +221,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing TopicEventSubscription. /// - /// Name of the TopicEventSubscription. + /// + /// The the Bicep identifier name of the TopicEventSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the TopicEventSubscription. /// The existing TopicEventSubscription resource. - public static TopicEventSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TopicEventSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicSpace.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicSpace.cs index c844579a5cc44..603b8071177f6 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicSpace.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Generated/TopicSpace.cs @@ -68,10 +68,15 @@ public partial class TopicSpace : Resource /// /// Creates a new TopicSpace. /// - /// Name of the TopicSpace. + /// + /// The the Bicep identifier name of the TopicSpace resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TopicSpace. - public TopicSpace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventGrid/namespaces/topicSpaces", resourceVersion ?? "2024-06-01-preview") + public TopicSpace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventGrid/namespaces/topicSpaces", resourceVersion ?? "2024-06-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -96,9 +101,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing TopicSpace. /// - /// Name of the TopicSpace. + /// + /// The the Bicep identifier name of the TopicSpace resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TopicSpace. /// The existing TopicSpace resource. - public static TopicSpace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TopicSpace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/api/Azure.Provisioning.EventHubs.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/api/Azure.Provisioning.EventHubs.netstandard2.0.cs index 2c7fd6adaee3a..2424ba6e56da6 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/api/Azure.Provisioning.EventHubs.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/api/Azure.Provisioning.EventHubs.netstandard2.0.cs @@ -23,7 +23,7 @@ public enum EncodingCaptureDescription } public partial class EventHub : Azure.Provisioning.Primitives.Resource { - public EventHub(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHub(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CaptureDescription { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -36,7 +36,7 @@ public partial class EventHub : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHub FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHub FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_01; @@ -47,14 +47,14 @@ public static partial class ResourceVersions } public partial class EventHubAuthorizationRule : Azure.Provisioning.Primitives.Resource { - public EventHubAuthorizationRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubAuthorizationRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.EventHubs.EventHub? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rights { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubAuthorizationRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubAuthorizationRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.EventHubs.EventHubsAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -111,7 +111,7 @@ public enum EventHubsAccessRight } public partial class EventHubsApplicationGroup : Azure.Provisioning.Primitives.Resource { - public EventHubsApplicationGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsApplicationGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ClientAppGroupIdentifier { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsEnabled { get { throw null; } set { } } @@ -120,7 +120,7 @@ public partial class EventHubsApplicationGroup : Azure.Provisioning.Primitives.R public Azure.Provisioning.EventHubs.EventHubsNamespace? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Policies { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubsApplicationGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsApplicationGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_01_01; @@ -168,7 +168,7 @@ public enum EventHubsCaptureIdentityType } public partial class EventHubsCluster : Azure.Provisioning.Primitives.Resource { - public EventHubsCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -181,9 +181,9 @@ public partial class EventHubsCluster : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.EventHubs.EventHubsCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -216,7 +216,7 @@ public enum EventHubsClusterSkuName } public partial class EventHubsConsumerGroup : Azure.Provisioning.Primitives.Resource { - public EventHubsConsumerGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsConsumerGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -225,7 +225,7 @@ public partial class EventHubsConsumerGroup : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } public Azure.Provisioning.BicepValue UserMetadata { get { throw null; } set { } } - public static Azure.Provisioning.EventHubs.EventHubsConsumerGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsConsumerGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -238,7 +238,7 @@ public static partial class ResourceVersions } public partial class EventHubsDisasterRecovery : Azure.Provisioning.Primitives.Resource { - public EventHubsDisasterRecovery(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsDisasterRecovery(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AlternateName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -249,7 +249,7 @@ public partial class EventHubsDisasterRecovery : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue Role { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubsDisasterRecovery FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsDisasterRecovery FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -301,7 +301,7 @@ public enum EventHubsMetricId } public partial class EventHubsNamespace : Azure.Provisioning.Primitives.Resource { - public EventHubsNamespace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsNamespace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AlternateName { get { throw null; } set { } } public Azure.Provisioning.BicepValue ClusterArmId { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } @@ -327,9 +327,9 @@ public partial class EventHubsNamespace : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } public Azure.Provisioning.BicepValue ZoneRedundant { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.EventHubs.EventHubsBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.EventHubs.EventHubsNamespace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsNamespace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -344,14 +344,14 @@ public static partial class ResourceVersions } public partial class EventHubsNamespaceAuthorizationRule : Azure.Provisioning.Primitives.Resource { - public EventHubsNamespaceAuthorizationRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsNamespaceAuthorizationRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.EventHubs.EventHubsNamespace? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rights { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubsNamespaceAuthorizationRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsNamespaceAuthorizationRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.EventHubs.EventHubsAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -369,7 +369,7 @@ public enum EventHubsNetworkRuleIPAction } public partial class EventHubsNetworkRuleSet : Azure.Provisioning.Primitives.Resource { - public EventHubsNetworkRuleSet(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsNetworkRuleSet(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DefaultAction { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPRules { get { throw null; } set { } } @@ -380,7 +380,7 @@ public partial class EventHubsNetworkRuleSet : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TrustedServiceAccessEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepList VirtualNetworkRules { get { throw null; } set { } } - public static Azure.Provisioning.EventHubs.EventHubsNetworkRuleSet FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsNetworkRuleSet FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_01; @@ -408,7 +408,7 @@ public EventHubsNetworkRuleSetVirtualNetworkRules() { } } public partial class EventHubsPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public EventHubsPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -417,7 +417,7 @@ public partial class EventHubsPrivateEndpointConnection : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubsPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -478,7 +478,7 @@ public enum EventHubsSchemaCompatibility } public partial class EventHubsSchemaGroup : Azure.Provisioning.Primitives.Resource { - public EventHubsSchemaGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EventHubsSchemaGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedAtUtc { get { throw null; } } public Azure.Provisioning.BicepValue ETag { get { throw null; } } public Azure.Provisioning.BicepDictionary GroupProperties { get { throw null; } set { } } @@ -490,7 +490,7 @@ public partial class EventHubsSchemaGroup : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue SchemaType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedAtUtc { get { throw null; } } - public static Azure.Provisioning.EventHubs.EventHubsSchemaGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.EventHubs.EventHubsSchemaGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_09_01; diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHub.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHub.cs index c2a27e19b892a..7ebd14515927e 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHub.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHub.cs @@ -94,10 +94,15 @@ public partial class EventHub : Resource /// /// Creates a new EventHub. /// - /// Name of the EventHub. + /// + /// The the Bicep identifier name of the EventHub resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventHub. - public EventHub(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/eventhubs", resourceVersion ?? "2024-01-01") + public EventHub(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/eventhubs", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _captureDescription = BicepValue.DefineProperty(this, "CaptureDescription", ["properties", "captureDescription"]); @@ -142,9 +147,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHub. /// - /// Name of the EventHub. + /// + /// The the Bicep identifier name of the EventHub resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the EventHub. /// The existing EventHub resource. - public static EventHub FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHub FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubAuthorizationRule.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubAuthorizationRule.cs index 1e462495d6b75..8ff4a065039f3 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubAuthorizationRule.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubAuthorizationRule.cs @@ -59,10 +59,15 @@ public partial class EventHubAuthorizationRule : Resource /// /// Creates a new EventHubAuthorizationRule. /// - /// Name of the EventHubAuthorizationRule. + /// + /// The the Bicep identifier name of the EventHubAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubAuthorizationRule. - public EventHubAuthorizationRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/eventhubs/authorizationRules", resourceVersion ?? "2024-01-01") + public EventHubAuthorizationRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/eventhubs/authorizationRules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _rights = BicepList.DefineProperty(this, "Rights", ["properties", "rights"]); @@ -101,11 +106,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubAuthorizationRule. /// - /// Name of the EventHubAuthorizationRule. + /// + /// The the Bicep identifier name of the EventHubAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubAuthorizationRule. /// The existing EventHubAuthorizationRule resource. - public static EventHubAuthorizationRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubAuthorizationRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventHubAuthorizationRule resource. @@ -121,5 +131,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this EventHubAuthorizationRule resource. public EventHubsAccessKeys GetKeys() => EventHubsAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsApplicationGroup.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsApplicationGroup.cs index 642609cba3612..efb06b0c689b0 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsApplicationGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsApplicationGroup.cs @@ -81,10 +81,15 @@ public partial class EventHubsApplicationGroup : Resource /// /// Creates a new EventHubsApplicationGroup. /// - /// Name of the EventHubsApplicationGroup. + /// + /// The the Bicep identifier name of the EventHubsApplicationGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsApplicationGroup. - public EventHubsApplicationGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/applicationGroups", resourceVersion ?? "2024-01-01") + public EventHubsApplicationGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/applicationGroups", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _clientAppGroupIdentifier = BicepValue.DefineProperty(this, "ClientAppGroupIdentifier", ["properties", "clientAppGroupIdentifier"]); @@ -115,9 +120,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsApplicationGroup. /// - /// Name of the EventHubsApplicationGroup. + /// + /// The the Bicep identifier name of the EventHubsApplicationGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsApplicationGroup. /// The existing EventHubsApplicationGroup resource. - public static EventHubsApplicationGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsApplicationGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsCluster.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsCluster.cs index 95e6b78d34572..a943413399181 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsCluster.cs @@ -98,10 +98,15 @@ public partial class EventHubsCluster : Resource /// /// Creates a new EventHubsCluster. /// - /// Name of the EventHubsCluster. + /// + /// The the Bicep identifier name of the EventHubsCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventHubsCluster. - public EventHubsCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/clusters", resourceVersion ?? "2024-01-01") + public EventHubsCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/clusters", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -141,11 +146,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsCluster. /// - /// Name of the EventHubsCluster. + /// + /// The the Bicep identifier name of the EventHubsCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventHubsCluster. /// The existing EventHubsCluster resource. - public static EventHubsCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventHubsCluster resource. @@ -163,10 +173,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -179,13 +189,13 @@ public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, UserAssign /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsConsumerGroup.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsConsumerGroup.cs index c108029da4dc6..f3b9b59ebc113 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsConsumerGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsConsumerGroup.cs @@ -72,10 +72,15 @@ public partial class EventHubsConsumerGroup : Resource /// /// Creates a new EventHubsConsumerGroup. /// - /// Name of the EventHubsConsumerGroup. + /// + /// The the Bicep identifier name of the EventHubsConsumerGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsConsumerGroup. - public EventHubsConsumerGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/eventhubs/consumergroups", resourceVersion ?? "2024-01-01") + public EventHubsConsumerGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/eventhubs/consumergroups", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _userMetadata = BicepValue.DefineProperty(this, "UserMetadata", ["properties", "userMetadata"]); @@ -116,11 +121,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsConsumerGroup. /// - /// Name of the EventHubsConsumerGroup. + /// + /// The the Bicep identifier name of the EventHubsConsumerGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsConsumerGroup. /// The existing EventHubsConsumerGroup resource. - public static EventHubsConsumerGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsConsumerGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventHubsConsumerGroup resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsDisasterRecovery.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsDisasterRecovery.cs index 5d8c5e04a6304..8394c2c36a4cf 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsDisasterRecovery.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsDisasterRecovery.cs @@ -85,10 +85,15 @@ public partial class EventHubsDisasterRecovery : Resource /// /// Creates a new EventHubsDisasterRecovery. /// - /// Name of the EventHubsDisasterRecovery. + /// + /// The the Bicep identifier name of the EventHubsDisasterRecovery + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsDisasterRecovery. - public EventHubsDisasterRecovery(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/disasterRecoveryConfigs", resourceVersion ?? "2024-01-01") + public EventHubsDisasterRecovery(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/disasterRecoveryConfigs", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _alternateName = BicepValue.DefineProperty(this, "AlternateName", ["properties", "alternateName"]); @@ -131,11 +136,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsDisasterRecovery. /// - /// Name of the EventHubsDisasterRecovery. + /// + /// The the Bicep identifier name of the EventHubsDisasterRecovery + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsDisasterRecovery. /// The existing EventHubsDisasterRecovery resource. - public static EventHubsDisasterRecovery FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsDisasterRecovery FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventHubsDisasterRecovery resource. diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespace.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespace.cs index c143cf32d7d51..5efdeaf1f5acc 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespace.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespace.cs @@ -181,10 +181,15 @@ public partial class EventHubsNamespace : Resource /// /// Creates a new EventHubsNamespace. /// - /// Name of the EventHubsNamespace. + /// + /// The the Bicep identifier name of the EventHubsNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventHubsNamespace. - public EventHubsNamespace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces", resourceVersion ?? "2024-01-01") + public EventHubsNamespace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -252,11 +257,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsNamespace. /// - /// Name of the EventHubsNamespace. + /// + /// The the Bicep identifier name of the EventHubsNamespace resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EventHubsNamespace. /// The existing EventHubsNamespace resource. - public static EventHubsNamespace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsNamespace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this EventHubsNamespace resource. @@ -274,10 +284,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -290,13 +300,13 @@ public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, UserAssign /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(EventHubsBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{EventHubsBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespaceAuthorizationRule.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespaceAuthorizationRule.cs index 9f2630a616ae4..23a5878405c48 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespaceAuthorizationRule.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNamespaceAuthorizationRule.cs @@ -59,10 +59,15 @@ public partial class EventHubsNamespaceAuthorizationRule : Resource /// /// Creates a new EventHubsNamespaceAuthorizationRule. /// - /// Name of the EventHubsNamespaceAuthorizationRule. + /// + /// The the Bicep identifier name of the + /// EventHubsNamespaceAuthorizationRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventHubsNamespaceAuthorizationRule. - public EventHubsNamespaceAuthorizationRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/authorizationRules", resourceVersion ?? "2024-01-01") + public EventHubsNamespaceAuthorizationRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/authorizationRules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _rights = BicepList.DefineProperty(this, "Rights", ["properties", "rights"]); @@ -101,11 +106,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsNamespaceAuthorizationRule. /// - /// Name of the EventHubsNamespaceAuthorizationRule. + /// + /// The the Bicep identifier name of the + /// EventHubsNamespaceAuthorizationRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the EventHubsNamespaceAuthorizationRule. /// The existing EventHubsNamespaceAuthorizationRule resource. - public static EventHubsNamespaceAuthorizationRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsNamespaceAuthorizationRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this @@ -122,5 +132,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this EventHubsNamespaceAuthorizationRule resource. public EventHubsAccessKeys GetKeys() => EventHubsAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNetworkRuleSet.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNetworkRuleSet.cs index 38cfc0f301f8d..2fbb27d34143f 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNetworkRuleSet.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsNetworkRuleSet.cs @@ -84,10 +84,15 @@ public partial class EventHubsNetworkRuleSet : Resource /// /// Creates a new EventHubsNetworkRuleSet. /// - /// Name of the EventHubsNetworkRuleSet. + /// + /// The the Bicep identifier name of the EventHubsNetworkRuleSet resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsNetworkRuleSet. - public EventHubsNetworkRuleSet(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/networkRuleSets", resourceVersion ?? "2024-01-01") + public EventHubsNetworkRuleSet(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/networkRuleSets", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _defaultAction = BicepValue.DefineProperty(this, "DefaultAction", ["properties", "defaultAction"]); @@ -130,9 +135,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsNetworkRuleSet. /// - /// Name of the EventHubsNetworkRuleSet. + /// + /// The the Bicep identifier name of the EventHubsNetworkRuleSet resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsNetworkRuleSet. /// The existing EventHubsNetworkRuleSet resource. - public static EventHubsNetworkRuleSet FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsNetworkRuleSet FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsPrivateEndpointConnection.cs index b7b673762e5c5..11dc46bc8b61c 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsPrivateEndpointConnection.cs @@ -68,10 +68,15 @@ public partial class EventHubsPrivateEndpointConnection : Resource /// /// Creates a new EventHubsPrivateEndpointConnection. /// - /// Name of the EventHubsPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the EventHubsPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsPrivateEndpointConnection. - public EventHubsPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/privateEndpointConnections", resourceVersion ?? "2024-01-01") + public EventHubsPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/privateEndpointConnections", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -107,9 +112,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsPrivateEndpointConnection. /// - /// Name of the EventHubsPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the EventHubsPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the EventHubsPrivateEndpointConnection. /// The existing EventHubsPrivateEndpointConnection resource. - public static EventHubsPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsSchemaGroup.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsSchemaGroup.cs index 1c435c592bb66..46109e26bc520 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsSchemaGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Generated/EventHubsSchemaGroup.cs @@ -88,10 +88,15 @@ public partial class EventHubsSchemaGroup : Resource /// /// Creates a new EventHubsSchemaGroup. /// - /// Name of the EventHubsSchemaGroup. + /// + /// The the Bicep identifier name of the EventHubsSchemaGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsSchemaGroup. - public EventHubsSchemaGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.EventHub/namespaces/schemagroups", resourceVersion ?? "2024-01-01") + public EventHubsSchemaGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.EventHub/namespaces/schemagroups", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _groupProperties = BicepDictionary.DefineProperty(this, "GroupProperties", ["properties", "groupProperties"]); @@ -145,9 +150,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EventHubsSchemaGroup. /// - /// Name of the EventHubsSchemaGroup. + /// + /// The the Bicep identifier name of the EventHubsSchemaGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EventHubsSchemaGroup. /// The existing EventHubsSchemaGroup resource. - public static EventHubsSchemaGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EventHubsSchemaGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/api/Azure.Provisioning.KeyVault.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/api/Azure.Provisioning.KeyVault.netstandard2.0.cs index cfef37c8d74e8..d2e98eddd4687 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/api/Azure.Provisioning.KeyVault.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/api/Azure.Provisioning.KeyVault.netstandard2.0.cs @@ -219,7 +219,7 @@ public KeyVaultNetworkRuleSet() { } } public partial class KeyVaultPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public KeyVaultPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KeyVaultPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -230,7 +230,7 @@ public partial class KeyVaultPrivateEndpointConnection : Azure.Provisioning.Prim public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } } - public static Azure.Provisioning.KeyVault.KeyVaultPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KeyVault.KeyVaultPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_01; @@ -306,7 +306,7 @@ public enum KeyVaultProvisioningState } public partial class KeyVaultSecret : Azure.Provisioning.Primitives.Resource { - public KeyVaultSecret(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KeyVaultSecret(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -314,7 +314,7 @@ public partial class KeyVaultSecret : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.KeyVault.KeyVaultSecret FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KeyVault.KeyVaultSecret FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -334,16 +334,16 @@ public static partial class ResourceVersions } public partial class KeyVaultService : Azure.Provisioning.Primitives.Resource { - public KeyVaultService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KeyVaultService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KeyVault.KeyVaultBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KeyVault.KeyVaultBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KeyVault.KeyVaultBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.KeyVault.KeyVaultService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KeyVault.KeyVaultService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -386,7 +386,7 @@ public KeyVaultVirtualNetworkRule() { } } public partial class ManagedHsm : Azure.Provisioning.Primitives.Resource { - public ManagedHsm(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedHsm(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -394,7 +394,7 @@ public partial class ManagedHsm : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.KeyVault.ManagedHsm FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KeyVault.ManagedHsm FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_10_01; @@ -458,7 +458,7 @@ public ManagedHsmNetworkRuleSet() { } } public partial class ManagedHsmPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public ManagedHsmPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedHsmPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -470,7 +470,7 @@ public partial class ManagedHsmPrivateEndpointConnection : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.KeyVault.ManagedHsmPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KeyVault.ManagedHsmPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_10_01; diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultPrivateEndpointConnection.cs index ddf042d854b06..d2a53ee53948d 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultPrivateEndpointConnection.cs @@ -83,10 +83,15 @@ public partial class KeyVaultPrivateEndpointConnection : Resource /// /// Creates a new KeyVaultPrivateEndpointConnection. /// - /// Name of the KeyVaultPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the KeyVaultPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KeyVaultPrivateEndpointConnection. - public KeyVaultPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KeyVault/vaults/privateEndpointConnections", resourceVersion ?? "2023-07-01") + public KeyVaultPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KeyVault/vaults/privateEndpointConnections", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -164,9 +169,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing KeyVaultPrivateEndpointConnection. /// - /// Name of the KeyVaultPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the KeyVaultPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KeyVaultPrivateEndpointConnection. /// The existing KeyVaultPrivateEndpointConnection resource. - public static KeyVaultPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KeyVaultPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultSecret.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultSecret.cs index 4e4a62bdf59d3..bc8a0caaaf579 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultSecret.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultSecret.cs @@ -66,10 +66,15 @@ public partial class KeyVaultSecret : Resource /// /// Creates a new KeyVaultSecret. /// - /// Name of the KeyVaultSecret. + /// + /// The the Bicep identifier name of the KeyVaultSecret resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the KeyVaultSecret. - public KeyVaultSecret(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KeyVault/vaults/secrets", resourceVersion ?? "2023-07-01") + public KeyVaultSecret(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KeyVault/vaults/secrets", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"], isRequired: true); @@ -144,11 +149,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing KeyVaultSecret. /// - /// Name of the KeyVaultSecret. + /// + /// The the Bicep identifier name of the KeyVaultSecret resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the KeyVaultSecret. /// The existing KeyVaultSecret resource. - public static KeyVaultSecret FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KeyVaultSecret FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this KeyVaultSecret resource. diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultService.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultService.cs index 02b91db09b2a9..c07bfafb6537c 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultService.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/KeyVaultService.cs @@ -62,10 +62,15 @@ public partial class KeyVaultService : Resource /// /// Creates a new KeyVaultService. /// - /// Name of the KeyVaultService. + /// + /// The the Bicep identifier name of the KeyVaultService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the KeyVaultService. - public KeyVaultService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KeyVault/vaults", resourceVersion ?? "2023-07-01") + public KeyVaultService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KeyVault/vaults", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -139,11 +144,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing KeyVaultService. /// - /// Name of the KeyVaultService. + /// + /// The the Bicep identifier name of the KeyVaultService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the KeyVaultService. /// The existing KeyVaultService resource. - public static KeyVaultService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KeyVaultService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this KeyVaultService resource. @@ -161,10 +171,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(KeyVaultBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{KeyVaultBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{KeyVaultBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -177,13 +187,13 @@ public RoleAssignment CreateRoleAssignment(KeyVaultBuiltInRole role, UserAssigne /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(KeyVaultBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{KeyVaultBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(KeyVaultBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{KeyVaultBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsm.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsm.cs index 64c162b5b48b9..1d78df470cf66 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsm.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsm.cs @@ -64,10 +64,15 @@ public partial class ManagedHsm : Resource /// /// Creates a new ManagedHsm. /// - /// Name of the ManagedHsm. + /// + /// The the Bicep identifier name of the ManagedHsm resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedHsm. - public ManagedHsm(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KeyVault/managedHSMs", resourceVersion ?? "2023-07-01") + public ManagedHsm(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KeyVault/managedHSMs", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -122,9 +127,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedHsm. /// - /// Name of the ManagedHsm. + /// + /// The the Bicep identifier name of the ManagedHsm resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedHsm. /// The existing ManagedHsm resource. - public static ManagedHsm FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedHsm FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnection.cs index df84188387082..c21c244b246ac 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnection.cs @@ -90,10 +90,15 @@ public partial class ManagedHsmPrivateEndpointConnection : Resource /// /// Creates a new ManagedHsmPrivateEndpointConnection. /// - /// Name of the ManagedHsmPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ManagedHsmPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedHsmPrivateEndpointConnection. - public ManagedHsmPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KeyVault/managedHSMs/privateEndpointConnections", resourceVersion ?? "2023-07-01") + public ManagedHsmPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KeyVault/managedHSMs/privateEndpointConnections", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -152,9 +157,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedHsmPrivateEndpointConnection. /// - /// Name of the ManagedHsmPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ManagedHsmPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedHsmPrivateEndpointConnection. /// The existing ManagedHsmPrivateEndpointConnection resource. - public static ManagedHsmPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedHsmPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/api/Azure.Provisioning.Kubernetes.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Kubernetes/api/Azure.Provisioning.Kubernetes.netstandard2.0.cs index 1bd39cbecb0df..e9a49b3c70ed4 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/api/Azure.Provisioning.Kubernetes.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/api/Azure.Provisioning.Kubernetes.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Provisioning.Kubernetes { public partial class ConnectedCluster : Azure.Provisioning.Primitives.Resource { - public ConnectedCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ConnectedCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AgentPublicKeyCertificate { get { throw null; } set { } } public Azure.Provisioning.BicepValue AgentVersion { get { throw null; } } public Azure.Provisioning.BicepValue ConnectivityStatus { get { throw null; } } @@ -23,9 +23,9 @@ public partial class ConnectedCluster : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TotalCoreCount { get { throw null; } } public Azure.Provisioning.BicepValue TotalNodeCount { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Kubernetes.KubernetesBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Kubernetes.KubernetesBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Kubernetes.KubernetesBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.Kubernetes.ConnectedCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Kubernetes.ConnectedCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Generated/ConnectedCluster.cs b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Generated/ConnectedCluster.cs index 884ff17598216..83d37f777103b 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Generated/ConnectedCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Generated/ConnectedCluster.cs @@ -151,10 +151,15 @@ public partial class ConnectedCluster : Resource /// /// Creates a new ConnectedCluster. /// - /// Name of the ConnectedCluster. + /// + /// The the Bicep identifier name of the ConnectedCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ConnectedCluster. - public ConnectedCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Kubernetes/connectedClusters", resourceVersion ?? "2024-01-01") + public ConnectedCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Kubernetes/connectedClusters", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _agentPublicKeyCertificate = BicepValue.DefineProperty(this, "AgentPublicKeyCertificate", ["properties", "agentPublicKeyCertificate"], isRequired: true); @@ -207,11 +212,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ConnectedCluster. /// - /// Name of the ConnectedCluster. + /// + /// The the Bicep identifier name of the ConnectedCluster resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ConnectedCluster. /// The existing ConnectedCluster resource. - public static ConnectedCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ConnectedCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ConnectedCluster resource. @@ -229,10 +239,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(KubernetesBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{KubernetesBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{KubernetesBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -245,13 +255,13 @@ public RoleAssignment CreateRoleAssignment(KubernetesBuiltInRole role, UserAssig /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(KubernetesBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{KubernetesBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(KubernetesBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{KubernetesBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/api/Azure.Provisioning.KubernetesConfiguration.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/api/Azure.Provisioning.KubernetesConfiguration.netstandard2.0.cs index 4722999b4a37b..da6101f38323c 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/api/Azure.Provisioning.KubernetesConfiguration.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/api/Azure.Provisioning.KubernetesConfiguration.netstandard2.0.cs @@ -41,7 +41,7 @@ public KubernetesBucket() { } } public partial class KubernetesClusterExtension : Azure.Provisioning.Primitives.Resource { - public KubernetesClusterExtension(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KubernetesClusterExtension(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AksAssignedIdentity { get { throw null; } set { } } public Azure.Provisioning.BicepValue AutoUpgradeMinorVersion { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary ConfigurationProtectedSettings { get { throw null; } set { } } @@ -62,9 +62,9 @@ public partial class KubernetesClusterExtension : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepList Statuses { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.KubernetesConfiguration.KubernetesClusterExtension FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KubernetesConfiguration.KubernetesClusterExtension FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -179,7 +179,7 @@ public enum KubernetesFluxComplianceState } public partial class KubernetesFluxConfiguration : Azure.Provisioning.Primitives.Resource { - public KubernetesFluxConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KubernetesFluxConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AzureBlob { get { throw null; } set { } } public Azure.Provisioning.BicepValue Bucket { get { throw null; } set { } } public Azure.Provisioning.BicepValue ComplianceState { get { throw null; } } @@ -200,9 +200,9 @@ public partial class KubernetesFluxConfiguration : Azure.Provisioning.Primitives public Azure.Provisioning.BicepList Statuses { get { throw null; } } public Azure.Provisioning.BicepValue StatusUpdatedOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.KubernetesConfiguration.KubernetesConfigurationBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.KubernetesConfiguration.KubernetesFluxConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KubernetesConfiguration.KubernetesFluxConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_03_01; @@ -281,7 +281,7 @@ public KubernetesServicePrincipal() { } } public partial class KubernetesSourceControlConfiguration : Azure.Provisioning.Primitives.Resource { - public KubernetesSourceControlConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public KubernetesSourceControlConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ComplianceStatus { get { throw null; } } public Azure.Provisioning.BicepDictionary ConfigurationProtectedSettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue HelmOperatorProperties { get { throw null; } set { } } @@ -298,7 +298,7 @@ public partial class KubernetesSourceControlConfiguration : Azure.Provisioning.P public Azure.Provisioning.BicepValue RepositoryUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SshKnownHostsContents { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.KubernetesConfiguration.KubernetesSourceControlConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.KubernetesConfiguration.KubernetesSourceControlConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_03_01; diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesClusterExtension.cs b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesClusterExtension.cs index f96e709c73a54..92dfaf9b53cd2 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesClusterExtension.cs +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesClusterExtension.cs @@ -156,10 +156,15 @@ public partial class KubernetesClusterExtension : Resource /// /// Creates a new KubernetesClusterExtension. /// - /// Name of the KubernetesClusterExtension. + /// + /// The the Bicep identifier name of the KubernetesClusterExtension + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KubernetesClusterExtension. - public KubernetesClusterExtension(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KubernetesConfiguration/extensions", resourceVersion ?? "2023-05-01") + public KubernetesClusterExtension(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KubernetesConfiguration/extensions", resourceVersion ?? "2023-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _aksAssignedIdentity = BicepValue.DefineProperty(this, "AksAssignedIdentity", ["properties", "aksAssignedIdentity"]); @@ -212,11 +217,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing KubernetesClusterExtension. /// - /// Name of the KubernetesClusterExtension. + /// + /// The the Bicep identifier name of the KubernetesClusterExtension + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KubernetesClusterExtension. /// The existing KubernetesClusterExtension resource. - public static KubernetesClusterExtension FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KubernetesClusterExtension FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Creates a role assignment for a user-assigned identity that grants @@ -226,10 +236,10 @@ public static KubernetesClusterExtension FromExisting(string resourceName, strin /// The . /// The . public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -242,13 +252,13 @@ public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole ro /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesFluxConfiguration.cs b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesFluxConfiguration.cs index 31e7624f078c0..4353cb5f67704 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesFluxConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesFluxConfiguration.cs @@ -153,10 +153,15 @@ public partial class KubernetesFluxConfiguration : Resource /// /// Creates a new KubernetesFluxConfiguration. /// - /// Name of the KubernetesFluxConfiguration. + /// + /// The the Bicep identifier name of the KubernetesFluxConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KubernetesFluxConfiguration. - public KubernetesFluxConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KubernetesConfiguration/fluxConfigurations", resourceVersion ?? "2023-05-01") + public KubernetesFluxConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KubernetesConfiguration/fluxConfigurations", resourceVersion ?? "2023-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _azureBlob = BicepValue.DefineProperty(this, "AzureBlob", ["properties", "azureBlob"]); @@ -214,11 +219,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing KubernetesFluxConfiguration. /// - /// Name of the KubernetesFluxConfiguration. + /// + /// The the Bicep identifier name of the KubernetesFluxConfiguration + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the KubernetesFluxConfiguration. /// The existing KubernetesFluxConfiguration resource. - public static KubernetesFluxConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KubernetesFluxConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Creates a role assignment for a user-assigned identity that grants @@ -228,10 +238,10 @@ public static KubernetesFluxConfiguration FromExisting(string resourceName, stri /// The . /// The . public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -244,13 +254,13 @@ public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole ro /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(KubernetesConfigurationBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{KubernetesConfigurationBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesSourceControlConfiguration.cs b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesSourceControlConfiguration.cs index 6a989f61c407d..4afee41b158db 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesSourceControlConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Generated/KubernetesSourceControlConfiguration.cs @@ -121,10 +121,15 @@ public partial class KubernetesSourceControlConfiguration : Resource /// /// Creates a new KubernetesSourceControlConfiguration. /// - /// Name of the KubernetesSourceControlConfiguration. + /// + /// The the Bicep identifier name of the + /// KubernetesSourceControlConfiguration resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the KubernetesSourceControlConfiguration. - public KubernetesSourceControlConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.KubernetesConfiguration/sourceControlConfigurations", resourceVersion ?? "2023-05-01") + public KubernetesSourceControlConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.KubernetesConfiguration/sourceControlConfigurations", resourceVersion ?? "2023-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _configurationProtectedSettings = BicepDictionary.DefineProperty(this, "ConfigurationProtectedSettings", ["properties", "configurationProtectedSettings"]); @@ -178,9 +183,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing KubernetesSourceControlConfiguration. /// - /// Name of the KubernetesSourceControlConfiguration. + /// + /// The the Bicep identifier name of the + /// KubernetesSourceControlConfiguration resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the KubernetesSourceControlConfiguration. /// The existing KubernetesSourceControlConfiguration resource. - public static KubernetesSourceControlConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static KubernetesSourceControlConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/api/Azure.Provisioning.OperationalInsights.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/api/Azure.Provisioning.OperationalInsights.netstandard2.0.cs index be09659fc6300..b2e9fe0c66980 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/api/Azure.Provisioning.OperationalInsights.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/api/Azure.Provisioning.OperationalInsights.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Provisioning.OperationalInsights { public partial class LogAnalyticsQuery : Azure.Provisioning.Primitives.Resource { - public LogAnalyticsQuery(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LogAnalyticsQuery(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationId { get { throw null; } } public Azure.Provisioning.BicepValue Author { get { throw null; } } public Azure.Provisioning.BicepValue Body { get { throw null; } set { } } @@ -16,7 +16,7 @@ public partial class LogAnalyticsQuery : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Related { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary> Tags { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.LogAnalyticsQuery FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.LogAnalyticsQuery FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_09_01; @@ -25,7 +25,7 @@ public static partial class ResourceVersions } public partial class LogAnalyticsQueryPack : Azure.Provisioning.Primitives.Resource { - public LogAnalyticsQueryPack(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LogAnalyticsQueryPack(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -35,7 +35,7 @@ public partial class LogAnalyticsQueryPack : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue QueryPackId { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.LogAnalyticsQueryPack FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.LogAnalyticsQueryPack FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_09_01; @@ -62,7 +62,7 @@ public OperationalInsightsCapacityReservationProperties() { } } public partial class OperationalInsightsCluster : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsCluster(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsCluster(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AssociatedWorkspaces { get { throw null; } set { } } public Azure.Provisioning.BicepValue BillingType { get { throw null; } set { } } public Azure.Provisioning.BicepValue CapacityReservationProperties { get { throw null; } set { } } @@ -80,7 +80,7 @@ public partial class OperationalInsightsCluster : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsCluster FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsCluster FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -174,7 +174,7 @@ public enum OperationalInsightsColumnType } public partial class OperationalInsightsDataExport : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsDataExport(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsDataExport(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } set { } } public Azure.Provisioning.BicepValue DataExportId { get { throw null; } set { } } public Azure.Provisioning.BicepValue DestinationType { get { throw null; } } @@ -187,7 +187,7 @@ public partial class OperationalInsightsDataExport : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue ResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList TableNames { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsDataExport FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsDataExport FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_08_01; @@ -210,7 +210,7 @@ public enum OperationalInsightsDataIngestionStatus } public partial class OperationalInsightsDataSource : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsDataSource(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsDataSource(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ETag { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } set { } } @@ -219,7 +219,7 @@ public partial class OperationalInsightsDataSource : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsDataSource FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsDataSource FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_08_01; @@ -280,7 +280,7 @@ public OperationalInsightsKeyVaultProperties() { } } public partial class OperationalInsightsLinkedService : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsLinkedService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsLinkedService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.OperationalInsights.OperationalInsightsWorkspace? Parent { get { throw null; } set { } } @@ -289,7 +289,7 @@ public partial class OperationalInsightsLinkedService : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue WriteAccessResourceId { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsLinkedService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsLinkedService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_08_01; @@ -305,14 +305,14 @@ public enum OperationalInsightsLinkedServiceEntityStatus } public partial class OperationalInsightsLinkedStorageAccounts : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsLinkedStorageAccounts(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsLinkedStorageAccounts(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DataSourceType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.OperationalInsights.OperationalInsightsWorkspace? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList StorageAccountIds { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsLinkedStorageAccounts FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsLinkedStorageAccounts FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_08_01; @@ -332,7 +332,7 @@ public enum OperationalInsightsPublicNetworkAccessType } public partial class OperationalInsightsSavedSearch : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsSavedSearch(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsSavedSearch(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Category { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } set { } } @@ -345,7 +345,7 @@ public partial class OperationalInsightsSavedSearch : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsSavedSearch FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsSavedSearch FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_03_20; @@ -379,7 +379,7 @@ public OperationalInsightsStorageAccount() { } } public partial class OperationalInsightsTable : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsTable(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsTable(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ArchiveRetentionInDays { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsRetentionInDaysAsDefault { get { throw null; } } @@ -396,7 +396,7 @@ public partial class OperationalInsightsTable : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue SearchResults { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TotalRetentionInDays { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsTable FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsTable FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_08_01; @@ -470,7 +470,7 @@ public OperationalInsightsTag() { } } public partial class OperationalInsightsWorkspace : Azure.Provisioning.Primitives.Resource { - public OperationalInsightsWorkspace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OperationalInsightsWorkspace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue CustomerId { get { throw null; } } public Azure.Provisioning.BicepValue DefaultDataCollectionRuleResourceId { get { throw null; } set { } } @@ -491,7 +491,7 @@ public partial class OperationalInsightsWorkspace : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkspaceCapping { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.OperationalInsightsWorkspace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.OperationalInsightsWorkspace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.OperationalInsights.OperationalInsightsWorkspaceSharedKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -584,7 +584,7 @@ public enum RetentionInDaysAsDefaultState } public partial class StorageInsight : Azure.Provisioning.Primitives.Resource { - public StorageInsight(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageInsight(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Containers { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -595,7 +595,7 @@ public partial class StorageInsight : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList Tables { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.OperationalInsights.StorageInsight FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.OperationalInsights.StorageInsight FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_03_20; diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQuery.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQuery.cs index a383c744afd90..1fae36b5e54ce 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQuery.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQuery.cs @@ -111,10 +111,15 @@ public partial class LogAnalyticsQuery : Resource /// /// Creates a new LogAnalyticsQuery. /// - /// Name of the LogAnalyticsQuery. + /// + /// The the Bicep identifier name of the LogAnalyticsQuery resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LogAnalyticsQuery. - public LogAnalyticsQuery(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/queryPacks/queries", resourceVersion ?? "2023-09-01") + public LogAnalyticsQuery(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/queryPacks/queries", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _body = BicepValue.DefineProperty(this, "Body", ["properties", "body"]); @@ -150,9 +155,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LogAnalyticsQuery. /// - /// Name of the LogAnalyticsQuery. + /// + /// The the Bicep identifier name of the LogAnalyticsQuery resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LogAnalyticsQuery. /// The existing LogAnalyticsQuery resource. - public static LogAnalyticsQuery FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LogAnalyticsQuery FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQueryPack.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQueryPack.cs index 3b79b68aad96e..810923b7ed301 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQueryPack.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/LogAnalyticsQueryPack.cs @@ -78,10 +78,15 @@ public partial class LogAnalyticsQueryPack : Resource /// /// Creates a new LogAnalyticsQueryPack. /// - /// Name of the LogAnalyticsQueryPack. + /// + /// The the Bicep identifier name of the LogAnalyticsQueryPack resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the LogAnalyticsQueryPack. - public LogAnalyticsQueryPack(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/queryPacks", resourceVersion ?? "2023-09-01") + public LogAnalyticsQueryPack(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/queryPacks", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -113,9 +118,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LogAnalyticsQueryPack. /// - /// Name of the LogAnalyticsQueryPack. + /// + /// The the Bicep identifier name of the LogAnalyticsQueryPack resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the LogAnalyticsQueryPack. /// The existing LogAnalyticsQueryPack resource. - public static LogAnalyticsQueryPack FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LogAnalyticsQueryPack FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsCluster.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsCluster.cs index 16f1a22192528..b19a9442deeb9 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsCluster.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsCluster.cs @@ -131,10 +131,15 @@ public partial class OperationalInsightsCluster : Resource /// /// Creates a new OperationalInsightsCluster. /// - /// Name of the OperationalInsightsCluster. + /// + /// The the Bicep identifier name of the OperationalInsightsCluster + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsCluster. - public OperationalInsightsCluster(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/clusters", resourceVersion ?? "2023-09-01") + public OperationalInsightsCluster(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/clusters", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -189,11 +194,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsCluster. /// - /// Name of the OperationalInsightsCluster. + /// + /// The the Bicep identifier name of the OperationalInsightsCluster + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsCluster. /// The existing OperationalInsightsCluster resource. - public static OperationalInsightsCluster FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsCluster FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this OperationalInsightsCluster diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataExport.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataExport.cs index 3d7e809f90da5..8a04560152d28 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataExport.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataExport.cs @@ -95,10 +95,15 @@ public partial class OperationalInsightsDataExport : Resource /// /// Creates a new OperationalInsightsDataExport. /// - /// Name of the OperationalInsightsDataExport. + /// + /// The the Bicep identifier name of the OperationalInsightsDataExport + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsDataExport. - public OperationalInsightsDataExport(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/dataExports", resourceVersion ?? "2023-09-01") + public OperationalInsightsDataExport(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/dataExports", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _createdOn = BicepValue.DefineProperty(this, "CreatedOn", ["properties", "createdDate"]); @@ -133,9 +138,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsDataExport. /// - /// Name of the OperationalInsightsDataExport. + /// + /// The the Bicep identifier name of the OperationalInsightsDataExport + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsDataExport. /// The existing OperationalInsightsDataExport resource. - public static OperationalInsightsDataExport FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsDataExport FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataSource.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataSource.cs index 2576b8dc30694..2b80765016e31 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataSource.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsDataSource.cs @@ -84,10 +84,15 @@ public partial class OperationalInsightsDataSource : Resource /// /// Creates a new OperationalInsightsDataSource. /// - /// Name of the OperationalInsightsDataSource. + /// + /// The the Bicep identifier name of the OperationalInsightsDataSource + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsDataSource. - public OperationalInsightsDataSource(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/dataSources", resourceVersion ?? "2023-09-01") + public OperationalInsightsDataSource(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/dataSources", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"], isRequired: true); @@ -118,9 +123,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsDataSource. /// - /// Name of the OperationalInsightsDataSource. + /// + /// The the Bicep identifier name of the OperationalInsightsDataSource + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsDataSource. /// The existing OperationalInsightsDataSource resource. - public static OperationalInsightsDataSource FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsDataSource FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedService.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedService.cs index b25b5fef48e3f..27bcdaffed79c 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedService.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedService.cs @@ -71,10 +71,15 @@ public partial class OperationalInsightsLinkedService : Resource /// /// Creates a new OperationalInsightsLinkedService. /// - /// Name of the OperationalInsightsLinkedService. + /// + /// The the Bicep identifier name of the OperationalInsightsLinkedService + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsLinkedService. - public OperationalInsightsLinkedService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/linkedServices", resourceVersion ?? "2023-09-01") + public OperationalInsightsLinkedService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/linkedServices", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _provisioningState = BicepValue.DefineProperty(this, "ProvisioningState", ["properties", "provisioningState"]); @@ -105,9 +110,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsLinkedService. /// - /// Name of the OperationalInsightsLinkedService. + /// + /// The the Bicep identifier name of the OperationalInsightsLinkedService + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsLinkedService. /// The existing OperationalInsightsLinkedService resource. - public static OperationalInsightsLinkedService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsLinkedService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedStorageAccounts.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedStorageAccounts.cs index bbd636d9faf50..5da21cd8a6bd6 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedStorageAccounts.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsLinkedStorageAccounts.cs @@ -57,10 +57,16 @@ public partial class OperationalInsightsLinkedStorageAccounts : Resource /// /// Creates a new OperationalInsightsLinkedStorageAccounts. /// - /// Name of the OperationalInsightsLinkedStorageAccounts. + /// + /// The the Bicep identifier name of the + /// OperationalInsightsLinkedStorageAccounts resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the OperationalInsightsLinkedStorageAccounts. - public OperationalInsightsLinkedStorageAccounts(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts", resourceVersion ?? "2023-09-01") + public OperationalInsightsLinkedStorageAccounts(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _dataSourceType = BicepValue.DefineProperty(this, "DataSourceType", ["properties", "dataSourceType"], isRequired: true); @@ -90,9 +96,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// OperationalInsightsLinkedStorageAccounts. /// - /// Name of the OperationalInsightsLinkedStorageAccounts. + /// + /// The the Bicep identifier name of the + /// OperationalInsightsLinkedStorageAccounts resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the OperationalInsightsLinkedStorageAccounts. /// The existing OperationalInsightsLinkedStorageAccounts resource. - public static OperationalInsightsLinkedStorageAccounts FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsLinkedStorageAccounts FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsSavedSearch.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsSavedSearch.cs index 9712582ad89b1..78e550da0ffe2 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsSavedSearch.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsSavedSearch.cs @@ -101,10 +101,15 @@ public partial class OperationalInsightsSavedSearch : Resource /// /// Creates a new OperationalInsightsSavedSearch. /// - /// Name of the OperationalInsightsSavedSearch. + /// + /// The the Bicep identifier name of the OperationalInsightsSavedSearch + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsSavedSearch. - public OperationalInsightsSavedSearch(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/savedSearches", resourceVersion ?? "2023-09-01") + public OperationalInsightsSavedSearch(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/savedSearches", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _category = BicepValue.DefineProperty(this, "Category", ["properties", "category"], isRequired: true); @@ -159,9 +164,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsSavedSearch. /// - /// Name of the OperationalInsightsSavedSearch. + /// + /// The the Bicep identifier name of the OperationalInsightsSavedSearch + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsSavedSearch. /// The existing OperationalInsightsSavedSearch resource. - public static OperationalInsightsSavedSearch FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsSavedSearch FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsTable.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsTable.cs index 5bfc48feefd36..371c4bb533515 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsTable.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsTable.cs @@ -126,10 +126,15 @@ public partial class OperationalInsightsTable : Resource /// /// Creates a new OperationalInsightsTable. /// - /// Name of the OperationalInsightsTable. + /// + /// The the Bicep identifier name of the OperationalInsightsTable resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the OperationalInsightsTable. - public OperationalInsightsTable(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/tables", resourceVersion ?? "2023-09-01") + public OperationalInsightsTable(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/tables", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _plan = BicepValue.DefineProperty(this, "Plan", ["properties", "plan"]); @@ -173,9 +178,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsTable. /// - /// Name of the OperationalInsightsTable. + /// + /// The the Bicep identifier name of the OperationalInsightsTable resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the OperationalInsightsTable. /// The existing OperationalInsightsTable resource. - public static OperationalInsightsTable FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsTable FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsWorkspace.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsWorkspace.cs index fa5c178e9529d..8df19fbdc309b 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsWorkspace.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/OperationalInsightsWorkspace.cs @@ -150,10 +150,15 @@ public partial class OperationalInsightsWorkspace : Resource /// /// Creates a new OperationalInsightsWorkspace. /// - /// Name of the OperationalInsightsWorkspace. + /// + /// The the Bicep identifier name of the OperationalInsightsWorkspace + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsWorkspace. - public OperationalInsightsWorkspace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces", resourceVersion ?? "2023-09-01") + public OperationalInsightsWorkspace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -216,11 +221,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing OperationalInsightsWorkspace. /// - /// Name of the OperationalInsightsWorkspace. + /// + /// The the Bicep identifier name of the OperationalInsightsWorkspace + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the OperationalInsightsWorkspace. /// The existing OperationalInsightsWorkspace resource. - public static OperationalInsightsWorkspace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OperationalInsightsWorkspace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this OperationalInsightsWorkspace @@ -237,5 +247,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this OperationalInsightsWorkspace resource. public OperationalInsightsWorkspaceSharedKeys GetKeys() => OperationalInsightsWorkspaceSharedKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/StorageInsight.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/StorageInsight.cs index 9272931ea268d..e8f5ad3a216ad 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/StorageInsight.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Generated/StorageInsight.cs @@ -82,10 +82,15 @@ public partial class StorageInsight : Resource /// /// Creates a new StorageInsight. /// - /// Name of the StorageInsight. + /// + /// The the Bicep identifier name of the StorageInsight resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageInsight. - public StorageInsight(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.OperationalInsights/workspaces/storageInsightConfigs", resourceVersion ?? "2023-09-01") + public StorageInsight(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.OperationalInsights/workspaces/storageInsightConfigs", resourceVersion ?? "2023-09-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _containers = BicepList.DefineProperty(this, "Containers", ["properties", "containers"]); @@ -123,9 +128,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageInsight. /// - /// Name of the StorageInsight. + /// + /// The the Bicep identifier name of the StorageInsight resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageInsight. /// The existing StorageInsight resource. - public static StorageInsight FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageInsight FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/api/Azure.Provisioning.PostgreSql.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/api/Azure.Provisioning.PostgreSql.netstandard2.0.cs index 0183646318695..4cacd113c9d5d 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/api/Azure.Provisioning.PostgreSql.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/api/Azure.Provisioning.PostgreSql.netstandard2.0.cs @@ -6,7 +6,7 @@ public enum PostgreSqlAdministratorType } public partial class PostgreSqlConfiguration : Azure.Provisioning.Primitives.Resource { - public PostgreSqlConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowedValues { get { throw null; } } public Azure.Provisioning.BicepValue DataType { get { throw null; } } public Azure.Provisioning.BicepValue DefaultValue { get { throw null; } } @@ -17,7 +17,7 @@ public partial class PostgreSqlConfiguration : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue Source { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Value { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_12_01; @@ -26,14 +26,14 @@ public static partial class ResourceVersions } public partial class PostgreSqlDatabase : Azure.Provisioning.Primitives.Resource { - public PostgreSqlDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Charset { get { throw null; } set { } } public Azure.Provisioning.BicepValue Collation { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.PostgreSql.PostgreSqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -44,14 +44,14 @@ public static partial class ResourceVersions } public partial class PostgreSqlFirewallRule : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.PostgreSql.PostgreSqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -62,7 +62,7 @@ public static partial class ResourceVersions } public partial class PostgreSqlFlexibleServer : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFlexibleServer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFlexibleServer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorLogin { get { throw null; } set { } } public Azure.Provisioning.BicepValue AdministratorLoginPassword { get { throw null; } set { } } public Azure.Provisioning.BicepValue AuthConfig { get { throw null; } set { } } @@ -90,7 +90,7 @@ public partial class PostgreSqlFlexibleServer : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -102,7 +102,7 @@ public static partial class ResourceVersions } public partial class PostgreSqlFlexibleServerActiveDirectoryAdministrator : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFlexibleServerActiveDirectoryAdministrator(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFlexibleServerActiveDirectoryAdministrator(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue ObjectId { get { throw null; } } @@ -111,7 +111,7 @@ public partial class PostgreSqlFlexibleServerActiveDirectoryAdministrator : Azur public Azure.Provisioning.BicepValue PrincipalType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerActiveDirectoryAdministrator FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerActiveDirectoryAdministrator FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_06_01; @@ -140,7 +140,7 @@ public PostgreSqlFlexibleServerBackupProperties() { } } public partial class PostgreSqlFlexibleServerConfiguration : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFlexibleServerConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFlexibleServerConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowedValues { get { throw null; } } public Azure.Provisioning.BicepValue DataType { get { throw null; } } public Azure.Provisioning.BicepValue DefaultValue { get { throw null; } } @@ -156,7 +156,7 @@ public partial class PostgreSqlFlexibleServerConfiguration : Azure.Provisioning. public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Unit { get { throw null; } } public Azure.Provisioning.BicepValue Value { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_06_01; @@ -183,14 +183,14 @@ public enum PostgreSqlFlexibleServerCreateMode } public partial class PostgreSqlFlexibleServerDatabase : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFlexibleServerDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFlexibleServerDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Charset { get { throw null; } set { } } public Azure.Provisioning.BicepValue Collation { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_06_01; @@ -211,14 +211,14 @@ public PostgreSqlFlexibleServerDataEncryption() { } } public partial class PostgreSqlFlexibleServerFirewallRule : Azure.Provisioning.Primitives.Resource { - public PostgreSqlFlexibleServerFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlFlexibleServerFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlFlexibleServerFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_06_01; @@ -392,7 +392,7 @@ public enum PostgreSqlManagedDiskPerformanceTier } public partial class PostgreSqlMigration : Azure.Provisioning.Primitives.Resource { - public PostgreSqlMigration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlMigration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Cancel { get { throw null; } set { } } public Azure.Provisioning.BicepValue CurrentStatus { get { throw null; } } public Azure.Provisioning.BicepList DbsToCancelMigrationOn { get { throw null; } set { } } @@ -419,7 +419,7 @@ public partial class PostgreSqlMigration : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue TargetDbServerMetadata { get { throw null; } } public Azure.Provisioning.BicepValue TargetDbServerResourceId { get { throw null; } } public Azure.Provisioning.BicepValue TriggerCutover { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlMigration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlMigration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_06_01; @@ -510,7 +510,7 @@ public enum PostgreSqlMinimalTlsVersionEnum } public partial class PostgreSqlPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public PostgreSqlPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -518,7 +518,7 @@ public partial class PostgreSqlPrivateEndpointConnection : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_06_01; @@ -562,7 +562,7 @@ public enum PostgreSqlSecurityAlertPolicyName } public partial class PostgreSqlServer : Azure.Provisioning.Primitives.Resource { - public PostgreSqlServer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlServer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorLogin { get { throw null; } } public Azure.Provisioning.BicepValue ByokEnforcement { get { throw null; } } public Azure.Provisioning.BicepValue EarliestRestoreOn { get { throw null; } } @@ -586,7 +586,7 @@ public partial class PostgreSqlServer : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UserVisibleState { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlServer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlServer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -597,7 +597,7 @@ public static partial class ResourceVersions } public partial class PostgreSqlServerAdministrator : Azure.Provisioning.Primitives.Resource { - public PostgreSqlServerAdministrator(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlServerAdministrator(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LoginAccountName { get { throw null; } set { } } @@ -606,7 +606,7 @@ public partial class PostgreSqlServerAdministrator : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue SecureId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlServerAdministrator FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlServerAdministrator FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_12_01; @@ -615,7 +615,7 @@ public static partial class ResourceVersions } public partial class PostgreSqlServerKey : Azure.Provisioning.Primitives.Resource { - public PostgreSqlServerKey(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlServerKey(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } @@ -624,7 +624,7 @@ public partial class PostgreSqlServerKey : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue ServerKeyType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Uri { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlServerKey FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlServerKey FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_01_01; @@ -697,7 +697,7 @@ public PostgreSqlServerPropertiesForRestore() { } } public partial class PostgreSqlServerSecurityAlertPolicy : Azure.Provisioning.Primitives.Resource { - public PostgreSqlServerSecurityAlertPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlServerSecurityAlertPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList DisabledAlerts { get { throw null; } set { } } public Azure.Provisioning.BicepList EmailAddresses { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -709,7 +709,7 @@ public partial class PostgreSqlServerSecurityAlertPolicy : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue StorageAccountAccessKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.PostgreSql.PostgreSqlServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_12_01; @@ -778,7 +778,7 @@ public PostgreSqlStorageProfile() { } } public partial class PostgreSqlVirtualNetworkRule : Azure.Provisioning.Primitives.Resource { - public PostgreSqlVirtualNetworkRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PostgreSqlVirtualNetworkRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IgnoreMissingVnetServiceEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -786,7 +786,7 @@ public partial class PostgreSqlVirtualNetworkRule : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VirtualNetworkSubnetId { get { throw null; } set { } } - public static Azure.Provisioning.PostgreSql.PostgreSqlVirtualNetworkRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.PostgreSql.PostgreSqlVirtualNetworkRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlConfiguration.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlConfiguration.cs index ebe53bc9127a5..23df5ca74a437 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlConfiguration.cs @@ -80,10 +80,15 @@ public partial class PostgreSqlConfiguration : Resource /// /// Creates a new PostgreSqlConfiguration. /// - /// Name of the PostgreSqlConfiguration. + /// + /// The the Bicep identifier name of the PostgreSqlConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlConfiguration. - public PostgreSqlConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/configurations", resourceVersion ?? "2017-12-01") + public PostgreSqlConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/configurations", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _source = BicepValue.DefineProperty(this, "Source", ["properties", "source"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlConfiguration. /// - /// Name of the PostgreSqlConfiguration. + /// + /// The the Bicep identifier name of the PostgreSqlConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlConfiguration. /// The existing PostgreSqlConfiguration resource. - public static PostgreSqlConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlDatabase.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlDatabase.cs index 702ae5d2bb72d..16d7402e06268 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlDatabase.cs @@ -57,10 +57,15 @@ public partial class PostgreSqlDatabase : Resource /// /// Creates a new PostgreSqlDatabase. /// - /// Name of the PostgreSqlDatabase. + /// + /// The the Bicep identifier name of the PostgreSqlDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlDatabase. - public PostgreSqlDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/databases", resourceVersion ?? "2017-12-01") + public PostgreSqlDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/databases", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _charset = BicepValue.DefineProperty(this, "Charset", ["properties", "charset"]); @@ -89,11 +94,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlDatabase. /// - /// Name of the PostgreSqlDatabase. + /// + /// The the Bicep identifier name of the PostgreSqlDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlDatabase. /// The existing PostgreSqlDatabase resource. - public static PostgreSqlDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PostgreSqlDatabase resource. diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFirewallRule.cs index c225b04a13dc8..c5a7e6d8c5a55 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFirewallRule.cs @@ -58,10 +58,15 @@ public partial class PostgreSqlFirewallRule : Resource /// /// Creates a new PostgreSqlFirewallRule. /// - /// Name of the PostgreSqlFirewallRule. + /// + /// The the Bicep identifier name of the PostgreSqlFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlFirewallRule. - public PostgreSqlFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/firewallRules", resourceVersion ?? "2017-12-01") + public PostgreSqlFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/firewallRules", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIPAddress = BicepValue.DefineProperty(this, "EndIPAddress", ["properties", "endIpAddress"], isRequired: true); @@ -90,11 +95,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlFirewallRule. /// - /// Name of the PostgreSqlFirewallRule. + /// + /// The the Bicep identifier name of the PostgreSqlFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlFirewallRule. /// The existing PostgreSqlFirewallRule resource. - public static PostgreSqlFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PostgreSqlFirewallRule resource. diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServer.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServer.cs index 4c9761754b1d1..96171f4bbffec 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServer.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServer.cs @@ -193,10 +193,15 @@ public partial class PostgreSqlFlexibleServer : Resource /// /// Creates a new PostgreSqlFlexibleServer. /// - /// Name of the PostgreSqlFlexibleServer. + /// + /// The the Bicep identifier name of the PostgreSqlFlexibleServer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServer. - public PostgreSqlFlexibleServer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers", resourceVersion ?? "2024-08-01") + public PostgreSqlFlexibleServer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -251,11 +256,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlFlexibleServer. /// - /// Name of the PostgreSqlFlexibleServer. + /// + /// The the Bicep identifier name of the PostgreSqlFlexibleServer resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServer. /// The existing PostgreSqlFlexibleServer resource. - public static PostgreSqlFlexibleServer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFlexibleServer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PostgreSqlFlexibleServer resource. diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerActiveDirectoryAdministrator.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerActiveDirectoryAdministrator.cs index 305ce76527c95..49f5c77f89835 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerActiveDirectoryAdministrator.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerActiveDirectoryAdministrator.cs @@ -69,10 +69,16 @@ public partial class PostgreSqlFlexibleServerActiveDirectoryAdministrator : Reso /// /// Creates a new PostgreSqlFlexibleServerActiveDirectoryAdministrator. /// - /// Name of the PostgreSqlFlexibleServerActiveDirectoryAdministrator. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerActiveDirectoryAdministrator resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlFlexibleServerActiveDirectoryAdministrator. - public PostgreSqlFlexibleServerActiveDirectoryAdministrator(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers/administrators", resourceVersion ?? "2024-08-01") + public PostgreSqlFlexibleServerActiveDirectoryAdministrator(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers/administrators", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _objectId = BicepValue.DefineProperty(this, "ObjectId", ["properties", "objectId"], isOutput: true); @@ -110,9 +116,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// PostgreSqlFlexibleServerActiveDirectoryAdministrator. /// - /// Name of the PostgreSqlFlexibleServerActiveDirectoryAdministrator. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerActiveDirectoryAdministrator resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlFlexibleServerActiveDirectoryAdministrator. /// The existing PostgreSqlFlexibleServerActiveDirectoryAdministrator resource. - public static PostgreSqlFlexibleServerActiveDirectoryAdministrator FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFlexibleServerActiveDirectoryAdministrator FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerConfiguration.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerConfiguration.cs index aa26b0c943f74..dfd5b2b6e21f9 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerConfiguration.cs @@ -110,10 +110,15 @@ public partial class PostgreSqlFlexibleServerConfiguration : Resource /// /// Creates a new PostgreSqlFlexibleServerConfiguration. /// - /// Name of the PostgreSqlFlexibleServerConfiguration. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerConfiguration resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerConfiguration. - public PostgreSqlFlexibleServerConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers/configurations", resourceVersion ?? "2024-08-01") + public PostgreSqlFlexibleServerConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers/configurations", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _source = BicepValue.DefineProperty(this, "Source", ["properties", "source"]); @@ -157,9 +162,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// PostgreSqlFlexibleServerConfiguration. /// - /// Name of the PostgreSqlFlexibleServerConfiguration. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerConfiguration resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerConfiguration. /// The existing PostgreSqlFlexibleServerConfiguration resource. - public static PostgreSqlFlexibleServerConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFlexibleServerConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerDatabase.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerDatabase.cs index 8a7b675c1fcb7..0c8e96656ea07 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerDatabase.cs @@ -56,10 +56,15 @@ public partial class PostgreSqlFlexibleServerDatabase : Resource /// /// Creates a new PostgreSqlFlexibleServerDatabase. /// - /// Name of the PostgreSqlFlexibleServerDatabase. + /// + /// The the Bicep identifier name of the PostgreSqlFlexibleServerDatabase + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerDatabase. - public PostgreSqlFlexibleServerDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers/databases", resourceVersion ?? "2024-08-01") + public PostgreSqlFlexibleServerDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers/databases", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _charset = BicepValue.DefineProperty(this, "Charset", ["properties", "charset"]); @@ -93,9 +98,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlFlexibleServerDatabase. /// - /// Name of the PostgreSqlFlexibleServerDatabase. + /// + /// The the Bicep identifier name of the PostgreSqlFlexibleServerDatabase + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerDatabase. /// The existing PostgreSqlFlexibleServerDatabase resource. - public static PostgreSqlFlexibleServerDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFlexibleServerDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerFirewallRule.cs index 485d4191f838e..bcddf372c149f 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlFlexibleServerFirewallRule.cs @@ -57,10 +57,15 @@ public partial class PostgreSqlFlexibleServerFirewallRule : Resource /// /// Creates a new PostgreSqlFlexibleServerFirewallRule. /// - /// Name of the PostgreSqlFlexibleServerFirewallRule. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerFirewallRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerFirewallRule. - public PostgreSqlFlexibleServerFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers/firewallRules", resourceVersion ?? "2024-08-01") + public PostgreSqlFlexibleServerFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers/firewallRules", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIPAddress = BicepValue.DefineProperty(this, "EndIPAddress", ["properties", "endIpAddress"], isRequired: true); @@ -94,9 +99,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlFlexibleServerFirewallRule. /// - /// Name of the PostgreSqlFlexibleServerFirewallRule. + /// + /// The the Bicep identifier name of the + /// PostgreSqlFlexibleServerFirewallRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlFlexibleServerFirewallRule. /// The existing PostgreSqlFlexibleServerFirewallRule resource. - public static PostgreSqlFlexibleServerFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlFlexibleServerFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlMigration.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlMigration.cs index 52fcd12e440bf..35ae58d17b515 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlMigration.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlMigration.cs @@ -186,10 +186,15 @@ public partial class PostgreSqlMigration : Resource /// /// Creates a new PostgreSqlMigration. /// - /// Name of the PostgreSqlMigration. + /// + /// The the Bicep identifier name of the PostgreSqlMigration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlMigration. - public PostgreSqlMigration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/flexibleServers/migrations", resourceVersion ?? "2024-08-01") + public PostgreSqlMigration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/flexibleServers/migrations", resourceVersion ?? "2024-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -243,9 +248,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlMigration. /// - /// Name of the PostgreSqlMigration. + /// + /// The the Bicep identifier name of the PostgreSqlMigration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlMigration. /// The existing PostgreSqlMigration resource. - public static PostgreSqlMigration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlMigration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlPrivateEndpointConnection.cs index e37254b98cdd4..5564bb6526f47 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlPrivateEndpointConnection.cs @@ -62,10 +62,15 @@ public partial class PostgreSqlPrivateEndpointConnection : Resource /// /// Creates a new PostgreSqlPrivateEndpointConnection. /// - /// Name of the PostgreSqlPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// PostgreSqlPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlPrivateEndpointConnection. - public PostgreSqlPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/privateEndpointConnections", resourceVersion ?? "2018-06-01") + public PostgreSqlPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/privateEndpointConnections", resourceVersion ?? "2018-06-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -95,9 +100,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlPrivateEndpointConnection. /// - /// Name of the PostgreSqlPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// PostgreSqlPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlPrivateEndpointConnection. /// The existing PostgreSqlPrivateEndpointConnection resource. - public static PostgreSqlPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServer.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServer.cs index 46292447598d2..24c7660b84afb 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServer.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServer.cs @@ -175,10 +175,15 @@ public partial class PostgreSqlServer : Resource /// /// Creates a new PostgreSqlServer. /// - /// Name of the PostgreSqlServer. + /// + /// The the Bicep identifier name of the PostgreSqlServer resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlServer. - public PostgreSqlServer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers", resourceVersion ?? "2017-12-01") + public PostgreSqlServer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -224,11 +229,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlServer. /// - /// Name of the PostgreSqlServer. + /// + /// The the Bicep identifier name of the PostgreSqlServer resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PostgreSqlServer. /// The existing PostgreSqlServer resource. - public static PostgreSqlServer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlServer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PostgreSqlServer resource. diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerAdministrator.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerAdministrator.cs index 30f04a4dda18c..f991b6be08824 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerAdministrator.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerAdministrator.cs @@ -68,10 +68,15 @@ public partial class PostgreSqlServerAdministrator : Resource /// /// Creates a new PostgreSqlServerAdministrator. /// - /// Name of the PostgreSqlServerAdministrator. + /// + /// The the Bicep identifier name of the PostgreSqlServerAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlServerAdministrator. - public PostgreSqlServerAdministrator(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/administrators", resourceVersion ?? "2017-12-01") + public PostgreSqlServerAdministrator(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/administrators", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _administratorType = BicepValue.DefineProperty(this, "AdministratorType", ["properties", "administratorType"]); @@ -102,9 +107,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlServerAdministrator. /// - /// Name of the PostgreSqlServerAdministrator. + /// + /// The the Bicep identifier name of the PostgreSqlServerAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlServerAdministrator. /// The existing PostgreSqlServerAdministrator resource. - public static PostgreSqlServerAdministrator FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlServerAdministrator FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerKey.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerKey.cs index 15a5ff323f9e2..f23d968633188 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerKey.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerKey.cs @@ -69,10 +69,15 @@ public partial class PostgreSqlServerKey : Resource /// /// Creates a new PostgreSqlServerKey. /// - /// Name of the PostgreSqlServerKey. + /// + /// The the Bicep identifier name of the PostgreSqlServerKey resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlServerKey. - public PostgreSqlServerKey(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/keys", resourceVersion ?? "2020-01-01") + public PostgreSqlServerKey(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/keys", resourceVersion ?? "2020-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _serverKeyType = BicepValue.DefineProperty(this, "ServerKeyType", ["properties", "serverKeyType"]); @@ -103,9 +108,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlServerKey. /// - /// Name of the PostgreSqlServerKey. + /// + /// The the Bicep identifier name of the PostgreSqlServerKey resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the PostgreSqlServerKey. /// The existing PostgreSqlServerKey resource. - public static PostgreSqlServerKey FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlServerKey FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerSecurityAlertPolicy.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerSecurityAlertPolicy.cs index e98e68cf30721..11d5a0d5a8a45 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerSecurityAlertPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlServerSecurityAlertPolicy.cs @@ -91,10 +91,15 @@ public partial class PostgreSqlServerSecurityAlertPolicy : Resource /// /// Creates a new PostgreSqlServerSecurityAlertPolicy. /// - /// Name of the PostgreSqlServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the + /// PostgreSqlServerSecurityAlertPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlServerSecurityAlertPolicy. - public PostgreSqlServerSecurityAlertPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/securityAlertPolicies", resourceVersion ?? "2017-12-01") + public PostgreSqlServerSecurityAlertPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/securityAlertPolicies", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _disabledAlerts = BicepList.DefineProperty(this, "DisabledAlerts", ["properties", "disabledAlerts"]); @@ -128,9 +133,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlServerSecurityAlertPolicy. /// - /// Name of the PostgreSqlServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the + /// PostgreSqlServerSecurityAlertPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the PostgreSqlServerSecurityAlertPolicy. /// The existing PostgreSqlServerSecurityAlertPolicy resource. - public static PostgreSqlServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlVirtualNetworkRule.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlVirtualNetworkRule.cs index fe884b5402ff3..829fa9d549275 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlVirtualNetworkRule.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Generated/PostgreSqlVirtualNetworkRule.cs @@ -64,10 +64,15 @@ public partial class PostgreSqlVirtualNetworkRule : Resource /// /// Creates a new PostgreSqlVirtualNetworkRule. /// - /// Name of the PostgreSqlVirtualNetworkRule. + /// + /// The the Bicep identifier name of the PostgreSqlVirtualNetworkRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlVirtualNetworkRule. - public PostgreSqlVirtualNetworkRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.DBforPostgreSQL/servers/virtualNetworkRules", resourceVersion ?? "2017-12-01") + public PostgreSqlVirtualNetworkRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.DBforPostgreSQL/servers/virtualNetworkRules", resourceVersion ?? "2017-12-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _ignoreMissingVnetServiceEndpoint = BicepValue.DefineProperty(this, "IgnoreMissingVnetServiceEndpoint", ["properties", "ignoreMissingVnetServiceEndpoint"]); @@ -97,11 +102,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PostgreSqlVirtualNetworkRule. /// - /// Name of the PostgreSqlVirtualNetworkRule. + /// + /// The the Bicep identifier name of the PostgreSqlVirtualNetworkRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the PostgreSqlVirtualNetworkRule. /// The existing PostgreSqlVirtualNetworkRule resource. - public static PostgreSqlVirtualNetworkRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PostgreSqlVirtualNetworkRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PostgreSqlVirtualNetworkRule diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/tests/BasicPostgreSqlTests.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/tests/BasicPostgreSqlTests.cs index 974ce2714e2b8..92572d173d55b 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/tests/BasicPostgreSqlTests.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/tests/BasicPostgreSqlTests.cs @@ -121,7 +121,7 @@ param aadAdminOid string param location string = resourceGroup().location resource server 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = { - name: take('server${uniqueString(resourceGroup().id)}', 24) + name: take('server-${uniqueString(resourceGroup().id)}', 63) location: location properties: { administratorLogin: adminLogin diff --git a/sdk/provisioning/Azure.Provisioning.Redis/api/Azure.Provisioning.Redis.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Redis/api/Azure.Provisioning.Redis.netstandard2.0.cs index d0bcef27f61ae..d85e27a88165c 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/api/Azure.Provisioning.Redis.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/api/Azure.Provisioning.Redis.netstandard2.0.cs @@ -52,7 +52,7 @@ public RedisAccessKeys() { } } public partial class RedisCacheAccessPolicy : Azure.Provisioning.Primitives.Resource { - public RedisCacheAccessPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisCacheAccessPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Redis.RedisResource? Parent { get { throw null; } set { } } @@ -60,7 +60,7 @@ public partial class RedisCacheAccessPolicy : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TypePropertiesType { get { throw null; } } - public static Azure.Provisioning.Redis.RedisCacheAccessPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisCacheAccessPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -84,7 +84,7 @@ public static partial class ResourceVersions } public partial class RedisCacheAccessPolicyAssignment : Azure.Provisioning.Primitives.Resource { - public RedisCacheAccessPolicyAssignment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisCacheAccessPolicyAssignment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessPolicyName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -93,7 +93,7 @@ public partial class RedisCacheAccessPolicyAssignment : Azure.Provisioning.Primi public Azure.Provisioning.Redis.RedisResource? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Redis.RedisCacheAccessPolicyAssignment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisCacheAccessPolicyAssignment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -152,14 +152,14 @@ public enum RedisDayOfWeek } public partial class RedisFirewallRule : Azure.Provisioning.Primitives.Resource { - public RedisFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIP { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Redis.RedisResource? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartIP { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Redis.RedisFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -200,7 +200,7 @@ public enum RedisLinkedServerRole } public partial class RedisLinkedServerWithProperty : Azure.Provisioning.Primitives.Resource { - public RedisLinkedServerWithProperty(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisLinkedServerWithProperty(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue GeoReplicatedPrimaryHostName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LinkedRedisCacheId { get { throw null; } set { } } @@ -211,7 +211,7 @@ public partial class RedisLinkedServerWithProperty : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue ServerRole { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Redis.RedisLinkedServerWithProperty FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisLinkedServerWithProperty FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -235,14 +235,14 @@ public static partial class ResourceVersions } public partial class RedisPatchSchedule : Azure.Provisioning.Primitives.Resource { - public RedisPatchSchedule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisPatchSchedule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Redis.RedisResource? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList ScheduleEntries { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Redis.RedisPatchSchedule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisPatchSchedule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -278,7 +278,7 @@ public RedisPatchScheduleSetting() { } } public partial class RedisPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public RedisPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Redis.RedisResource? Parent { get { throw null; } set { } } @@ -286,7 +286,7 @@ public partial class RedisPrivateEndpointConnection : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue RedisPrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue RedisProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Redis.RedisPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_07_01; @@ -354,7 +354,7 @@ public enum RedisPublicNetworkAccess } public partial class RedisResource : Azure.Provisioning.Primitives.Resource { - public RedisResource(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RedisResource(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessKeys { get { throw null; } } public Azure.Provisioning.BicepValue EnableNonSslPort { get { throw null; } set { } } public Azure.Provisioning.BicepValue HostName { get { throw null; } } @@ -383,9 +383,9 @@ public partial class RedisResource : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary TenantSettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdateChannel { get { throw null; } set { } } public Azure.Provisioning.BicepList Zones { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Redis.RedisBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Redis.RedisBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Redis.RedisBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.Redis.RedisResource FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Redis.RedisResource FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.Redis.RedisAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicy.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicy.cs index 1efd00352ba37..308cd1d319b09 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicy.cs @@ -63,10 +63,15 @@ public partial class RedisCacheAccessPolicy : Resource /// /// Creates a new RedisCacheAccessPolicy. /// - /// Name of the RedisCacheAccessPolicy. + /// + /// The the Bicep identifier name of the RedisCacheAccessPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the RedisCacheAccessPolicy. - public RedisCacheAccessPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/accessPolicies", resourceVersion ?? "2024-03-01") + public RedisCacheAccessPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/accessPolicies", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _permissions = BicepValue.DefineProperty(this, "Permissions", ["properties", "permissions"]); @@ -171,9 +176,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisCacheAccessPolicy. /// - /// Name of the RedisCacheAccessPolicy. + /// + /// The the Bicep identifier name of the RedisCacheAccessPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the RedisCacheAccessPolicy. /// The existing RedisCacheAccessPolicy resource. - public static RedisCacheAccessPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisCacheAccessPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicyAssignment.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicyAssignment.cs index 59450bd64d90a..5fa4854889392 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicyAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisCacheAccessPolicyAssignment.cs @@ -69,10 +69,15 @@ public partial class RedisCacheAccessPolicyAssignment : Resource /// /// Creates a new RedisCacheAccessPolicyAssignment. /// - /// Name of the RedisCacheAccessPolicyAssignment. + /// + /// The the Bicep identifier name of the RedisCacheAccessPolicyAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisCacheAccessPolicyAssignment. - public RedisCacheAccessPolicyAssignment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/accessPolicyAssignments", resourceVersion ?? "2024-03-01") + public RedisCacheAccessPolicyAssignment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/accessPolicyAssignments", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _accessPolicyName = BicepValue.DefineProperty(this, "AccessPolicyName", ["properties", "accessPolicyName"]); @@ -178,9 +183,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisCacheAccessPolicyAssignment. /// - /// Name of the RedisCacheAccessPolicyAssignment. + /// + /// The the Bicep identifier name of the RedisCacheAccessPolicyAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisCacheAccessPolicyAssignment. /// The existing RedisCacheAccessPolicyAssignment resource. - public static RedisCacheAccessPolicyAssignment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisCacheAccessPolicyAssignment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisFirewallRule.cs index b17c3f6945cdf..75edd8c26330f 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisFirewallRule.cs @@ -58,10 +58,15 @@ public partial class RedisFirewallRule : Resource /// /// Creates a new RedisFirewallRule. /// - /// Name of the RedisFirewallRule. + /// + /// The the Bicep identifier name of the RedisFirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the RedisFirewallRule. - public RedisFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/firewallRules", resourceVersion ?? "2024-03-01") + public RedisFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/firewallRules", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIP = BicepValue.DefineProperty(this, "EndIP", ["properties", "endIP"], isRequired: true); @@ -165,11 +170,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisFirewallRule. /// - /// Name of the RedisFirewallRule. + /// + /// The the Bicep identifier name of the RedisFirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the RedisFirewallRule. /// The existing RedisFirewallRule resource. - public static RedisFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this RedisFirewallRule resource. diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisLinkedServerWithProperty.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisLinkedServerWithProperty.cs index 80a2a22adb94d..93ca179a30694 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisLinkedServerWithProperty.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisLinkedServerWithProperty.cs @@ -83,10 +83,15 @@ public partial class RedisLinkedServerWithProperty : Resource /// /// Creates a new RedisLinkedServerWithProperty. /// - /// Name of the RedisLinkedServerWithProperty. + /// + /// The the Bicep identifier name of the RedisLinkedServerWithProperty + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisLinkedServerWithProperty. - public RedisLinkedServerWithProperty(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/linkedServers", resourceVersion ?? "2024-03-01") + public RedisLinkedServerWithProperty(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/linkedServers", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _linkedRedisCacheId = BicepValue.DefineProperty(this, "LinkedRedisCacheId", ["properties", "linkedRedisCacheId"], isRequired: true); @@ -194,9 +199,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisLinkedServerWithProperty. /// - /// Name of the RedisLinkedServerWithProperty. + /// + /// The the Bicep identifier name of the RedisLinkedServerWithProperty + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisLinkedServerWithProperty. /// The existing RedisLinkedServerWithProperty resource. - public static RedisLinkedServerWithProperty FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisLinkedServerWithProperty FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPatchSchedule.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPatchSchedule.cs index 4734257f2f050..eee751450dc61 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPatchSchedule.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPatchSchedule.cs @@ -57,10 +57,15 @@ public partial class RedisPatchSchedule : Resource /// /// Creates a new RedisPatchSchedule. /// - /// Name of the RedisPatchSchedule. + /// + /// The the Bicep identifier name of the RedisPatchSchedule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the RedisPatchSchedule. - public RedisPatchSchedule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/patchSchedules", resourceVersion ?? "2024-03-01") + public RedisPatchSchedule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/patchSchedules", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _scheduleEntries = BicepList.DefineProperty(this, "ScheduleEntries", ["properties", "scheduleEntries"], isRequired: true); @@ -164,9 +169,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisPatchSchedule. /// - /// Name of the RedisPatchSchedule. + /// + /// The the Bicep identifier name of the RedisPatchSchedule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the RedisPatchSchedule. /// The existing RedisPatchSchedule resource. - public static RedisPatchSchedule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisPatchSchedule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPrivateEndpointConnection.cs index b6fb2224f3ad8..56de0a385ab81 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisPrivateEndpointConnection.cs @@ -64,10 +64,15 @@ public partial class RedisPrivateEndpointConnection : Resource /// /// Creates a new RedisPrivateEndpointConnection. /// - /// Name of the RedisPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the RedisPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisPrivateEndpointConnection. - public RedisPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis/privateEndpointConnections", resourceVersion ?? "2024-03-01") + public RedisPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis/privateEndpointConnections", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _redisPrivateLinkServiceConnectionState = BicepValue.DefineProperty(this, "RedisPrivateLinkServiceConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -137,9 +142,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisPrivateEndpointConnection. /// - /// Name of the RedisPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the RedisPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RedisPrivateEndpointConnection. /// The existing RedisPrivateEndpointConnection resource. - public static RedisPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisResource.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisResource.cs index 238826f849ffb..5c99b5900c355 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisResource.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Generated/RedisResource.cs @@ -214,10 +214,15 @@ public partial class RedisResource : Resource /// /// Creates a new RedisResource. /// - /// Name of the RedisResource. + /// + /// The the Bicep identifier name of the RedisResource resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the RedisResource. - public RedisResource(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Cache/redis", resourceVersion ?? "2024-03-01") + public RedisResource(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Cache/redis", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -343,11 +348,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing RedisResource. /// - /// Name of the RedisResource. + /// + /// The the Bicep identifier name of the RedisResource resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the RedisResource. /// The existing RedisResource resource. - public static RedisResource FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RedisResource FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this RedisResource resource. @@ -363,7 +373,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this RedisResource resource. public RedisAccessKeys GetKeys() => RedisAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); /// /// Creates a role assignment for a user-assigned identity that grants @@ -373,10 +383,10 @@ public RedisAccessKeys GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(RedisBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{RedisBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{RedisBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -389,13 +399,13 @@ public RoleAssignment CreateRoleAssignment(RedisBuiltInRole role, UserAssignedId /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(RedisBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{RedisBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(RedisBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{RedisBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.Search/api/Azure.Provisioning.Search.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Search/api/Azure.Provisioning.Search.netstandard2.0.cs index 9e77efe366fe6..81864730aca67 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/api/Azure.Provisioning.Search.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Search/api/Azure.Provisioning.Search.netstandard2.0.cs @@ -67,13 +67,13 @@ public SearchManagementRequestOptions() { } } public partial class SearchPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public SearchPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SearchPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Search.SearchService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Search.SearchPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Search.SearchPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_07_31_Preview; @@ -119,7 +119,7 @@ public enum SearchSemanticSearch } public partial class SearchService : Azure.Provisioning.Primitives.Resource { - public SearchService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SearchService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AuthOptions { get { throw null; } set { } } public Azure.Provisioning.BicepList DisabledDataExfiltrationOptions { get { throw null; } set { } } public Azure.Provisioning.BicepValue EncryptionWithCmk { get { throw null; } set { } } @@ -144,9 +144,9 @@ public partial class SearchService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StatusDetails { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Search.SearchBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Search.SearchBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Search.SearchBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.Search.SearchService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Search.SearchService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -268,13 +268,13 @@ public enum SearchServiceStatus } public partial class SharedSearchServicePrivateLink : Azure.Provisioning.Primitives.Resource { - public SharedSearchServicePrivateLink(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SharedSearchServicePrivateLink(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Search.SearchService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Search.SharedSearchServicePrivateLink FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Search.SharedSearchServicePrivateLink FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_07_31_Preview; diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchPrivateEndpointConnection.cs index 2e1bb6fc6e7ca..8d25aaa52e216 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchPrivateEndpointConnection.cs @@ -52,10 +52,15 @@ public partial class SearchPrivateEndpointConnection : Resource /// /// Creates a new SearchPrivateEndpointConnection. /// - /// Name of the SearchPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SearchPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SearchPrivateEndpointConnection. - public SearchPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Search/searchServices/privateEndpointConnections", resourceVersion ?? "2023-11-01") + public SearchPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Search/searchServices/privateEndpointConnections", resourceVersion ?? "2023-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"]); @@ -138,9 +143,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SearchPrivateEndpointConnection. /// - /// Name of the SearchPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SearchPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SearchPrivateEndpointConnection. /// The existing SearchPrivateEndpointConnection resource. - public static SearchPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SearchPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchService.cs b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchService.cs index a2a7bb5123a9a..5831261a18043 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchService.cs +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SearchService.cs @@ -240,10 +240,15 @@ public partial class SearchService : Resource /// /// Creates a new SearchService. /// - /// Name of the SearchService. + /// + /// The the Bicep identifier name of the SearchService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SearchService. - public SearchService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Search/searchServices", resourceVersion ?? "2023-11-01") + public SearchService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Search/searchServices", resourceVersion ?? "2023-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -345,11 +350,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SearchService. /// - /// Name of the SearchService. + /// + /// The the Bicep identifier name of the SearchService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SearchService. /// The existing SearchService resource. - public static SearchService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SearchService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SearchService resource. @@ -367,10 +377,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(SearchBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{SearchBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{SearchBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -383,13 +393,13 @@ public RoleAssignment CreateRoleAssignment(SearchBuiltInRole role, UserAssignedI /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(SearchBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{SearchBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(SearchBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{SearchBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SharedSearchServicePrivateLink.cs b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SharedSearchServicePrivateLink.cs index 7ccc50acbedca..f10c3738258d3 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SharedSearchServicePrivateLink.cs +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Generated/SharedSearchServicePrivateLink.cs @@ -52,10 +52,15 @@ public partial class SharedSearchServicePrivateLink : Resource /// /// Creates a new SharedSearchServicePrivateLink. /// - /// Name of the SharedSearchServicePrivateLink. + /// + /// The the Bicep identifier name of the SharedSearchServicePrivateLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SharedSearchServicePrivateLink. - public SharedSearchServicePrivateLink(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Search/searchServices/sharedPrivateLinkResources", resourceVersion ?? "2023-11-01") + public SharedSearchServicePrivateLink(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Search/searchServices/sharedPrivateLinkResources", resourceVersion ?? "2023-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"]); @@ -138,9 +143,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SharedSearchServicePrivateLink. /// - /// Name of the SharedSearchServicePrivateLink. + /// + /// The the Bicep identifier name of the SharedSearchServicePrivateLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SharedSearchServicePrivateLink. /// The existing SharedSearchServicePrivateLink resource. - public static SharedSearchServicePrivateLink FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SharedSearchServicePrivateLink FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/api/Azure.Provisioning.ServiceBus.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/api/Azure.Provisioning.ServiceBus.netstandard2.0.cs index 0251a485dc9c8..0fabe71c856c7 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/api/Azure.Provisioning.ServiceBus.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/api/Azure.Provisioning.ServiceBus.netstandard2.0.cs @@ -11,7 +11,7 @@ public MessageCountDetails() { } } public partial class MigrationConfiguration : Azure.Provisioning.Primitives.Resource { - public MigrationConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public MigrationConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue MigrationState { get { throw null; } } @@ -21,7 +21,7 @@ public partial class MigrationConfiguration : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TargetServiceBusNamespace { get { throw null; } set { } } - public static Azure.Provisioning.ServiceBus.MigrationConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.MigrationConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_01; @@ -97,7 +97,7 @@ public ServiceBusCorrelationFilter() { } } public partial class ServiceBusDisasterRecovery : Azure.Provisioning.Primitives.Resource { - public ServiceBusDisasterRecovery(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusDisasterRecovery(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AlternateName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -108,7 +108,7 @@ public partial class ServiceBusDisasterRecovery : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue Role { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusDisasterRecovery FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusDisasterRecovery FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -185,7 +185,7 @@ public enum ServiceBusMinimumTlsVersion } public partial class ServiceBusNamespace : Azure.Provisioning.Primitives.Resource { - public ServiceBusNamespace(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusNamespace(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AlternateName { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue DisableLocalAuth { get { throw null; } set { } } @@ -207,9 +207,9 @@ public partial class ServiceBusNamespace : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ServiceBus.ServiceBusBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ServiceBus.ServiceBusBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.ServiceBus.ServiceBusBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.ServiceBus.ServiceBusNamespace FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusNamespace FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -223,14 +223,14 @@ public static partial class ResourceVersions } public partial class ServiceBusNamespaceAuthorizationRule : Azure.Provisioning.Primitives.Resource { - public ServiceBusNamespaceAuthorizationRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusNamespaceAuthorizationRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.ServiceBus.ServiceBusNamespace? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rights { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusNamespaceAuthorizationRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusNamespaceAuthorizationRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.ServiceBus.ServiceBusAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -247,7 +247,7 @@ public enum ServiceBusNetworkRuleIPAction } public partial class ServiceBusNetworkRuleSet : Azure.Provisioning.Primitives.Resource { - public ServiceBusNetworkRuleSet(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusNetworkRuleSet(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DefaultAction { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList IPRules { get { throw null; } set { } } @@ -258,7 +258,7 @@ public partial class ServiceBusNetworkRuleSet : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue PublicNetworkAccess { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList VirtualNetworkRules { get { throw null; } set { } } - public static Azure.Provisioning.ServiceBus.ServiceBusNetworkRuleSet FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusNetworkRuleSet FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_01; @@ -285,7 +285,7 @@ public ServiceBusNetworkRuleSetVirtualNetworkRules() { } } public partial class ServiceBusPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public ServiceBusPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -294,7 +294,7 @@ public partial class ServiceBusPrivateEndpointConnection : Azure.Provisioning.Pr public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -347,7 +347,7 @@ public enum ServiceBusPublicNetworkAccessFlag } public partial class ServiceBusQueue : Azure.Provisioning.Primitives.Resource { - public ServiceBusQueue(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusQueue(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessedOn { get { throw null; } } public Azure.Provisioning.BicepValue AutoDeleteOnIdle { get { throw null; } set { } } public Azure.Provisioning.BicepValue CountDetails { get { throw null; } } @@ -375,7 +375,7 @@ public partial class ServiceBusQueue : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusQueue FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusQueue FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -387,14 +387,14 @@ public static partial class ResourceVersions } public partial class ServiceBusQueueAuthorizationRule : Azure.Provisioning.Primitives.Resource { - public ServiceBusQueueAuthorizationRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusQueueAuthorizationRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.ServiceBus.ServiceBusQueue? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rights { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusQueueAuthorizationRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusQueueAuthorizationRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.ServiceBus.ServiceBusAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -407,7 +407,7 @@ public static partial class ResourceVersions } public partial class ServiceBusRule : Azure.Provisioning.Primitives.Resource { - public ServiceBusRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Action { get { throw null; } set { } } public Azure.Provisioning.BicepValue CorrelationFilter { get { throw null; } set { } } public Azure.Provisioning.BicepValue FilterType { get { throw null; } set { } } @@ -417,7 +417,7 @@ public partial class ServiceBusRule : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.ServiceBus.ServiceBusSubscription? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SqlFilter { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_04_01; @@ -453,7 +453,7 @@ public ServiceBusSqlFilter() { } } public partial class ServiceBusSubscription : Azure.Provisioning.Primitives.Resource { - public ServiceBusSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessedOn { get { throw null; } } public Azure.Provisioning.BicepValue AutoDeleteOnIdle { get { throw null; } set { } } public Azure.Provisioning.BicepValue ClientAffineProperties { get { throw null; } set { } } @@ -478,7 +478,7 @@ public partial class ServiceBusSubscription : Azure.Provisioning.Primitives.Reso public Azure.Provisioning.BicepValue Status { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -490,7 +490,7 @@ public static partial class ResourceVersions } public partial class ServiceBusTopic : Azure.Provisioning.Primitives.Resource { - public ServiceBusTopic(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusTopic(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessedOn { get { throw null; } } public Azure.Provisioning.BicepValue AutoDeleteOnIdle { get { throw null; } set { } } public Azure.Provisioning.BicepValue CountDetails { get { throw null; } } @@ -513,7 +513,7 @@ public partial class ServiceBusTopic : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SupportOrdering { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusTopic FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusTopic FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -525,14 +525,14 @@ public static partial class ResourceVersions } public partial class ServiceBusTopicAuthorizationRule : Azure.Provisioning.Primitives.Resource { - public ServiceBusTopicAuthorizationRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServiceBusTopicAuthorizationRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.ServiceBus.ServiceBusTopic? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rights { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.ServiceBus.ServiceBusTopicAuthorizationRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.ServiceBus.ServiceBusTopicAuthorizationRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.ServiceBus.ServiceBusAccessKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/MigrationConfiguration.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/MigrationConfiguration.cs index d3ec2efbaecd7..f7ed38c742381 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/MigrationConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/MigrationConfiguration.cs @@ -83,10 +83,15 @@ public partial class MigrationConfiguration : Resource /// /// Creates a new MigrationConfiguration. /// - /// Name of the MigrationConfiguration. + /// + /// The the Bicep identifier name of the MigrationConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MigrationConfiguration. - public MigrationConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/migrationConfigurations", resourceVersion ?? "2024-01-01") + public MigrationConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/migrationConfigurations", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true, defaultValue: GetNameDefaultValue()); _postMigrationName = BicepValue.DefineProperty(this, "PostMigrationName", ["properties", "postMigrationName"]); @@ -124,9 +129,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing MigrationConfiguration. /// - /// Name of the MigrationConfiguration. + /// + /// The the Bicep identifier name of the MigrationConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the MigrationConfiguration. /// The existing MigrationConfiguration resource. - public static MigrationConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static MigrationConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusDisasterRecovery.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusDisasterRecovery.cs index fac02b9de6c41..9df5b691db08a 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusDisasterRecovery.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusDisasterRecovery.cs @@ -86,10 +86,15 @@ public partial class ServiceBusDisasterRecovery : Resource /// /// Creates a new ServiceBusDisasterRecovery. /// - /// Name of the ServiceBusDisasterRecovery. + /// + /// The the Bicep identifier name of the ServiceBusDisasterRecovery + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusDisasterRecovery. - public ServiceBusDisasterRecovery(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/disasterRecoveryConfigs", resourceVersion ?? "2024-01-01") + public ServiceBusDisasterRecovery(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/disasterRecoveryConfigs", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _alternateName = BicepValue.DefineProperty(this, "AlternateName", ["properties", "alternateName"]); @@ -127,11 +132,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusDisasterRecovery. /// - /// Name of the ServiceBusDisasterRecovery. + /// + /// The the Bicep identifier name of the ServiceBusDisasterRecovery + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusDisasterRecovery. /// The existing ServiceBusDisasterRecovery resource. - public static ServiceBusDisasterRecovery FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusDisasterRecovery FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusDisasterRecovery diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespace.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespace.cs index 364a15bf6f126..e26b0b6b65518 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespace.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespace.cs @@ -156,10 +156,15 @@ public partial class ServiceBusNamespace : Resource /// /// Creates a new ServiceBusNamespace. /// - /// Name of the ServiceBusNamespace. + /// + /// The the Bicep identifier name of the ServiceBusNamespace resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusNamespace. - public ServiceBusNamespace(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces", resourceVersion ?? "2024-01-01") + public ServiceBusNamespace(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -218,11 +223,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusNamespace. /// - /// Name of the ServiceBusNamespace. + /// + /// The the Bicep identifier name of the ServiceBusNamespace resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusNamespace. /// The existing ServiceBusNamespace resource. - public static ServiceBusNamespace FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusNamespace FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusNamespace resource. @@ -240,10 +250,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(ServiceBusBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{ServiceBusBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{ServiceBusBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -256,13 +266,13 @@ public RoleAssignment CreateRoleAssignment(ServiceBusBuiltInRole role, UserAssig /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(ServiceBusBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{ServiceBusBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(ServiceBusBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{ServiceBusBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespaceAuthorizationRule.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespaceAuthorizationRule.cs index 59fff4e4ca6d3..7de1e436422ac 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespaceAuthorizationRule.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNamespaceAuthorizationRule.cs @@ -59,10 +59,15 @@ public partial class ServiceBusNamespaceAuthorizationRule : Resource /// /// Creates a new ServiceBusNamespaceAuthorizationRule. /// - /// Name of the ServiceBusNamespaceAuthorizationRule. + /// + /// The the Bicep identifier name of the + /// ServiceBusNamespaceAuthorizationRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ServiceBusNamespaceAuthorizationRule. - public ServiceBusNamespaceAuthorizationRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/AuthorizationRules", resourceVersion ?? "2024-01-01") + public ServiceBusNamespaceAuthorizationRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/AuthorizationRules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _rights = BicepList.DefineProperty(this, "Rights", ["properties", "rights"]); @@ -96,11 +101,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusNamespaceAuthorizationRule. /// - /// Name of the ServiceBusNamespaceAuthorizationRule. + /// + /// The the Bicep identifier name of the + /// ServiceBusNamespaceAuthorizationRule resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ServiceBusNamespaceAuthorizationRule. /// The existing ServiceBusNamespaceAuthorizationRule resource. - public static ServiceBusNamespaceAuthorizationRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusNamespaceAuthorizationRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this @@ -117,5 +127,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this ServiceBusNamespaceAuthorizationRule resource. public ServiceBusAccessKeys GetKeys() => ServiceBusAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNetworkRuleSet.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNetworkRuleSet.cs index d0db9597c02f3..509b9117ebe93 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNetworkRuleSet.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusNetworkRuleSet.cs @@ -82,10 +82,15 @@ public partial class ServiceBusNetworkRuleSet : Resource /// /// Creates a new ServiceBusNetworkRuleSet. /// - /// Name of the ServiceBusNetworkRuleSet. + /// + /// The the Bicep identifier name of the ServiceBusNetworkRuleSet resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusNetworkRuleSet. - public ServiceBusNetworkRuleSet(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/networkRuleSets", resourceVersion ?? "2024-01-01") + public ServiceBusNetworkRuleSet(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/networkRuleSets", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _defaultAction = BicepValue.DefineProperty(this, "DefaultAction", ["properties", "defaultAction"]); @@ -123,9 +128,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusNetworkRuleSet. /// - /// Name of the ServiceBusNetworkRuleSet. + /// + /// The the Bicep identifier name of the ServiceBusNetworkRuleSet resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusNetworkRuleSet. /// The existing ServiceBusNetworkRuleSet resource. - public static ServiceBusNetworkRuleSet FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusNetworkRuleSet FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusPrivateEndpointConnection.cs index a9bd5d384917b..47d03d49688f8 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusPrivateEndpointConnection.cs @@ -68,10 +68,15 @@ public partial class ServiceBusPrivateEndpointConnection : Resource /// /// Creates a new ServiceBusPrivateEndpointConnection. /// - /// Name of the ServiceBusPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ServiceBusPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ServiceBusPrivateEndpointConnection. - public ServiceBusPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/privateEndpointConnections", resourceVersion ?? "2024-01-01") + public ServiceBusPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/privateEndpointConnections", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -102,9 +107,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusPrivateEndpointConnection. /// - /// Name of the ServiceBusPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ServiceBusPrivateEndpointConnection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ServiceBusPrivateEndpointConnection. /// The existing ServiceBusPrivateEndpointConnection resource. - public static ServiceBusPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueue.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueue.cs index 4adaa04927c7f..8f931411073fc 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueue.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueue.cs @@ -199,10 +199,15 @@ public partial class ServiceBusQueue : Resource /// /// Creates a new ServiceBusQueue. /// - /// Name of the ServiceBusQueue. + /// + /// The the Bicep identifier name of the ServiceBusQueue resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ServiceBusQueue. - public ServiceBusQueue(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/queues", resourceVersion ?? "2024-01-01") + public ServiceBusQueue(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/queues", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _autoDeleteOnIdle = BicepValue.DefineProperty(this, "AutoDeleteOnIdle", ["properties", "autoDeleteOnIdle"]); @@ -257,11 +262,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusQueue. /// - /// Name of the ServiceBusQueue. + /// + /// The the Bicep identifier name of the ServiceBusQueue resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ServiceBusQueue. /// The existing ServiceBusQueue resource. - public static ServiceBusQueue FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusQueue FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusQueue resource. diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueueAuthorizationRule.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueueAuthorizationRule.cs index 54f6c6dd0d1d1..19d9f3debcd71 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueueAuthorizationRule.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusQueueAuthorizationRule.cs @@ -59,10 +59,15 @@ public partial class ServiceBusQueueAuthorizationRule : Resource /// /// Creates a new ServiceBusQueueAuthorizationRule. /// - /// Name of the ServiceBusQueueAuthorizationRule. + /// + /// The the Bicep identifier name of the ServiceBusQueueAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusQueueAuthorizationRule. - public ServiceBusQueueAuthorizationRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/queues/authorizationRules", resourceVersion ?? "2024-01-01") + public ServiceBusQueueAuthorizationRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/queues/authorizationRules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _rights = BicepList.DefineProperty(this, "Rights", ["properties", "rights"]); @@ -96,11 +101,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusQueueAuthorizationRule. /// - /// Name of the ServiceBusQueueAuthorizationRule. + /// + /// The the Bicep identifier name of the ServiceBusQueueAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusQueueAuthorizationRule. /// The existing ServiceBusQueueAuthorizationRule resource. - public static ServiceBusQueueAuthorizationRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusQueueAuthorizationRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusQueueAuthorizationRule @@ -117,5 +127,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this ServiceBusQueueAuthorizationRule resource. public ServiceBusAccessKeys GetKeys() => ServiceBusAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusRule.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusRule.cs index 5b61b1b49af0e..b78ef7d203952 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusRule.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusRule.cs @@ -76,10 +76,15 @@ public partial class ServiceBusRule : Resource /// /// Creates a new ServiceBusRule. /// - /// Name of the ServiceBusRule. + /// + /// The the Bicep identifier name of the ServiceBusRule resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ServiceBusRule. - public ServiceBusRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules", resourceVersion ?? "2024-01-01") + public ServiceBusRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _action = BicepValue.DefineProperty(this, "Action", ["properties", "action"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusRule. /// - /// Name of the ServiceBusRule. + /// + /// The the Bicep identifier name of the ServiceBusRule resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ServiceBusRule. /// The existing ServiceBusRule resource. - public static ServiceBusRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusSubscription.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusSubscription.cs index 49244de48fd10..e00478b645d61 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusSubscription.cs @@ -174,10 +174,15 @@ public partial class ServiceBusSubscription : Resource /// /// Creates a new ServiceBusSubscription. /// - /// Name of the ServiceBusSubscription. + /// + /// The the Bicep identifier name of the ServiceBusSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusSubscription. - public ServiceBusSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/topics/subscriptions", resourceVersion ?? "2024-01-01") + public ServiceBusSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/topics/subscriptions", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _autoDeleteOnIdle = BicepValue.DefineProperty(this, "AutoDeleteOnIdle", ["properties", "autoDeleteOnIdle"]); @@ -229,11 +234,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusSubscription. /// - /// Name of the ServiceBusSubscription. + /// + /// The the Bicep identifier name of the ServiceBusSubscription resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ServiceBusSubscription. /// The existing ServiceBusSubscription resource. - public static ServiceBusSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusSubscription resource. diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopic.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopic.cs index d60e4c159be38..3706b73086259 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopic.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopic.cs @@ -164,10 +164,15 @@ public partial class ServiceBusTopic : Resource /// /// Creates a new ServiceBusTopic. /// - /// Name of the ServiceBusTopic. + /// + /// The the Bicep identifier name of the ServiceBusTopic resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ServiceBusTopic. - public ServiceBusTopic(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/topics", resourceVersion ?? "2024-01-01") + public ServiceBusTopic(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/topics", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _autoDeleteOnIdle = BicepValue.DefineProperty(this, "AutoDeleteOnIdle", ["properties", "autoDeleteOnIdle"]); @@ -217,11 +222,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusTopic. /// - /// Name of the ServiceBusTopic. + /// + /// The the Bicep identifier name of the ServiceBusTopic resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ServiceBusTopic. /// The existing ServiceBusTopic resource. - public static ServiceBusTopic FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusTopic FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusTopic resource. diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopicAuthorizationRule.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopicAuthorizationRule.cs index 1965f1b5b4aba..5c5a783c785f6 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopicAuthorizationRule.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Generated/ServiceBusTopicAuthorizationRule.cs @@ -59,10 +59,15 @@ public partial class ServiceBusTopicAuthorizationRule : Resource /// /// Creates a new ServiceBusTopicAuthorizationRule. /// - /// Name of the ServiceBusTopicAuthorizationRule. + /// + /// The the Bicep identifier name of the ServiceBusTopicAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusTopicAuthorizationRule. - public ServiceBusTopicAuthorizationRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ServiceBus/namespaces/topics/authorizationRules", resourceVersion ?? "2024-01-01") + public ServiceBusTopicAuthorizationRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ServiceBus/namespaces/topics/authorizationRules", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _rights = BicepList.DefineProperty(this, "Rights", ["properties", "rights"]); @@ -96,11 +101,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServiceBusTopicAuthorizationRule. /// - /// Name of the ServiceBusTopicAuthorizationRule. + /// + /// The the Bicep identifier name of the ServiceBusTopicAuthorizationRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServiceBusTopicAuthorizationRule. /// The existing ServiceBusTopicAuthorizationRule resource. - public static ServiceBusTopicAuthorizationRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServiceBusTopicAuthorizationRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ServiceBusTopicAuthorizationRule @@ -117,5 +127,5 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this ServiceBusTopicAuthorizationRule resource. public ServiceBusAccessKeys GetKeys() => ServiceBusAccessKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/api/Azure.Provisioning.SignalR.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.SignalR/api/Azure.Provisioning.SignalR.netstandard2.0.cs index 617bf1138d579..245c2279ff8e2 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/api/Azure.Provisioning.SignalR.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/api/Azure.Provisioning.SignalR.netstandard2.0.cs @@ -33,7 +33,7 @@ public enum PrivateLinkServiceConnectionStatus } public partial class SignalRCustomCertificate : Azure.Provisioning.Primitives.Resource { - public SignalRCustomCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SignalRCustomCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue KeyVaultBaseUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue KeyVaultSecretName { get { throw null; } set { } } @@ -42,7 +42,7 @@ public partial class SignalRCustomCertificate : Azure.Provisioning.Primitives.Re public Azure.Provisioning.SignalR.SignalRService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.SignalR.SignalRCustomCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.SignalR.SignalRCustomCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_10_01; @@ -56,7 +56,7 @@ public static partial class ResourceVersions } public partial class SignalRCustomDomain : Azure.Provisioning.Primitives.Resource { - public SignalRCustomDomain(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SignalRCustomDomain(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CustomCertificateId { get { throw null; } set { } } public Azure.Provisioning.BicepValue DomainName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -64,7 +64,7 @@ public partial class SignalRCustomDomain : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.SignalR.SignalRService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.SignalR.SignalRCustomDomain FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.SignalR.SignalRCustomDomain FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_05_01; @@ -136,7 +136,7 @@ public SignalRPrivateEndpointAcl() { } } public partial class SignalRPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public SignalRPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SignalRPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -145,7 +145,7 @@ public partial class SignalRPrivateEndpointConnection : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.SignalR.SignalRPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.SignalR.SignalRPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_10_01; @@ -212,7 +212,7 @@ public SignalRResourceSku() { } } public partial class SignalRService : Azure.Provisioning.Primitives.Resource { - public SignalRService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SignalRService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList CorsAllowedOrigins { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisableAadAuth { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisableLocalAuth { get { throw null; } set { } } @@ -240,9 +240,9 @@ public partial class SignalRService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepList UpstreamTemplates { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.SignalR.SignalRBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.SignalR.SignalRBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.SignalR.SignalRBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.SignalR.SignalRService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.SignalR.SignalRService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.SignalR.SignalRKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -264,7 +264,7 @@ public enum SignalRServiceKind } public partial class SignalRSharedPrivateLink : Azure.Provisioning.Primitives.Resource { - public SignalRSharedPrivateLink(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SignalRSharedPrivateLink(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue GroupId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -274,7 +274,7 @@ public partial class SignalRSharedPrivateLink : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue RequestMessage { get { throw null; } set { } } public Azure.Provisioning.BicepValue Status { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.SignalR.SignalRSharedPrivateLink FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.SignalR.SignalRSharedPrivateLink FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_10_01; diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomCertificate.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomCertificate.cs index cce8884aa69ae..4d9f2420ca24b 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomCertificate.cs @@ -68,10 +68,15 @@ public partial class SignalRCustomCertificate : Resource /// /// Creates a new SignalRCustomCertificate. /// - /// Name of the SignalRCustomCertificate. + /// + /// The the Bicep identifier name of the SignalRCustomCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRCustomCertificate. - public SignalRCustomCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/signalR/customCertificates", resourceVersion ?? "2024-03-01") + public SignalRCustomCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/signalR/customCertificates", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _keyVaultBaseUri = BicepValue.DefineProperty(this, "KeyVaultBaseUri", ["properties", "keyVaultBaseUri"], isRequired: true); @@ -127,9 +132,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SignalRCustomCertificate. /// - /// Name of the SignalRCustomCertificate. + /// + /// The the Bicep identifier name of the SignalRCustomCertificate resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRCustomCertificate. /// The existing SignalRCustomCertificate resource. - public static SignalRCustomCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SignalRCustomCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomDomain.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomDomain.cs index d2563a638b111..30db0d804cc33 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomDomain.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRCustomDomain.cs @@ -62,10 +62,15 @@ public partial class SignalRCustomDomain : Resource /// /// Creates a new SignalRCustomDomain. /// - /// Name of the SignalRCustomDomain. + /// + /// The the Bicep identifier name of the SignalRCustomDomain resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRCustomDomain. - public SignalRCustomDomain(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/signalR/customDomains", resourceVersion ?? "2024-03-01") + public SignalRCustomDomain(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/signalR/customDomains", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _domainName = BicepValue.DefineProperty(this, "DomainName", ["properties", "domainName"], isRequired: true); @@ -115,9 +120,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SignalRCustomDomain. /// - /// Name of the SignalRCustomDomain. + /// + /// The the Bicep identifier name of the SignalRCustomDomain resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRCustomDomain. /// The existing SignalRCustomDomain resource. - public static SignalRCustomDomain FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SignalRCustomDomain FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRPrivateEndpointConnection.cs index 992326ecb7952..41443aaa71b6e 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRPrivateEndpointConnection.cs @@ -69,10 +69,15 @@ public partial class SignalRPrivateEndpointConnection : Resource /// /// Creates a new SignalRPrivateEndpointConnection. /// - /// Name of the SignalRPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SignalRPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SignalRPrivateEndpointConnection. - public SignalRPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/signalR/privateEndpointConnections", resourceVersion ?? "2024-03-01") + public SignalRPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/signalR/privateEndpointConnections", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -128,9 +133,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SignalRPrivateEndpointConnection. /// - /// Name of the SignalRPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SignalRPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SignalRPrivateEndpointConnection. /// The existing SignalRPrivateEndpointConnection resource. - public static SignalRPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SignalRPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRService.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRService.cs index ca72b16df2462..8bc1047392eee 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRService.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRService.cs @@ -207,10 +207,15 @@ public partial class SignalRService : Resource /// /// Creates a new SignalRService. /// - /// Name of the SignalRService. + /// + /// The the Bicep identifier name of the SignalRService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SignalRService. - public SignalRService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/signalR", resourceVersion ?? "2024-03-01") + public SignalRService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/signalR", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -285,11 +290,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SignalRService. /// - /// Name of the SignalRService. + /// + /// The the Bicep identifier name of the SignalRService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SignalRService. /// The existing SignalRService resource. - public static SignalRService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SignalRService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SignalRService resource. @@ -305,7 +315,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this SignalRService resource. public SignalRKeys GetKeys() => SignalRKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); /// /// Creates a role assignment for a user-assigned identity that grants @@ -315,10 +325,10 @@ public SignalRKeys GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(SignalRBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{SignalRBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{SignalRBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -331,13 +341,13 @@ public RoleAssignment CreateRoleAssignment(SignalRBuiltInRole role, UserAssigned /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(SignalRBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{SignalRBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(SignalRBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{SignalRBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRSharedPrivateLink.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRSharedPrivateLink.cs index 0d9e1cfe4f0b7..909e48817f927 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRSharedPrivateLink.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Generated/SignalRSharedPrivateLink.cs @@ -76,10 +76,15 @@ public partial class SignalRSharedPrivateLink : Resource /// /// Creates a new SignalRSharedPrivateLink. /// - /// Name of the SignalRSharedPrivateLink. + /// + /// The the Bicep identifier name of the SignalRSharedPrivateLink resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRSharedPrivateLink. - public SignalRSharedPrivateLink(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/signalR/sharedPrivateLinkResources", resourceVersion ?? "2024-03-01") + public SignalRSharedPrivateLink(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/signalR/sharedPrivateLinkResources", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _groupId = BicepValue.DefineProperty(this, "GroupId", ["properties", "groupId"]); @@ -136,9 +141,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SignalRSharedPrivateLink. /// - /// Name of the SignalRSharedPrivateLink. + /// + /// The the Bicep identifier name of the SignalRSharedPrivateLink resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SignalRSharedPrivateLink. /// The existing SignalRSharedPrivateLink resource. - public static SignalRSharedPrivateLink FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SignalRSharedPrivateLink FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/api/Azure.Provisioning.Sql.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Sql/api/Azure.Provisioning.Sql.netstandard2.0.cs index fe8b9bcffaebd..22fb281e01728 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/api/Azure.Provisioning.Sql.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/api/Azure.Provisioning.Sql.netstandard2.0.cs @@ -16,14 +16,14 @@ public enum AuthenticationName } public partial class BackupShortTermRetentionPolicy : Azure.Provisioning.Primitives.Resource { - public BackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public BackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DiffBackupIntervalInHours { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue RetentionDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.BackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.BackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -59,14 +59,14 @@ public CreateDatabaseRestorePointDefinition() { } } public partial class DatabaseAdvancedThreatProtection : Azure.Provisioning.Primitives.Resource { - public DatabaseAdvancedThreatProtection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DatabaseAdvancedThreatProtection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.DatabaseAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.DatabaseAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -102,7 +102,7 @@ public DatabaseVulnerabilityAssessmentRuleBaselineItem() { } } public partial class DataMaskingPolicy : Azure.Provisioning.Primitives.Resource { - public DataMaskingPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DataMaskingPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationPrincipals { get { throw null; } } public Azure.Provisioning.BicepValue DataMaskingState { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExemptPrincipals { get { throw null; } set { } } @@ -113,7 +113,7 @@ public partial class DataMaskingPolicy : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.DataMaskingPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.DataMaskingPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -129,7 +129,7 @@ public enum DataMaskingState } public partial class DistributedAvailabilityGroup : Azure.Provisioning.Primitives.Resource { - public DistributedAvailabilityGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public DistributedAvailabilityGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DistributedAvailabilityGroupId { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LastHardenedLsn { get { throw null; } } @@ -144,7 +144,7 @@ public partial class DistributedAvailabilityGroup : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TargetDatabase { get { throw null; } set { } } public Azure.Provisioning.BicepValue TargetReplicaId { get { throw null; } } - public static Azure.Provisioning.Sql.DistributedAvailabilityGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.DistributedAvailabilityGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -163,7 +163,7 @@ public enum DtcName } public partial class ElasticPool : Azure.Provisioning.Primitives.Resource { - public ElasticPool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ElasticPool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AvailabilityZone { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue HighAvailabilityReplicaCount { get { throw null; } set { } } @@ -183,7 +183,7 @@ public partial class ElasticPool : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ElasticPool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ElasticPool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -214,7 +214,7 @@ public enum ElasticPoolState } public partial class EncryptionProtector : Azure.Provisioning.Primitives.Resource { - public EncryptionProtector(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EncryptionProtector(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAutoRotationEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } @@ -227,7 +227,7 @@ public partial class EncryptionProtector : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Thumbprint { get { throw null; } } public Azure.Provisioning.BicepValue Uri { get { throw null; } } - public static Azure.Provisioning.Sql.EncryptionProtector FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.EncryptionProtector FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -241,7 +241,7 @@ public enum EncryptionProtectorName } public partial class ExtendedDatabaseBlobAuditingPolicy : Azure.Provisioning.Primitives.Resource { - public ExtendedDatabaseBlobAuditingPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ExtendedDatabaseBlobAuditingPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AuditActionsAndGroups { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureMonitorTargetEnabled { get { throw null; } set { } } @@ -257,7 +257,7 @@ public partial class ExtendedDatabaseBlobAuditingPolicy : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue StorageAccountSubscriptionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ExtendedDatabaseBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ExtendedDatabaseBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -269,7 +269,7 @@ public static partial class ResourceVersions } public partial class ExtendedServerBlobAuditingPolicy : Azure.Provisioning.Primitives.Resource { - public ExtendedServerBlobAuditingPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ExtendedServerBlobAuditingPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AuditActionsAndGroups { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureMonitorTargetEnabled { get { throw null; } set { } } @@ -286,7 +286,7 @@ public partial class ExtendedServerBlobAuditingPolicy : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue StorageAccountSubscriptionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ExtendedServerBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ExtendedServerBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -300,7 +300,7 @@ public enum ExternalGovernanceStatus } public partial class FailoverGroup : Azure.Provisioning.Primitives.Resource { - public FailoverGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public FailoverGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList FailoverDatabases { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -313,7 +313,7 @@ public partial class FailoverGroup : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ReplicationState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Sql.FailoverGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.FailoverGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -346,7 +346,7 @@ public enum FreeLimitExhaustionBehavior } public partial class GeoBackupPolicy : Azure.Provisioning.Primitives.Resource { - public GeoBackupPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GeoBackupPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -355,7 +355,7 @@ public partial class GeoBackupPolicy : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageType { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.GeoBackupPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.GeoBackupPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -380,7 +380,7 @@ public enum GeoSecondaryInstanceType } public partial class InstanceFailoverGroup : Azure.Provisioning.Primitives.Resource { - public InstanceFailoverGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public InstanceFailoverGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList ManagedInstancePairs { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -391,7 +391,7 @@ public partial class InstanceFailoverGroup : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue ReplicationState { get { throw null; } } public Azure.Provisioning.BicepValue SecondaryType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.InstanceFailoverGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.InstanceFailoverGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -411,7 +411,7 @@ public enum InstanceFailoverGroupReplicationRole } public partial class InstancePool : Azure.Provisioning.Primitives.Resource { - public InstancePool(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public InstancePool(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DnsZone { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LicenseType { get { throw null; } set { } } @@ -423,7 +423,7 @@ public partial class InstancePool : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue VCores { get { throw null; } set { } } - public static Azure.Provisioning.Sql.InstancePool FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.InstancePool FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -437,13 +437,13 @@ public enum InstancePoolLicenseType } public partial class IPv6FirewallRule : Azure.Provisioning.Primitives.Resource { - public IPv6FirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public IPv6FirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIPv6Address { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartIPv6Address { get { throw null; } set { } } - public static Azure.Provisioning.Sql.IPv6FirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.IPv6FirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -554,14 +554,14 @@ public enum JobTargetType } public partial class LedgerDigestUpload : Azure.Provisioning.Primitives.Resource { - public LedgerDigestUpload(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LedgerDigestUpload(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DigestStorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.LedgerDigestUpload FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.LedgerDigestUpload FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -580,13 +580,13 @@ public enum LedgerDigestUploadsState } public partial class LogicalDatabaseTransparentDataEncryption : Azure.Provisioning.Primitives.Resource { - public LogicalDatabaseTransparentDataEncryption(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LogicalDatabaseTransparentDataEncryption(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.LogicalDatabaseTransparentDataEncryption FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.LogicalDatabaseTransparentDataEncryption FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_04_01; @@ -596,7 +596,7 @@ public static partial class ResourceVersions } public partial class LongTermRetentionPolicy : Azure.Provisioning.Primitives.Resource { - public LongTermRetentionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public LongTermRetentionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue BackupStorageAccessTier { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue MakeBackupsImmutable { get { throw null; } set { } } @@ -607,7 +607,7 @@ public partial class LongTermRetentionPolicy : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue WeeklyRetention { get { throw null; } set { } } public Azure.Provisioning.BicepValue WeekOfYear { get { throw null; } set { } } public Azure.Provisioning.BicepValue YearlyRetention { get { throw null; } set { } } - public static Azure.Provisioning.Sql.LongTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.LongTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -621,13 +621,13 @@ public enum LongTermRetentionPolicyName } public partial class ManagedBackupShortTermRetentionPolicy : Azure.Provisioning.Primitives.Resource { - public ManagedBackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedBackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue RetentionDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedBackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedBackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -636,7 +636,7 @@ public static partial class ResourceVersions } public partial class ManagedDatabase : Azure.Provisioning.Primitives.Resource { - public ManagedDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowAutoCompleteRestore { get { throw null; } set { } } public Azure.Provisioning.BicepValue CatalogCollation { get { throw null; } set { } } public Azure.Provisioning.BicepValue Collation { get { throw null; } set { } } @@ -665,7 +665,7 @@ public partial class ManagedDatabase : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StorageContainerUri { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -674,14 +674,14 @@ public static partial class ResourceVersions } public partial class ManagedDatabaseAdvancedThreatProtection : Azure.Provisioning.Primitives.Resource { - public ManagedDatabaseAdvancedThreatProtection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabaseAdvancedThreatProtection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedDatabaseAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabaseAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -697,7 +697,7 @@ public enum ManagedDatabaseCreateMode } public partial class ManagedDatabaseSecurityAlertPolicy : Azure.Provisioning.Primitives.Resource { - public ManagedDatabaseSecurityAlertPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabaseSecurityAlertPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList DisabledAlerts { get { throw null; } set { } } public Azure.Provisioning.BicepList EmailAddresses { get { throw null; } set { } } @@ -710,7 +710,7 @@ public partial class ManagedDatabaseSecurityAlertPolicy : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue StorageAccountAccessKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedDatabaseSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabaseSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -719,7 +719,7 @@ public static partial class ResourceVersions } public partial class ManagedDatabaseSensitivityLabel : Azure.Provisioning.Primitives.Resource { - public ManagedDatabaseSensitivityLabel(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabaseSensitivityLabel(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ColumnName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue InformationType { get { throw null; } set { } } @@ -733,7 +733,7 @@ public partial class ManagedDatabaseSensitivityLabel : Azure.Provisioning.Primit public Azure.Provisioning.BicepValue SchemaName { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TableName { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedDatabaseSensitivityLabel FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabaseSensitivityLabel FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum ManagedDatabaseStatus { @@ -754,7 +754,7 @@ public enum ManagedDatabaseStatus } public partial class ManagedDatabaseVulnerabilityAssessment : Azure.Provisioning.Primitives.Resource { - public ManagedDatabaseVulnerabilityAssessment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabaseVulnerabilityAssessment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedDatabase? Parent { get { throw null; } set { } } @@ -763,7 +763,7 @@ public partial class ManagedDatabaseVulnerabilityAssessment : Azure.Provisioning public Azure.Provisioning.BicepValue StorageContainerPath { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageContainerSasKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedDatabaseVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabaseVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -772,16 +772,16 @@ public static partial class ResourceVersions } public partial class ManagedDatabaseVulnerabilityAssessmentRuleBaseline : Azure.Provisioning.Primitives.Resource { - public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList BaselineResults { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class ManagedInstance : Azure.Provisioning.Primitives.Resource { - public ManagedInstance(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstance(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorLogin { get { throw null; } set { } } public Azure.Provisioning.BicepValue AdministratorLoginPassword { get { throw null; } set { } } public Azure.Provisioning.BicepValue Administrators { get { throw null; } set { } } @@ -818,7 +818,7 @@ public partial class ManagedInstance : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TimezoneId { get { throw null; } set { } } public Azure.Provisioning.BicepValue VCores { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedInstance FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstance FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -829,7 +829,7 @@ public static partial class ResourceVersions } public partial class ManagedInstanceAdministrator : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceAdministrator(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceAdministrator(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Login { get { throw null; } set { } } @@ -838,7 +838,7 @@ public partial class ManagedInstanceAdministrator : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue Sid { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedInstanceAdministrator FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceAdministrator FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -851,14 +851,14 @@ public enum ManagedInstanceAdministratorType } public partial class ManagedInstanceAdvancedThreatProtection : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceAdvancedThreatProtection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceAdvancedThreatProtection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -866,13 +866,13 @@ public static partial class ResourceVersions } public partial class ManagedInstanceAzureADOnlyAuthentication : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceAzureADOnlyAuthentication(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceAzureADOnlyAuthentication(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureADOnlyAuthenticationEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceAzureADOnlyAuthentication FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceAzureADOnlyAuthentication FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -881,7 +881,7 @@ public static partial class ResourceVersions } public partial class ManagedInstanceDtc : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceDtc(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceDtc(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DtcEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue DtcHostNameDnsSuffix { get { throw null; } } public Azure.Provisioning.BicepList ExternalDnsSuffixSearchList { get { throw null; } set { } } @@ -891,7 +891,7 @@ public partial class ManagedInstanceDtc : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SecuritySettings { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceDtc FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceDtc FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -916,7 +916,7 @@ public ManagedInstanceDtcTransactionManagerCommunicationSettings() { } } public partial class ManagedInstanceEncryptionProtector : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceEncryptionProtector(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceEncryptionProtector(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAutoRotationEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } @@ -927,7 +927,7 @@ public partial class ManagedInstanceEncryptionProtector : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Thumbprint { get { throw null; } } public Azure.Provisioning.BicepValue Uri { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceEncryptionProtector FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceEncryptionProtector FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -946,7 +946,7 @@ public ManagedInstanceExternalAdministrator() { } } public partial class ManagedInstanceKey : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceKey(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceKey(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAutoRotationEnabled { get { throw null; } } @@ -957,7 +957,7 @@ public partial class ManagedInstanceKey : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Thumbprint { get { throw null; } } public Azure.Provisioning.BicepValue Uri { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedInstanceKey FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceKey FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -971,7 +971,7 @@ public enum ManagedInstanceLicenseType } public partial class ManagedInstanceLongTermRetentionPolicy : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceLongTermRetentionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceLongTermRetentionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue MonthlyRetention { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -980,7 +980,7 @@ public partial class ManagedInstanceLongTermRetentionPolicy : Azure.Provisioning public Azure.Provisioning.BicepValue WeeklyRetention { get { throw null; } set { } } public Azure.Provisioning.BicepValue WeekOfYear { get { throw null; } set { } } public Azure.Provisioning.BicepValue YearlyRetention { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedInstanceLongTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceLongTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1006,7 +1006,7 @@ public ManagedInstancePecProperty() { } } public partial class ManagedInstancePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public ManagedInstancePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstancePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -1014,7 +1014,7 @@ public partial class ManagedInstancePrivateEndpointConnection : Azure.Provisioni public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstancePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstancePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1061,14 +1061,14 @@ public enum ManagedInstanceProxyOverride } public partial class ManagedInstanceServerConfigurationOption : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceServerConfigurationOption(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceServerConfigurationOption(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue ServerConfigurationOptionValue { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceServerConfigurationOption FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceServerConfigurationOption FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1082,7 +1082,7 @@ public enum ManagedInstanceServerConfigurationOptionName } public partial class ManagedInstanceServerTrustCertificate : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceServerTrustCertificate(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceServerTrustCertificate(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CertificateName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -1090,7 +1090,7 @@ public partial class ManagedInstanceServerTrustCertificate : Azure.Provisioning. public Azure.Provisioning.BicepValue PublicBlob { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Thumbprint { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceServerTrustCertificate FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceServerTrustCertificate FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1099,7 +1099,7 @@ public static partial class ResourceVersions } public partial class ManagedInstanceStartStopSchedule : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceStartStopSchedule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceStartStopSchedule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -1109,7 +1109,7 @@ public partial class ManagedInstanceStartStopSchedule : Azure.Provisioning.Primi public Azure.Provisioning.BicepList ScheduleList { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TimeZoneId { get { throw null; } set { } } - public static Azure.Provisioning.Sql.ManagedInstanceStartStopSchedule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceStartStopSchedule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1123,7 +1123,7 @@ public enum ManagedInstanceStartStopScheduleName } public partial class ManagedInstanceVulnerabilityAssessment : Azure.Provisioning.Primitives.Resource { - public ManagedInstanceVulnerabilityAssessment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedInstanceVulnerabilityAssessment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } @@ -1132,7 +1132,7 @@ public partial class ManagedInstanceVulnerabilityAssessment : Azure.Provisioning public Azure.Provisioning.BicepValue StorageContainerPath { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageContainerSasKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedInstanceVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedInstanceVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1141,14 +1141,14 @@ public static partial class ResourceVersions } public partial class ManagedLedgerDigestUpload : Azure.Provisioning.Primitives.Resource { - public ManagedLedgerDigestUpload(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedLedgerDigestUpload(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DigestStorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedLedgerDigestUpload FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedLedgerDigestUpload FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -1166,12 +1166,12 @@ public enum ManagedLedgerDigestUploadsState } public partial class ManagedRestorableDroppedDbBackupShortTermRetentionPolicy : Azure.Provisioning.Primitives.Resource { - public ManagedRestorableDroppedDbBackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedRestorableDroppedDbBackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.BicepValue RetentionDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedRestorableDroppedDbBackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedRestorableDroppedDbBackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum ManagedServerCreateMode { @@ -1180,7 +1180,7 @@ public enum ManagedServerCreateMode } public partial class ManagedServerDnsAlias : Azure.Provisioning.Primitives.Resource { - public ManagedServerDnsAlias(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedServerDnsAlias(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AzureDnsRecord { get { throw null; } } public Azure.Provisioning.BicepValue CreateDnsRecord { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1188,7 +1188,7 @@ public partial class ManagedServerDnsAlias : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue PublicAzureDnsRecord { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedServerDnsAlias FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedServerDnsAlias FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1197,7 +1197,7 @@ public static partial class ResourceVersions } public partial class ManagedServerSecurityAlertPolicy : Azure.Provisioning.Primitives.Resource { - public ManagedServerSecurityAlertPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedServerSecurityAlertPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList DisabledAlerts { get { throw null; } set { } } public Azure.Provisioning.BicepList EmailAddresses { get { throw null; } set { } } @@ -1210,7 +1210,7 @@ public partial class ManagedServerSecurityAlertPolicy : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue StorageAccountAccessKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1224,13 +1224,13 @@ public enum ManagedShortTermRetentionPolicyName } public partial class ManagedTransparentDataEncryption : Azure.Provisioning.Primitives.Resource { - public ManagedTransparentDataEncryption(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagedTransparentDataEncryption(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ManagedTransparentDataEncryption FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ManagedTransparentDataEncryption FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1239,13 +1239,13 @@ public static partial class ResourceVersions } public partial class OutboundFirewallRule : Azure.Provisioning.Primitives.Resource { - public OutboundFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public OutboundFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.OutboundFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.OutboundFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1317,14 +1317,14 @@ public enum SensitivityLabelRank } public partial class ServerAdvancedThreatProtection : Azure.Provisioning.Primitives.Resource { - public ServerAdvancedThreatProtection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ServerAdvancedThreatProtection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.ServerAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.ServerAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1391,13 +1391,13 @@ public enum SqlAdministratorType } public partial class SqlAgentConfiguration : Azure.Provisioning.Primitives.Resource { - public SqlAgentConfiguration(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlAgentConfiguration(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.ManagedInstance? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlAgentConfiguration FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlAgentConfiguration FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_06_01; @@ -1463,7 +1463,7 @@ public enum SqlBackupStorageRedundancy } public partial class SqlDatabase : Azure.Provisioning.Primitives.Resource { - public SqlDatabase(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabase(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AutoPauseDelay { get { throw null; } set { } } public Azure.Provisioning.BicepValue AvailabilityZone { get { throw null; } set { } } public Azure.Provisioning.BicepValue CatalogCollation { get { throw null; } set { } } @@ -1522,7 +1522,7 @@ public partial class SqlDatabase : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UseFreeLimit { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlDatabase FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabase FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1536,7 +1536,7 @@ public static partial class ResourceVersions } public partial class SqlDatabaseBlobAuditingPolicy : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseBlobAuditingPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseBlobAuditingPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AuditActionsAndGroups { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureMonitorTargetEnabled { get { throw null; } set { } } @@ -1552,7 +1552,7 @@ public partial class SqlDatabaseBlobAuditingPolicy : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue StorageAccountSubscriptionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1586,7 +1586,7 @@ public enum SqlDatabaseKeyType } public partial class SqlDatabaseSecurityAlertPolicy : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseSecurityAlertPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseSecurityAlertPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList DisabledAlerts { get { throw null; } set { } } public Azure.Provisioning.BicepList EmailAddresses { get { throw null; } set { } } @@ -1599,7 +1599,7 @@ public partial class SqlDatabaseSecurityAlertPolicy : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue StorageAccountAccessKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1610,7 +1610,7 @@ public static partial class ResourceVersions } public partial class SqlDatabaseSensitivityLabel : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseSensitivityLabel(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseSensitivityLabel(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ColumnName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue InformationType { get { throw null; } set { } } @@ -1624,28 +1624,28 @@ public partial class SqlDatabaseSensitivityLabel : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue SchemaName { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TableName { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseSensitivityLabel FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseSensitivityLabel FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SqlDatabaseSqlVulnerabilityAssessmentBaseline : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseSqlVulnerabilityAssessmentBaseline(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseSqlVulnerabilityAssessmentBaseline(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsLatestScan { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.BicepDictionary>> Results { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseSqlVulnerabilityAssessmentBaseline FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseSqlVulnerabilityAssessmentBaseline FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public partial class SqlDatabaseSqlVulnerabilityAssessmentBaselineRule : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsLatestScan { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabaseSqlVulnerabilityAssessmentBaseline? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList> Results { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseSqlVulnerabilityAssessmentBaselineRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseSqlVulnerabilityAssessmentBaselineRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum SqlDatabaseStatus { @@ -1676,7 +1676,7 @@ public enum SqlDatabaseStatus } public partial class SqlDatabaseVulnerabilityAssessment : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseVulnerabilityAssessment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseVulnerabilityAssessment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } @@ -1685,7 +1685,7 @@ public partial class SqlDatabaseVulnerabilityAssessment : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue StorageContainerPath { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageContainerSasKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1694,12 +1694,12 @@ public static partial class ResourceVersions } public partial class SqlDatabaseVulnerabilityAssessmentRuleBaseline : Azure.Provisioning.Primitives.Resource { - public SqlDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlDatabaseVulnerabilityAssessmentRuleBaseline(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList BaselineResults { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum SqlDayOfWeek { @@ -1713,13 +1713,13 @@ public enum SqlDayOfWeek } public partial class SqlFirewallRule : Azure.Provisioning.Primitives.Resource { - public SqlFirewallRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlFirewallRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EndIPAddress { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartIPAddress { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlFirewallRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlFirewallRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1745,7 +1745,7 @@ public enum SqlMinimalTlsVersion } public partial class SqlPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public SqlPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1754,7 +1754,7 @@ public partial class SqlPrivateEndpointConnection : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1803,7 +1803,7 @@ public enum SqlSecurityAlertPolicyName } public partial class SqlServer : Azure.Provisioning.Primitives.Resource { - public SqlServer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorLogin { get { throw null; } set { } } public Azure.Provisioning.BicepValue AdministratorLoginPassword { get { throw null; } set { } } public Azure.Provisioning.BicepValue Administrators { get { throw null; } set { } } @@ -1827,9 +1827,9 @@ public partial class SqlServer : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } set { } } public Azure.Provisioning.BicepValue WorkspaceFeature { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Sql.SqlBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Sql.SqlBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Sql.SqlBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.Sql.SqlServer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1842,7 +1842,7 @@ public static partial class ResourceVersions } public partial class SqlServerAzureADAdministrator : Azure.Provisioning.Primitives.Resource { - public SqlServerAzureADAdministrator(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerAzureADAdministrator(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AdministratorType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureADOnlyAuthenticationEnabled { get { throw null; } } @@ -1851,7 +1851,7 @@ public partial class SqlServerAzureADAdministrator : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue Sid { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerAzureADAdministrator FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerAzureADAdministrator FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1862,13 +1862,13 @@ public static partial class ResourceVersions } public partial class SqlServerAzureADOnlyAuthentication : Azure.Provisioning.Primitives.Resource { - public SqlServerAzureADOnlyAuthentication(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerAzureADOnlyAuthentication(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureADOnlyAuthenticationEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerAzureADOnlyAuthentication FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerAzureADOnlyAuthentication FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1879,7 +1879,7 @@ public static partial class ResourceVersions } public partial class SqlServerBlobAuditingPolicy : Azure.Provisioning.Primitives.Resource { - public SqlServerBlobAuditingPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerBlobAuditingPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AuditActionsAndGroups { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureMonitorTargetEnabled { get { throw null; } set { } } @@ -1895,7 +1895,7 @@ public partial class SqlServerBlobAuditingPolicy : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue StorageAccountSubscriptionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1904,7 +1904,7 @@ public static partial class ResourceVersions } public partial class SqlServerCommunicationLink : Azure.Provisioning.Primitives.Resource { - public SqlServerCommunicationLink(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerCommunicationLink(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -1913,7 +1913,7 @@ public partial class SqlServerCommunicationLink : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue PartnerServer { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerCommunicationLink FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerCommunicationLink FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1923,7 +1923,7 @@ public static partial class ResourceVersions } public partial class SqlServerConnectionPolicy : Azure.Provisioning.Primitives.Resource { - public SqlServerConnectionPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerConnectionPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Kind { get { throw null; } } @@ -1931,7 +1931,7 @@ public partial class SqlServerConnectionPolicy : Azure.Provisioning.Primitives.R public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerConnectionPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerConnectionPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1942,7 +1942,7 @@ public static partial class ResourceVersions } public partial class SqlServerDatabaseRestorePoint : Azure.Provisioning.Primitives.Resource { - public SqlServerDatabaseRestorePoint(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerDatabaseRestorePoint(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue EarliestRestoreOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } @@ -1952,7 +1952,7 @@ public partial class SqlServerDatabaseRestorePoint : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue RestorePointLabel { get { throw null; } } public Azure.Provisioning.BicepValue RestorePointType { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerDatabaseRestorePoint FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerDatabaseRestorePoint FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2014_01_01; @@ -1964,7 +1964,7 @@ public static partial class ResourceVersions } public partial class SqlServerDevOpsAuditingSetting : Azure.Provisioning.Primitives.Resource { - public SqlServerDevOpsAuditingSetting(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerDevOpsAuditingSetting(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAzureMonitorTargetEnabled { get { throw null; } set { } } public Azure.Provisioning.BicepValue IsManagedIdentityInUse { get { throw null; } set { } } @@ -1975,7 +1975,7 @@ public partial class SqlServerDevOpsAuditingSetting : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue StorageAccountSubscriptionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerDevOpsAuditingSetting FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerDevOpsAuditingSetting FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1984,13 +1984,13 @@ public static partial class ResourceVersions } public partial class SqlServerDnsAlias : Azure.Provisioning.Primitives.Resource { - public SqlServerDnsAlias(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerDnsAlias(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AzureDnsRecord { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerDnsAlias FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerDnsAlias FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -1999,7 +1999,7 @@ public static partial class ResourceVersions } public partial class SqlServerJob : Azure.Provisioning.Primitives.Resource { - public SqlServerJob(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJob(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -2007,7 +2007,7 @@ public partial class SqlServerJob : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Schedule { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerJob FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJob FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2016,7 +2016,7 @@ public static partial class ResourceVersions } public partial class SqlServerJobAgent : Azure.Provisioning.Primitives.Resource { - public SqlServerJobAgent(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJobAgent(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DatabaseId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2026,7 +2026,7 @@ public partial class SqlServerJobAgent : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerJobAgent FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJobAgent FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2035,14 +2035,14 @@ public static partial class ResourceVersions } public partial class SqlServerJobCredential : Azure.Provisioning.Primitives.Resource { - public SqlServerJobCredential(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJobCredential(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Sql.SqlServerJobAgent? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Password { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Username { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerJobCredential FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJobCredential FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2051,7 +2051,7 @@ public static partial class ResourceVersions } public partial class SqlServerJobExecution : Azure.Provisioning.Primitives.Resource { - public SqlServerJobExecution(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJobExecution(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreateOn { get { throw null; } } public Azure.Provisioning.BicepValue CurrentAttempts { get { throw null; } } public Azure.Provisioning.BicepValue CurrentAttemptStartOn { get { throw null; } } @@ -2069,7 +2069,7 @@ public partial class SqlServerJobExecution : Azure.Provisioning.Primitives.Resou public Azure.Provisioning.BicepValue StepName { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Target { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerJobExecution FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJobExecution FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2092,7 +2092,7 @@ public enum SqlServerJobScheduleType } public partial class SqlServerJobStep : Azure.Provisioning.Primitives.Resource { - public SqlServerJobStep(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJobStep(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Action { get { throw null; } set { } } public Azure.Provisioning.BicepValue Credential { get { throw null; } set { } } public Azure.Provisioning.BicepValue ExecutionOptions { get { throw null; } set { } } @@ -2103,7 +2103,7 @@ public partial class SqlServerJobStep : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StepId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TargetGroup { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerJobStep FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJobStep FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2112,13 +2112,13 @@ public static partial class ResourceVersions } public partial class SqlServerJobTargetGroup : Azure.Provisioning.Primitives.Resource { - public SqlServerJobTargetGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerJobTargetGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList Members { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Sql.SqlServerJobAgent? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerJobTargetGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerJobTargetGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2127,7 +2127,7 @@ public static partial class ResourceVersions } public partial class SqlServerKey : Azure.Provisioning.Primitives.Resource { - public SqlServerKey(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerKey(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsAutoRotationEnabled { get { throw null; } } @@ -2140,7 +2140,7 @@ public partial class SqlServerKey : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Thumbprint { get { throw null; } } public Azure.Provisioning.BicepValue Uri { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerKey FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerKey FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2166,7 +2166,7 @@ public SqlServerPrivateEndpointConnection() { } } public partial class SqlServerSecurityAlertPolicy : Azure.Provisioning.Primitives.Resource { - public SqlServerSecurityAlertPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerSecurityAlertPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepList DisabledAlerts { get { throw null; } set { } } public Azure.Provisioning.BicepList EmailAddresses { get { throw null; } set { } } @@ -2179,7 +2179,7 @@ public partial class SqlServerSecurityAlertPolicy : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue StorageAccountAccessKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2188,13 +2188,13 @@ public static partial class ResourceVersions } public partial class SqlServerSqlVulnerabilityAssessment : Azure.Provisioning.Primitives.Resource { - public SqlServerSqlVulnerabilityAssessment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerSqlVulnerabilityAssessment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -2202,14 +2202,14 @@ public static partial class ResourceVersions } public partial class SqlServerSqlVulnerabilityAssessmentBaseline : Azure.Provisioning.Primitives.Resource { - public SqlServerSqlVulnerabilityAssessmentBaseline(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerSqlVulnerabilityAssessmentBaseline(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsLatestScan { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessment? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary>> Results { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessmentBaseline FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessmentBaseline FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -2217,14 +2217,14 @@ public static partial class ResourceVersions } public partial class SqlServerSqlVulnerabilityAssessmentBaselineRule : Azure.Provisioning.Primitives.Resource { - public SqlServerSqlVulnerabilityAssessmentBaselineRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerSqlVulnerabilityAssessmentBaselineRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsLatestScan { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessmentBaseline? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList> Results { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessmentBaselineRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerSqlVulnerabilityAssessmentBaselineRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2024_05_01_preview; @@ -2232,13 +2232,13 @@ public static partial class ResourceVersions } public partial class SqlServerTrustGroup : Azure.Provisioning.Primitives.Resource { - public SqlServerTrustGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerTrustGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList GroupMembers { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepList TrustScopes { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerTrustGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerTrustGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2247,7 +2247,7 @@ public static partial class ResourceVersions } public partial class SqlServerVirtualNetworkRule : Azure.Provisioning.Primitives.Resource { - public SqlServerVirtualNetworkRule(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerVirtualNetworkRule(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IgnoreMissingVnetServiceEndpoint { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -2255,7 +2255,7 @@ public partial class SqlServerVirtualNetworkRule : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue VirtualNetworkSubnetId { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SqlServerVirtualNetworkRule FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerVirtualNetworkRule FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2273,7 +2273,7 @@ public enum SqlServerVirtualNetworkRuleState } public partial class SqlServerVulnerabilityAssessment : Azure.Provisioning.Primitives.Resource { - public SqlServerVulnerabilityAssessment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SqlServerVulnerabilityAssessment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Sql.SqlServer? Parent { get { throw null; } set { } } @@ -2282,7 +2282,7 @@ public partial class SqlServerVulnerabilityAssessment : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue StorageContainerPath { get { throw null; } set { } } public Azure.Provisioning.BicepValue StorageContainerSasKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.SqlServerVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SqlServerVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2323,7 +2323,7 @@ public enum SqlVulnerabilityAssessmentState } public partial class SyncAgent : Azure.Provisioning.Primitives.Resource { - public SyncAgent(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SyncAgent(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ExpireOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IsUpToDate { get { throw null; } } @@ -2334,7 +2334,7 @@ public partial class SyncAgent : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SyncDatabaseId { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.Sql.SyncAgent FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SyncAgent FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2360,7 +2360,7 @@ public enum SyncDirection } public partial class SyncGroup : Azure.Provisioning.Primitives.Resource { - public SyncGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SyncGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConflictLoggingRetentionInDays { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConflictResolutionPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue HubDatabasePassword { get { throw null; } set { } } @@ -2378,7 +2378,7 @@ public partial class SyncGroup : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SyncState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UsePrivateLinkConnection { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SyncGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SyncGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -2416,7 +2416,7 @@ public enum SyncGroupState } public partial class SyncMember : Azure.Provisioning.Primitives.Resource { - public SyncMember(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SyncMember(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DatabaseName { get { throw null; } set { } } public Azure.Provisioning.BicepValue DatabaseType { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2433,7 +2433,7 @@ public partial class SyncMember : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UsePrivateLinkConnection { get { throw null; } set { } } public Azure.Provisioning.BicepValue UserName { get { throw null; } set { } } - public static Azure.Provisioning.Sql.SyncMember FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.SyncMember FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2497,7 +2497,7 @@ public VulnerabilityAssessmentRecurringScansProperties() { } } public partial class WorkloadClassifier : Azure.Provisioning.Primitives.Resource { - public WorkloadClassifier(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WorkloadClassifier(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Context { get { throw null; } set { } } public Azure.Provisioning.BicepValue EndTime { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2508,7 +2508,7 @@ public partial class WorkloadClassifier : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.Sql.WorkloadGroup? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue StartTime { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.WorkloadClassifier FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.WorkloadClassifier FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; @@ -2517,7 +2517,7 @@ public static partial class ResourceVersions } public partial class WorkloadGroup : Azure.Provisioning.Primitives.Resource { - public WorkloadGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WorkloadGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Importance { get { throw null; } set { } } public Azure.Provisioning.BicepValue MaxResourcePercent { get { throw null; } set { } } @@ -2528,7 +2528,7 @@ public partial class WorkloadGroup : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.Sql.SqlDatabase? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue QueryExecutionTimeout { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Sql.WorkloadGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Sql.WorkloadGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_11_01; diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/BackupShortTermRetentionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/BackupShortTermRetentionPolicy.cs index 51a31dfac1b3f..b6f04e8b27649 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/BackupShortTermRetentionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/BackupShortTermRetentionPolicy.cs @@ -59,10 +59,15 @@ public partial class BackupShortTermRetentionPolicy : Resource /// /// Creates a new BackupShortTermRetentionPolicy. /// - /// Name of the BackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the BackupShortTermRetentionPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the BackupShortTermRetentionPolicy. - public BackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies", resourceVersion ?? "2021-11-01") + public BackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _diffBackupIntervalInHours = BicepValue.DefineProperty(this, "DiffBackupIntervalInHours", ["properties", "diffBackupIntervalInHours"]); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing BackupShortTermRetentionPolicy. /// - /// Name of the BackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the BackupShortTermRetentionPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the BackupShortTermRetentionPolicy. /// The existing BackupShortTermRetentionPolicy resource. - public static BackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static BackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DataMaskingPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DataMaskingPolicy.cs index 204562fc91e8c..81382e0c61643 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DataMaskingPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DataMaskingPolicy.cs @@ -84,10 +84,15 @@ public partial class DataMaskingPolicy : Resource /// /// Creates a new DataMaskingPolicy. /// - /// Name of the DataMaskingPolicy. + /// + /// The the Bicep identifier name of the DataMaskingPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the DataMaskingPolicy. - public DataMaskingPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/dataMaskingPolicies", resourceVersion ?? "2021-11-01") + public DataMaskingPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/dataMaskingPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _dataMaskingState = BicepValue.DefineProperty(this, "DataMaskingState", ["properties", "dataMaskingState"]); @@ -130,9 +135,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DataMaskingPolicy. /// - /// Name of the DataMaskingPolicy. + /// + /// The the Bicep identifier name of the DataMaskingPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the DataMaskingPolicy. /// The existing DataMaskingPolicy resource. - public static DataMaskingPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DataMaskingPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DatabaseAdvancedThreatProtection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DatabaseAdvancedThreatProtection.cs index 8670f1f97cc11..6741ff75dd72a 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DatabaseAdvancedThreatProtection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DatabaseAdvancedThreatProtection.cs @@ -58,10 +58,15 @@ public partial class DatabaseAdvancedThreatProtection : Resource /// /// Creates a new DatabaseAdvancedThreatProtection. /// - /// Name of the DatabaseAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the DatabaseAdvancedThreatProtection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DatabaseAdvancedThreatProtection. - public DatabaseAdvancedThreatProtection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings", resourceVersion ?? "2021-11-01") + public DatabaseAdvancedThreatProtection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -90,9 +95,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DatabaseAdvancedThreatProtection. /// - /// Name of the DatabaseAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the DatabaseAdvancedThreatProtection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DatabaseAdvancedThreatProtection. /// The existing DatabaseAdvancedThreatProtection resource. - public static DatabaseAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DatabaseAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DistributedAvailabilityGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DistributedAvailabilityGroup.cs index 5275be63242b0..75bed98b9bd7d 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DistributedAvailabilityGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/DistributedAvailabilityGroup.cs @@ -105,10 +105,15 @@ public partial class DistributedAvailabilityGroup : Resource /// /// Creates a new DistributedAvailabilityGroup. /// - /// Name of the DistributedAvailabilityGroup. + /// + /// The the Bicep identifier name of the DistributedAvailabilityGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DistributedAvailabilityGroup. - public DistributedAvailabilityGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/distributedAvailabilityGroups", resourceVersion ?? "2021-11-01") + public DistributedAvailabilityGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/distributedAvailabilityGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _primaryAvailabilityGroupName = BicepValue.DefineProperty(this, "PrimaryAvailabilityGroupName", ["properties", "primaryAvailabilityGroupName"]); @@ -145,9 +150,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing DistributedAvailabilityGroup. /// - /// Name of the DistributedAvailabilityGroup. + /// + /// The the Bicep identifier name of the DistributedAvailabilityGroup + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the DistributedAvailabilityGroup. /// The existing DistributedAvailabilityGroup resource. - public static DistributedAvailabilityGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static DistributedAvailabilityGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ElasticPool.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ElasticPool.cs index 4f85b19e11fbf..31552ae6e9c3f 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ElasticPool.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ElasticPool.cs @@ -151,10 +151,15 @@ public partial class ElasticPool : Resource /// /// Creates a new ElasticPool. /// - /// Name of the ElasticPool. + /// + /// The the Bicep identifier name of the ElasticPool resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ElasticPool. - public ElasticPool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/elasticPools", resourceVersion ?? "2021-11-01") + public ElasticPool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/elasticPools", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -211,11 +216,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ElasticPool. /// - /// Name of the ElasticPool. + /// + /// The the Bicep identifier name of the ElasticPool resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ElasticPool. /// The existing ElasticPool resource. - public static ElasticPool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ElasticPool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ElasticPool resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/EncryptionProtector.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/EncryptionProtector.cs index 9e8cddbf0b503..c1826ac0c7fb7 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/EncryptionProtector.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/EncryptionProtector.cs @@ -94,10 +94,15 @@ public partial class EncryptionProtector : Resource /// /// Creates a new EncryptionProtector. /// - /// Name of the EncryptionProtector. + /// + /// The the Bicep identifier name of the EncryptionProtector resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EncryptionProtector. - public EncryptionProtector(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/encryptionProtector", resourceVersion ?? "2021-11-01") + public EncryptionProtector(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/encryptionProtector", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isAutoRotationEnabled = BicepValue.DefineProperty(this, "IsAutoRotationEnabled", ["properties", "autoRotationEnabled"]); @@ -132,9 +137,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EncryptionProtector. /// - /// Name of the EncryptionProtector. + /// + /// The the Bicep identifier name of the EncryptionProtector resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the EncryptionProtector. /// The existing EncryptionProtector resource. - public static EncryptionProtector FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EncryptionProtector FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedDatabaseBlobAuditingPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedDatabaseBlobAuditingPolicy.cs index c721b6095c240..f767bda6092ed 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedDatabaseBlobAuditingPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedDatabaseBlobAuditingPolicy.cs @@ -198,10 +198,15 @@ public partial class ExtendedDatabaseBlobAuditingPolicy : Resource /// /// Creates a new ExtendedDatabaseBlobAuditingPolicy. /// - /// Name of the ExtendedDatabaseBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the ExtendedDatabaseBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ExtendedDatabaseBlobAuditingPolicy. - public ExtendedDatabaseBlobAuditingPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/extendedAuditingSettings", resourceVersion ?? "2021-11-01") + public ExtendedDatabaseBlobAuditingPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/extendedAuditingSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _auditActionsAndGroups = BicepList.DefineProperty(this, "AuditActionsAndGroups", ["properties", "auditActionsAndGroups"]); @@ -254,9 +259,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ExtendedDatabaseBlobAuditingPolicy. /// - /// Name of the ExtendedDatabaseBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the ExtendedDatabaseBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ExtendedDatabaseBlobAuditingPolicy. /// The existing ExtendedDatabaseBlobAuditingPolicy resource. - public static ExtendedDatabaseBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ExtendedDatabaseBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedServerBlobAuditingPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedServerBlobAuditingPolicy.cs index 6156ab4f771fc..d26702eed66dc 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedServerBlobAuditingPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ExtendedServerBlobAuditingPolicy.cs @@ -218,10 +218,15 @@ public partial class ExtendedServerBlobAuditingPolicy : Resource /// /// Creates a new ExtendedServerBlobAuditingPolicy. /// - /// Name of the ExtendedServerBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the ExtendedServerBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ExtendedServerBlobAuditingPolicy. - public ExtendedServerBlobAuditingPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/extendedAuditingSettings", resourceVersion ?? "2021-11-01") + public ExtendedServerBlobAuditingPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/extendedAuditingSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _auditActionsAndGroups = BicepList.DefineProperty(this, "AuditActionsAndGroups", ["properties", "auditActionsAndGroups"]); @@ -260,9 +265,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ExtendedServerBlobAuditingPolicy. /// - /// Name of the ExtendedServerBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the ExtendedServerBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ExtendedServerBlobAuditingPolicy. /// The existing ExtendedServerBlobAuditingPolicy resource. - public static ExtendedServerBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ExtendedServerBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/FailoverGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/FailoverGroup.cs index 303f4c76b6b5b..410d9601e99d4 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/FailoverGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/FailoverGroup.cs @@ -94,10 +94,15 @@ public partial class FailoverGroup : Resource /// /// Creates a new FailoverGroup. /// - /// Name of the FailoverGroup. + /// + /// The the Bicep identifier name of the FailoverGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FailoverGroup. - public FailoverGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/failoverGroups", resourceVersion ?? "2021-11-01") + public FailoverGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/failoverGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _failoverDatabases = BicepList.DefineProperty(this, "FailoverDatabases", ["properties", "databases"]); @@ -132,11 +137,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing FailoverGroup. /// - /// Name of the FailoverGroup. + /// + /// The the Bicep identifier name of the FailoverGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FailoverGroup. /// The existing FailoverGroup resource. - public static FailoverGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static FailoverGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this FailoverGroup resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/GeoBackupPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/GeoBackupPolicy.cs index 39eb626f8c426..37b13189f93af 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/GeoBackupPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/GeoBackupPolicy.cs @@ -69,10 +69,15 @@ public partial class GeoBackupPolicy : Resource /// /// Creates a new GeoBackupPolicy. /// - /// Name of the GeoBackupPolicy. + /// + /// The the Bicep identifier name of the GeoBackupPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GeoBackupPolicy. - public GeoBackupPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/geoBackupPolicies", resourceVersion ?? "2021-11-01") + public GeoBackupPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/geoBackupPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"], isRequired: true); @@ -113,9 +118,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing GeoBackupPolicy. /// - /// Name of the GeoBackupPolicy. + /// + /// The the Bicep identifier name of the GeoBackupPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GeoBackupPolicy. /// The existing GeoBackupPolicy resource. - public static GeoBackupPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GeoBackupPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/IPv6FirewallRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/IPv6FirewallRule.cs index 35e190f3d1b3f..a8832b7ec520d 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/IPv6FirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/IPv6FirewallRule.cs @@ -50,10 +50,15 @@ public partial class IPv6FirewallRule : Resource /// /// Creates a new IPv6FirewallRule. /// - /// Name of the IPv6FirewallRule. + /// + /// The the Bicep identifier name of the IPv6FirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the IPv6FirewallRule. - public IPv6FirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/ipv6FirewallRules", resourceVersion ?? "2021-11-01") + public IPv6FirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/ipv6FirewallRules", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIPv6Address = BicepValue.DefineProperty(this, "EndIPv6Address", ["properties", "endIPv6Address"]); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing IPv6FirewallRule. /// - /// Name of the IPv6FirewallRule. + /// + /// The the Bicep identifier name of the IPv6FirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the IPv6FirewallRule. /// The existing IPv6FirewallRule resource. - public static IPv6FirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static IPv6FirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstanceFailoverGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstanceFailoverGroup.cs index 95a2ff25b4c81..1519f0dddbcfe 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstanceFailoverGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstanceFailoverGroup.cs @@ -82,10 +82,15 @@ public partial class InstanceFailoverGroup : Resource /// /// Creates a new InstanceFailoverGroup. /// - /// Name of the InstanceFailoverGroup. + /// + /// The the Bicep identifier name of the InstanceFailoverGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the InstanceFailoverGroup. - public InstanceFailoverGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/locations/instanceFailoverGroups", resourceVersion ?? "2021-11-01") + public InstanceFailoverGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/locations/instanceFailoverGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _managedInstancePairs = BicepList.DefineProperty(this, "ManagedInstancePairs", ["properties", "managedInstancePairs"]); @@ -118,9 +123,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing InstanceFailoverGroup. /// - /// Name of the InstanceFailoverGroup. + /// + /// The the Bicep identifier name of the InstanceFailoverGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the InstanceFailoverGroup. /// The existing InstanceFailoverGroup resource. - public static InstanceFailoverGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static InstanceFailoverGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstancePool.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstancePool.cs index 82ab878d9e843..6f3c00a4fa188 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstancePool.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/InstancePool.cs @@ -90,10 +90,15 @@ public partial class InstancePool : Resource /// /// Creates a new InstancePool. /// - /// Name of the InstancePool. + /// + /// The the Bicep identifier name of the InstancePool resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the InstancePool. - public InstancePool(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/instancePools", resourceVersion ?? "2021-11-01") + public InstancePool(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/instancePools", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -127,9 +132,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing InstancePool. /// - /// Name of the InstancePool. + /// + /// The the Bicep identifier name of the InstancePool resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the InstancePool. /// The existing InstancePool resource. - public static InstancePool FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static InstancePool FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LedgerDigestUpload.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LedgerDigestUpload.cs index b493b383ac98a..a9a8930dd1c5b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LedgerDigestUpload.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LedgerDigestUpload.cs @@ -57,10 +57,15 @@ public partial class LedgerDigestUpload : Resource /// /// Creates a new LedgerDigestUpload. /// - /// Name of the LedgerDigestUpload. + /// + /// The the Bicep identifier name of the LedgerDigestUpload resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LedgerDigestUpload. - public LedgerDigestUpload(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/ledgerDigestUploads", resourceVersion ?? "2021-11-01") + public LedgerDigestUpload(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/ledgerDigestUploads", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _digestStorageEndpoint = BicepValue.DefineProperty(this, "DigestStorageEndpoint", ["properties", "digestStorageEndpoint"]); @@ -89,9 +94,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LedgerDigestUpload. /// - /// Name of the LedgerDigestUpload. + /// + /// The the Bicep identifier name of the LedgerDigestUpload resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the LedgerDigestUpload. /// The existing LedgerDigestUpload resource. - public static LedgerDigestUpload FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LedgerDigestUpload FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LogicalDatabaseTransparentDataEncryption.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LogicalDatabaseTransparentDataEncryption.cs index 5ca1a0f1c938d..30dd964cb6554 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LogicalDatabaseTransparentDataEncryption.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LogicalDatabaseTransparentDataEncryption.cs @@ -50,10 +50,16 @@ public partial class LogicalDatabaseTransparentDataEncryption : Resource /// /// Creates a new LogicalDatabaseTransparentDataEncryption. /// - /// Name of the LogicalDatabaseTransparentDataEncryption. + /// + /// The the Bicep identifier name of the + /// LogicalDatabaseTransparentDataEncryption resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the LogicalDatabaseTransparentDataEncryption. - public LogicalDatabaseTransparentDataEncryption(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/transparentDataEncryption", resourceVersion ?? "2021-11-01") + public LogicalDatabaseTransparentDataEncryption(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/transparentDataEncryption", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -87,9 +93,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// LogicalDatabaseTransparentDataEncryption. /// - /// Name of the LogicalDatabaseTransparentDataEncryption. + /// + /// The the Bicep identifier name of the + /// LogicalDatabaseTransparentDataEncryption resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the LogicalDatabaseTransparentDataEncryption. /// The existing LogicalDatabaseTransparentDataEncryption resource. - public static LogicalDatabaseTransparentDataEncryption FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LogicalDatabaseTransparentDataEncryption FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LongTermRetentionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LongTermRetentionPolicy.cs index 76bfe90549cd0..98ab511d01883 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LongTermRetentionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/LongTermRetentionPolicy.cs @@ -80,10 +80,15 @@ public partial class LongTermRetentionPolicy : Resource /// /// Creates a new LongTermRetentionPolicy. /// - /// Name of the LongTermRetentionPolicy. + /// + /// The the Bicep identifier name of the LongTermRetentionPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the LongTermRetentionPolicy. - public LongTermRetentionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies", resourceVersion ?? "2021-11-01") + public LongTermRetentionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _backupStorageAccessTier = BicepValue.DefineProperty(this, "BackupStorageAccessTier", ["properties", "backupStorageAccessTier"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing LongTermRetentionPolicy. /// - /// Name of the LongTermRetentionPolicy. + /// + /// The the Bicep identifier name of the LongTermRetentionPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the LongTermRetentionPolicy. /// The existing LongTermRetentionPolicy resource. - public static LongTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static LongTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedBackupShortTermRetentionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedBackupShortTermRetentionPolicy.cs index 18de9ffeeae9f..6604582d59c36 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedBackupShortTermRetentionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedBackupShortTermRetentionPolicy.cs @@ -51,10 +51,15 @@ public partial class ManagedBackupShortTermRetentionPolicy : Resource /// /// Creates a new ManagedBackupShortTermRetentionPolicy. /// - /// Name of the ManagedBackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedBackupShortTermRetentionPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedBackupShortTermRetentionPolicy. - public ManagedBackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/backupShortTermRetentionPolicies", resourceVersion ?? "2021-11-01") + public ManagedBackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/backupShortTermRetentionPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _retentionDays = BicepValue.DefineProperty(this, "RetentionDays", ["properties", "retentionDays"]); @@ -83,9 +88,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedBackupShortTermRetentionPolicy. /// - /// Name of the ManagedBackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedBackupShortTermRetentionPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedBackupShortTermRetentionPolicy. /// The existing ManagedBackupShortTermRetentionPolicy resource. - public static ManagedBackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedBackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabase.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabase.cs index 0eca65fa59aef..aa5bba47025cd 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabase.cs @@ -218,10 +218,15 @@ public partial class ManagedDatabase : Resource /// /// Creates a new ManagedDatabase. /// - /// Name of the ManagedDatabase. + /// + /// The the Bicep identifier name of the ManagedDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedDatabase. - public ManagedDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases", resourceVersion ?? "2021-11-01") + public ManagedDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -272,9 +277,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedDatabase. /// - /// Name of the ManagedDatabase. + /// + /// The the Bicep identifier name of the ManagedDatabase resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedDatabase. /// The existing ManagedDatabase resource. - public static ManagedDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseAdvancedThreatProtection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseAdvancedThreatProtection.cs index 6171357aba05f..40e90fa911076 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseAdvancedThreatProtection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseAdvancedThreatProtection.cs @@ -58,10 +58,15 @@ public partial class ManagedDatabaseAdvancedThreatProtection : Resource /// /// Creates a new ManagedDatabaseAdvancedThreatProtection. /// - /// Name of the ManagedDatabaseAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseAdvancedThreatProtection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseAdvancedThreatProtection. - public ManagedDatabaseAdvancedThreatProtection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings", resourceVersion ?? "2024-05-01-preview") + public ManagedDatabaseAdvancedThreatProtection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -86,9 +91,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedDatabaseAdvancedThreatProtection. /// - /// Name of the ManagedDatabaseAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseAdvancedThreatProtection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseAdvancedThreatProtection. /// The existing ManagedDatabaseAdvancedThreatProtection resource. - public static ManagedDatabaseAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabaseAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSecurityAlertPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSecurityAlertPolicy.cs index 507d6b2271448..b734409045975 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSecurityAlertPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSecurityAlertPolicy.cs @@ -99,10 +99,15 @@ public partial class ManagedDatabaseSecurityAlertPolicy : Resource /// /// Creates a new ManagedDatabaseSecurityAlertPolicy. /// - /// Name of the ManagedDatabaseSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the ManagedDatabaseSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseSecurityAlertPolicy. - public ManagedDatabaseSecurityAlertPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/securityAlertPolicies", resourceVersion ?? "2021-11-01") + public ManagedDatabaseSecurityAlertPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/securityAlertPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _disabledAlerts = BicepList.DefineProperty(this, "DisabledAlerts", ["properties", "disabledAlerts"]); @@ -137,9 +142,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedDatabaseSecurityAlertPolicy. /// - /// Name of the ManagedDatabaseSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the ManagedDatabaseSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseSecurityAlertPolicy. /// The existing ManagedDatabaseSecurityAlertPolicy resource. - public static ManagedDatabaseSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabaseSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSensitivityLabel.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSensitivityLabel.cs index 2fbdc64041623..8e5bd4065c533 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSensitivityLabel.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseSensitivityLabel.cs @@ -100,10 +100,15 @@ public partial class ManagedDatabaseSensitivityLabel : Resource /// /// Creates a new ManagedDatabaseSensitivityLabel. /// - /// Name of the ManagedDatabaseSensitivityLabel. + /// + /// The the Bicep identifier name of the ManagedDatabaseSensitivityLabel + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseSensitivityLabel. - public ManagedDatabaseSensitivityLabel(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels", resourceVersion) + public ManagedDatabaseSensitivityLabel(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _informationType = BicepValue.DefineProperty(this, "InformationType", ["properties", "informationType"]); @@ -123,9 +128,14 @@ public ManagedDatabaseSensitivityLabel(string resourceName, string? resourceVers /// /// Creates a reference to an existing ManagedDatabaseSensitivityLabel. /// - /// Name of the ManagedDatabaseSensitivityLabel. + /// + /// The the Bicep identifier name of the ManagedDatabaseSensitivityLabel + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseSensitivityLabel. /// The existing ManagedDatabaseSensitivityLabel resource. - public static ManagedDatabaseSensitivityLabel FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabaseSensitivityLabel FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessment.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessment.cs index b3f4695dda179..420b5122f7526 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessment.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessment.cs @@ -76,10 +76,15 @@ public partial class ManagedDatabaseVulnerabilityAssessment : Resource /// /// Creates a new ManagedDatabaseVulnerabilityAssessment. /// - /// Name of the ManagedDatabaseVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseVulnerabilityAssessment. - public ManagedDatabaseVulnerabilityAssessment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") + public ManagedDatabaseVulnerabilityAssessment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _recurringScans = BicepValue.DefineProperty(this, "RecurringScans", ["properties", "recurringScans"]); @@ -111,9 +116,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedDatabaseVulnerabilityAssessment. /// - /// Name of the ManagedDatabaseVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedDatabaseVulnerabilityAssessment. /// The existing ManagedDatabaseVulnerabilityAssessment resource. - public static ManagedDatabaseVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabaseVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentRuleBaseline.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentRuleBaseline.cs index 35ddd94f2fa8e..c9103e5e18618 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentRuleBaseline.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentRuleBaseline.cs @@ -45,10 +45,16 @@ public partial class ManagedDatabaseVulnerabilityAssessmentRuleBaseline : Resour /// /// Creates a new ManagedDatabaseVulnerabilityAssessmentRuleBaseline. /// - /// Name of the ManagedDatabaseVulnerabilityAssessmentRuleBaseline. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseVulnerabilityAssessmentRuleBaseline resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedDatabaseVulnerabilityAssessmentRuleBaseline. - public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/vulnerabilityAssessments/rules/baselines", resourceVersion) + public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/vulnerabilityAssessments/rules/baselines", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _baselineResults = BicepList.DefineProperty(this, "BaselineResults", ["properties", "baselineResults"]); @@ -60,9 +66,15 @@ public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, s /// Creates a reference to an existing /// ManagedDatabaseVulnerabilityAssessmentRuleBaseline. /// - /// Name of the ManagedDatabaseVulnerabilityAssessmentRuleBaseline. + /// + /// The the Bicep identifier name of the + /// ManagedDatabaseVulnerabilityAssessmentRuleBaseline resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedDatabaseVulnerabilityAssessmentRuleBaseline. /// The existing ManagedDatabaseVulnerabilityAssessmentRuleBaseline resource. - public static ManagedDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstance.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstance.cs index ce713595a6b16..2d183ec0df290 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstance.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstance.cs @@ -274,10 +274,15 @@ public partial class ManagedInstance : Resource /// /// Creates a new ManagedInstance. /// - /// Name of the ManagedInstance. + /// + /// The the Bicep identifier name of the ManagedInstance resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstance. - public ManagedInstance(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances", resourceVersion ?? "2021-11-01") + public ManagedInstance(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -336,11 +341,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstance. /// - /// Name of the ManagedInstance. + /// + /// The the Bicep identifier name of the ManagedInstance resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstance. /// The existing ManagedInstance resource. - public static ManagedInstance FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstance FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ManagedInstance resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdministrator.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdministrator.cs index e8c0b589fb004..07ad74256ac6e 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdministrator.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdministrator.cs @@ -68,10 +68,15 @@ public partial class ManagedInstanceAdministrator : Resource /// /// Creates a new ManagedInstanceAdministrator. /// - /// Name of the ManagedInstanceAdministrator. + /// + /// The the Bicep identifier name of the ManagedInstanceAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceAdministrator. - public ManagedInstanceAdministrator(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/administrators", resourceVersion ?? "2021-11-01") + public ManagedInstanceAdministrator(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/administrators", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _administratorType = BicepValue.DefineProperty(this, "AdministratorType", ["properties", "administratorType"]); @@ -102,9 +107,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstanceAdministrator. /// - /// Name of the ManagedInstanceAdministrator. + /// + /// The the Bicep identifier name of the ManagedInstanceAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceAdministrator. /// The existing ManagedInstanceAdministrator resource. - public static ManagedInstanceAdministrator FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceAdministrator FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdvancedThreatProtection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdvancedThreatProtection.cs index dbba5f09e5bb8..bd56ef31d068a 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdvancedThreatProtection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAdvancedThreatProtection.cs @@ -58,10 +58,15 @@ public partial class ManagedInstanceAdvancedThreatProtection : Resource /// /// Creates a new ManagedInstanceAdvancedThreatProtection. /// - /// Name of the ManagedInstanceAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceAdvancedThreatProtection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceAdvancedThreatProtection. - public ManagedInstanceAdvancedThreatProtection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/advancedThreatProtectionSettings", resourceVersion ?? "2024-05-01-preview") + public ManagedInstanceAdvancedThreatProtection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/advancedThreatProtectionSettings", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -86,9 +91,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceAdvancedThreatProtection. /// - /// Name of the ManagedInstanceAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceAdvancedThreatProtection resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceAdvancedThreatProtection. /// The existing ManagedInstanceAdvancedThreatProtection resource. - public static ManagedInstanceAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAzureADOnlyAuthentication.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAzureADOnlyAuthentication.cs index 17cd63f040266..77b892d3d7edc 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAzureADOnlyAuthentication.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceAzureADOnlyAuthentication.cs @@ -50,10 +50,16 @@ public partial class ManagedInstanceAzureADOnlyAuthentication : Resource /// /// Creates a new ManagedInstanceAzureADOnlyAuthentication. /// - /// Name of the ManagedInstanceAzureADOnlyAuthentication. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceAzureADOnlyAuthentication resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstanceAzureADOnlyAuthentication. - public ManagedInstanceAzureADOnlyAuthentication(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/azureADOnlyAuthentications", resourceVersion ?? "2021-11-01") + public ManagedInstanceAzureADOnlyAuthentication(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/azureADOnlyAuthentications", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isAzureADOnlyAuthenticationEnabled = BicepValue.DefineProperty(this, "IsAzureADOnlyAuthenticationEnabled", ["properties", "azureADOnlyAuthentication"]); @@ -82,9 +88,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceAzureADOnlyAuthentication. /// - /// Name of the ManagedInstanceAzureADOnlyAuthentication. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceAzureADOnlyAuthentication resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstanceAzureADOnlyAuthentication. /// The existing ManagedInstanceAzureADOnlyAuthentication resource. - public static ManagedInstanceAzureADOnlyAuthentication FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceAzureADOnlyAuthentication FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceDtc.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceDtc.cs index 20043b9cf50a0..e059b635a981b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceDtc.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceDtc.cs @@ -75,10 +75,15 @@ public partial class ManagedInstanceDtc : Resource /// /// Creates a new ManagedInstanceDtc. /// - /// Name of the ManagedInstanceDtc. + /// + /// The the Bicep identifier name of the ManagedInstanceDtc resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstanceDtc. - public ManagedInstanceDtc(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/dtc", resourceVersion ?? "2021-11-01") + public ManagedInstanceDtc(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/dtc", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _dtcEnabled = BicepValue.DefineProperty(this, "DtcEnabled", ["properties", "dtcEnabled"]); @@ -110,9 +115,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstanceDtc. /// - /// Name of the ManagedInstanceDtc. + /// + /// The the Bicep identifier name of the ManagedInstanceDtc resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstanceDtc. /// The existing ManagedInstanceDtc resource. - public static ManagedInstanceDtc FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceDtc FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceEncryptionProtector.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceEncryptionProtector.cs index 90bbd076bdc8f..4d5151fc40172 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceEncryptionProtector.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceEncryptionProtector.cs @@ -82,10 +82,15 @@ public partial class ManagedInstanceEncryptionProtector : Resource /// /// Creates a new ManagedInstanceEncryptionProtector. /// - /// Name of the ManagedInstanceEncryptionProtector. + /// + /// The the Bicep identifier name of the ManagedInstanceEncryptionProtector + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceEncryptionProtector. - public ManagedInstanceEncryptionProtector(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/encryptionProtector", resourceVersion ?? "2021-11-01") + public ManagedInstanceEncryptionProtector(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/encryptionProtector", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isAutoRotationEnabled = BicepValue.DefineProperty(this, "IsAutoRotationEnabled", ["properties", "autoRotationEnabled"]); @@ -118,9 +123,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstanceEncryptionProtector. /// - /// Name of the ManagedInstanceEncryptionProtector. + /// + /// The the Bicep identifier name of the ManagedInstanceEncryptionProtector + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceEncryptionProtector. /// The existing ManagedInstanceEncryptionProtector resource. - public static ManagedInstanceEncryptionProtector FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceEncryptionProtector FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceKey.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceKey.cs index 1d26e2f756cb7..7b2a5d09cb0bb 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceKey.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceKey.cs @@ -83,10 +83,15 @@ public partial class ManagedInstanceKey : Resource /// /// Creates a new ManagedInstanceKey. /// - /// Name of the ManagedInstanceKey. + /// + /// The the Bicep identifier name of the ManagedInstanceKey resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstanceKey. - public ManagedInstanceKey(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/keys", resourceVersion ?? "2021-11-01") + public ManagedInstanceKey(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/keys", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _serverKeyType = BicepValue.DefineProperty(this, "ServerKeyType", ["properties", "serverKeyType"]); @@ -119,9 +124,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstanceKey. /// - /// Name of the ManagedInstanceKey. + /// + /// The the Bicep identifier name of the ManagedInstanceKey resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagedInstanceKey. /// The existing ManagedInstanceKey resource. - public static ManagedInstanceKey FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceKey FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceLongTermRetentionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceLongTermRetentionPolicy.cs index 370ecdfcbce16..67166204e719a 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceLongTermRetentionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceLongTermRetentionPolicy.cs @@ -68,10 +68,15 @@ public partial class ManagedInstanceLongTermRetentionPolicy : Resource /// /// Creates a new ManagedInstanceLongTermRetentionPolicy. /// - /// Name of the ManagedInstanceLongTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceLongTermRetentionPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceLongTermRetentionPolicy. - public ManagedInstanceLongTermRetentionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/backupLongTermRetentionPolicies", resourceVersion ?? "2021-11-01") + public ManagedInstanceLongTermRetentionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/backupLongTermRetentionPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _monthlyRetention = BicepValue.DefineProperty(this, "MonthlyRetention", ["properties", "monthlyRetention"]); @@ -103,9 +108,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceLongTermRetentionPolicy. /// - /// Name of the ManagedInstanceLongTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceLongTermRetentionPolicy resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceLongTermRetentionPolicy. /// The existing ManagedInstanceLongTermRetentionPolicy resource. - public static ManagedInstanceLongTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceLongTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstancePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstancePrivateEndpointConnection.cs index 4c7d5e9eef312..5841777a91502 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstancePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstancePrivateEndpointConnection.cs @@ -62,10 +62,16 @@ public partial class ManagedInstancePrivateEndpointConnection : Resource /// /// Creates a new ManagedInstancePrivateEndpointConnection. /// - /// Name of the ManagedInstancePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ManagedInstancePrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstancePrivateEndpointConnection. - public ManagedInstancePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/privateEndpointConnections", resourceVersion ?? "2021-11-01") + public ManagedInstancePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/privateEndpointConnections", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -96,9 +102,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstancePrivateEndpointConnection. /// - /// Name of the ManagedInstancePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the + /// ManagedInstancePrivateEndpointConnection resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstancePrivateEndpointConnection. /// The existing ManagedInstancePrivateEndpointConnection resource. - public static ManagedInstancePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstancePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerConfigurationOption.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerConfigurationOption.cs index c2e46056a7d14..ee595722a083c 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerConfigurationOption.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerConfigurationOption.cs @@ -56,10 +56,16 @@ public partial class ManagedInstanceServerConfigurationOption : Resource /// /// Creates a new ManagedInstanceServerConfigurationOption. /// - /// Name of the ManagedInstanceServerConfigurationOption. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceServerConfigurationOption resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstanceServerConfigurationOption. - public ManagedInstanceServerConfigurationOption(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/serverConfigurationOptions", resourceVersion ?? "2021-11-01") + public ManagedInstanceServerConfigurationOption(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/serverConfigurationOptions", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _serverConfigurationOptionValue = BicepValue.DefineProperty(this, "ServerConfigurationOptionValue", ["properties", "serverConfigurationOptionValue"]); @@ -89,9 +95,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceServerConfigurationOption. /// - /// Name of the ManagedInstanceServerConfigurationOption. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceServerConfigurationOption resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagedInstanceServerConfigurationOption. /// The existing ManagedInstanceServerConfigurationOption resource. - public static ManagedInstanceServerConfigurationOption FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceServerConfigurationOption FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerTrustCertificate.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerTrustCertificate.cs index 3bc36d4f44700..6eaf5f833cb1b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerTrustCertificate.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceServerTrustCertificate.cs @@ -62,10 +62,15 @@ public partial class ManagedInstanceServerTrustCertificate : Resource /// /// Creates a new ManagedInstanceServerTrustCertificate. /// - /// Name of the ManagedInstanceServerTrustCertificate. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceServerTrustCertificate resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceServerTrustCertificate. - public ManagedInstanceServerTrustCertificate(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/serverTrustCertificates", resourceVersion ?? "2021-11-01") + public ManagedInstanceServerTrustCertificate(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/serverTrustCertificates", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _publicBlob = BicepValue.DefineProperty(this, "PublicBlob", ["properties", "publicBlob"]); @@ -96,9 +101,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceServerTrustCertificate. /// - /// Name of the ManagedInstanceServerTrustCertificate. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceServerTrustCertificate resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceServerTrustCertificate. /// The existing ManagedInstanceServerTrustCertificate resource. - public static ManagedInstanceServerTrustCertificate FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceServerTrustCertificate FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceStartStopSchedule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceStartStopSchedule.cs index 2f2a552b3347c..986f66c99392a 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceStartStopSchedule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceStartStopSchedule.cs @@ -76,10 +76,15 @@ public partial class ManagedInstanceStartStopSchedule : Resource /// /// Creates a new ManagedInstanceStartStopSchedule. /// - /// Name of the ManagedInstanceStartStopSchedule. + /// + /// The the Bicep identifier name of the ManagedInstanceStartStopSchedule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceStartStopSchedule. - public ManagedInstanceStartStopSchedule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/startStopSchedules", resourceVersion ?? "2021-11-01") + public ManagedInstanceStartStopSchedule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/startStopSchedules", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -111,9 +116,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedInstanceStartStopSchedule. /// - /// Name of the ManagedInstanceStartStopSchedule. + /// + /// The the Bicep identifier name of the ManagedInstanceStartStopSchedule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedInstanceStartStopSchedule. /// The existing ManagedInstanceStartStopSchedule resource. - public static ManagedInstanceStartStopSchedule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceStartStopSchedule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceVulnerabilityAssessment.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceVulnerabilityAssessment.cs index d34acd25d09e2..0414b6fd19903 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceVulnerabilityAssessment.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedInstanceVulnerabilityAssessment.cs @@ -77,10 +77,15 @@ public partial class ManagedInstanceVulnerabilityAssessment : Resource /// /// Creates a new ManagedInstanceVulnerabilityAssessment. /// - /// Name of the ManagedInstanceVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceVulnerabilityAssessment. - public ManagedInstanceVulnerabilityAssessment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") + public ManagedInstanceVulnerabilityAssessment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _recurringScans = BicepValue.DefineProperty(this, "RecurringScans", ["properties", "recurringScans"]); @@ -112,9 +117,14 @@ public static class ResourceVersions /// Creates a reference to an existing /// ManagedInstanceVulnerabilityAssessment. /// - /// Name of the ManagedInstanceVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// ManagedInstanceVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the ManagedInstanceVulnerabilityAssessment. /// The existing ManagedInstanceVulnerabilityAssessment resource. - public static ManagedInstanceVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedInstanceVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedLedgerDigestUpload.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedLedgerDigestUpload.cs index fb02f32c585a6..bc234e7b0e47d 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedLedgerDigestUpload.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedLedgerDigestUpload.cs @@ -57,10 +57,15 @@ public partial class ManagedLedgerDigestUpload : Resource /// /// Creates a new ManagedLedgerDigestUpload. /// - /// Name of the ManagedLedgerDigestUpload. + /// + /// The the Bicep identifier name of the ManagedLedgerDigestUpload + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedLedgerDigestUpload. - public ManagedLedgerDigestUpload(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/ledgerDigestUploads", resourceVersion ?? "2024-05-01-preview") + public ManagedLedgerDigestUpload(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/ledgerDigestUploads", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _digestStorageEndpoint = BicepValue.DefineProperty(this, "DigestStorageEndpoint", ["properties", "digestStorageEndpoint"]); @@ -84,9 +89,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedLedgerDigestUpload. /// - /// Name of the ManagedLedgerDigestUpload. + /// + /// The the Bicep identifier name of the ManagedLedgerDigestUpload + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedLedgerDigestUpload. /// The existing ManagedLedgerDigestUpload resource. - public static ManagedLedgerDigestUpload FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedLedgerDigestUpload FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedRestorableDroppedDbBackupShortTermRetentionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedRestorableDroppedDbBackupShortTermRetentionPolicy.cs index 43ba6b5a10e42..087b1ec981700 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedRestorableDroppedDbBackupShortTermRetentionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedRestorableDroppedDbBackupShortTermRetentionPolicy.cs @@ -45,10 +45,16 @@ public partial class ManagedRestorableDroppedDbBackupShortTermRetentionPolicy : /// /// Creates a new ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. /// - /// Name of the ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedRestorableDroppedDbBackupShortTermRetentionPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. - public ManagedRestorableDroppedDbBackupShortTermRetentionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies", resourceVersion) + public ManagedRestorableDroppedDbBackupShortTermRetentionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _retentionDays = BicepValue.DefineProperty(this, "RetentionDays", ["properties", "retentionDays"]); @@ -60,9 +66,15 @@ public ManagedRestorableDroppedDbBackupShortTermRetentionPolicy(string resourceN /// Creates a reference to an existing /// ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. /// - /// Name of the ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. + /// + /// The the Bicep identifier name of the + /// ManagedRestorableDroppedDbBackupShortTermRetentionPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ManagedRestorableDroppedDbBackupShortTermRetentionPolicy. /// The existing ManagedRestorableDroppedDbBackupShortTermRetentionPolicy resource. - public static ManagedRestorableDroppedDbBackupShortTermRetentionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedRestorableDroppedDbBackupShortTermRetentionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerDnsAlias.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerDnsAlias.cs index 162d22835b907..ca3a6d7e59c7c 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerDnsAlias.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerDnsAlias.cs @@ -62,10 +62,15 @@ public partial class ManagedServerDnsAlias : Resource /// /// Creates a new ManagedServerDnsAlias. /// - /// Name of the ManagedServerDnsAlias. + /// + /// The the Bicep identifier name of the ManagedServerDnsAlias resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ManagedServerDnsAlias. - public ManagedServerDnsAlias(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/dnsAliases", resourceVersion ?? "2021-11-01") + public ManagedServerDnsAlias(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/dnsAliases", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _createDnsRecord = BicepValue.DefineProperty(this, "CreateDnsRecord", ["createDnsRecord"]); @@ -95,9 +100,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedServerDnsAlias. /// - /// Name of the ManagedServerDnsAlias. + /// + /// The the Bicep identifier name of the ManagedServerDnsAlias resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ManagedServerDnsAlias. /// The existing ManagedServerDnsAlias resource. - public static ManagedServerDnsAlias FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedServerDnsAlias FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerSecurityAlertPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerSecurityAlertPolicy.cs index 8292283ada17d..5a87b19306543 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerSecurityAlertPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedServerSecurityAlertPolicy.cs @@ -99,10 +99,15 @@ public partial class ManagedServerSecurityAlertPolicy : Resource /// /// Creates a new ManagedServerSecurityAlertPolicy. /// - /// Name of the ManagedServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the ManagedServerSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedServerSecurityAlertPolicy. - public ManagedServerSecurityAlertPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/securityAlertPolicies", resourceVersion ?? "2021-11-01") + public ManagedServerSecurityAlertPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/securityAlertPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _disabledAlerts = BicepList.DefineProperty(this, "DisabledAlerts", ["properties", "disabledAlerts"]); @@ -137,9 +142,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedServerSecurityAlertPolicy. /// - /// Name of the ManagedServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the ManagedServerSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedServerSecurityAlertPolicy. /// The existing ManagedServerSecurityAlertPolicy resource. - public static ManagedServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedTransparentDataEncryption.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedTransparentDataEncryption.cs index 820e5a4d45df1..26a25e7695b9c 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedTransparentDataEncryption.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ManagedTransparentDataEncryption.cs @@ -50,10 +50,15 @@ public partial class ManagedTransparentDataEncryption : Resource /// /// Creates a new ManagedTransparentDataEncryption. /// - /// Name of the ManagedTransparentDataEncryption. + /// + /// The the Bicep identifier name of the ManagedTransparentDataEncryption + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedTransparentDataEncryption. - public ManagedTransparentDataEncryption(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/databases/transparentDataEncryption", resourceVersion ?? "2021-11-01") + public ManagedTransparentDataEncryption(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/databases/transparentDataEncryption", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -81,9 +86,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagedTransparentDataEncryption. /// - /// Name of the ManagedTransparentDataEncryption. + /// + /// The the Bicep identifier name of the ManagedTransparentDataEncryption + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagedTransparentDataEncryption. /// The existing ManagedTransparentDataEncryption resource. - public static ManagedTransparentDataEncryption FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagedTransparentDataEncryption FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/OutboundFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/OutboundFirewallRule.cs index f35e4df83ac30..836a5eb974778 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/OutboundFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/OutboundFirewallRule.cs @@ -50,10 +50,15 @@ public partial class OutboundFirewallRule : Resource /// /// Creates a new OutboundFirewallRule. /// - /// Name of the OutboundFirewallRule. + /// + /// The the Bicep identifier name of the OutboundFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the OutboundFirewallRule. - public OutboundFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/outboundFirewallRules", resourceVersion ?? "2021-11-01") + public OutboundFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/outboundFirewallRules", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _id = BicepValue.DefineProperty(this, "Id", ["id"], isOutput: true); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing OutboundFirewallRule. /// - /// Name of the OutboundFirewallRule. + /// + /// The the Bicep identifier name of the OutboundFirewallRule resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the OutboundFirewallRule. /// The existing OutboundFirewallRule resource. - public static OutboundFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static OutboundFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ServerAdvancedThreatProtection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ServerAdvancedThreatProtection.cs index b1959514c3017..b7c7256af857e 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ServerAdvancedThreatProtection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/ServerAdvancedThreatProtection.cs @@ -58,10 +58,15 @@ public partial class ServerAdvancedThreatProtection : Resource /// /// Creates a new ServerAdvancedThreatProtection. /// - /// Name of the ServerAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the ServerAdvancedThreatProtection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServerAdvancedThreatProtection. - public ServerAdvancedThreatProtection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/advancedThreatProtectionSettings", resourceVersion ?? "2021-11-01") + public ServerAdvancedThreatProtection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/advancedThreatProtectionSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -90,9 +95,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ServerAdvancedThreatProtection. /// - /// Name of the ServerAdvancedThreatProtection. + /// + /// The the Bicep identifier name of the ServerAdvancedThreatProtection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ServerAdvancedThreatProtection. /// The existing ServerAdvancedThreatProtection resource. - public static ServerAdvancedThreatProtection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ServerAdvancedThreatProtection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlAgentConfiguration.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlAgentConfiguration.cs index 56d0a6dfee76a..728fc93dd9318 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlAgentConfiguration.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlAgentConfiguration.cs @@ -50,10 +50,15 @@ public partial class SqlAgentConfiguration : Resource /// /// Creates a new SqlAgentConfiguration. /// - /// Name of the SqlAgentConfiguration. + /// + /// The the Bicep identifier name of the SqlAgentConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlAgentConfiguration. - public SqlAgentConfiguration(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/managedInstances/sqlAgent", resourceVersion ?? "2021-11-01") + public SqlAgentConfiguration(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/managedInstances/sqlAgent", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -86,9 +91,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlAgentConfiguration. /// - /// Name of the SqlAgentConfiguration. + /// + /// The the Bicep identifier name of the SqlAgentConfiguration resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlAgentConfiguration. /// The existing SqlAgentConfiguration resource. - public static SqlAgentConfiguration FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlAgentConfiguration FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabase.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabase.cs index 78eacbd355d40..0b60455b2f8d3 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabase.cs @@ -476,10 +476,15 @@ public partial class SqlDatabase : Resource /// /// Creates a new SqlDatabase. /// - /// Name of the SqlDatabase. + /// + /// The the Bicep identifier name of the SqlDatabase resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabase. - public SqlDatabase(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases", resourceVersion ?? "2021-11-01") + public SqlDatabase(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -575,11 +580,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlDatabase. /// - /// Name of the SqlDatabase. + /// + /// The the Bicep identifier name of the SqlDatabase resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabase. /// The existing SqlDatabase resource. - public static SqlDatabase FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabase FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SqlDatabase resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseBlobAuditingPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseBlobAuditingPolicy.cs index d0c0b75279971..48b532e209b98 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseBlobAuditingPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseBlobAuditingPolicy.cs @@ -198,10 +198,15 @@ public partial class SqlDatabaseBlobAuditingPolicy : Resource /// /// Creates a new SqlDatabaseBlobAuditingPolicy. /// - /// Name of the SqlDatabaseBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the SqlDatabaseBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseBlobAuditingPolicy. - public SqlDatabaseBlobAuditingPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/auditingSettings", resourceVersion ?? "2021-11-01") + public SqlDatabaseBlobAuditingPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/auditingSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _auditActionsAndGroups = BicepList.DefineProperty(this, "AuditActionsAndGroups", ["properties", "auditActionsAndGroups"]); @@ -239,9 +244,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlDatabaseBlobAuditingPolicy. /// - /// Name of the SqlDatabaseBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the SqlDatabaseBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseBlobAuditingPolicy. /// The existing SqlDatabaseBlobAuditingPolicy resource. - public static SqlDatabaseBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSecurityAlertPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSecurityAlertPolicy.cs index 0172f1e484faa..c3ed6efbb7bf4 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSecurityAlertPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSecurityAlertPolicy.cs @@ -99,10 +99,15 @@ public partial class SqlDatabaseSecurityAlertPolicy : Resource /// /// Creates a new SqlDatabaseSecurityAlertPolicy. /// - /// Name of the SqlDatabaseSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the SqlDatabaseSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseSecurityAlertPolicy. - public SqlDatabaseSecurityAlertPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/securityAlertPolicies", resourceVersion ?? "2021-11-01") + public SqlDatabaseSecurityAlertPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/securityAlertPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _disabledAlerts = BicepList.DefineProperty(this, "DisabledAlerts", ["properties", "disabledAlerts"]); @@ -147,9 +152,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlDatabaseSecurityAlertPolicy. /// - /// Name of the SqlDatabaseSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the SqlDatabaseSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseSecurityAlertPolicy. /// The existing SqlDatabaseSecurityAlertPolicy resource. - public static SqlDatabaseSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSensitivityLabel.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSensitivityLabel.cs index 538914958d7e5..51b1fdfd3cac3 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSensitivityLabel.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSensitivityLabel.cs @@ -100,10 +100,15 @@ public partial class SqlDatabaseSensitivityLabel : Resource /// /// Creates a new SqlDatabaseSensitivityLabel. /// - /// Name of the SqlDatabaseSensitivityLabel. + /// + /// The the Bicep identifier name of the SqlDatabaseSensitivityLabel + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseSensitivityLabel. - public SqlDatabaseSensitivityLabel(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", resourceVersion) + public SqlDatabaseSensitivityLabel(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _informationType = BicepValue.DefineProperty(this, "InformationType", ["properties", "informationType"]); @@ -123,9 +128,14 @@ public SqlDatabaseSensitivityLabel(string resourceName, string? resourceVersion /// /// Creates a reference to an existing SqlDatabaseSensitivityLabel. /// - /// Name of the SqlDatabaseSensitivityLabel. + /// + /// The the Bicep identifier name of the SqlDatabaseSensitivityLabel + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseSensitivityLabel. /// The existing SqlDatabaseSensitivityLabel resource. - public static SqlDatabaseSensitivityLabel FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseSensitivityLabel FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaseline.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaseline.cs index 2a0542aedfb26..9b13298425fed 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaseline.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaseline.cs @@ -51,10 +51,16 @@ public partial class SqlDatabaseSqlVulnerabilityAssessmentBaseline : Resource /// /// Creates a new SqlDatabaseSqlVulnerabilityAssessmentBaseline. /// - /// Name of the SqlDatabaseSqlVulnerabilityAssessmentBaseline. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseSqlVulnerabilityAssessmentBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseSqlVulnerabilityAssessmentBaseline. - public SqlDatabaseSqlVulnerabilityAssessmentBaseline(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines", resourceVersion) + public SqlDatabaseSqlVulnerabilityAssessmentBaseline(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isLatestScan = BicepValue.DefineProperty(this, "IsLatestScan", ["properties", "latestScan"]); @@ -67,9 +73,15 @@ public SqlDatabaseSqlVulnerabilityAssessmentBaseline(string resourceName, string /// Creates a reference to an existing /// SqlDatabaseSqlVulnerabilityAssessmentBaseline. /// - /// Name of the SqlDatabaseSqlVulnerabilityAssessmentBaseline. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseSqlVulnerabilityAssessmentBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseSqlVulnerabilityAssessmentBaseline. /// The existing SqlDatabaseSqlVulnerabilityAssessmentBaseline resource. - public static SqlDatabaseSqlVulnerabilityAssessmentBaseline FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseSqlVulnerabilityAssessmentBaseline FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineRule.cs index ee90c4612c8c7..68e92aae1ee56 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineRule.cs @@ -57,10 +57,16 @@ public partial class SqlDatabaseSqlVulnerabilityAssessmentBaselineRule : Resourc /// /// Creates a new SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. /// - /// Name of the SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseSqlVulnerabilityAssessmentBaselineRule resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. - public SqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines/rules", resourceVersion) + public SqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines/rules", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isLatestScan = BicepValue.DefineProperty(this, "IsLatestScan", ["properties", "latestScan"]); @@ -74,9 +80,15 @@ public SqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string resourceName, st /// Creates a reference to an existing /// SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. /// - /// Name of the SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseSqlVulnerabilityAssessmentBaselineRule resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseSqlVulnerabilityAssessmentBaselineRule. /// The existing SqlDatabaseSqlVulnerabilityAssessmentBaselineRule resource. - public static SqlDatabaseSqlVulnerabilityAssessmentBaselineRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseSqlVulnerabilityAssessmentBaselineRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessment.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessment.cs index 9f5bda22cf7a4..a1bfd599e6d69 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessment.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessment.cs @@ -76,10 +76,15 @@ public partial class SqlDatabaseVulnerabilityAssessment : Resource /// /// Creates a new SqlDatabaseVulnerabilityAssessment. /// - /// Name of the SqlDatabaseVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the SqlDatabaseVulnerabilityAssessment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseVulnerabilityAssessment. - public SqlDatabaseVulnerabilityAssessment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") + public SqlDatabaseVulnerabilityAssessment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _recurringScans = BicepValue.DefineProperty(this, "RecurringScans", ["properties", "recurringScans"]); @@ -110,9 +115,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlDatabaseVulnerabilityAssessment. /// - /// Name of the SqlDatabaseVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the SqlDatabaseVulnerabilityAssessment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlDatabaseVulnerabilityAssessment. /// The existing SqlDatabaseVulnerabilityAssessment resource. - public static SqlDatabaseVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentRuleBaseline.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentRuleBaseline.cs index b7c7ca9ac3823..498956b23f89f 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentRuleBaseline.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentRuleBaseline.cs @@ -45,10 +45,16 @@ public partial class SqlDatabaseVulnerabilityAssessmentRuleBaseline : Resource /// /// Creates a new SqlDatabaseVulnerabilityAssessmentRuleBaseline. /// - /// Name of the SqlDatabaseVulnerabilityAssessmentRuleBaseline. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseVulnerabilityAssessmentRuleBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseVulnerabilityAssessmentRuleBaseline. - public SqlDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines", resourceVersion) + public SqlDatabaseVulnerabilityAssessmentRuleBaseline(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _baselineResults = BicepList.DefineProperty(this, "BaselineResults", ["properties", "baselineResults"]); @@ -60,9 +66,15 @@ public SqlDatabaseVulnerabilityAssessmentRuleBaseline(string resourceName, strin /// Creates a reference to an existing /// SqlDatabaseVulnerabilityAssessmentRuleBaseline. /// - /// Name of the SqlDatabaseVulnerabilityAssessmentRuleBaseline. + /// + /// The the Bicep identifier name of the + /// SqlDatabaseVulnerabilityAssessmentRuleBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlDatabaseVulnerabilityAssessmentRuleBaseline. /// The existing SqlDatabaseVulnerabilityAssessmentRuleBaseline resource. - public static SqlDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlDatabaseVulnerabilityAssessmentRuleBaseline FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlFirewallRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlFirewallRule.cs index a84b43f145da2..ce4647576523c 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlFirewallRule.cs @@ -53,10 +53,15 @@ public partial class SqlFirewallRule : Resource /// /// Creates a new SqlFirewallRule. /// - /// Name of the SqlFirewallRule. + /// + /// The the Bicep identifier name of the SqlFirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlFirewallRule. - public SqlFirewallRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/firewallRules", resourceVersion ?? "2021-11-01") + public SqlFirewallRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/firewallRules", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _endIPAddress = BicepValue.DefineProperty(this, "EndIPAddress", ["properties", "endIpAddress"]); @@ -94,11 +99,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlFirewallRule. /// - /// Name of the SqlFirewallRule. + /// + /// The the Bicep identifier name of the SqlFirewallRule resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlFirewallRule. /// The existing SqlFirewallRule resource. - public static SqlFirewallRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlFirewallRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SqlFirewallRule resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlPrivateEndpointConnection.cs index eae67a5da19fd..71fea21d5ad45 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlPrivateEndpointConnection.cs @@ -69,10 +69,15 @@ public partial class SqlPrivateEndpointConnection : Resource /// /// Creates a new SqlPrivateEndpointConnection. /// - /// Name of the SqlPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SqlPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlPrivateEndpointConnection. - public SqlPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/privateEndpointConnections", resourceVersion ?? "2021-11-01") + public SqlPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/privateEndpointConnections", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -113,9 +118,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlPrivateEndpointConnection. /// - /// Name of the SqlPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the SqlPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlPrivateEndpointConnection. /// The existing SqlPrivateEndpointConnection resource. - public static SqlPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServer.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServer.cs index cbb2e3256f28a..50eb6391b14f8 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServer.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServer.cs @@ -176,10 +176,15 @@ public partial class SqlServer : Resource /// /// Creates a new SqlServer. /// - /// Name of the SqlServer. + /// + /// The the Bicep identifier name of the SqlServer resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServer. - public SqlServer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers", resourceVersion ?? "2021-11-01") + public SqlServer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -235,11 +240,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServer. /// - /// Name of the SqlServer. + /// + /// The the Bicep identifier name of the SqlServer resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServer. /// The existing SqlServer resource. - public static SqlServer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SqlServer resource. @@ -257,10 +267,10 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The . /// The . public RoleAssignment CreateRoleAssignment(SqlBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{SqlBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{SqlBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -273,13 +283,13 @@ public RoleAssignment CreateRoleAssignment(SqlBuiltInRole role, UserAssignedIden /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(SqlBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{SqlBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(SqlBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{SqlBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADAdministrator.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADAdministrator.cs index ad445ebabd742..ef441622d81a6 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADAdministrator.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADAdministrator.cs @@ -75,10 +75,15 @@ public partial class SqlServerAzureADAdministrator : Resource /// /// Creates a new SqlServerAzureADAdministrator. /// - /// Name of the SqlServerAzureADAdministrator. + /// + /// The the Bicep identifier name of the SqlServerAzureADAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerAzureADAdministrator. - public SqlServerAzureADAdministrator(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/administrators", resourceVersion ?? "2021-11-01") + public SqlServerAzureADAdministrator(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/administrators", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true, defaultValue: GetNameDefaultValue()); _administratorType = BicepValue.DefineProperty(this, "AdministratorType", ["properties", "administratorType"]); @@ -120,9 +125,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerAzureADAdministrator. /// - /// Name of the SqlServerAzureADAdministrator. + /// + /// The the Bicep identifier name of the SqlServerAzureADAdministrator + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerAzureADAdministrator. /// The existing SqlServerAzureADAdministrator resource. - public static SqlServerAzureADAdministrator FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerAzureADAdministrator FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADOnlyAuthentication.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADOnlyAuthentication.cs index 825532e191ba9..c3425ab22a0b8 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADOnlyAuthentication.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerAzureADOnlyAuthentication.cs @@ -50,10 +50,15 @@ public partial class SqlServerAzureADOnlyAuthentication : Resource /// /// Creates a new SqlServerAzureADOnlyAuthentication. /// - /// Name of the SqlServerAzureADOnlyAuthentication. + /// + /// The the Bicep identifier name of the SqlServerAzureADOnlyAuthentication + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerAzureADOnlyAuthentication. - public SqlServerAzureADOnlyAuthentication(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/azureADOnlyAuthentications", resourceVersion ?? "2021-11-01") + public SqlServerAzureADOnlyAuthentication(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/azureADOnlyAuthentications", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isAzureADOnlyAuthenticationEnabled = BicepValue.DefineProperty(this, "IsAzureADOnlyAuthenticationEnabled", ["properties", "azureADOnlyAuthentication"]); @@ -91,9 +96,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerAzureADOnlyAuthentication. /// - /// Name of the SqlServerAzureADOnlyAuthentication. + /// + /// The the Bicep identifier name of the SqlServerAzureADOnlyAuthentication + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerAzureADOnlyAuthentication. /// The existing SqlServerAzureADOnlyAuthentication resource. - public static SqlServerAzureADOnlyAuthentication FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerAzureADOnlyAuthentication FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerBlobAuditingPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerBlobAuditingPolicy.cs index fde0eb67c204a..6d04357db8aa2 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerBlobAuditingPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerBlobAuditingPolicy.cs @@ -212,10 +212,15 @@ public partial class SqlServerBlobAuditingPolicy : Resource /// /// Creates a new SqlServerBlobAuditingPolicy. /// - /// Name of the SqlServerBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the SqlServerBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerBlobAuditingPolicy. - public SqlServerBlobAuditingPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/auditingSettings", resourceVersion ?? "2021-11-01") + public SqlServerBlobAuditingPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/auditingSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _auditActionsAndGroups = BicepList.DefineProperty(this, "AuditActionsAndGroups", ["properties", "auditActionsAndGroups"]); @@ -253,9 +258,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerBlobAuditingPolicy. /// - /// Name of the SqlServerBlobAuditingPolicy. + /// + /// The the Bicep identifier name of the SqlServerBlobAuditingPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerBlobAuditingPolicy. /// The existing SqlServerBlobAuditingPolicy resource. - public static SqlServerBlobAuditingPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerBlobAuditingPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerCommunicationLink.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerCommunicationLink.cs index 161b39d29b6fb..3dcbe4d9f67fb 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerCommunicationLink.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerCommunicationLink.cs @@ -69,10 +69,15 @@ public partial class SqlServerCommunicationLink : Resource /// /// Creates a new SqlServerCommunicationLink. /// - /// Name of the SqlServerCommunicationLink. + /// + /// The the Bicep identifier name of the SqlServerCommunicationLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerCommunicationLink. - public SqlServerCommunicationLink(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/communicationLinks", resourceVersion ?? "2014-04-01") + public SqlServerCommunicationLink(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/communicationLinks", resourceVersion ?? "2014-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _partnerServer = BicepValue.DefineProperty(this, "PartnerServer", ["properties", "partnerServer"]); @@ -108,9 +113,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerCommunicationLink. /// - /// Name of the SqlServerCommunicationLink. + /// + /// The the Bicep identifier name of the SqlServerCommunicationLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerCommunicationLink. /// The existing SqlServerCommunicationLink resource. - public static SqlServerCommunicationLink FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerCommunicationLink FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerConnectionPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerConnectionPolicy.cs index 5587a1f604368..fb18ed4a78441 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerConnectionPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerConnectionPolicy.cs @@ -62,10 +62,15 @@ public partial class SqlServerConnectionPolicy : Resource /// /// Creates a new SqlServerConnectionPolicy. /// - /// Name of the SqlServerConnectionPolicy. + /// + /// The the Bicep identifier name of the SqlServerConnectionPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerConnectionPolicy. - public SqlServerConnectionPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/connectionPolicies", resourceVersion ?? "2021-11-01") + public SqlServerConnectionPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/connectionPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _connectionType = BicepValue.DefineProperty(this, "ConnectionType", ["properties", "connectionType"]); @@ -105,9 +110,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerConnectionPolicy. /// - /// Name of the SqlServerConnectionPolicy. + /// + /// The the Bicep identifier name of the SqlServerConnectionPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerConnectionPolicy. /// The existing SqlServerConnectionPolicy resource. - public static SqlServerConnectionPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerConnectionPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDatabaseRestorePoint.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDatabaseRestorePoint.cs index b326e4802d828..c9b71d6df9730 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDatabaseRestorePoint.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDatabaseRestorePoint.cs @@ -74,10 +74,15 @@ public partial class SqlServerDatabaseRestorePoint : Resource /// /// Creates a new SqlServerDatabaseRestorePoint. /// - /// Name of the SqlServerDatabaseRestorePoint. + /// + /// The the Bicep identifier name of the SqlServerDatabaseRestorePoint + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerDatabaseRestorePoint. - public SqlServerDatabaseRestorePoint(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/restorePoints", resourceVersion ?? "2021-11-01") + public SqlServerDatabaseRestorePoint(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/restorePoints", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _earliestRestoreOn = BicepValue.DefineProperty(this, "EarliestRestoreOn", ["properties", "earliestRestoreDate"], isOutput: true); @@ -124,9 +129,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerDatabaseRestorePoint. /// - /// Name of the SqlServerDatabaseRestorePoint. + /// + /// The the Bicep identifier name of the SqlServerDatabaseRestorePoint + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerDatabaseRestorePoint. /// The existing SqlServerDatabaseRestorePoint resource. - public static SqlServerDatabaseRestorePoint FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerDatabaseRestorePoint FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDevOpsAuditingSetting.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDevOpsAuditingSetting.cs index ad10037bc4d6a..2709b2c61e54e 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDevOpsAuditingSetting.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDevOpsAuditingSetting.cs @@ -106,10 +106,15 @@ public partial class SqlServerDevOpsAuditingSetting : Resource /// /// Creates a new SqlServerDevOpsAuditingSetting. /// - /// Name of the SqlServerDevOpsAuditingSetting. + /// + /// The the Bicep identifier name of the SqlServerDevOpsAuditingSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerDevOpsAuditingSetting. - public SqlServerDevOpsAuditingSetting(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/devOpsAuditingSettings", resourceVersion ?? "2021-11-01") + public SqlServerDevOpsAuditingSetting(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/devOpsAuditingSettings", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _isAzureMonitorTargetEnabled = BicepValue.DefineProperty(this, "IsAzureMonitorTargetEnabled", ["properties", "isAzureMonitorTargetEnabled"]); @@ -142,9 +147,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerDevOpsAuditingSetting. /// - /// Name of the SqlServerDevOpsAuditingSetting. + /// + /// The the Bicep identifier name of the SqlServerDevOpsAuditingSetting + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerDevOpsAuditingSetting. /// The existing SqlServerDevOpsAuditingSetting resource. - public static SqlServerDevOpsAuditingSetting FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerDevOpsAuditingSetting FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDnsAlias.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDnsAlias.cs index 7b7a5402007f6..006281d17e92a 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDnsAlias.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerDnsAlias.cs @@ -50,10 +50,15 @@ public partial class SqlServerDnsAlias : Resource /// /// Creates a new SqlServerDnsAlias. /// - /// Name of the SqlServerDnsAlias. + /// + /// The the Bicep identifier name of the SqlServerDnsAlias resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerDnsAlias. - public SqlServerDnsAlias(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/dnsAliases", resourceVersion ?? "2021-11-01") + public SqlServerDnsAlias(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/dnsAliases", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _azureDnsRecord = BicepValue.DefineProperty(this, "AzureDnsRecord", ["properties", "azureDnsRecord"], isOutput: true); @@ -81,9 +86,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerDnsAlias. /// - /// Name of the SqlServerDnsAlias. + /// + /// The the Bicep identifier name of the SqlServerDnsAlias resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerDnsAlias. /// The existing SqlServerDnsAlias resource. - public static SqlServerDnsAlias FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerDnsAlias FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJob.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJob.cs index 809bbb33c6d24..7da7e3afb72c3 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJob.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJob.cs @@ -62,10 +62,15 @@ public partial class SqlServerJob : Resource /// /// Creates a new SqlServerJob. /// - /// Name of the SqlServerJob. + /// + /// The the Bicep identifier name of the SqlServerJob resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerJob. - public SqlServerJob(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents/jobs", resourceVersion ?? "2021-11-01") + public SqlServerJob(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents/jobs", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -95,9 +100,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJob. /// - /// Name of the SqlServerJob. + /// + /// The the Bicep identifier name of the SqlServerJob resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerJob. /// The existing SqlServerJob resource. - public static SqlServerJob FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJob FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobAgent.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobAgent.cs index e64b5f306a08e..d558fcf4b82c0 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobAgent.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobAgent.cs @@ -75,10 +75,15 @@ public partial class SqlServerJobAgent : Resource /// /// Creates a new SqlServerJobAgent. /// - /// Name of the SqlServerJobAgent. + /// + /// The the Bicep identifier name of the SqlServerJobAgent resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerJobAgent. - public SqlServerJobAgent(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents", resourceVersion ?? "2021-11-01") + public SqlServerJobAgent(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -110,9 +115,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJobAgent. /// - /// Name of the SqlServerJobAgent. + /// + /// The the Bicep identifier name of the SqlServerJobAgent resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerJobAgent. /// The existing SqlServerJobAgent resource. - public static SqlServerJobAgent FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJobAgent FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobCredential.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobCredential.cs index ff5fb639938af..4390ef72cf883 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobCredential.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobCredential.cs @@ -56,10 +56,15 @@ public partial class SqlServerJobCredential : Resource /// /// Creates a new SqlServerJobCredential. /// - /// Name of the SqlServerJobCredential. + /// + /// The the Bicep identifier name of the SqlServerJobCredential resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobCredential. - public SqlServerJobCredential(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents/credentials", resourceVersion ?? "2021-11-01") + public SqlServerJobCredential(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents/credentials", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _password = BicepValue.DefineProperty(this, "Password", ["properties", "password"]); @@ -88,9 +93,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJobCredential. /// - /// Name of the SqlServerJobCredential. + /// + /// The the Bicep identifier name of the SqlServerJobCredential resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobCredential. /// The existing SqlServerJobCredential resource. - public static SqlServerJobCredential FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJobCredential FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobExecution.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobExecution.cs index 478974dd71a8a..d51d0d11f7902 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobExecution.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobExecution.cs @@ -122,10 +122,15 @@ public partial class SqlServerJobExecution : Resource /// /// Creates a new SqlServerJobExecution. /// - /// Name of the SqlServerJobExecution. + /// + /// The the Bicep identifier name of the SqlServerJobExecution resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobExecution. - public SqlServerJobExecution(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents/jobs/executions", resourceVersion ?? "2021-11-01") + public SqlServerJobExecution(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents/jobs/executions", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _createOn = BicepValue.DefineProperty(this, "CreateOn", ["properties", "createTime"], isOutput: true); @@ -165,9 +170,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJobExecution. /// - /// Name of the SqlServerJobExecution. + /// + /// The the Bicep identifier name of the SqlServerJobExecution resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobExecution. /// The existing SqlServerJobExecution resource. - public static SqlServerJobExecution FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJobExecution FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobStep.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobStep.cs index 78b9eb9ef8f0f..4c4320e36db3d 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobStep.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobStep.cs @@ -84,10 +84,15 @@ public partial class SqlServerJobStep : Resource /// /// Creates a new SqlServerJobStep. /// - /// Name of the SqlServerJobStep. + /// + /// The the Bicep identifier name of the SqlServerJobStep resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerJobStep. - public SqlServerJobStep(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents/jobs/steps", resourceVersion ?? "2021-11-01") + public SqlServerJobStep(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents/jobs/steps", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _action = BicepValue.DefineProperty(this, "Action", ["properties", "action"]); @@ -120,9 +125,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJobStep. /// - /// Name of the SqlServerJobStep. + /// + /// The the Bicep identifier name of the SqlServerJobStep resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the SqlServerJobStep. /// The existing SqlServerJobStep resource. - public static SqlServerJobStep FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJobStep FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobTargetGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobTargetGroup.cs index 00940c705c592..a2ee68e86c0f8 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobTargetGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerJobTargetGroup.cs @@ -51,10 +51,15 @@ public partial class SqlServerJobTargetGroup : Resource /// /// Creates a new SqlServerJobTargetGroup. /// - /// Name of the SqlServerJobTargetGroup. + /// + /// The the Bicep identifier name of the SqlServerJobTargetGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobTargetGroup. - public SqlServerJobTargetGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/jobAgents/targetGroups", resourceVersion ?? "2021-11-01") + public SqlServerJobTargetGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/jobAgents/targetGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _members = BicepList.DefineProperty(this, "Members", ["properties", "members"]); @@ -82,9 +87,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerJobTargetGroup. /// - /// Name of the SqlServerJobTargetGroup. + /// + /// The the Bicep identifier name of the SqlServerJobTargetGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerJobTargetGroup. /// The existing SqlServerJobTargetGroup resource. - public static SqlServerJobTargetGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerJobTargetGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerKey.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerKey.cs index ab4205d519a42..a6e865205af83 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerKey.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerKey.cs @@ -100,10 +100,15 @@ public partial class SqlServerKey : Resource /// /// Creates a new SqlServerKey. /// - /// Name of the SqlServerKey. + /// + /// The the Bicep identifier name of the SqlServerKey resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerKey. - public SqlServerKey(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/keys", resourceVersion ?? "2021-11-01") + public SqlServerKey(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/keys", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _serverKeyType = BicepValue.DefineProperty(this, "ServerKeyType", ["properties", "serverKeyType"]); @@ -138,9 +143,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerKey. /// - /// Name of the SqlServerKey. + /// + /// The the Bicep identifier name of the SqlServerKey resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerKey. /// The existing SqlServerKey resource. - public static SqlServerKey FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerKey FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSecurityAlertPolicy.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSecurityAlertPolicy.cs index 568af40261490..9e1960d3e18dc 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSecurityAlertPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSecurityAlertPolicy.cs @@ -99,10 +99,15 @@ public partial class SqlServerSecurityAlertPolicy : Resource /// /// Creates a new SqlServerSecurityAlertPolicy. /// - /// Name of the SqlServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the SqlServerSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerSecurityAlertPolicy. - public SqlServerSecurityAlertPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/securityAlertPolicies", resourceVersion ?? "2021-11-01") + public SqlServerSecurityAlertPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/securityAlertPolicies", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _disabledAlerts = BicepList.DefineProperty(this, "DisabledAlerts", ["properties", "disabledAlerts"]); @@ -137,9 +142,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerSecurityAlertPolicy. /// - /// Name of the SqlServerSecurityAlertPolicy. + /// + /// The the Bicep identifier name of the SqlServerSecurityAlertPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerSecurityAlertPolicy. /// The existing SqlServerSecurityAlertPolicy resource. - public static SqlServerSecurityAlertPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerSecurityAlertPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessment.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessment.cs index 4cb43108e5be4..bbe68a9074b73 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessment.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessment.cs @@ -52,10 +52,15 @@ public partial class SqlServerSqlVulnerabilityAssessment : Resource /// /// Creates a new SqlServerSqlVulnerabilityAssessment. /// - /// Name of the SqlServerSqlVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessment. - public SqlServerSqlVulnerabilityAssessment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments", resourceVersion ?? "2024-05-01-preview") + public SqlServerSqlVulnerabilityAssessment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _state = BicepValue.DefineProperty(this, "State", ["properties", "state"]); @@ -78,9 +83,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerSqlVulnerabilityAssessment. /// - /// Name of the SqlServerSqlVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessment resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessment. /// The existing SqlServerSqlVulnerabilityAssessment resource. - public static SqlServerSqlVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerSqlVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaseline.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaseline.cs index e901a1de4a4d7..617c0d9ac5306 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaseline.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaseline.cs @@ -57,10 +57,16 @@ public partial class SqlServerSqlVulnerabilityAssessmentBaseline : Resource /// /// Creates a new SqlServerSqlVulnerabilityAssessmentBaseline. /// - /// Name of the SqlServerSqlVulnerabilityAssessmentBaseline. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessmentBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessmentBaseline. - public SqlServerSqlVulnerabilityAssessmentBaseline(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines", resourceVersion ?? "2024-05-01-preview") + public SqlServerSqlVulnerabilityAssessmentBaseline(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isLatestScan = BicepValue.DefineProperty(this, "IsLatestScan", ["properties", "latestScan"]); @@ -85,9 +91,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// SqlServerSqlVulnerabilityAssessmentBaseline. /// - /// Name of the SqlServerSqlVulnerabilityAssessmentBaseline. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessmentBaseline resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessmentBaseline. /// The existing SqlServerSqlVulnerabilityAssessmentBaseline resource. - public static SqlServerSqlVulnerabilityAssessmentBaseline FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerSqlVulnerabilityAssessmentBaseline FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineRule.cs index a8d5266ebdc25..d6d019428da9b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineRule.cs @@ -57,10 +57,16 @@ public partial class SqlServerSqlVulnerabilityAssessmentBaselineRule : Resource /// /// Creates a new SqlServerSqlVulnerabilityAssessmentBaselineRule. /// - /// Name of the SqlServerSqlVulnerabilityAssessmentBaselineRule. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessmentBaselineRule resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessmentBaselineRule. - public SqlServerSqlVulnerabilityAssessmentBaselineRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines/rules", resourceVersion ?? "2024-05-01-preview") + public SqlServerSqlVulnerabilityAssessmentBaselineRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines/rules", resourceVersion ?? "2024-05-01-preview") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _isLatestScan = BicepValue.DefineProperty(this, "IsLatestScan", ["properties", "latestScan"]); @@ -86,9 +92,15 @@ public static class ResourceVersions /// Creates a reference to an existing /// SqlServerSqlVulnerabilityAssessmentBaselineRule. /// - /// Name of the SqlServerSqlVulnerabilityAssessmentBaselineRule. + /// + /// The the Bicep identifier name of the + /// SqlServerSqlVulnerabilityAssessmentBaselineRule resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SqlServerSqlVulnerabilityAssessmentBaselineRule. /// The existing SqlServerSqlVulnerabilityAssessmentBaselineRule resource. - public static SqlServerSqlVulnerabilityAssessmentBaselineRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerSqlVulnerabilityAssessmentBaselineRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerTrustGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerTrustGroup.cs index 33304face3eea..cdcba75e2b62f 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerTrustGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerTrustGroup.cs @@ -51,10 +51,15 @@ public partial class SqlServerTrustGroup : Resource /// /// Creates a new SqlServerTrustGroup. /// - /// Name of the SqlServerTrustGroup. + /// + /// The the Bicep identifier name of the SqlServerTrustGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerTrustGroup. - public SqlServerTrustGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/locations/serverTrustGroups", resourceVersion ?? "2021-11-01") + public SqlServerTrustGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/locations/serverTrustGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _groupMembers = BicepList.DefineProperty(this, "GroupMembers", ["properties", "groupMembers"]); @@ -82,9 +87,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerTrustGroup. /// - /// Name of the SqlServerTrustGroup. + /// + /// The the Bicep identifier name of the SqlServerTrustGroup resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the SqlServerTrustGroup. /// The existing SqlServerTrustGroup resource. - public static SqlServerTrustGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerTrustGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVirtualNetworkRule.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVirtualNetworkRule.cs index d3b1ad06f018c..f58ba2c2ca45d 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVirtualNetworkRule.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVirtualNetworkRule.cs @@ -63,10 +63,15 @@ public partial class SqlServerVirtualNetworkRule : Resource /// /// Creates a new SqlServerVirtualNetworkRule. /// - /// Name of the SqlServerVirtualNetworkRule. + /// + /// The the Bicep identifier name of the SqlServerVirtualNetworkRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerVirtualNetworkRule. - public SqlServerVirtualNetworkRule(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/virtualNetworkRules", resourceVersion ?? "2021-11-01") + public SqlServerVirtualNetworkRule(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/virtualNetworkRules", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _ignoreMissingVnetServiceEndpoint = BicepValue.DefineProperty(this, "IgnoreMissingVnetServiceEndpoint", ["properties", "ignoreMissingVnetServiceEndpoint"]); @@ -96,9 +101,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerVirtualNetworkRule. /// - /// Name of the SqlServerVirtualNetworkRule. + /// + /// The the Bicep identifier name of the SqlServerVirtualNetworkRule + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerVirtualNetworkRule. /// The existing SqlServerVirtualNetworkRule resource. - public static SqlServerVirtualNetworkRule FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerVirtualNetworkRule FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVulnerabilityAssessment.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVulnerabilityAssessment.cs index 3b89d53e39198..82305e2221354 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVulnerabilityAssessment.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SqlServerVulnerabilityAssessment.cs @@ -77,10 +77,15 @@ public partial class SqlServerVulnerabilityAssessment : Resource /// /// Creates a new SqlServerVulnerabilityAssessment. /// - /// Name of the SqlServerVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the SqlServerVulnerabilityAssessment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerVulnerabilityAssessment. - public SqlServerVulnerabilityAssessment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") + public SqlServerVulnerabilityAssessment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/vulnerabilityAssessments", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _recurringScans = BicepValue.DefineProperty(this, "RecurringScans", ["properties", "recurringScans"]); @@ -111,9 +116,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SqlServerVulnerabilityAssessment. /// - /// Name of the SqlServerVulnerabilityAssessment. + /// + /// The the Bicep identifier name of the SqlServerVulnerabilityAssessment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SqlServerVulnerabilityAssessment. /// The existing SqlServerVulnerabilityAssessment resource. - public static SqlServerVulnerabilityAssessment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SqlServerVulnerabilityAssessment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncAgent.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncAgent.cs index d48459547355b..f389692b6ac26 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncAgent.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncAgent.cs @@ -80,10 +80,15 @@ public partial class SyncAgent : Resource /// /// Creates a new SyncAgent. /// - /// Name of the SyncAgent. + /// + /// The the Bicep identifier name of the SyncAgent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncAgent. - public SyncAgent(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/syncAgents", resourceVersion ?? "2021-11-01") + public SyncAgent(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/syncAgents", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _syncDatabaseId = BicepValue.DefineProperty(this, "SyncDatabaseId", ["properties", "syncDatabaseId"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SyncAgent. /// - /// Name of the SyncAgent. + /// + /// The the Bicep identifier name of the SyncAgent resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncAgent. /// The existing SyncAgent resource. - public static SyncAgent FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SyncAgent FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncGroup.cs index c3b986987dfea..395d1ce0d6663 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncGroup.cs @@ -125,10 +125,15 @@ public partial class SyncGroup : Resource /// /// Creates a new SyncGroup. /// - /// Name of the SyncGroup. + /// + /// The the Bicep identifier name of the SyncGroup resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncGroup. - public SyncGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/syncGroups", resourceVersion ?? "2021-11-01") + public SyncGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/syncGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _conflictLoggingRetentionInDays = BicepValue.DefineProperty(this, "ConflictLoggingRetentionInDays", ["properties", "conflictLoggingRetentionInDays"]); @@ -168,11 +173,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing SyncGroup. /// - /// Name of the SyncGroup. + /// + /// The the Bicep identifier name of the SyncGroup resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncGroup. /// The existing SyncGroup resource. - public static SyncGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SyncGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SyncGroup resource. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncMember.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncMember.cs index d84dd1c3c4ee1..410dd480990b5 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncMember.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/SyncMember.cs @@ -118,10 +118,15 @@ public partial class SyncMember : Resource /// /// Creates a new SyncMember. /// - /// Name of the SyncMember. + /// + /// The the Bicep identifier name of the SyncMember resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncMember. - public SyncMember(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/syncGroups/syncMembers", resourceVersion ?? "2021-11-01") + public SyncMember(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/syncGroups/syncMembers", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _databaseName = BicepValue.DefineProperty(this, "DatabaseName", ["properties", "databaseName"]); @@ -160,9 +165,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing SyncMember. /// - /// Name of the SyncMember. + /// + /// The the Bicep identifier name of the SyncMember resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the SyncMember. /// The existing SyncMember resource. - public static SyncMember FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SyncMember FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadClassifier.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadClassifier.cs index 939a5e7c3cda5..51abb88a69246 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadClassifier.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadClassifier.cs @@ -80,10 +80,15 @@ public partial class WorkloadClassifier : Resource /// /// Creates a new WorkloadClassifier. /// - /// Name of the WorkloadClassifier. + /// + /// The the Bicep identifier name of the WorkloadClassifier resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WorkloadClassifier. - public WorkloadClassifier(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers", resourceVersion ?? "2021-11-01") + public WorkloadClassifier(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _context = BicepValue.DefineProperty(this, "Context", ["properties", "context"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WorkloadClassifier. /// - /// Name of the WorkloadClassifier. + /// + /// The the Bicep identifier name of the WorkloadClassifier resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WorkloadClassifier. /// The existing WorkloadClassifier resource. - public static WorkloadClassifier FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WorkloadClassifier FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadGroup.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadGroup.cs index 4be885c778acb..85fbe3ffdcec5 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadGroup.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Generated/WorkloadGroup.cs @@ -80,10 +80,15 @@ public partial class WorkloadGroup : Resource /// /// Creates a new WorkloadGroup. /// - /// Name of the WorkloadGroup. + /// + /// The the Bicep identifier name of the WorkloadGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WorkloadGroup. - public WorkloadGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Sql/servers/databases/workloadGroups", resourceVersion ?? "2021-11-01") + public WorkloadGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Sql/servers/databases/workloadGroups", resourceVersion ?? "2021-11-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _importance = BicepValue.DefineProperty(this, "Importance", ["properties", "importance"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WorkloadGroup. /// - /// Name of the WorkloadGroup. + /// + /// The the Bicep identifier name of the WorkloadGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WorkloadGroup. /// The existing WorkloadGroup resource. - public static WorkloadGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WorkloadGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/api/Azure.Provisioning.Storage.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.Storage/api/Azure.Provisioning.Storage.netstandard2.0.cs index 3a2d6fb127cae..82f6708648002 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/api/Azure.Provisioning.Storage.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/api/Azure.Provisioning.Storage.netstandard2.0.cs @@ -34,7 +34,7 @@ public enum AllowedCopyScope } public partial class BlobContainer : Azure.Provisioning.Primitives.Resource { - public BlobContainer(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public BlobContainer(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DefaultEncryptionScope { get { throw null; } set { } } public Azure.Provisioning.BicepValue DeletedOn { get { throw null; } } public Azure.Provisioning.BicepValue EnableNfsV3AllSquash { get { throw null; } set { } } @@ -59,7 +59,7 @@ public partial class BlobContainer : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue RemainingRetentionDays { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.Storage.BlobContainer FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.BlobContainer FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -100,14 +100,14 @@ public BlobContainerImmutabilityPolicy() { } } public partial class BlobInventoryPolicy : Azure.Provisioning.Primitives.Resource { - public BlobInventoryPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public BlobInventoryPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LastModifiedOn { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Storage.StorageAccount? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue PolicySchema { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.BlobInventoryPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.BlobInventoryPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_15; @@ -218,7 +218,7 @@ public BlobRestoreStatus() { } } public partial class BlobService : Azure.Provisioning.Primitives.Resource, Azure.Provisioning.Primitives.IClientCreator, Azure.Provisioning.Primitives.IClientCreator { - public BlobService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public BlobService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ChangeFeed { get { throw null; } set { } } public Azure.Provisioning.BicepValue ContainerDeleteRetentionPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepList CorsRules { get { throw null; } set { } } @@ -234,7 +234,7 @@ public partial class BlobService : Azure.Provisioning.Primitives.Resource, Azure public Azure.Provisioning.BicepValue SystemData { get { throw null; } } System.Collections.Generic.IEnumerable Azure.Provisioning.Primitives.IClientCreator.GetOutputs() { throw null; } Azure.Storage.Blobs.BlobServiceClient Azure.Provisioning.Primitives.IClientCreator.CreateClient(System.Collections.Generic.IReadOnlyDictionary deploymentOutputs, Azure.Core.TokenCredential credential, Azure.Storage.Blobs.BlobClientOptions? options) { throw null; } - public static Azure.Provisioning.Storage.BlobService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.BlobService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2016_05_01; @@ -328,7 +328,7 @@ public enum DirectoryServiceOption } public partial class EncryptionScope : Azure.Provisioning.Primitives.Resource { - public EncryptionScope(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public EncryptionScope(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue KeyVaultProperties { get { throw null; } set { } } @@ -339,7 +339,7 @@ public partial class EncryptionScope : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Source { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.EncryptionScope FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.EncryptionScope FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_06_01; @@ -383,7 +383,7 @@ public enum ExpirationAction } public partial class FileService : Azure.Provisioning.Primitives.Resource { - public FileService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public FileService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList CorsRules { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.Storage.StorageAccount? Parent { get { throw null; } set { } } @@ -391,7 +391,7 @@ public partial class FileService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ShareDeleteRetentionPolicy { get { throw null; } set { } } public Azure.Provisioning.BicepValue Sku { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.FileService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.FileService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2016_05_01; @@ -420,7 +420,7 @@ public static partial class ResourceVersions } public partial class FileShare : Azure.Provisioning.Primitives.Resource { - public FileShare(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public FileShare(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessTier { get { throw null; } set { } } public Azure.Provisioning.BicepValue AccessTierChangeOn { get { throw null; } } public Azure.Provisioning.BicepValue AccessTierStatus { get { throw null; } } @@ -444,7 +444,7 @@ public partial class FileShare : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SnapshotOn { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public static Azure.Provisioning.Storage.FileShare FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.FileShare FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -509,7 +509,7 @@ public enum GeoReplicationStatus } public partial class ImmutabilityPolicy : Azure.Provisioning.Primitives.Resource { - public ImmutabilityPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ImmutabilityPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AllowProtectedAppendWrites { get { throw null; } set { } } public Azure.Provisioning.BicepValue AllowProtectedAppendWritesAll { get { throw null; } set { } } public Azure.Provisioning.BicepValue ETag { get { throw null; } } @@ -519,7 +519,7 @@ public partial class ImmutabilityPolicy : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.Storage.BlobContainer? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.ImmutabilityPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.ImmutabilityPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2016_05_01; @@ -688,7 +688,7 @@ public ManagementPolicyVersion() { } } public partial class ObjectReplicationPolicy : Azure.Provisioning.Primitives.Resource { - public ObjectReplicationPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ObjectReplicationPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DestinationAccount { get { throw null; } set { } } public Azure.Provisioning.BicepValue EnabledOn { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -698,7 +698,7 @@ public partial class ObjectReplicationPolicy : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepList Rules { get { throw null; } set { } } public Azure.Provisioning.BicepValue SourceAccount { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.ObjectReplicationPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.ObjectReplicationPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_15; @@ -749,13 +749,13 @@ public ProtectedAppendWritesHistory() { } } public partial class QueueService : Azure.Provisioning.Primitives.Resource { - public QueueService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public QueueService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList CorsRules { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Storage.StorageAccount? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.QueueService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.QueueService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2016_05_01; @@ -807,7 +807,7 @@ public SmbSetting() { } } public partial class StorageAccount : Azure.Provisioning.Primitives.Resource { - public StorageAccount(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageAccount(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AccessTier { get { throw null; } set { } } public Azure.Provisioning.BicepValue AllowBlobPublicAccess { get { throw null; } set { } } public Azure.Provisioning.BicepValue AllowCrossTenantReplication { get { throw null; } set { } } @@ -855,9 +855,9 @@ public partial class StorageAccount : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue StorageAccountSkuConversionStatus { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Storage.StorageBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Storage.StorageBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.Storage.StorageBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.Storage.StorageAccount FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StorageAccount FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.BicepList GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -984,7 +984,7 @@ public StorageAccountKeyVaultProperties() { } } public partial class StorageAccountLocalUser : Azure.Provisioning.Primitives.Resource { - public StorageAccountLocalUser(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageAccountLocalUser(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue HasSharedKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue HasSshKey { get { throw null; } set { } } public Azure.Provisioning.BicepValue HasSshPassword { get { throw null; } set { } } @@ -996,7 +996,7 @@ public partial class StorageAccountLocalUser : Azure.Provisioning.Primitives.Res public Azure.Provisioning.BicepValue Sid { get { throw null; } } public Azure.Provisioning.BicepList SshAuthorizedKeys { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.StorageAccountLocalUser FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StorageAccountLocalUser FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.Storage.LocalUserKeys GetKeys() { throw null; } public static partial class ResourceVersions { @@ -1028,13 +1028,13 @@ public static partial class ResourceVersions } public partial class StorageAccountManagementPolicy : Azure.Provisioning.Primitives.Resource { - public StorageAccountManagementPolicy(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageAccountManagementPolicy(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue LastModifiedOn { get { throw null; } } public Azure.Provisioning.Storage.StorageAccount? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList Rules { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.StorageAccountManagementPolicy FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StorageAccountManagementPolicy FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_15; @@ -1272,7 +1272,7 @@ public StoragePermissionScope() { } } public partial class StoragePrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public StoragePrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StoragePrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -1280,7 +1280,7 @@ public partial class StoragePrivateEndpointConnection : Azure.Provisioning.Primi public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.StoragePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StoragePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_15; @@ -1359,14 +1359,14 @@ public enum StoragePublicNetworkAccess } public partial class StorageQueue : Azure.Provisioning.Primitives.Resource { - public StorageQueue(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageQueue(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApproximateMessageCount { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepDictionary Metadata { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Storage.QueueService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.StorageQueue FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StorageQueue FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1458,14 +1458,14 @@ public StorageSshPublicKey() { } } public partial class StorageTable : Azure.Provisioning.Primitives.Resource { - public StorageTable(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public StorageTable(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.Storage.TableService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepList SignedIdentifiers { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TableName { get { throw null; } } - public static Azure.Provisioning.Storage.StorageTable FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.StorageTable FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1509,13 +1509,13 @@ public StorageTableSignedIdentifier() { } } public partial class TableService : Azure.Provisioning.Primitives.Resource { - public TableService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TableService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList CorsRules { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.Storage.StorageAccount? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Storage.TableService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Storage.TableService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2016_05_01; diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/BlobService.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/BlobService.cs index 1460cfc948877..128e903286628 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/BlobService.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/BlobService.cs @@ -24,7 +24,7 @@ private partial BicepValue GetNameDefaultValue() => /// IEnumerable IClientCreator.GetOutputs() { - yield return new ProvisioningOutput($"{ResourceName}_endpoint", typeof(string)) + yield return new ProvisioningOutput($"{IdentifierName}_endpoint", typeof(string)) { Value = Parent!.PrimaryEndpoints.Value!.BlobUri }; @@ -50,10 +50,10 @@ BlobServiceClient IClientCreator.CreateCli BlobClientOptions? options) { // TODO: Move into a shared helper off ProvCtx's namescoping - string qualifiedName = $"{ResourceName}_endpoint"; + string qualifiedName = $"{IdentifierName}_endpoint"; string endpoint = (deploymentOutputs.TryGetValue(qualifiedName, out object? raw) && raw is string value) ? value : - throw new InvalidOperationException($"Could not find output value {qualifiedName} to construct {GetType().Name} resource {ResourceName}."); + throw new InvalidOperationException($"Could not find output value {qualifiedName} to construct {GetType().Name} resource {IdentifierName}."); return new BlobServiceClient(new Uri(endpoint), credential, options); } } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobContainer.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobContainer.cs index 15341bf4a9389..e5a55dfa1370f 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobContainer.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobContainer.cs @@ -182,10 +182,15 @@ public partial class BlobContainer : Resource /// /// Creates a new BlobContainer. /// - /// Name of the BlobContainer. + /// + /// The the Bicep identifier name of the BlobContainer resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the BlobContainer. - public BlobContainer(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/blobServices/containers", resourceVersion ?? "2024-01-01") + public BlobContainer(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/blobServices/containers", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _defaultEncryptionScope = BicepValue.DefineProperty(this, "DefaultEncryptionScope", ["properties", "defaultEncryptionScope"]); @@ -332,11 +337,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing BlobContainer. /// - /// Name of the BlobContainer. + /// + /// The the Bicep identifier name of the BlobContainer resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the BlobContainer. /// The existing BlobContainer resource. - public static BlobContainer FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static BlobContainer FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this BlobContainer resource. diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobInventoryPolicy.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobInventoryPolicy.cs index 9b61cace0ed37..1ed0bd8889b3a 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobInventoryPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobInventoryPolicy.cs @@ -58,10 +58,15 @@ public partial class BlobInventoryPolicy : Resource /// /// Creates a new BlobInventoryPolicy. /// - /// Name of the BlobInventoryPolicy. + /// + /// The the Bicep identifier name of the BlobInventoryPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the BlobInventoryPolicy. - public BlobInventoryPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/inventoryPolicies", resourceVersion ?? "2024-01-01") + public BlobInventoryPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/inventoryPolicies", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _policySchema = BicepValue.DefineProperty(this, "PolicySchema", ["properties", "policy"]); @@ -200,9 +205,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing BlobInventoryPolicy. /// - /// Name of the BlobInventoryPolicy. + /// + /// The the Bicep identifier name of the BlobInventoryPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the BlobInventoryPolicy. /// The existing BlobInventoryPolicy resource. - public static BlobInventoryPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static BlobInventoryPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobService.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobService.cs index 69f8bfb294ba6..852c72ee3fdee 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobService.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/BlobService.cs @@ -111,10 +111,15 @@ public partial class BlobService : Resource /// /// Creates a new BlobService. /// - /// Name of the BlobService. + /// + /// The the Bicep identifier name of the BlobService resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the BlobService. - public BlobService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/blobServices", resourceVersion ?? "2024-01-01") + public BlobService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/blobServices", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], defaultValue: GetNameDefaultValue()); _changeFeed = BicepValue.DefineProperty(this, "ChangeFeed", ["properties", "changeFeed"]); @@ -251,9 +256,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing BlobService. /// - /// Name of the BlobService. + /// + /// The the Bicep identifier name of the BlobService resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the BlobService. /// The existing BlobService resource. - public static BlobService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static BlobService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/EncryptionScope.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/EncryptionScope.cs index c06ec05dc06d0..07c633e484adf 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/EncryptionScope.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/EncryptionScope.cs @@ -89,10 +89,15 @@ public partial class EncryptionScope : Resource /// /// Creates a new EncryptionScope. /// - /// Name of the EncryptionScope. + /// + /// The the Bicep identifier name of the EncryptionScope resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EncryptionScope. - public EncryptionScope(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/encryptionScopes", resourceVersion ?? "2024-01-01") + public EncryptionScope(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/encryptionScopes", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _keyVaultProperties = BicepValue.DefineProperty(this, "KeyVaultProperties", ["properties", "keyVaultProperties"]); @@ -185,9 +190,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing EncryptionScope. /// - /// Name of the EncryptionScope. + /// + /// The the Bicep identifier name of the EncryptionScope resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the EncryptionScope. /// The existing EncryptionScope resource. - public static EncryptionScope FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static EncryptionScope FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileService.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileService.cs index 53cdc1151be2e..ce0893c0be3fa 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileService.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileService.cs @@ -71,10 +71,15 @@ public partial class FileService : Resource /// /// Creates a new FileService. /// - /// Name of the FileService. + /// + /// The the Bicep identifier name of the FileService resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FileService. - public FileService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/fileServices", resourceVersion ?? "2024-01-01") + public FileService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/fileServices", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], defaultValue: GetNameDefaultValue()); _corsRules = BicepList.DefineProperty(this, "CorsRules", ["properties", "cors", "corsRules"]); @@ -205,9 +210,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing FileService. /// - /// Name of the FileService. + /// + /// The the Bicep identifier name of the FileService resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FileService. /// The existing FileService resource. - public static FileService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static FileService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileShare.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileShare.cs index 03bcc525a96d9..ff3331473a18d 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileShare.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/FileShare.cs @@ -173,10 +173,15 @@ public partial class FileShare : Resource /// /// Creates a new FileShare. /// - /// Name of the FileShare. + /// + /// The the Bicep identifier name of the FileShare resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FileShare. - public FileShare(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/fileServices/shares", resourceVersion ?? "2024-01-01") + public FileShare(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/fileServices/shares", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _accessTier = BicepValue.DefineProperty(this, "AccessTier", ["properties", "accessTier"]); @@ -322,11 +327,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing FileShare. /// - /// Name of the FileShare. + /// + /// The the Bicep identifier name of the FileShare resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the FileShare. /// The existing FileShare resource. - public static FileShare FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static FileShare FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this FileShare resource. diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ImmutabilityPolicy.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ImmutabilityPolicy.cs index c8e6f2f3103a4..8fd02907b0218 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ImmutabilityPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ImmutabilityPolicy.cs @@ -90,10 +90,15 @@ public partial class ImmutabilityPolicy : Resource /// /// Creates a new ImmutabilityPolicy. /// - /// Name of the ImmutabilityPolicy. + /// + /// The the Bicep identifier name of the ImmutabilityPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ImmutabilityPolicy. - public ImmutabilityPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies", resourceVersion ?? "2024-01-01") + public ImmutabilityPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _allowProtectedAppendWrites = BicepValue.DefineProperty(this, "AllowProtectedAppendWrites", ["properties", "allowProtectedAppendWrites"]); @@ -225,9 +230,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ImmutabilityPolicy. /// - /// Name of the ImmutabilityPolicy. + /// + /// The the Bicep identifier name of the ImmutabilityPolicy resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ImmutabilityPolicy. /// The existing ImmutabilityPolicy resource. - public static ImmutabilityPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ImmutabilityPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ObjectReplicationPolicy.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ObjectReplicationPolicy.cs index 9d0cd808e107d..73c949b4c93a9 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ObjectReplicationPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/ObjectReplicationPolicy.cs @@ -77,10 +77,15 @@ public partial class ObjectReplicationPolicy : Resource /// /// Creates a new ObjectReplicationPolicy. /// - /// Name of the ObjectReplicationPolicy. + /// + /// The the Bicep identifier name of the ObjectReplicationPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ObjectReplicationPolicy. - public ObjectReplicationPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/objectReplicationPolicies", resourceVersion ?? "2024-01-01") + public ObjectReplicationPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/objectReplicationPolicies", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _destinationAccount = BicepValue.DefineProperty(this, "DestinationAccount", ["properties", "destinationAccount"]); @@ -222,9 +227,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ObjectReplicationPolicy. /// - /// Name of the ObjectReplicationPolicy. + /// + /// The the Bicep identifier name of the ObjectReplicationPolicy resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ObjectReplicationPolicy. /// The existing ObjectReplicationPolicy resource. - public static ObjectReplicationPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ObjectReplicationPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/QueueService.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/QueueService.cs index 28eb007bcbc59..cd661082df51d 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/QueueService.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/QueueService.cs @@ -52,10 +52,15 @@ public partial class QueueService : Resource /// /// Creates a new QueueService. /// - /// Name of the QueueService. + /// + /// The the Bicep identifier name of the QueueService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the QueueService. - public QueueService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/queueServices", resourceVersion ?? "2024-01-01") + public QueueService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/queueServices", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _corsRules = BicepList.DefineProperty(this, "CorsRules", ["properties", "cors", "corsRules"]); @@ -183,9 +188,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing QueueService. /// - /// Name of the QueueService. + /// + /// The the Bicep identifier name of the QueueService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the QueueService. /// The existing QueueService resource. - public static QueueService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static QueueService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccount.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccount.cs index a26a3430da7d1..e3e389a77725e 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccount.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccount.cs @@ -361,10 +361,15 @@ public partial class StorageAccount : Resource /// /// Creates a new StorageAccount. /// - /// Name of the StorageAccount. + /// + /// The the Bicep identifier name of the StorageAccount resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageAccount. - public StorageAccount(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts", resourceVersion ?? "2024-01-01") + public StorageAccount(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"], isRequired: true); @@ -544,11 +549,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageAccount. /// - /// Name of the StorageAccount. + /// + /// The the Bicep identifier name of the StorageAccount resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageAccount. /// The existing StorageAccount resource. - public static StorageAccount FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageAccount FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this StorageAccount resource. @@ -565,7 +575,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => public BicepList GetKeys() => BicepList.FromExpression( StorageAccountKey.FromExpression, - new MemberExpression(new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys")), "keys")); + new MemberExpression(new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys")), "keys")); /// /// Creates a role assignment for a user-assigned identity that grants @@ -575,10 +585,10 @@ public BicepList GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(StorageBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{StorageBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{StorageBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -591,13 +601,13 @@ public RoleAssignment CreateRoleAssignment(StorageBuiltInRole role, UserAssigned /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(StorageBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{StorageBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(StorageBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{StorageBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountLocalUser.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountLocalUser.cs index 6b24b75111ea5..fc32d9f92eaf8 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountLocalUser.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountLocalUser.cs @@ -93,10 +93,15 @@ public partial class StorageAccountLocalUser : Resource /// /// Creates a new StorageAccountLocalUser. /// - /// Name of the StorageAccountLocalUser. + /// + /// The the Bicep identifier name of the StorageAccountLocalUser resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the StorageAccountLocalUser. - public StorageAccountLocalUser(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/localUsers", resourceVersion ?? "2024-01-01") + public StorageAccountLocalUser(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/localUsers", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _hasSharedKey = BicepValue.DefineProperty(this, "HasSharedKey", ["properties", "hasSharedKey"]); @@ -240,11 +245,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageAccountLocalUser. /// - /// Name of the StorageAccountLocalUser. + /// + /// The the Bicep identifier name of the StorageAccountLocalUser resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the StorageAccountLocalUser. /// The existing StorageAccountLocalUser resource. - public static StorageAccountLocalUser FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageAccountLocalUser FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get access keys for this StorageAccountLocalUser resource. @@ -252,5 +262,5 @@ public static StorageAccountLocalUser FromExisting(string resourceName, string? /// The keys for this StorageAccountLocalUser resource. public LocalUserKeys GetKeys() => LocalUserKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountManagementPolicy.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountManagementPolicy.cs index 37b7f58a973b2..516109ee55ed6 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountManagementPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageAccountManagementPolicy.cs @@ -59,10 +59,15 @@ public partial class StorageAccountManagementPolicy : Resource /// /// Creates a new StorageAccountManagementPolicy. /// - /// Name of the StorageAccountManagementPolicy. + /// + /// The the Bicep identifier name of the StorageAccountManagementPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StorageAccountManagementPolicy. - public StorageAccountManagementPolicy(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/managementPolicies", resourceVersion ?? "2024-01-01") + public StorageAccountManagementPolicy(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/managementPolicies", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], defaultValue: GetNameDefaultValue()); _rules = BicepList.DefineProperty(this, "Rules", ["properties", "policy", "rules"]); @@ -201,9 +206,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageAccountManagementPolicy. /// - /// Name of the StorageAccountManagementPolicy. + /// + /// The the Bicep identifier name of the StorageAccountManagementPolicy + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StorageAccountManagementPolicy. /// The existing StorageAccountManagementPolicy resource. - public static StorageAccountManagementPolicy FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageAccountManagementPolicy FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StoragePrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StoragePrivateEndpointConnection.cs index dffbc80edc4b8..2ddfe7b333b20 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StoragePrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StoragePrivateEndpointConnection.cs @@ -64,10 +64,15 @@ public partial class StoragePrivateEndpointConnection : Resource /// /// Creates a new StoragePrivateEndpointConnection. /// - /// Name of the StoragePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the StoragePrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StoragePrivateEndpointConnection. - public StoragePrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/privateEndpointConnections", resourceVersion ?? "2024-01-01") + public StoragePrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/privateEndpointConnections", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -207,9 +212,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing StoragePrivateEndpointConnection. /// - /// Name of the StoragePrivateEndpointConnection. + /// + /// The the Bicep identifier name of the StoragePrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the StoragePrivateEndpointConnection. /// The existing StoragePrivateEndpointConnection resource. - public static StoragePrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StoragePrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageQueue.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageQueue.cs index 5dc031ce7a224..de33a10c1725f 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageQueue.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageQueue.cs @@ -64,10 +64,15 @@ public partial class StorageQueue : Resource /// /// Creates a new StorageQueue. /// - /// Name of the StorageQueue. + /// + /// The the Bicep identifier name of the StorageQueue resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageQueue. - public StorageQueue(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/queueServices/queues", resourceVersion ?? "2024-01-01") + public StorageQueue(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/queueServices/queues", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _metadata = BicepDictionary.DefineProperty(this, "Metadata", ["properties", "metadata"]); @@ -196,11 +201,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageQueue. /// - /// Name of the StorageQueue. + /// + /// The the Bicep identifier name of the StorageQueue resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageQueue. /// The existing StorageQueue resource. - public static StorageQueue FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageQueue FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this StorageQueue resource. diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageTable.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageTable.cs index b4d45a7aa92a0..a472d418ae263 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageTable.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/StorageTable.cs @@ -60,10 +60,15 @@ public partial class StorageTable : Resource /// /// Creates a new StorageTable. /// - /// Name of the StorageTable. + /// + /// The the Bicep identifier name of the StorageTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageTable. - public StorageTable(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/tableServices/tables", resourceVersion ?? "2024-01-01") + public StorageTable(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/tableServices/tables", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _signedIdentifiers = BicepList.DefineProperty(this, "SignedIdentifiers", ["properties", "signedIdentifiers"]); @@ -192,11 +197,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing StorageTable. /// - /// Name of the StorageTable. + /// + /// The the Bicep identifier name of the StorageTable resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the StorageTable. /// The existing StorageTable resource. - public static StorageTable FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static StorageTable FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this StorageTable resource. diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/TableService.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/TableService.cs index f9c6959561bfc..31cf2fc47d1af 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/TableService.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Generated/TableService.cs @@ -52,10 +52,15 @@ public partial class TableService : Resource /// /// Creates a new TableService. /// - /// Name of the TableService. + /// + /// The the Bicep identifier name of the TableService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TableService. - public TableService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Storage/storageAccounts/tableServices", resourceVersion ?? "2024-01-01") + public TableService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Storage/storageAccounts/tableServices", resourceVersion ?? "2024-01-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _corsRules = BicepList.DefineProperty(this, "CorsRules", ["properties", "cors", "corsRules"]); @@ -183,9 +188,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing TableService. /// - /// Name of the TableService. + /// + /// The the Bicep identifier name of the TableService resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TableService. /// The existing TableService resource. - public static TableService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TableService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs b/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs index 219f6f2e3117e..d7eb24db8afb7 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/tests/BasicStorageTests.cs @@ -165,7 +165,7 @@ await test.Define( infra.Add(role); role = storage.CreateRoleAssignment(StorageBuiltInRole.StorageBlobDataContributor, RoleManagementPrincipalType.ServicePrincipal, id.PrincipalId); - role.ResourceName = "storage_writer"; + role.IdentifierName = "storage_writer"; infra.Add(role); return infra; diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/api/Azure.Provisioning.WebPubSub.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/api/Azure.Provisioning.WebPubSub.netstandard2.0.cs index 77f8c7feb6f5d..2a256be1cd9b1 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/api/Azure.Provisioning.WebPubSub.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/api/Azure.Provisioning.WebPubSub.netstandard2.0.cs @@ -85,13 +85,13 @@ public WebPubSubEventHandler() { } } public partial class WebPubSubHub : Azure.Provisioning.Primitives.Resource { - public WebPubSubHub(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebPubSubHub(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.WebPubSub.WebPubSubService? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.WebPubSub.WebPubSubHub FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.WebPubSub.WebPubSubHub FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_05_01; @@ -126,7 +126,7 @@ public WebPubSubNetworkAcls() { } } public partial class WebPubSubPrivateEndpointConnection : Azure.Provisioning.Primitives.Resource { - public WebPubSubPrivateEndpointConnection(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebPubSubPrivateEndpointConnection(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ConnectionState { get { throw null; } set { } } public Azure.Provisioning.BicepList GroupIds { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -135,7 +135,7 @@ public partial class WebPubSubPrivateEndpointConnection : Azure.Provisioning.Pri public Azure.Provisioning.BicepValue PrivateEndpointId { get { throw null; } set { } } public Azure.Provisioning.BicepValue ProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.WebPubSub.WebPubSubPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.WebPubSub.WebPubSubPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_05_01; @@ -192,7 +192,7 @@ public enum WebPubSubRequestType } public partial class WebPubSubService : Azure.Provisioning.Primitives.Resource { - public WebPubSubService(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebPubSubService(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ExternalIP { get { throw null; } } public Azure.Provisioning.BicepValue HostName { get { throw null; } } public Azure.Provisioning.BicepValue HostNamePrefix { get { throw null; } } @@ -216,9 +216,9 @@ public partial class WebPubSubService : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue Version { get { throw null; } } - public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? resourceNameSuffix = null) { throw null; } + public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole role, Azure.Provisioning.BicepValue principalType, Azure.Provisioning.BicepValue principalId, string? identifierNameSuffix = null) { throw null; } public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; } - public static Azure.Provisioning.WebPubSub.WebPubSubService FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.WebPubSub.WebPubSubService FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public Azure.Provisioning.WebPubSub.WebPubSubKeys GetKeys() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } @@ -233,7 +233,7 @@ public static partial class ResourceVersions } public partial class WebPubSubSharedPrivateLink : Azure.Provisioning.Primitives.Resource { - public WebPubSubSharedPrivateLink(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public WebPubSubSharedPrivateLink(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue GroupId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -243,7 +243,7 @@ public partial class WebPubSubSharedPrivateLink : Azure.Provisioning.Primitives. public Azure.Provisioning.BicepValue RequestMessage { get { throw null; } set { } } public Azure.Provisioning.BicepValue Status { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.WebPubSub.WebPubSubSharedPrivateLink FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.WebPubSub.WebPubSubSharedPrivateLink FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_05_01; diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubHub.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubHub.cs index 2c91e74f89683..7c4ca121d7aa2 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubHub.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubHub.cs @@ -51,10 +51,15 @@ public partial class WebPubSubHub : Resource /// /// Creates a new WebPubSubHub. /// - /// Name of the WebPubSubHub. + /// + /// The the Bicep identifier name of the WebPubSubHub resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebPubSubHub. - public WebPubSubHub(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/webPubSub/hubs", resourceVersion ?? "2024-03-01") + public WebPubSubHub(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/webPubSub/hubs", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _properties = BicepValue.DefineProperty(this, "Properties", ["properties"], isRequired: true); @@ -97,9 +102,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebPubSubHub. /// - /// Name of the WebPubSubHub. + /// + /// The the Bicep identifier name of the WebPubSubHub resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the WebPubSubHub. /// The existing WebPubSubHub resource. - public static WebPubSubHub FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebPubSubHub FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubPrivateEndpointConnection.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubPrivateEndpointConnection.cs index 73eceec13a1cc..6a46de77cb182 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubPrivateEndpointConnection.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubPrivateEndpointConnection.cs @@ -69,10 +69,15 @@ public partial class WebPubSubPrivateEndpointConnection : Resource /// /// Creates a new WebPubSubPrivateEndpointConnection. /// - /// Name of the WebPubSubPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the WebPubSubPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebPubSubPrivateEndpointConnection. - public WebPubSubPrivateEndpointConnection(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/webPubSub/privateEndpointConnections", resourceVersion ?? "2024-03-01") + public WebPubSubPrivateEndpointConnection(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/webPubSub/privateEndpointConnections", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _connectionState = BicepValue.DefineProperty(this, "ConnectionState", ["properties", "privateLinkServiceConnectionState"]); @@ -118,9 +123,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebPubSubPrivateEndpointConnection. /// - /// Name of the WebPubSubPrivateEndpointConnection. + /// + /// The the Bicep identifier name of the WebPubSubPrivateEndpointConnection + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebPubSubPrivateEndpointConnection. /// The existing WebPubSubPrivateEndpointConnection resource. - public static WebPubSubPrivateEndpointConnection FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebPubSubPrivateEndpointConnection FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubService.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubService.cs index 266d73faf3b98..79509871aaf6c 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubService.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubService.cs @@ -174,10 +174,15 @@ public partial class WebPubSubService : Resource /// /// Creates a new WebPubSubService. /// - /// Name of the WebPubSubService. + /// + /// The the Bicep identifier name of the WebPubSubService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebPubSubService. - public WebPubSubService(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/webPubSub", resourceVersion ?? "2024-03-01") + public WebPubSubService(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/webPubSub", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -238,11 +243,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebPubSubService. /// - /// Name of the WebPubSubService. + /// + /// The the Bicep identifier name of the WebPubSubService resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the WebPubSubService. /// The existing WebPubSubService resource. - public static WebPubSubService FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebPubSubService FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this WebPubSubService resource. @@ -258,7 +268,7 @@ public override ResourceNameRequirements GetResourceNameRequirements() => /// The keys for this WebPubSubService resource. public WebPubSubKeys GetKeys() => WebPubSubKeys.FromExpression( - new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), "listKeys"))); + new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), "listKeys"))); /// /// Creates a role assignment for a user-assigned identity that grants @@ -268,10 +278,10 @@ public WebPubSubKeys GetKeys() => /// The . /// The . public RoleAssignment CreateRoleAssignment(WebPubSubBuiltInRole role, UserAssignedIdentity identity) => - new($"{ResourceName}_{identity.ResourceName}_{WebPubSubBuiltInRole.GetBuiltInRoleName(role)}") + new($"{IdentifierName}_{identity.IdentifierName}_{WebPubSubBuiltInRole.GetBuiltInRoleName(role)}") { Name = BicepFunction.CreateGuid(Id, identity.PrincipalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = RoleManagementPrincipalType.ServicePrincipal, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = identity.PrincipalId @@ -284,13 +294,13 @@ public RoleAssignment CreateRoleAssignment(WebPubSubBuiltInRole role, UserAssign /// The role to grant. /// The type of the principal to assign to. /// The principal to assign to. - /// Optional role assignment resource name suffix. + /// Optional role assignment identifier name suffix. /// The . - public RoleAssignment CreateRoleAssignment(WebPubSubBuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) => - new($"{ResourceName}_{WebPubSubBuiltInRole.GetBuiltInRoleName(role)}{(resourceNameSuffix is null ? "" : "_")}{resourceNameSuffix}") + public RoleAssignment CreateRoleAssignment(WebPubSubBuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) => + new($"{IdentifierName}_{WebPubSubBuiltInRole.GetBuiltInRoleName(role)}{(identifierNameSuffix is null ? "" : "_")}{identifierNameSuffix}") { Name = BicepFunction.CreateGuid(Id, principalId, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())), - Scope = new IdentifierExpression(ResourceName), + Scope = new IdentifierExpression(IdentifierName), PrincipalType = principalType, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString()), PrincipalId = principalId diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubSharedPrivateLink.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubSharedPrivateLink.cs index 0e8ff65fa92aa..5b9892ed770b7 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubSharedPrivateLink.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Generated/WebPubSubSharedPrivateLink.cs @@ -76,10 +76,15 @@ public partial class WebPubSubSharedPrivateLink : Resource /// /// Creates a new WebPubSubSharedPrivateLink. /// - /// Name of the WebPubSubSharedPrivateLink. + /// + /// The the Bicep identifier name of the WebPubSubSharedPrivateLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebPubSubSharedPrivateLink. - public WebPubSubSharedPrivateLink(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.SignalRService/webPubSub/sharedPrivateLinkResources", resourceVersion ?? "2024-03-01") + public WebPubSubSharedPrivateLink(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.SignalRService/webPubSub/sharedPrivateLinkResources", resourceVersion ?? "2024-03-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _groupId = BicepValue.DefineProperty(this, "GroupId", ["properties", "groupId"]); @@ -126,9 +131,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing WebPubSubSharedPrivateLink. /// - /// Name of the WebPubSubSharedPrivateLink. + /// + /// The the Bicep identifier name of the WebPubSubSharedPrivateLink + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the WebPubSubSharedPrivateLink. /// The existing WebPubSubSharedPrivateLink resource. - public static WebPubSubSharedPrivateLink FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static WebPubSubSharedPrivateLink FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs index 1559b9c2a2029..f7323886f23ed 100644 --- a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs @@ -145,7 +145,7 @@ namespace Azure.Provisioning.Authorization { public partial class AuthorizationRoleDefinition : Azure.Provisioning.Primitives.Resource { - public AuthorizationRoleDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public AuthorizationRoleDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList AssignableScopes { get { throw null; } set { } } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -154,7 +154,7 @@ public partial class AuthorizationRoleDefinition : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue RoleName { get { throw null; } set { } } public Azure.Provisioning.BicepValue RoleType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Authorization.AuthorizationRoleDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Authorization.AuthorizationRoleDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_01; @@ -194,7 +194,7 @@ public PolicyAssignmentProperties() { } } public partial class RoleAssignment : Azure.Provisioning.Primitives.Resource { - public RoleAssignment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RoleAssignment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Condition { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConditionVersion { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedBy { get { throw null; } } @@ -210,7 +210,7 @@ public partial class RoleAssignment : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedBy { get { throw null; } } public Azure.Provisioning.BicepValue UpdatedOn { get { throw null; } } - public static Azure.Provisioning.Authorization.RoleAssignment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Authorization.RoleAssignment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2015_06_01; @@ -230,7 +230,7 @@ public enum RoleAssignmentEnablementRuleType } public partial class RoleAssignmentScheduleRequest : Azure.Provisioning.Primitives.Resource { - public RoleAssignmentScheduleRequest(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RoleAssignmentScheduleRequest(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApprovalId { get { throw null; } } public Azure.Provisioning.BicepValue Condition { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConditionVersion { get { throw null; } set { } } @@ -255,7 +255,7 @@ public partial class RoleAssignmentScheduleRequest : Azure.Provisioning.Primitiv public Azure.Provisioning.BicepValue TargetRoleAssignmentScheduleId { get { throw null; } set { } } public Azure.Provisioning.BicepValue TargetRoleAssignmentScheduleInstanceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue TicketInfo { get { throw null; } set { } } - public static Azure.Provisioning.Authorization.RoleAssignmentScheduleRequest FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Authorization.RoleAssignmentScheduleRequest FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_10_01; @@ -278,7 +278,7 @@ public RoleDefinitionPermission() { } } public partial class RoleEligibilityScheduleRequest : Azure.Provisioning.Primitives.Resource { - public RoleEligibilityScheduleRequest(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RoleEligibilityScheduleRequest(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApprovalId { get { throw null; } } public Azure.Provisioning.BicepValue Condition { get { throw null; } set { } } public Azure.Provisioning.BicepValue ConditionVersion { get { throw null; } set { } } @@ -302,7 +302,7 @@ public partial class RoleEligibilityScheduleRequest : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue TargetRoleEligibilityScheduleId { get { throw null; } set { } } public Azure.Provisioning.BicepValue TargetRoleEligibilityScheduleInstanceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue TicketInfo { get { throw null; } set { } } - public static Azure.Provisioning.Authorization.RoleEligibilityScheduleRequest FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Authorization.RoleEligibilityScheduleRequest FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_10_01; @@ -367,7 +367,7 @@ public RoleManagementPolicyApprovalRule() { } } public partial class RoleManagementPolicyAssignment : Azure.Provisioning.Primitives.Resource { - public RoleManagementPolicyAssignment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public RoleManagementPolicyAssignment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList EffectiveRules { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } @@ -376,7 +376,7 @@ public partial class RoleManagementPolicyAssignment : Azure.Provisioning.Primiti public Azure.Provisioning.BicepValue RoleDefinitionId { get { throw null; } set { } } public Azure.Provisioning.BicepValue Scope { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Authorization.RoleManagementPolicyAssignment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Authorization.RoleManagementPolicyAssignment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_10_01; @@ -808,7 +808,7 @@ public override void ResolveProperties(Azure.Provisioning.ProvisioningContext co } public partial class ModuleImport : Azure.Provisioning.Primitives.NamedProvisioningConstruct { - public ModuleImport(string resourceName, Azure.Provisioning.BicepValue path) : base (default(string)) { } + public ModuleImport(string identifierName, Azure.Provisioning.BicepValue path) : base (default(string)) { } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary Parameters { get { throw null; } } public Azure.Provisioning.BicepValue Path { get { throw null; } set { } } @@ -818,8 +818,8 @@ protected internal override void Validate(Azure.Provisioning.ProvisioningContext } public abstract partial class NamedProvisioningConstruct : Azure.Provisioning.Primitives.ProvisioningConstruct { - protected NamedProvisioningConstruct(string resourceName) { } - public string ResourceName { get { throw null; } set { } } + protected NamedProvisioningConstruct(string identifierName) { } + public string IdentifierName { get { throw null; } set { } } } public partial class OrderingInfrastructureResolver : Azure.Provisioning.Primitives.InfrastructureResolver { @@ -918,7 +918,7 @@ public ApiProfile() { } } public partial class ArmApplication : Azure.Provisioning.Primitives.Resource { - public ArmApplication(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ArmApplication(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationDefinitionId { get { throw null; } set { } } public Azure.Provisioning.BicepList Artifacts { get { throw null; } } public Azure.Provisioning.BicepList Authorizations { get { throw null; } } @@ -944,7 +944,7 @@ public partial class ArmApplication : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdatedBy { get { throw null; } } - public static Azure.Provisioning.Resources.ArmApplication FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ArmApplication FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_09_01; @@ -984,7 +984,7 @@ public ArmApplicationAuthorization() { } } public partial class ArmApplicationDefinition : Azure.Provisioning.Primitives.Resource { - public ArmApplicationDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ArmApplicationDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Artifacts { get { throw null; } set { } } public Azure.Provisioning.BicepList Authorizations { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreateUiDefinition { get { throw null; } set { } } @@ -1005,7 +1005,7 @@ public partial class ArmApplicationDefinition : Azure.Provisioning.Primitives.Re public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Resources.ArmApplicationDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ArmApplicationDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2017_09_01; @@ -1162,14 +1162,14 @@ public ArmDependency() { } } public partial class ArmDeployment : Azure.Provisioning.Primitives.Resource { - public ArmDeployment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ArmDeployment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue Properties { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } } - public static Azure.Provisioning.Resources.ArmDeployment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ArmDeployment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Provisioning.Resources.ArmDeployment FromExpression(Azure.Provisioning.Expressions.Expression expression) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1259,14 +1259,14 @@ public ArmDeploymentPropertiesExtended() { } } public partial class ArmDeploymentScript : Azure.Provisioning.Primitives.Resource { - public ArmDeploymentScript(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ArmDeploymentScript(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Identity { get { throw null; } set { } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Resources.ArmDeploymentScript FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ArmDeploymentScript FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2020_10_01; @@ -1395,7 +1395,7 @@ public enum ExtendedLocationType } public partial class GenericResource : Azure.Provisioning.Primitives.Resource { - public GenericResource(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public GenericResource(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ChangedOn { get { throw null; } } public Azure.Provisioning.BicepValue CreatedOn { get { throw null; } } public Azure.Provisioning.BicepValue ExtendedLocation { get { throw null; } set { } } @@ -1411,7 +1411,7 @@ public partial class GenericResource : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Sku { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Resources.GenericResource FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.GenericResource FromExisting(string identifierName, string? resourceVersion = null) { throw null; } } public enum JitApprovalMode { @@ -1441,7 +1441,7 @@ public JitAuthorizationPolicies() { } } public partial class JitRequest : Azure.Provisioning.Primitives.Resource { - public JitRequest(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public JitRequest(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ApplicationResourceId { get { throw null; } set { } } public Azure.Provisioning.BicepValue CreatedBy { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1455,7 +1455,7 @@ public partial class JitRequest : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UpdatedBy { get { throw null; } } - public static Azure.Provisioning.Resources.JitRequest FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.JitRequest FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2019_07_01; @@ -1515,7 +1515,7 @@ public enum ManagedServiceIdentityType } public partial class ManagementGroup : Azure.Provisioning.Primitives.Resource { - public ManagementGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagementGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Children { get { throw null; } } public Azure.Provisioning.BicepValue Details { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } @@ -1523,7 +1523,7 @@ public partial class ManagementGroup : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } } - public static Azure.Provisioning.Resources.ManagementGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ManagementGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1588,7 +1588,7 @@ public ManagementGroupPathElement() { } } public partial class ManagementGroupPolicyDefinition : Azure.Provisioning.Primitives.Resource { - public ManagementGroupPolicyDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagementGroupPolicyDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1599,7 +1599,7 @@ public partial class ManagementGroupPolicyDefinition : Azure.Provisioning.Primit public Azure.Provisioning.BicepValue PolicyRule { get { throw null; } set { } } public Azure.Provisioning.BicepValue PolicyType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.ManagementGroupPolicyDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ManagementGroupPolicyDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1620,7 +1620,7 @@ public static partial class ResourceVersions } public partial class ManagementGroupPolicySetDefinition : Azure.Provisioning.Primitives.Resource { - public ManagementGroupPolicySetDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagementGroupPolicySetDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -1631,7 +1631,7 @@ public partial class ManagementGroupPolicySetDefinition : Azure.Provisioning.Pri public Azure.Provisioning.BicepList PolicyDefinitions { get { throw null; } set { } } public Azure.Provisioning.BicepValue PolicyType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.ManagementGroupPolicySetDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ManagementGroupPolicySetDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1650,7 +1650,7 @@ public static partial class ResourceVersions } public partial class ManagementGroupSubscription : Azure.Provisioning.Primitives.Resource { - public ManagementGroupSubscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagementGroupSubscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } @@ -1659,7 +1659,7 @@ public partial class ManagementGroupSubscription : Azure.Provisioning.Primitives public Azure.Provisioning.BicepValue State { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepValue Tenant { get { throw null; } } - public static Azure.Provisioning.Resources.ManagementGroupSubscription FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ManagementGroupSubscription FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2018_03_01_beta; @@ -1673,14 +1673,14 @@ public static partial class ResourceVersions } public partial class ManagementLock : Azure.Provisioning.Primitives.Resource { - public ManagementLock(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ManagementLock(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Level { get { throw null; } set { } } public Azure.Provisioning.BicepValue Name { get { throw null; } set { } } public Azure.Provisioning.BicepValue Notes { get { throw null; } set { } } public Azure.Provisioning.BicepList Owners { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.ManagementLock FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ManagementLock FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1727,7 +1727,7 @@ public ParentManagementGroupInfo() { } } public partial class PolicyAssignment : Azure.Provisioning.Primitives.Resource { - public PolicyAssignment(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public PolicyAssignment(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue EnforcementMode { get { throw null; } set { } } @@ -1744,7 +1744,7 @@ public partial class PolicyAssignment : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepList ResourceSelectors { get { throw null; } set { } } public Azure.Provisioning.BicepValue Scope { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.PolicyAssignment FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.PolicyAssignment FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -1831,7 +1831,7 @@ public ProviderResourceType() { } } public partial class ResourceGroup : Azure.Provisioning.Primitives.Resource { - public ResourceGroup(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public ResourceGroup(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } public Azure.Provisioning.BicepValue ManagedBy { get { throw null; } set { } } @@ -1839,7 +1839,7 @@ public partial class ResourceGroup : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue ResourceGroupProvisioningState { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } - public static Azure.Provisioning.Resources.ResourceGroup FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.ResourceGroup FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Provisioning.Resources.ResourceGroup FromExpression(Azure.Provisioning.Expressions.Expression expression) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -2021,7 +2021,7 @@ public SubResource() { } } public partial class Subscription : Azure.Provisioning.Primitives.Resource { - public Subscription(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public Subscription(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue AuthorizationSource { get { throw null; } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2069,7 +2069,7 @@ public SubscriptionPolicies() { } } public partial class SubscriptionPolicyDefinition : Azure.Provisioning.Primitives.Resource { - public SubscriptionPolicyDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SubscriptionPolicyDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2080,13 +2080,13 @@ public partial class SubscriptionPolicyDefinition : Azure.Provisioning.Primitive public Azure.Provisioning.BicepValue PolicyRule { get { throw null; } set { } } public Azure.Provisioning.BicepValue PolicyType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.SubscriptionPolicyDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.SubscriptionPolicyDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } } public partial class SubscriptionPolicySetDefinition : Azure.Provisioning.Primitives.Resource { - public SubscriptionPolicySetDefinition(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public SubscriptionPolicySetDefinition(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2097,7 +2097,7 @@ public partial class SubscriptionPolicySetDefinition : Azure.Provisioning.Primit public Azure.Provisioning.BicepList PolicyDefinitions { get { throw null; } set { } } public Azure.Provisioning.BicepValue PolicyType { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Resources.SubscriptionPolicySetDefinition FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.SubscriptionPolicySetDefinition FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } } @@ -2133,12 +2133,12 @@ public SystemData() { } } public partial class TagResource : Azure.Provisioning.Primitives.Resource { - public TagResource(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TagResource(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Name { get { throw null; } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary TagValues { get { throw null; } set { } } - public static Azure.Provisioning.Resources.TagResource FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.TagResource FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -2154,7 +2154,7 @@ public static partial class ResourceVersions } public partial class TemplateSpec : Azure.Provisioning.Primitives.Resource { - public TemplateSpec(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TemplateSpec(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue DisplayName { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } @@ -2164,7 +2164,7 @@ public partial class TemplateSpec : Azure.Provisioning.Primitives.Resource public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepDictionary Versions { get { throw null; } } - public static Azure.Provisioning.Resources.TemplateSpec FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.TemplateSpec FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions @@ -2175,7 +2175,7 @@ public static partial class ResourceVersions } public partial class TemplateSpecVersion : Azure.Provisioning.Primitives.Resource { - public TemplateSpecVersion(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public TemplateSpecVersion(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Description { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepList LinkedTemplates { get { throw null; } set { } } @@ -2187,7 +2187,7 @@ public partial class TemplateSpecVersion : Azure.Provisioning.Primitives.Resourc public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue UiFormDefinition { get { throw null; } set { } } - public static Azure.Provisioning.Resources.TemplateSpecVersion FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Resources.TemplateSpecVersion FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2021_05_01; @@ -2203,7 +2203,7 @@ public TemplateSpecVersionInfo() { } } public partial class Tenant : Azure.Provisioning.Primitives.Resource { - public Tenant(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public Tenant(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue Country { get { throw null; } } public Azure.Provisioning.BicepValue CountryCode { get { throw null; } } public Azure.Provisioning.BicepValue DefaultDomain { get { throw null; } } @@ -2276,7 +2276,7 @@ namespace Azure.Provisioning.Roles { public partial class FederatedIdentityCredential : Azure.Provisioning.Primitives.Resource { - public FederatedIdentityCredential(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public FederatedIdentityCredential(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepList Audiences { get { throw null; } set { } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue IssuerUri { get { throw null; } set { } } @@ -2284,7 +2284,7 @@ public partial class FederatedIdentityCredential : Azure.Provisioning.Primitives public Azure.Provisioning.Roles.UserAssignedIdentity? Parent { get { throw null; } set { } } public Azure.Provisioning.BicepValue Subject { get { throw null; } set { } } public Azure.Provisioning.BicepValue SystemData { get { throw null; } } - public static Azure.Provisioning.Roles.FederatedIdentityCredential FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Roles.FederatedIdentityCredential FromExisting(string identifierName, string? resourceVersion = null) { throw null; } public static partial class ResourceVersions { public static readonly string V2022_01_31_PREVIEW; @@ -2294,7 +2294,7 @@ public static partial class ResourceVersions } public partial class UserAssignedIdentity : Azure.Provisioning.Primitives.Resource { - public UserAssignedIdentity(string resourceName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } + public UserAssignedIdentity(string identifierName, string? resourceVersion = null) : base (default(string), default(Azure.Core.ResourceType), default(string)) { } public Azure.Provisioning.BicepValue ClientId { get { throw null; } } public Azure.Provisioning.BicepValue Id { get { throw null; } } public Azure.Provisioning.BicepValue Location { get { throw null; } set { } } @@ -2303,7 +2303,7 @@ public partial class UserAssignedIdentity : Azure.Provisioning.Primitives.Resour public Azure.Provisioning.BicepValue SystemData { get { throw null; } } public Azure.Provisioning.BicepDictionary Tags { get { throw null; } set { } } public Azure.Provisioning.BicepValue TenantId { get { throw null; } } - public static Azure.Provisioning.Roles.UserAssignedIdentity FromExisting(string resourceName, string? resourceVersion = null) { throw null; } + public static Azure.Provisioning.Roles.UserAssignedIdentity FromExisting(string identifierName, string? resourceVersion = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Provisioning.Primitives.ResourceNameRequirements GetResourceNameRequirements() { throw null; } public static partial class ResourceVersions diff --git a/sdk/provisioning/Azure.Provisioning/src/Authorization/AuthorizationRoleDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Authorization/AuthorizationRoleDefinition.cs index 958c853ffa6bc..23d0114e9c05c 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Authorization/AuthorizationRoleDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Authorization/AuthorizationRoleDefinition.cs @@ -12,5 +12,5 @@ public partial class AuthorizationRoleDefinition // naming policies won't be able to manage that as cleanly. Anyone who // really wants can override the value though. private partial BicepValue GetNameDefaultValue() => - BicepFunction.CreateGuid(BicepFunction.GetResourceGroup().Id, ResourceName); + BicepFunction.CreateGuid(BicepFunction.GetResourceGroup().Id, IdentifierName); } diff --git a/sdk/provisioning/Azure.Provisioning/src/Authorization/RoleAssignment.cs b/sdk/provisioning/Azure.Provisioning/src/Authorization/RoleAssignment.cs index 76b81a92d3e5d..9810a110667c8 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Authorization/RoleAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Authorization/RoleAssignment.cs @@ -12,5 +12,5 @@ public partial class RoleAssignment // won't be able to manage that as cleanly. Anyone who really wants can // override the value though. private partial BicepValue GetNameDefaultValue() => - BicepFunction.CreateGuid(BicepFunction.GetResourceGroup().Id, ResourceName); + BicepFunction.CreateGuid(BicepFunction.GetResourceGroup().Id, IdentifierName); } diff --git a/sdk/provisioning/Azure.Provisioning/src/BicepDictionaryOfT.cs b/sdk/provisioning/Azure.Provisioning/src/BicepDictionaryOfT.cs index accb9b0e886fd..2a85fc175a3ff 100644 --- a/sdk/provisioning/Azure.Provisioning/src/BicepDictionaryOfT.cs +++ b/sdk/provisioning/Azure.Provisioning/src/BicepDictionaryOfT.cs @@ -69,7 +69,7 @@ internal override void Assign(BicepValue source) /// /// The variable or parameter. public static implicit operator BicepDictionary(ProvisioningVariable reference) => - new(new BicepValueReference(reference, ""), BicepSyntax.Var(reference.ResourceName)) { IsSecure = reference is ProvisioningParameter p && p.IsSecure }; + new(new BicepValueReference(reference, ""), BicepSyntax.Var(reference.IdentifierName)) { IsSecure = reference is ProvisioningParameter p && p.IsSecure }; // TODO: Make it possible to correctly reference these values (especially // across module boundaries)? Currently we only allow pulling values into diff --git a/sdk/provisioning/Azure.Provisioning/src/BicepListOfT.cs b/sdk/provisioning/Azure.Provisioning/src/BicepListOfT.cs index d91c1d1637daa..e4b05df779463 100644 --- a/sdk/provisioning/Azure.Provisioning/src/BicepListOfT.cs +++ b/sdk/provisioning/Azure.Provisioning/src/BicepListOfT.cs @@ -66,7 +66,7 @@ internal override void Assign(BicepValue source) public static implicit operator BicepList(ProvisioningVariable reference) => new( new BicepValueReference(reference, ""), - BicepSyntax.Var(reference.ResourceName)) + BicepSyntax.Var(reference.IdentifierName)) { IsSecure = reference is ProvisioningParameter p && p.IsSecure }; diff --git a/sdk/provisioning/Azure.Provisioning/src/BicepValueOfT.cs b/sdk/provisioning/Azure.Provisioning/src/BicepValueOfT.cs index 5e32af4fe9a39..06d1e10774264 100644 --- a/sdk/provisioning/Azure.Provisioning/src/BicepValueOfT.cs +++ b/sdk/provisioning/Azure.Provisioning/src/BicepValueOfT.cs @@ -115,7 +115,7 @@ public static implicit operator BicepValue(T value) } public static implicit operator BicepValue(Expression expression) => new(expression); public static implicit operator BicepValue(ProvisioningVariable reference) => - new(new BicepValueReference(reference, ""), BicepSyntax.Var(reference.ResourceName)) { IsSecure = reference is ProvisioningParameter p && p.IsSecure }; + new(new BicepValueReference(reference, ""), BicepSyntax.Var(reference.IdentifierName)) { IsSecure = reference is ProvisioningParameter p && p.IsSecure }; // Special case conversions to string for things like Uri, AzureLocation, etc. public static implicit operator BicepValue(BicepValue value) => diff --git a/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepFunction.cs b/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepFunction.cs index 8a99f2cbf0163..0739bdfba8efe 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepFunction.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Expressions/BicepFunction.cs @@ -313,7 +313,7 @@ public static BicepValue Interpolate(FormattableString text) text.GetArgument(i) switch { BicepValue v => v, - ProvisioningVariable v => BicepSyntax.Var(v.ResourceName), + ProvisioningVariable v => BicepSyntax.Var(v.IdentifierName), var a => new BicepValue(a?.ToString() ?? "") }; }; diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplication.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplication.cs index 00e92b413ca30..7ec4e71abb0f0 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplication.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplication.cs @@ -201,10 +201,15 @@ public partial class ArmApplication : Resource /// /// Creates a new ArmApplication. /// - /// Name of the ArmApplication. + /// + /// The the Bicep identifier name of the ArmApplication resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ArmApplication. - public ArmApplication(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Solutions/applications", resourceVersion ?? "2021-07-01") + public ArmApplication(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Solutions/applications", resourceVersion ?? "2021-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _kind = BicepValue.DefineProperty(this, "Kind", ["kind"], isRequired: true); @@ -277,9 +282,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ArmApplication. /// - /// Name of the ArmApplication. + /// + /// The the Bicep identifier name of the ArmApplication resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ArmApplication. /// The existing ArmApplication resource. - public static ArmApplication FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ArmApplication FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplicationDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplicationDefinition.cs index e603bafbd063d..a6120965cae76 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplicationDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmApplicationDefinition.cs @@ -171,10 +171,15 @@ public partial class ArmApplicationDefinition : Resource /// /// Creates a new ArmApplicationDefinition. /// - /// Name of the ArmApplicationDefinition. + /// + /// The the Bicep identifier name of the ArmApplicationDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ArmApplicationDefinition. - public ArmApplicationDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Solutions/applicationDefinitions", resourceVersion ?? "2021-07-01") + public ArmApplicationDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Solutions/applicationDefinitions", resourceVersion ?? "2021-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -242,9 +247,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ArmApplicationDefinition. /// - /// Name of the ArmApplicationDefinition. + /// + /// The the Bicep identifier name of the ArmApplicationDefinition resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ArmApplicationDefinition. /// The existing ArmApplicationDefinition resource. - public static ArmApplicationDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ArmApplicationDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeployment.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeployment.cs index d5e56289f7baa..aedbb1d451535 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeployment.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeployment.cs @@ -59,10 +59,15 @@ public partial class ArmDeployment : Resource /// /// Creates a new ArmDeployment. /// - /// Name of the ArmDeployment. + /// + /// The the Bicep identifier name of the ArmDeployment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ArmDeployment. - public ArmDeployment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/deployments", resourceVersion ?? "2023-07-01") + public ArmDeployment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/deployments", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _id = BicepValue.DefineProperty(this, "Id", ["id"], isOutput: true); @@ -226,11 +231,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ArmDeployment. /// - /// Name of the ArmDeployment. + /// + /// The the Bicep identifier name of the ArmDeployment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ArmDeployment. /// The existing ArmDeployment resource. - public static ArmDeployment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ArmDeployment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Creates a new ArmDeployment resource from a Bicep expression that @@ -243,7 +253,7 @@ public static ArmDeployment FromExisting(string resourceName, string? resourceVe [EditorBrowsable(EditorBrowsableState.Never)] public static ArmDeployment FromExpression(Expression expression) { - ArmDeployment resource = new(expression.ToString()); + ArmDeployment resource = new(nameof(ArmDeployment)); resource.OverrideWithExpression(expression); return resource; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeploymentScript.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeploymentScript.cs index 66b67c24c9066..9861e52b86fcd 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeploymentScript.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ArmDeploymentScript.cs @@ -58,10 +58,15 @@ public partial class ArmDeploymentScript : Resource /// /// Creates a new ArmDeploymentScript. /// - /// Name of the ArmDeploymentScript. + /// + /// The the Bicep identifier name of the ArmDeploymentScript resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ArmDeploymentScript. - public ArmDeploymentScript(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/deploymentScripts", resourceVersion ?? "2023-08-01") + public ArmDeploymentScript(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/deploymentScripts", resourceVersion ?? "2023-08-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -90,9 +95,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ArmDeploymentScript. /// - /// Name of the ArmDeploymentScript. + /// + /// The the Bicep identifier name of the ArmDeploymentScript resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the ArmDeploymentScript. /// The existing ArmDeploymentScript resource. - public static ArmDeploymentScript FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ArmDeploymentScript FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/AuthorizationRoleDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/AuthorizationRoleDefinition.cs index 0e21dd38a2c07..ec16b6dd7257e 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/AuthorizationRoleDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/AuthorizationRoleDefinition.cs @@ -74,10 +74,15 @@ public partial class AuthorizationRoleDefinition : Resource /// /// Creates a new AuthorizationRoleDefinition. /// - /// Name of the AuthorizationRoleDefinition. + /// + /// The the Bicep identifier name of the AuthorizationRoleDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AuthorizationRoleDefinition. - public AuthorizationRoleDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/roleDefinitions", resourceVersion ?? "2022-04-01") + public AuthorizationRoleDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/roleDefinitions", resourceVersion ?? "2022-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true, defaultValue: GetNameDefaultValue()); _assignableScopes = BicepList.DefineProperty(this, "AssignableScopes", ["properties", "assignableScopes"]); @@ -138,9 +143,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing AuthorizationRoleDefinition. /// - /// Name of the AuthorizationRoleDefinition. + /// + /// The the Bicep identifier name of the AuthorizationRoleDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the AuthorizationRoleDefinition. /// The existing AuthorizationRoleDefinition resource. - public static AuthorizationRoleDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static AuthorizationRoleDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/FederatedIdentityCredential.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/FederatedIdentityCredential.cs index ebbb0b19ce6d7..f1e1d1e706f6f 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/FederatedIdentityCredential.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/FederatedIdentityCredential.cs @@ -63,10 +63,15 @@ public partial class FederatedIdentityCredential : Resource /// /// Creates a new FederatedIdentityCredential. /// - /// Name of the FederatedIdentityCredential. + /// + /// The the Bicep identifier name of the FederatedIdentityCredential + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the FederatedIdentityCredential. - public FederatedIdentityCredential(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials", resourceVersion ?? "2023-01-31") + public FederatedIdentityCredential(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials", resourceVersion ?? "2023-01-31") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _audiences = BicepList.DefineProperty(this, "Audiences", ["properties", "audiences"]); @@ -101,9 +106,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing FederatedIdentityCredential. /// - /// Name of the FederatedIdentityCredential. + /// + /// The the Bicep identifier name of the FederatedIdentityCredential + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the FederatedIdentityCredential. /// The existing FederatedIdentityCredential resource. - public static FederatedIdentityCredential FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static FederatedIdentityCredential FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/GenericResource.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/GenericResource.cs index 3bd77300a97b7..2d74b1230db22 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/GenericResource.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/GenericResource.cs @@ -128,10 +128,15 @@ public partial class GenericResource : Resource /// /// Creates a new GenericResource. /// - /// Name of the GenericResource. + /// + /// The the Bicep identifier name of the GenericResource resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GenericResource. - public GenericResource(string resourceName, string? resourceVersion = default) - : base(resourceName, "", resourceVersion) + public GenericResource(string identifierName, string? resourceVersion = default) + : base(identifierName, "", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -153,9 +158,14 @@ public GenericResource(string resourceName, string? resourceVersion = default) /// /// Creates a reference to an existing GenericResource. /// - /// Name of the GenericResource. + /// + /// The the Bicep identifier name of the GenericResource resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the GenericResource. /// The existing GenericResource resource. - public static GenericResource FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static GenericResource FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/JitRequest.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/JitRequest.cs index ea27c2c0e9ad1..0c3409c0f444f 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/JitRequest.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/JitRequest.cs @@ -98,10 +98,15 @@ public partial class JitRequest : Resource /// /// Creates a new JitRequest. /// - /// Name of the JitRequest. + /// + /// The the Bicep identifier name of the JitRequest resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the JitRequest. - public JitRequest(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Solutions/jitRequests", resourceVersion ?? "2021-07-01") + public JitRequest(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Solutions/jitRequests", resourceVersion ?? "2021-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -137,9 +142,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing JitRequest. /// - /// Name of the JitRequest. + /// + /// The the Bicep identifier name of the JitRequest resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the JitRequest. /// The existing JitRequest resource. - public static JitRequest FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static JitRequest FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroup.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroup.cs index 8ba1710237867..bb6f43c5f0672 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroup.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroup.cs @@ -67,10 +67,15 @@ public partial class ManagementGroup : Resource /// /// Creates a new ManagementGroup. /// - /// Name of the ManagementGroup. + /// + /// The the Bicep identifier name of the ManagementGroup resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagementGroup. - public ManagementGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Management/managementGroups", resourceVersion ?? "2023-04-01") + public ManagementGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Management/managementGroups", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"]); _details = BicepValue.DefineProperty(this, "Details", ["properties", "details"]); @@ -125,11 +130,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagementGroup. /// - /// Name of the ManagementGroup. + /// + /// The the Bicep identifier name of the ManagementGroup resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the ManagementGroup. /// The existing ManagementGroup resource. - public static ManagementGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagementGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ManagementGroup resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicyDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicyDefinition.cs index 0229ff5d50121..4283d53b65d4c 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicyDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicyDefinition.cs @@ -113,10 +113,15 @@ public partial class ManagementGroupPolicyDefinition : Resource /// /// Creates a new ManagementGroupPolicyDefinition. /// - /// Name of the ManagementGroupPolicyDefinition. + /// + /// The the Bicep identifier name of the ManagementGroupPolicyDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupPolicyDefinition. - public ManagementGroupPolicyDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/policyDefinitions", resourceVersion ?? "2023-04-01") + public ManagementGroupPolicyDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/policyDefinitions", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -199,11 +204,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagementGroupPolicyDefinition. /// - /// Name of the ManagementGroupPolicyDefinition. + /// + /// The the Bicep identifier name of the ManagementGroupPolicyDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupPolicyDefinition. /// The existing ManagementGroupPolicyDefinition resource. - public static ManagementGroupPolicyDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagementGroupPolicyDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ManagementGroupPolicyDefinition diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicySetDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicySetDefinition.cs index 94d393e3d821e..913e834034f49 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicySetDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupPolicySetDefinition.cs @@ -100,10 +100,15 @@ public partial class ManagementGroupPolicySetDefinition : Resource /// /// Creates a new ManagementGroupPolicySetDefinition. /// - /// Name of the ManagementGroupPolicySetDefinition. + /// + /// The the Bicep identifier name of the ManagementGroupPolicySetDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupPolicySetDefinition. - public ManagementGroupPolicySetDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/policySetDefinitions", resourceVersion ?? "2023-04-01") + public ManagementGroupPolicySetDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/policySetDefinitions", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -176,11 +181,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagementGroupPolicySetDefinition. /// - /// Name of the ManagementGroupPolicySetDefinition. + /// + /// The the Bicep identifier name of the ManagementGroupPolicySetDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupPolicySetDefinition. /// The existing ManagementGroupPolicySetDefinition resource. - public static ManagementGroupPolicySetDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagementGroupPolicySetDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ManagementGroupPolicySetDefinition diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupSubscription.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupSubscription.cs index a9fd6c9a575fc..3e1f150f122a3 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupSubscription.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementGroupSubscription.cs @@ -71,10 +71,15 @@ public partial class ManagementGroupSubscription : Resource /// /// Creates a new ManagementGroupSubscription. /// - /// Name of the ManagementGroupSubscription. + /// + /// The the Bicep identifier name of the ManagementGroupSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupSubscription. - public ManagementGroupSubscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Management/managementGroups/subscriptions", resourceVersion ?? "2023-04-01") + public ManagementGroupSubscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Management/managementGroups/subscriptions", resourceVersion ?? "2023-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _displayName = BicepValue.DefineProperty(this, "DisplayName", ["properties", "displayName"], isOutput: true); @@ -130,9 +135,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagementGroupSubscription. /// - /// Name of the ManagementGroupSubscription. + /// + /// The the Bicep identifier name of the ManagementGroupSubscription + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the ManagementGroupSubscription. /// The existing ManagementGroupSubscription resource. - public static ManagementGroupSubscription FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagementGroupSubscription FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementLock.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementLock.cs index dd8da3b49bcaf..bdbaad5493deb 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementLock.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ManagementLock.cs @@ -62,10 +62,15 @@ public partial class ManagementLock : Resource /// /// Creates a new ManagementLock. /// - /// Name of the ManagementLock. + /// + /// The the Bicep identifier name of the ManagementLock resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagementLock. - public ManagementLock(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/locks", resourceVersion ?? "2020-05-01") + public ManagementLock(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/locks", resourceVersion ?? "2020-05-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _level = BicepValue.DefineProperty(this, "Level", ["properties", "level"], isRequired: true); @@ -109,11 +114,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ManagementLock. /// - /// Name of the ManagementLock. + /// + /// The the Bicep identifier name of the ManagementLock resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ManagementLock. /// The existing ManagementLock resource. - public static ManagementLock FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ManagementLock FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this ManagementLock resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/PolicyAssignment.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/PolicyAssignment.cs index e5abfcf582cb0..16ef5b2fb359b 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/PolicyAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/PolicyAssignment.cs @@ -138,10 +138,15 @@ public partial class PolicyAssignment : Resource /// /// Creates a new PolicyAssignment. /// - /// Name of the PolicyAssignment. + /// + /// The the Bicep identifier name of the PolicyAssignment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PolicyAssignment. - public PolicyAssignment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/policyAssignments", resourceVersion ?? "2024-04-01") + public PolicyAssignment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/policyAssignments", resourceVersion ?? "2024-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -240,11 +245,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing PolicyAssignment. /// - /// Name of the PolicyAssignment. + /// + /// The the Bicep identifier name of the PolicyAssignment resource. This + /// can be used to refer to the resource in expressions, but is not the + /// Azure name of the resource. This value can contain letters, numbers, + /// and underscores. + /// /// Version of the PolicyAssignment. /// The existing PolicyAssignment resource. - public static PolicyAssignment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static PolicyAssignment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this PolicyAssignment resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/ResourceGroup.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/ResourceGroup.cs index 9565ff58fabf7..aec8c9c7792e6 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/ResourceGroup.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/ResourceGroup.cs @@ -68,10 +68,15 @@ public partial class ResourceGroup : Resource /// /// Creates a new ResourceGroup. /// - /// Name of the ResourceGroup. + /// + /// The the Bicep identifier name of the ResourceGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ResourceGroup. - public ResourceGroup(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/resourceGroups", resourceVersion ?? "2023-07-01") + public ResourceGroup(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/resourceGroups", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -306,11 +311,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing ResourceGroup. /// - /// Name of the ResourceGroup. + /// + /// The the Bicep identifier name of the ResourceGroup resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the ResourceGroup. /// The existing ResourceGroup resource. - public static ResourceGroup FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static ResourceGroup FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Creates a new ResourceGroup resource from a Bicep expression that @@ -323,7 +333,7 @@ public static ResourceGroup FromExisting(string resourceName, string? resourceVe [EditorBrowsable(EditorBrowsableState.Never)] public static ResourceGroup FromExpression(Expression expression) { - ResourceGroup resource = new(expression.ToString()); + ResourceGroup resource = new(nameof(ResourceGroup)); resource.OverrideWithExpression(expression); return resource; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignment.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignment.cs index daa66d9dc1fcb..01b5921e4d06f 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignment.cs @@ -119,10 +119,15 @@ public partial class RoleAssignment : Resource /// /// Creates a new RoleAssignment. /// - /// Name of the RoleAssignment. + /// + /// The the Bicep identifier name of the RoleAssignment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the RoleAssignment. - public RoleAssignment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/roleAssignments", resourceVersion ?? "2022-04-01") + public RoleAssignment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/roleAssignments", resourceVersion ?? "2022-04-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true, defaultValue: GetNameDefaultValue()); _principalId = BicepValue.DefineProperty(this, "PrincipalId", ["properties", "principalId"], isRequired: true); @@ -185,9 +190,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RoleAssignment. /// - /// Name of the RoleAssignment. + /// + /// The the Bicep identifier name of the RoleAssignment resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the RoleAssignment. /// The existing RoleAssignment resource. - public static RoleAssignment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RoleAssignment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignmentScheduleRequest.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignmentScheduleRequest.cs index 6f8c4a188377d..dc1901d99fa75 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignmentScheduleRequest.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleAssignmentScheduleRequest.cs @@ -170,10 +170,15 @@ public partial class RoleAssignmentScheduleRequest : Resource /// /// Creates a new RoleAssignmentScheduleRequest. /// - /// Name of the RoleAssignmentScheduleRequest. + /// + /// The the Bicep identifier name of the RoleAssignmentScheduleRequest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleAssignmentScheduleRequest. - public RoleAssignmentScheduleRequest(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/roleAssignmentScheduleRequests", resourceVersion ?? "2020-10-01") + public RoleAssignmentScheduleRequest(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/roleAssignmentScheduleRequests", resourceVersion ?? "2020-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _condition = BicepValue.DefineProperty(this, "Condition", ["properties", "condition"]); @@ -220,9 +225,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RoleAssignmentScheduleRequest. /// - /// Name of the RoleAssignmentScheduleRequest. + /// + /// The the Bicep identifier name of the RoleAssignmentScheduleRequest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleAssignmentScheduleRequest. /// The existing RoleAssignmentScheduleRequest resource. - public static RoleAssignmentScheduleRequest FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RoleAssignmentScheduleRequest FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleEligibilityScheduleRequest.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleEligibilityScheduleRequest.cs index 941d7fbe2eab5..74b15c65eda86 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleEligibilityScheduleRequest.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleEligibilityScheduleRequest.cs @@ -163,10 +163,15 @@ public partial class RoleEligibilityScheduleRequest : Resource /// /// Creates a new RoleEligibilityScheduleRequest. /// - /// Name of the RoleEligibilityScheduleRequest. + /// + /// The the Bicep identifier name of the RoleEligibilityScheduleRequest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleEligibilityScheduleRequest. - public RoleEligibilityScheduleRequest(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/roleEligibilityScheduleRequests", resourceVersion ?? "2020-10-01") + public RoleEligibilityScheduleRequest(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/roleEligibilityScheduleRequests", resourceVersion ?? "2020-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _condition = BicepValue.DefineProperty(this, "Condition", ["properties", "condition"]); @@ -212,9 +217,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RoleEligibilityScheduleRequest. /// - /// Name of the RoleEligibilityScheduleRequest. + /// + /// The the Bicep identifier name of the RoleEligibilityScheduleRequest + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleEligibilityScheduleRequest. /// The existing RoleEligibilityScheduleRequest resource. - public static RoleEligibilityScheduleRequest FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RoleEligibilityScheduleRequest FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleManagementPolicyAssignment.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleManagementPolicyAssignment.cs index f80f48d0171c2..104fbfc6c88b5 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/RoleManagementPolicyAssignment.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/RoleManagementPolicyAssignment.cs @@ -82,10 +82,15 @@ public partial class RoleManagementPolicyAssignment : Resource /// /// Creates a new RoleManagementPolicyAssignment. /// - /// Name of the RoleManagementPolicyAssignment. + /// + /// The the Bicep identifier name of the RoleManagementPolicyAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleManagementPolicyAssignment. - public RoleManagementPolicyAssignment(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/roleManagementPolicyAssignments", resourceVersion ?? "2020-10-01") + public RoleManagementPolicyAssignment(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/roleManagementPolicyAssignments", resourceVersion ?? "2020-10-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _policyId = BicepValue.DefineProperty(this, "PolicyId", ["properties", "policyId"]); @@ -116,9 +121,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing RoleManagementPolicyAssignment. /// - /// Name of the RoleManagementPolicyAssignment. + /// + /// The the Bicep identifier name of the RoleManagementPolicyAssignment + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the RoleManagementPolicyAssignment. /// The existing RoleManagementPolicyAssignment resource. - public static RoleManagementPolicyAssignment FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static RoleManagementPolicyAssignment FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/Subscription.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/Subscription.cs index 906e085f4f443..efaf5cbadb95c 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/Subscription.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/Subscription.cs @@ -79,10 +79,15 @@ public partial class Subscription : Resource /// /// Creates a new Subscription. /// - /// Name of the Subscription. + /// + /// The the Bicep identifier name of the Subscription resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the Subscription. - public Subscription(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/subscriptions", resourceVersion ?? "2019-10-01") + public Subscription(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/subscriptions", resourceVersion ?? "2019-10-01") { _authorizationSource = BicepValue.DefineProperty(this, "AuthorizationSource", ["authorizationSource"], isOutput: true); _displayName = BicepValue.DefineProperty(this, "DisplayName", ["displayName"], isOutput: true); @@ -227,7 +232,7 @@ public static class ResourceVersions [EditorBrowsable(EditorBrowsableState.Never)] public static Subscription FromExpression(Expression expression) { - Subscription resource = new(expression.ToString()); + Subscription resource = new(nameof(Subscription)); resource.OverrideWithExpression(expression); return resource; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicyDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicyDefinition.cs index bf9f4550db1cb..32609ad5f8f19 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicyDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicyDefinition.cs @@ -113,10 +113,15 @@ public partial class SubscriptionPolicyDefinition : Resource /// /// Creates a new SubscriptionPolicyDefinition. /// - /// Name of the SubscriptionPolicyDefinition. + /// + /// The the Bicep identifier name of the SubscriptionPolicyDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SubscriptionPolicyDefinition. - public SubscriptionPolicyDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/policyDefinitions", resourceVersion) + public SubscriptionPolicyDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/policyDefinitions", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -133,11 +138,16 @@ public SubscriptionPolicyDefinition(string resourceName, string? resourceVersion /// /// Creates a reference to an existing SubscriptionPolicyDefinition. /// - /// Name of the SubscriptionPolicyDefinition. + /// + /// The the Bicep identifier name of the SubscriptionPolicyDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SubscriptionPolicyDefinition. /// The existing SubscriptionPolicyDefinition resource. - public static SubscriptionPolicyDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SubscriptionPolicyDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SubscriptionPolicyDefinition diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicySetDefinition.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicySetDefinition.cs index c424f21ebf2c2..90f1ced3da598 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicySetDefinition.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/SubscriptionPolicySetDefinition.cs @@ -100,10 +100,15 @@ public partial class SubscriptionPolicySetDefinition : Resource /// /// Creates a new SubscriptionPolicySetDefinition. /// - /// Name of the SubscriptionPolicySetDefinition. + /// + /// The the Bicep identifier name of the SubscriptionPolicySetDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SubscriptionPolicySetDefinition. - public SubscriptionPolicySetDefinition(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Authorization/policySetDefinitions", resourceVersion) + public SubscriptionPolicySetDefinition(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Authorization/policySetDefinitions", resourceVersion) { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _description = BicepValue.DefineProperty(this, "Description", ["properties", "description"]); @@ -120,11 +125,16 @@ public SubscriptionPolicySetDefinition(string resourceName, string? resourceVers /// /// Creates a reference to an existing SubscriptionPolicySetDefinition. /// - /// Name of the SubscriptionPolicySetDefinition. + /// + /// The the Bicep identifier name of the SubscriptionPolicySetDefinition + /// resource. This can be used to refer to the resource in expressions, + /// but is not the Azure name of the resource. This value can contain + /// letters, numbers, and underscores. + /// /// Version of the SubscriptionPolicySetDefinition. /// The existing SubscriptionPolicySetDefinition resource. - public static SubscriptionPolicySetDefinition FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static SubscriptionPolicySetDefinition FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this SubscriptionPolicySetDefinition diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/TagResource.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/TagResource.cs index aee5f1746308b..816ae6e1e5e83 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/TagResource.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/TagResource.cs @@ -47,10 +47,15 @@ public partial class TagResource : Resource /// /// Creates a new TagResource. /// - /// Name of the TagResource. + /// + /// The the Bicep identifier name of the TagResource resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TagResource. - public TagResource(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/tags", resourceVersion ?? "2023-07-01") + public TagResource(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/tags", resourceVersion ?? "2023-07-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _tagValues = BicepDictionary.DefineProperty(this, "TagValues", ["properties", "tags"]); @@ -102,11 +107,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing TagResource. /// - /// Name of the TagResource. + /// + /// The the Bicep identifier name of the TagResource resource. This can be + /// used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TagResource. /// The existing TagResource resource. - public static TagResource FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TagResource FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this TagResource resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpec.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpec.cs index feb569d5ffba1..4c803fc0065a9 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpec.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpec.cs @@ -92,10 +92,15 @@ public partial class TemplateSpec : Resource /// /// Creates a new TemplateSpec. /// - /// Name of the TemplateSpec. + /// + /// The the Bicep identifier name of the TemplateSpec resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TemplateSpec. - public TemplateSpec(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/templateSpecs", resourceVersion ?? "2022-02-01") + public TemplateSpec(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/templateSpecs", resourceVersion ?? "2022-02-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -127,11 +132,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing TemplateSpec. /// - /// Name of the TemplateSpec. + /// + /// The the Bicep identifier name of the TemplateSpec resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the TemplateSpec. /// The existing TemplateSpec resource. - public static TemplateSpec FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TemplateSpec FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this TemplateSpec resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpecVersion.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpecVersion.cs index 0a07519e8a11a..0f948885580ee 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpecVersion.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/TemplateSpecVersion.cs @@ -127,10 +127,15 @@ public partial class TemplateSpecVersion : Resource /// /// Creates a new TemplateSpecVersion. /// - /// Name of the TemplateSpecVersion. + /// + /// The the Bicep identifier name of the TemplateSpecVersion resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the TemplateSpecVersion. - public TemplateSpecVersion(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/templateSpecs/versions", resourceVersion ?? "2022-02-01") + public TemplateSpecVersion(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/templateSpecs/versions", resourceVersion ?? "2022-02-01") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isOutput: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -164,9 +169,14 @@ public static class ResourceVersions /// /// Creates a reference to an existing TemplateSpecVersion. /// - /// Name of the TemplateSpecVersion. + /// + /// The the Bicep identifier name of the TemplateSpecVersion resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the TemplateSpecVersion. /// The existing TemplateSpecVersion resource. - public static TemplateSpecVersion FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static TemplateSpecVersion FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/Tenant.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/Tenant.cs index b5216b47250ab..c8edb0b795aa7 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/Tenant.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/Tenant.cs @@ -83,10 +83,15 @@ public partial class Tenant : Resource /// /// Creates a new Tenant. /// - /// Name of the Tenant. + /// + /// The the Bicep identifier name of the Tenant resource. This can be used + /// to refer to the resource in expressions, but is not the Azure name of + /// the resource. This value can contain letters, numbers, and + /// underscores. + /// /// Version of the Tenant. - public Tenant(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.Resources/tenants", resourceVersion ?? "2020-01-01") + public Tenant(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.Resources/tenants", resourceVersion ?? "2020-01-01") { _country = BicepValue.DefineProperty(this, "Country", ["country"], isOutput: true); _countryCode = BicepValue.DefineProperty(this, "CountryCode", ["countryCode"], isOutput: true); @@ -232,7 +237,7 @@ public static class ResourceVersions [EditorBrowsable(EditorBrowsableState.Never)] public static Tenant FromExpression(Expression expression) { - Tenant resource = new(expression.ToString()); + Tenant resource = new(nameof(Tenant)); resource.OverrideWithExpression(expression); return resource; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Generated/UserAssignedIdentity.cs b/sdk/provisioning/Azure.Provisioning/src/Generated/UserAssignedIdentity.cs index 42e31958a12f7..fb2b149e5be7f 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Generated/UserAssignedIdentity.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Generated/UserAssignedIdentity.cs @@ -72,10 +72,15 @@ public partial class UserAssignedIdentity : Resource /// /// Creates a new UserAssignedIdentity. /// - /// Name of the UserAssignedIdentity. + /// + /// The the Bicep identifier name of the UserAssignedIdentity resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the UserAssignedIdentity. - public UserAssignedIdentity(string resourceName, string? resourceVersion = default) - : base(resourceName, "Microsoft.ManagedIdentity/userAssignedIdentities", resourceVersion ?? "2023-01-31") + public UserAssignedIdentity(string identifierName, string? resourceVersion = default) + : base(identifierName, "Microsoft.ManagedIdentity/userAssignedIdentities", resourceVersion ?? "2023-01-31") { _name = BicepValue.DefineProperty(this, "Name", ["name"], isRequired: true); _location = BicepValue.DefineProperty(this, "Location", ["location"], isRequired: true); @@ -126,11 +131,16 @@ public static class ResourceVersions /// /// Creates a reference to an existing UserAssignedIdentity. /// - /// Name of the UserAssignedIdentity. + /// + /// The the Bicep identifier name of the UserAssignedIdentity resource. + /// This can be used to refer to the resource in expressions, but is not + /// the Azure name of the resource. This value can contain letters, + /// numbers, and underscores. + /// /// Version of the UserAssignedIdentity. /// The existing UserAssignedIdentity resource. - public static UserAssignedIdentity FromExisting(string resourceName, string? resourceVersion = default) => - new(resourceName, resourceVersion) { IsExistingResource = true }; + public static UserAssignedIdentity FromExisting(string identifierName, string? resourceVersion = default) => + new(identifierName, resourceVersion) { IsExistingResource = true }; /// /// Get the requirements for naming this UserAssignedIdentity resource. diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/BicepValueReference.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/BicepValueReference.cs index 6fd83eac26e71..8fdf52d8e9467 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/BicepValueReference.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/BicepValueReference.cs @@ -25,7 +25,7 @@ internal Expression GetReference() throw new NotImplementedException("Cannot reference a construct without a name yet."); } - Expression target = BicepSyntax.Var(named.ResourceName); + Expression target = BicepSyntax.Var(named.IdentifierName); if (BicepPath is not null) { foreach (string segment in BicepPath) diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/LocationPropertyResolver.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/LocationPropertyResolver.cs index 239e45bde4f4c..217a422dd45b7 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/LocationPropertyResolver.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/LocationPropertyResolver.cs @@ -65,8 +65,8 @@ private ProvisioningParameter GetOrCreateLocationParameter( IDictionary existing = infra.GetResources() .OfType() - .Where(p => p.ResourceName.StartsWith("location")) - .ToDictionary(p => p.ResourceName); + .Where(p => p.IdentifierName.StartsWith("location")) + .ToDictionary(p => p.IdentifierName); foreach (ProvisioningParameter p in existing.Values) { if (p.BicepType is TypeExpression type && @@ -87,7 +87,7 @@ private ProvisioningParameter GetOrCreateLocationParameter( // Optionally specialize to the resource if (construct is NamedProvisioningConstruct resource) { - name = $"{name}_{resource.ResourceName}"; + name = $"{name}_{resource.IdentifierName}"; increment = existing.ContainsKey(name); } diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/ModuleImport.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/ModuleImport.cs index e9aa2c45d285b..6e5981b732ec3 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/ModuleImport.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/ModuleImport.cs @@ -19,7 +19,7 @@ public class ModuleImport : NamedProvisioningConstruct public BicepDictionary Parameters { get; } - public ModuleImport(string resourceName, BicepValue path) : base(resourceName) + public ModuleImport(string identifierName, BicepValue path) : base(identifierName) { _name = BicepValue.DefineProperty(this, nameof(Name), ["name"], isRequired: true); _path = BicepValue.DefineProperty(this, nameof(Path), ["path"], defaultValue: path); @@ -39,7 +39,7 @@ protected internal override IEnumerable Compile() Dictionary properties = new() { { "name", _name.Compile() } }; if (_scope.Kind != BicepValueKind.Unset) { properties.Add("scope", _scope.Compile()); } if (Parameters.Count > 0) { properties.Add("params", Parameters.Compile()); } - ModuleStatement module = BicepSyntax.Declare.Module(ResourceName, _path.Compile(), BicepSyntax.Object(properties)); + ModuleStatement module = BicepSyntax.Declare.Module(IdentifierName, _path.Compile(), BicepSyntax.Object(properties)); statements.Add(module); return statements; } diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs index 480b6978391c6..dc3f2761fe9f9 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs @@ -12,14 +12,57 @@ namespace Azure.Provisioning.Primitives; /// /// A named Bicep entity, like a resource or parameter. /// -public abstract class NamedProvisioningConstruct(string resourceName) : ProvisioningConstruct +public abstract class NamedProvisioningConstruct : ProvisioningConstruct { /// - /// Gets or sets the the Bicep name of the resource. This can be used to - /// refer to the resource in expressions, but isn't the Azure name of the - /// resource. This value can contain letters, numbers, and underscores. + /// Gets or sets the the Bicep identifier name of the resource. This can + /// be used to refer to the resource in expressions, but is not the Azure + /// name of the resource. This value can contain letters, numbers, and + /// underscores. + /// + public string IdentifierName + { + get => _identifierName; + set => _identifierName = ValidateIdentifierName(value, nameof(value)); + } + private string _identifierName; + // TODO: Listen for feedback, but discuss IdentifierName vs. ProvisioningName in the Arch Board + + /// + /// Creates a named Bicep entity, like a resource or parameter. /// - public string ResourceName { get; set; } = resourceName; + /// + /// The the Bicep identifier name of the resource. This can be used to + /// refer to the resource in expressions, but is not the Azure name of the + /// resource. This value can contain letters, numbers, and underscores. + /// + protected NamedProvisioningConstruct(string identifierName) => + _identifierName = ValidateIdentifierName(identifierName, nameof(identifierName)); + + // TODO: Relax this in the future when we make identifier names optional + private static string ValidateIdentifierName(string identifierName, string paramName) + { + // TODO: Enable when Aspire is ready + /* + if (identifierName is null) + { + throw new ArgumentNullException(paramName, $"{nameof(IdentifierName)} cannot be null."); + } + else if (identifierName.Length == 0) + { + throw new ArgumentException($"{nameof(IdentifierName)} cannot be empty.", paramName); + } + + foreach (var ch in identifierName) + { + if (!char.IsLetterOrDigit(ch) && ch != '_') + { + throw new ArgumentException($"{nameof(IdentifierName)} \"{identifierName}\" should only contain letters, numbers, and underscores.", paramName); + } + } + /**/ + return identifierName; + } } public abstract class ProvisioningConstruct : Provisionable diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/Resource.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/Resource.cs index bc2b925447fbe..761d9b9362dfc 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/Resource.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/Resource.cs @@ -72,7 +72,7 @@ public abstract class Resource(string resourceName, ResourceType resourceType, s /// public virtual ProvisioningPlan Build(ProvisioningContext? context = default) => ParentInfrastructure?.Build(context ?? new()) ?? - throw new InvalidOperationException($"Cannot build a provisioning plan for {GetType().Name} resource {ResourceName} before it has been added to {nameof(Infrastructure)}."); + throw new InvalidOperationException($"Cannot build a provisioning plan for {GetType().Name} resource {IdentifierName} before it has been added to {nameof(Infrastructure)}."); /// protected internal override void Validate(ProvisioningContext? context = null) @@ -81,12 +81,12 @@ protected internal override void Validate(ProvisioningContext? context = null) if (ResourceVersion is null) { - throw new InvalidOperationException($"{GetType().Name} resource {ResourceName} must have {nameof(ResourceVersion)} specified."); + throw new InvalidOperationException($"{GetType().Name} resource {IdentifierName} must have {nameof(ResourceVersion)} specified."); } if (DependsOn.Count > 0 && (IsExistingResource || ExpressionOverride is not null)) { - throw new InvalidOperationException($"{GetType().Name} resource {ResourceName} cannot have dependencies if it's an existing resource or an expression override."); + throw new InvalidOperationException($"{GetType().Name} resource {IdentifierName} cannot have dependencies if it's an existing resource or an expression override."); } if (IsExistingResource) @@ -122,17 +122,17 @@ protected internal override IEnumerable Compile() // This should be caught by Validate above if (body is not ObjectExpression obj) { - throw new InvalidOperationException($"{GetType().Name} resource {ResourceName} cannot have dependencies if it's an existing resource or an expression override."); + throw new InvalidOperationException($"{GetType().Name} resource {IdentifierName} cannot have dependencies if it's an existing resource or an expression override."); } // Add the dependsOn property - ArrayExpression dependencies = new(DependsOn.Select(r => BicepSyntax.Var(r.ResourceName)).ToArray()); + ArrayExpression dependencies = new(DependsOn.Select(r => BicepSyntax.Var(r.IdentifierName)).ToArray()); body = new ObjectExpression([.. obj.Properties, new PropertyExpression("dependsOn", dependencies)]); } // Create a resource declaration ResourceStatement resource = BicepSyntax.Declare.Resource( - ResourceName, + IdentifierName, $"{ResourceType}@{ResourceVersion}", body); if (IsExistingResource) diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceNamePropertyResolver.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceNamePropertyResolver.cs index 7460d882f3236..352702dbbc4bb 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceNamePropertyResolver.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceNamePropertyResolver.cs @@ -180,7 +180,7 @@ protected static string SanitizeText(string text, ResourceNameCharacters validCh /// /// Generate a unique name for a resource by combining the resource's -/// as a prefix and a +/// as a prefix and a /// unique suffix based on the current resource group's ID. /// public class DynamicResourceNamePropertyResolver : ResourceNamePropertyResolver @@ -191,7 +191,7 @@ public class DynamicResourceNamePropertyResolver : ResourceNamePropertyResolver /// /// Generate a unique name for a resource by combining the resource's - /// as a prefix and a + /// as a prefix and a /// unique suffix based on the current resource group's ID. /// /// The provisioning context for this resource. @@ -203,7 +203,7 @@ public class DynamicResourceNamePropertyResolver : ResourceNamePropertyResolver Resource resource, ResourceNameRequirements requirements) { - string prefix = SanitizeText(resource.ResourceName, requirements.ValidCharacters); + string prefix = SanitizeText(resource.IdentifierName, requirements.ValidCharacters); string separator = requirements.ValidCharacters.HasFlag(ResourceNameCharacters.Hyphen) ? "-" : requirements.ValidCharacters.HasFlag(ResourceNameCharacters.Underscore) ? "_" : @@ -233,7 +233,7 @@ resource is not ResourceGroup ? /// /// Generate a unique name for a resource by combining the resource's -/// as a prefix and a +/// as a prefix and a /// randomly generated suffix of allowed characters. /// public class StaticResourceNamePropertyResolver : ResourceNamePropertyResolver @@ -247,7 +247,7 @@ public class StaticResourceNamePropertyResolver : ResourceNamePropertyResolver StringBuilder name = new(capacity: requirements.MaxLength); // Start with the sanitized resource name - name.Append(SanitizeText(resource.ResourceName, requirements.ValidCharacters)); + name.Append(SanitizeText(resource.IdentifierName, requirements.ValidCharacters)); if (name.Length >= requirements.MaxLength) { return name.ToString(0, requirements.MaxLength); diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceReference.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceReference.cs index 8b9a5696251e0..8690c4a03e65b 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceReference.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/ResourceReference.cs @@ -29,7 +29,7 @@ public T? Value // TODO: Consider tracking the source like we do for // BicepValue if that'll improve the overall experience // (debugging/errors/etc.) - BicepSyntax.Var(_value.ResourceName); + BicepSyntax.Var(_value.IdentifierName); } } diff --git a/sdk/provisioning/Azure.Provisioning/src/ProvisioningOutput.cs b/sdk/provisioning/Azure.Provisioning/src/ProvisioningOutput.cs index 4801b063677b2..214c97a682ead 100644 --- a/sdk/provisioning/Azure.Provisioning/src/ProvisioningOutput.cs +++ b/sdk/provisioning/Azure.Provisioning/src/ProvisioningOutput.cs @@ -15,7 +15,10 @@ public class ProvisioningOutput : ProvisioningVariable /// /// Creates a new ProvisioningOutput. /// - /// Name of the output. + /// + /// Name of the output. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the output. public ProvisioningOutput(string name, Expression type) : base(name, type, value: null) { } @@ -23,7 +26,10 @@ public ProvisioningOutput(string name, Expression type) /// /// Creates a new ProvisioningOutput. /// - /// Name of the output. + /// + /// Name of the output. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the output. public ProvisioningOutput(string name, Type type) : this(name, new TypeExpression(type)) { } @@ -31,7 +37,7 @@ public ProvisioningOutput(string name, Type type) /// protected internal override IEnumerable Compile() { - OutputStatement stmt = BicepSyntax.Declare.Output(ResourceName, BicepType, Value.Compile()); + OutputStatement stmt = BicepSyntax.Declare.Output(IdentifierName, BicepType, Value.Compile()); if (Description is not null) { stmt = stmt.Decorate("description", BicepSyntax.Value(Description)); } yield return stmt; } diff --git a/sdk/provisioning/Azure.Provisioning/src/ProvisioningParameter.cs b/sdk/provisioning/Azure.Provisioning/src/ProvisioningParameter.cs index b30aed04f36e1..ae9e64ba21a06 100644 --- a/sdk/provisioning/Azure.Provisioning/src/ProvisioningParameter.cs +++ b/sdk/provisioning/Azure.Provisioning/src/ProvisioningParameter.cs @@ -26,7 +26,10 @@ public bool IsSecure /// /// Creates a new ProvisioningParameter. /// - /// Name of the parameter. + /// + /// Name of the parameter. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the parameter. public ProvisioningParameter(string name, Expression type) : base(name, type, value: null) { } @@ -34,7 +37,10 @@ public ProvisioningParameter(string name, Expression type) /// /// Creates a new ProvisioningParameter. /// - /// Name of the parameter. + /// + /// Name of the parameter. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the parameter. public ProvisioningParameter(string name, Type type) : this(name, new TypeExpression(type)) { } @@ -42,7 +48,7 @@ public ProvisioningParameter(string name, Type type) /// protected internal override IEnumerable Compile() { - ParameterStatement stmt = BicepSyntax.Declare.Param(ResourceName, BicepType, Value.Kind == BicepValueKind.Unset ? null : Value.Compile()); + ParameterStatement stmt = BicepSyntax.Declare.Param(IdentifierName, BicepType, Value.Kind == BicepValueKind.Unset ? null : Value.Compile()); if (IsSecure) { stmt = stmt.Decorate("secure"); } if (Description is not null) { stmt = stmt.Decorate("description", BicepSyntax.Value(Description)); } yield return stmt; diff --git a/sdk/provisioning/Azure.Provisioning/src/ProvisioningVariable.cs b/sdk/provisioning/Azure.Provisioning/src/ProvisioningVariable.cs index 93d4af2fd7ae1..46767436a34db 100644 --- a/sdk/provisioning/Azure.Provisioning/src/ProvisioningVariable.cs +++ b/sdk/provisioning/Azure.Provisioning/src/ProvisioningVariable.cs @@ -34,7 +34,10 @@ public class ProvisioningVariable : NamedProvisioningConstruct /// /// Creates a new ProvisioningVariable. /// - /// Name of the variable. + /// + /// Name of the variable. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the variable. /// Default value of the variable. protected ProvisioningVariable(string name, Expression type, BicepValue? value) @@ -47,7 +50,10 @@ protected ProvisioningVariable(string name, Expression type, BicepValue? /// /// Creates a new ProvisioningVariable. /// - /// Name of the variable. + /// + /// Name of the variable. This value can contain letters, numbers, and + /// underscores. + /// /// Type of the variable. public ProvisioningVariable(string name, Type type) : this(name, new TypeExpression(type), value: null) { } @@ -56,7 +62,7 @@ public ProvisioningVariable(string name, Type type) protected internal override IEnumerable Compile() { // TODO: add the rest of https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/parameters#use-decorators? - VariableStatement stmt = BicepSyntax.Declare.Var(ResourceName, Value.Compile()); + VariableStatement stmt = BicepSyntax.Declare.Var(IdentifierName, Value.Compile()); if (Description is not null) { stmt = stmt.Decorate("description", BicepSyntax.Value(Description)); } yield return stmt; } diff --git a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs index b4b3515f1a9aa..9ec9058f479b1 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs +++ b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; @@ -179,7 +180,7 @@ await test.Define( new StringLiteral("Microsoft.App/managedEnvironments/dotNetComponents@2024-02-02-preview"), new ObjectExpression( new PropertyExpression("name", "aspire-dashboard"), - new PropertyExpression("parent", new IdentifierExpression(cae.ResourceName)), + new PropertyExpression("parent", new IdentifierExpression(cae.IdentifierName)), new PropertyExpression("properties", new ObjectExpression( new PropertyExpression("componentType", new StringLiteral("AspireDashboard"))))))); @@ -323,7 +324,7 @@ await test.Define( // the resource group Infrastructure infra = new() { TargetScope = "subscription" }; - ResourceGroup rg = new("rg-test", "2024-03-01"); + ResourceGroup rg = new("rg_test", "2024-03-01"); infra.Add(rg); return infra; @@ -335,12 +336,24 @@ await test.Define( @description('The location for the resource(s) to be deployed.') param location string = deployment().location - resource rg-test 'Microsoft.Resources/resourceGroups@2024-03-01' = { - name: take('rg-test-${uniqueString(deployment().id)}', 90) + resource rg_test 'Microsoft.Resources/resourceGroups@2024-03-01' = { + name: take('rg_test-${uniqueString(deployment().id)}', 90) location: location } """) .Lint() .ValidateAndDeployAsync(); } + + [Test] + public void ValidNames() + { + Assert.Throws(() => new StorageAccount(null!)); + Assert.Throws(() => new StorageAccount("")); + Assert.Throws(() => new StorageAccount("my-storage")); + Assert.Throws(() => new StorageAccount("my storage")); + Assert.Throws(() => new StorageAccount("my:storage")); + Assert.Throws(() => new StorageAccount("storage$")); + _ = new StorageAccount("ABCdef123_"); + } } diff --git a/sdk/provisioning/Generator/src/Model/Resource.cs b/sdk/provisioning/Generator/src/Model/Resource.cs index 237419aeb527f..c4021a1c7f9c1 100644 --- a/sdk/provisioning/Generator/src/Model/Resource.cs +++ b/sdk/provisioning/Generator/src/Model/Resource.cs @@ -116,10 +116,12 @@ public override void Generate() writer.WriteLine($"/// "); writer.WriteWrapped($"Creates a new {Name}."); writer.WriteLine($"/// "); - writer.WriteLine($"/// Name of the {Name}."); + writer.WriteLine($"/// "); + writer.WriteWrapped($"The the Bicep identifier name of the {Name} resource. This can be used to refer to the resource in expressions, but is not the Azure name of the resource. This value can contain letters, numbers, and underscores."); + writer.WriteLine($"/// "); writer.WriteLine($"/// Version of the {Name}."); - writer.WriteLine($"public {Name}(string resourceName, string? resourceVersion = default)"); - writer.Write($" : base(resourceName, \"{ResourceType}\", resourceVersion"); + writer.WriteLine($"public {Name}(string identifierName, string? resourceVersion = default)"); + writer.Write($" : base(identifierName, \"{ResourceType}\", resourceVersion"); if (DefaultResourceVersion is not null) { writer.Write($" ?? \"{DefaultResourceVersion}\""); @@ -176,13 +178,15 @@ public override void Generate() writer.WriteLine($"/// "); writer.WriteWrapped($"Creates a reference to an existing {Name}."); writer.WriteLine($"/// "); - writer.WriteLine($"/// Name of the {Name}."); + writer.WriteLine($"/// "); + writer.WriteWrapped($"The the Bicep identifier name of the {Name} resource. This can be used to refer to the resource in expressions, but is not the Azure name of the resource. This value can contain letters, numbers, and underscores."); + writer.WriteLine($"/// "); writer.WriteLine($"/// Version of the {Name}."); writer.WriteLine($"/// The existing {Name} resource."); - writer.WriteLine($"public static {Name} FromExisting(string resourceName, string? resourceVersion = default) =>"); + writer.WriteLine($"public static {Name} FromExisting(string identifierName, string? resourceVersion = default) =>"); using (writer.Scope()) { - writer.WriteLine($"new(resourceName, resourceVersion) {{ IsExistingResource = true }};"); + writer.WriteLine($"new(identifierName, resourceVersion) {{ IsExistingResource = true }};"); } } @@ -202,7 +206,7 @@ public override void Generate() writer.WriteLine($"public static {Name} FromExpression(Expression expression)"); using (writer.Scope("{", "}")) { - writer.WriteLine($"{Name} resource = new(expression.ToString());"); + writer.WriteLine($"{Name} resource = new(nameof({Name}));"); writer.WriteLine($"resource.OverrideWithExpression(expression);"); writer.WriteLine($"return resource;"); } @@ -254,7 +258,7 @@ public override void Generate() { writer.WriteLine($"{GetKeysType.Name}.FromExpression,"); } - string expr = $"new FunctionCallExpression(new MemberExpression(new IdentifierExpression(ResourceName), \"listKeys\"))"; + string expr = $"new FunctionCallExpression(new MemberExpression(new IdentifierExpression(IdentifierName), \"listKeys\"))"; if (GetKeysIsList) { expr = $"new MemberExpression({expr}, \"keys\")"; @@ -277,13 +281,13 @@ public override void Generate() writer.WriteLine($"public RoleAssignment CreateRoleAssignment({Spec!.Name}BuiltInRole role, UserAssignedIdentity identity) =>"); using (writer.Scope()) { - writer.WriteLine($"new($\"{{ResourceName}}_{{identity.ResourceName}}_{{{Spec!.Name}BuiltInRole.GetBuiltInRoleName(role)}}\")"); + writer.WriteLine($"new($\"{{IdentifierName}}_{{identity.IdentifierName}}_{{{Spec!.Name}BuiltInRole.GetBuiltInRoleName(role)}}\")"); using (writer.Scope("{", "};")) { writer.Write($"Name = BicepFunction.CreateGuid("); if (Properties.Any(p => p.Name == "Id")) { writer.Write("Id, "); } writer.WriteLine($"identity.PrincipalId, BicepFunction.GetSubscriptionResourceId(\"Microsoft.Authorization/roleDefinitions\", role.ToString())),"); - writer.WriteLine($"Scope = new IdentifierExpression(ResourceName),"); + writer.WriteLine($"Scope = new IdentifierExpression(IdentifierName),"); writer.WriteLine($"PrincipalType = RoleManagementPrincipalType.ServicePrincipal,"); writer.WriteLine($"RoleDefinitionId = BicepFunction.GetSubscriptionResourceId(\"Microsoft.Authorization/roleDefinitions\", role.ToString()),"); writer.WriteLine($"PrincipalId = identity.PrincipalId"); @@ -297,18 +301,18 @@ public override void Generate() writer.WriteLine($"/// The role to grant."); writer.WriteLine($"/// The type of the principal to assign to."); writer.WriteLine($"/// The principal to assign to."); - writer.WriteLine($"/// Optional role assignment resource name suffix."); + writer.WriteLine($"/// Optional role assignment identifier name suffix."); writer.WriteLine($"/// The ."); - writer.WriteLine($"public RoleAssignment CreateRoleAssignment({Spec!.Name}BuiltInRole role, BicepValue principalType, BicepValue principalId, string? resourceNameSuffix = default) =>"); + writer.WriteLine($"public RoleAssignment CreateRoleAssignment({Spec!.Name}BuiltInRole role, BicepValue principalType, BicepValue principalId, string? identifierNameSuffix = default) =>"); using (writer.Scope()) { - writer.WriteLine($"new($\"{{ResourceName}}_{{{Spec!.Name}BuiltInRole.GetBuiltInRoleName(role)}}{{(resourceNameSuffix is null ? \"\" : \"_\")}}{{resourceNameSuffix}}\")"); + writer.WriteLine($"new($\"{{IdentifierName}}_{{{Spec!.Name}BuiltInRole.GetBuiltInRoleName(role)}}{{(identifierNameSuffix is null ? \"\" : \"_\")}}{{identifierNameSuffix}}\")"); using (writer.Scope("{", "};")) { writer.Write($"Name = BicepFunction.CreateGuid("); if (Properties.Any(p => p.Name == "Id")) { writer.Write("Id, "); } writer.WriteLine($"principalId, BicepFunction.GetSubscriptionResourceId(\"Microsoft.Authorization/roleDefinitions\", role.ToString())),"); - writer.WriteLine($"Scope = new IdentifierExpression(ResourceName),"); + writer.WriteLine($"Scope = new IdentifierExpression(IdentifierName),"); writer.WriteLine($"PrincipalType = principalType,"); writer.WriteLine($"RoleDefinitionId = BicepFunction.GetSubscriptionResourceId(\"Microsoft.Authorization/roleDefinitions\", role.ToString()),"); writer.WriteLine($"PrincipalId = principalId"); From 17fcf072a658c482760b549f3e4b5a48d3d1d897 Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Thu, 3 Oct 2024 16:02:59 -0700 Subject: [PATCH 07/43] [DocumentIntelligence] Reenabling ignored test after service fix (#46416) --- .../Azure.AI.DocumentIntelligence/assets.json | 2 +- .../tests/DocumentAssert.cs | 1 + .../DocumentClassifierAdministrationLiveTests.cs | 10 ++++------ .../DocumentModelAdministrationLiveTests.cs | 1 + .../OperationWithIdLiveTests.cs | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json index 2e3e08e75ca0a..a44682a71766b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/documentintelligence/Azure.AI.DocumentIntelligence", - "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_0e2741b29e" + "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_76280009cf" } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs index e4ea384d963db..4ae2f043e3205 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs @@ -50,6 +50,7 @@ public static void AreEqual(AzureBlobFileListContentSource expected, AzureBlobFi public static void AreEqual(DocumentClassifierDetails expected, DocumentClassifierDetails actual) { Assert.AreEqual(expected.ClassifierId, actual.ClassifierId); + Assert.AreEqual(expected.BaseClassifierId, actual.BaseClassifierId); Assert.AreEqual(expected.Description, actual.Description); Assert.AreEqual(expected.ApiVersion, actual.ApiVersion); Assert.AreEqual(expected.CreatedOn, actual.CreatedOn); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationLiveTests.cs index 9923fc887f9f5..039b6d8fbfd4e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationLiveTests.cs @@ -63,6 +63,7 @@ public async Task BuildClassifierWithAzureBlobContentSource() DocumentClassifierDetails classifier = operation.Value; Assert.That(classifier.ClassifierId, Is.EqualTo(classifierId)); + Assert.That(classifier.BaseClassifierId, Is.Null); Assert.That(classifier.Description, Is.EqualTo(description)); Assert.That(classifier.ApiVersion, Is.EqualTo(ServiceVersionString)); Assert.That(classifier.CreatedOn, Is.GreaterThan(startTime)); @@ -139,7 +140,6 @@ public async Task BuildClassifierWithAzureBlobFileListContentSource() #region Copy [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/45476")] public async Task CopyClassifierTo() { var client = CreateDocumentIntelligenceAdministrationClient(); @@ -183,7 +183,7 @@ public async Task CopyClassifierTo() DocumentClassifierDetails classifier = operation.Value; Assert.That(classifier.ClassifierId, Is.EqualTo(classifierId)); - Assert.That(classifier.BaseClassifierId, Is.EqualTo(sourceClassifier.ClassifierId)); + Assert.That(classifier.BaseClassifierId, Is.Null); Assert.That(classifier.Description, Is.EqualTo(description)); Assert.That(classifier.ApiVersion, Is.EqualTo(ServiceVersionString)); @@ -191,8 +191,7 @@ public async Task CopyClassifierTo() Assert.That(classifier.CreatedOn, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); Assert.That(classifier.ExpiresOn, Is.GreaterThan(classifier.CreatedOn)); - // TODO: reenable validation once the following service issue has been fixed: https://github.com/Azure/azure-sdk-for-net/issues/37172 - // DocumentAssert.AreEquivalent(sourceClassifier.DocTypes, classifier.DocTypes); + DocumentAssert.AreEquivalent(sourceClassifier.DocTypes, classifier.DocTypes); foreach (var docType in classifier.DocTypes.Values) { @@ -304,7 +303,6 @@ public void DeleteClassifierCanParseError() #endregion Delete [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/45476")] public async Task AuthorizeClassifierCopy() { var client = CreateDocumentIntelligenceAdministrationClient(); @@ -314,12 +312,12 @@ public async Task AuthorizeClassifierCopy() ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(content); Assert.That(copyAuthorization.TargetClassifierId, Is.EqualTo(classifierId)); + Assert.That(copyAuthorization.TargetClassifierLocation.AbsoluteUri, Does.StartWith(TestEnvironment.Endpoint)); Assert.That(copyAuthorization.TargetResourceId, Is.EqualTo(TestEnvironment.ResourceId)); Assert.That(copyAuthorization.TargetResourceRegion, Is.EqualTo(TestEnvironment.ResourceRegion)); Assert.That(copyAuthorization.AccessToken, Is.Not.Null); Assert.That(copyAuthorization.AccessToken, Is.Not.Empty); Assert.That(copyAuthorization.ExpirationDateTime, Is.GreaterThan(Recording.UtcNow)); - // TODO: Check targetclassifierlocation and same for model test. } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs index 3f191ad2175e1..893a1d9077623 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs @@ -427,6 +427,7 @@ public async Task AuthorizeModelCopy() CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(content); Assert.That(copyAuthorization.TargetModelId, Is.EqualTo(modelId)); + Assert.That(copyAuthorization.TargetModelLocation.AbsoluteUri, Does.StartWith(TestEnvironment.Endpoint)); Assert.That(copyAuthorization.TargetResourceId, Is.EqualTo(TestEnvironment.ResourceId)); Assert.That(copyAuthorization.TargetResourceRegion, Is.EqualTo(TestEnvironment.ResourceRegion)); Assert.That(copyAuthorization.AccessToken, Is.Not.Null); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs index 9c2afb7033629..27ac4e43543a4 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs @@ -198,7 +198,6 @@ public async Task BuildClassifierOperationCanParseOperationId(WaitUntil waitUnti [RecordedTest] [TestCase(WaitUntil.Started)] [TestCase(WaitUntil.Completed)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/45476")] public async Task CopyClassifierToOperationCanParseOperationId(WaitUntil waitUntil) { var client = CreateDocumentIntelligenceAdministrationClient(); From 6cb0e110515e175229ebb201a2bbc9dc461c3f80 Mon Sep 17 00:00:00 2001 From: Krzysztof Cwalina Date: Thu, 3 Oct 2024 17:02:08 -0700 Subject: [PATCH 08/43] Added support for optional KeyVault to CloudMachine (#46418) * messaging * wrapped keyvault * removed test framework form the solution * keyvault works * removed unfinished send * updated api file --- .../Azure.CloudMachine.sln | 6 - ...rovisioning.CloudMachine.netstandard2.0.cs | 28 +++- .../Azure.Provisioning.CloudMachine.csproj | 2 + .../src/Client/MessagingServices.cs | 9 +- .../src/CloudMachineFeature.cs | 9 ++ .../src/CloudMachineInfrastructure.cs | 147 +++++++++++------- .../src/KeyVaultFeature.cs | 62 ++++++++ ...ure.Provisioning.CloudMachine.Tests.csproj | 1 - .../tests/CloudMachineTests.cs | 31 +++- 9 files changed, 222 insertions(+), 73 deletions(-) create mode 100644 sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineFeature.cs create mode 100644 sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln b/sdk/provisioning/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln index 7304563c24cd3..4a3ca5dfef4e7 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln @@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Provisioning.CloudMac EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Provisioning.CloudMachine.Tests", "tests\Azure.Provisioning.CloudMachine.Tests.csproj", "{46DCEF27-4157-4FB6-A283-B8484EC45665}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{67BF7830-BE03-4F13-B062-5D747A553542}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -23,10 +21,6 @@ Global {46DCEF27-4157-4FB6-A283-B8484EC45665}.Debug|Any CPU.Build.0 = Debug|Any CPU {46DCEF27-4157-4FB6-A283-B8484EC45665}.Release|Any CPU.ActiveCfg = Release|Any CPU {46DCEF27-4157-4FB6-A283-B8484EC45665}.Release|Any CPU.Build.0 = Release|Any CPU - {67BF7830-BE03-4F13-B062-5D747A553542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67BF7830-BE03-4F13-B062-5D747A553542}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67BF7830-BE03-4F13-B062-5D747A553542}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67BF7830-BE03-4F13-B062-5D747A553542}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs index 510ceac834c2b..56a3ffe03842f 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs @@ -44,11 +44,33 @@ public static partial class StorageServices } namespace Azure.Provisioning.CloudMachine { - public partial class CloudMachineInfrastructure : Azure.Provisioning.Infrastructure + public abstract partial class CloudMachineFeature { - public CloudMachineInfrastructure(string cloudMachineId) : base (default(string)) { } + protected CloudMachineFeature() { } + public abstract void AddTo(Azure.Provisioning.CloudMachine.CloudMachineInfrastructure cm); + } + public partial class CloudMachineInfrastructure + { + public CloudMachineInfrastructure(string cmId) { } + public string Id { get { throw null; } } + public Azure.Provisioning.Roles.UserAssignedIdentity Identity { get { throw null; } } public Azure.Provisioning.ProvisioningParameter PrincipalIdParameter { get { throw null; } } - public override Azure.Provisioning.ProvisioningPlan Build(Azure.Provisioning.ProvisioningContext? context = null) { throw null; } + public void AddFeature(Azure.Provisioning.CloudMachine.CloudMachineFeature resource) { } + public void AddResource(Azure.Provisioning.Primitives.NamedProvisioningConstruct resource) { } + public Azure.Provisioning.ProvisioningPlan Build(Azure.Provisioning.ProvisioningContext? context = null) { throw null; } public static bool Configure(string[] args, System.Action? configure = null) { throw null; } } } +namespace Azure.Provisioning.CloudMachine.KeyVault +{ + public static partial class KeyVaultExtensions + { + public static Azure.Security.KeyVault.Secrets.SecretClient GetKeyVaultSecretClient(this Azure.CloudMachine.CloudMachineClient client) { throw null; } + } + public partial class KeyVaultFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature + { + public KeyVaultFeature() { } + public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } + public override void AddTo(Azure.Provisioning.CloudMachine.CloudMachineInfrastructure cm) { } + } +} diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj index 949be59dda0b7..0b427e36fba50 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj @@ -13,6 +13,7 @@ + @@ -20,5 +21,6 @@ + diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Client/MessagingServices.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Client/MessagingServices.cs index b01153fa70b34..d7702dbf254ce 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Client/MessagingServices.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Client/MessagingServices.cs @@ -8,9 +8,10 @@ namespace Azure.CloudMachine; public static class MessagingServices { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "AZC0107:DO NOT call public asynchronous method in synchronous scope.", Justification = "")] public static void Send(this CloudMachineClient cm, object serializable) { - ServiceBusSender sender = cm.ClientCache.Get("cm_default_topic", () => + ServiceBusSender sender = cm.ClientCache.Get("cm_default_topic_sender", () => { ServiceBusClient sb = cm.ClientCache.Get(cm.Properties.ServiceBusNamespace, () => { @@ -18,12 +19,14 @@ public static void Send(this CloudMachineClient cm, object serializable) return sb; }); - ServiceBusSender sender = sb.CreateSender("cm_default_topic"); + ServiceBusSender sender = sb.CreateSender("cm_default_topic_sender"); return sender; }); BinaryData serialized = BinaryData.FromObjectAsJson(serializable); ServiceBusMessage message = new(serialized); - sender.SendMessageAsync(message); +#pragma warning disable AZC0102 // Do not use GetAwaiter().GetResult(). + sender.SendMessageAsync(message).GetAwaiter().GetResult(); +#pragma warning restore AZC0102 // Do not use GetAwaiter().GetResult(). } } diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineFeature.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineFeature.cs new file mode 100644 index 0000000000000..0f96ce3ea71fd --- /dev/null +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineFeature.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Provisioning.CloudMachine; + +public abstract class CloudMachineFeature +{ + public abstract void AddTo(CloudMachineInfrastructure cm); +} diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure.cs index aab92d74e6f63..f134dd71790e1 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure.cs @@ -11,24 +11,39 @@ using Azure.Provisioning.Roles; using Azure.Provisioning.ServiceBus; using Azure.Provisioning.Storage; +using Azure.Provisioning.Primitives; +using System.Collections.Generic; namespace Azure.Provisioning.CloudMachine; -public class CloudMachineInfrastructure : Infrastructure +public class CloudMachineInfrastructure { private readonly string _cmid; - private UserAssignedIdentity _identity; + + private Infrastructure _infrastructure = new Infrastructure("cm"); + private List _resources = new(); + + // storage private StorageAccount _storage; private BlobService _blobs; private BlobContainer _container; + + // servicebus private ServiceBusNamespace _serviceBusNamespace; private ServiceBusNamespaceAuthorizationRule _serviceBusNamespaceAuthorizationRule; - private ServiceBusTopic _serviceBusTopic_main; - private ServiceBusTopic _serviceBusTopic_app; - private ServiceBusSubscription _serviceBusSubscription_main; - private ServiceBusSubscription _serviceBusSubscription_app; - private SystemTopic _eventGridTopic_Blobs; - private SystemTopicEventSubscription _systemTopicEventSubscription; + + private ServiceBusTopic _serviceBusTopic_default; + private ServiceBusSubscription _serviceBusSubscription_default; + + private ServiceBusTopic _serviceBusTopic_private; + private ServiceBusSubscription _serviceBusSubscription_private; + + // eventgrid + private SystemTopic _eventGridTopic_blobs; + private SystemTopicEventSubscription _eventGridSubscription_blobs; + + public UserAssignedIdentity Identity { get; private set; } + public string Id => _cmid; /// /// The common principalId parameter. @@ -45,32 +60,35 @@ public class CloudMachineInfrastructure : Infrastructure ///// //public ProvisioningParameter PrincipalNameParameter => new BicepParameter("principalName", typeof(string)); - public CloudMachineInfrastructure(string cloudMachineId) : base("cm") + public CloudMachineInfrastructure(string cmId) { - _cmid = cloudMachineId; - _identity = new("cm_identity"); - _identity.Name = _cmid; + _cmid = cmId; + + // setup CM identity + Identity = new UserAssignedIdentity("cm_identity"); + Identity.Name = _cmid; + _infrastructure.Add(new ProvisioningOutput($"cm_managed_identity_id", typeof(string)) { Value = Identity.Id }); ManagedServiceIdentity managedServiceIdentity = new() { ManagedServiceIdentityType = ManagedServiceIdentityType.UserAssigned, - UserAssignedIdentities = { { BicepFunction.Interpolate($"{_identity.Id}").Compile().ToString(), new UserAssignedIdentityDetails() } } + UserAssignedIdentities = { { BicepFunction.Interpolate($"{Identity.Id}").Compile().ToString(), new UserAssignedIdentityDetails() } } }; - _storage = StorageResources.CreateAccount($"cm_sa"); + _storage = StorageResources.CreateAccount("cm_storage"); _storage.Identity = managedServiceIdentity; _storage.Name = _cmid; - _blobs = new("cm_blobs") + _blobs = new("cm_storage_blobs") { Parent = _storage, }; - _container = new BlobContainer("cm_container", "2023-01-01") + _container = new BlobContainer("cm_storage_blobs_container", "2023-01-01") { Parent = _blobs, Name = "default" }; - _serviceBusNamespace = new("cm_sb") + _serviceBusNamespace = new("cm_servicebus") { Sku = new ServiceBusSku { @@ -79,14 +97,14 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") }, Name = _cmid, }; - _serviceBusNamespaceAuthorizationRule = new($"cm_sb_auth_rule", "2021-11-01") + _serviceBusNamespaceAuthorizationRule = new($"cm_servicebus_auth_rule", "2021-11-01") { Parent = _serviceBusNamespace, Rights = [ServiceBusAccessRight.Listen, ServiceBusAccessRight.Send, ServiceBusAccessRight.Manage] }; - _serviceBusTopic_main = new("cm_internal_topic", "2021-11-01") + _serviceBusTopic_private = new("cm_servicebus_topic_private", "2021-11-01") { - Name = "cm_internal_topic", + Name = "cm_servicebus_topic_private", Parent = _serviceBusNamespace, MaxMessageSizeInKilobytes = 256, DefaultMessageTimeToLive = new StringLiteral("P14D"), @@ -95,9 +113,9 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") SupportOrdering = true, Status = ServiceBusMessagingEntityStatus.Active }; - _serviceBusSubscription_main = new("cm_internal_subscription", "2021-11-01") + _serviceBusSubscription_private = new("cm_servicebus_subscription_private", "2021-11-01") { - Parent = _serviceBusTopic_main, + Parent = _serviceBusTopic_private, IsClientAffine = false, LockDuration = new StringLiteral("PT30S"), RequiresSession = false, @@ -108,9 +126,9 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") EnableBatchedOperations = true, Status = ServiceBusMessagingEntityStatus.Active }; - _serviceBusTopic_app = new("cm_default_topic", "2021-11-01") + _serviceBusTopic_default = new("cm_servicebus_topic_default", "2021-11-01") { - Name = "cm_default_topic", + Name = "cm_servicebus_default_topic", Parent = _serviceBusNamespace, MaxMessageSizeInKilobytes = 256, DefaultMessageTimeToLive = new StringLiteral("P14D"), @@ -119,10 +137,10 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") SupportOrdering = true, Status = ServiceBusMessagingEntityStatus.Active }; - _serviceBusSubscription_app = new("cm_default_subscription", "2021-11-01") + _serviceBusSubscription_default = new("cm_servicebus_subscription_default", "2021-11-01") { - Name = "cm_default_subscription", - Parent = _serviceBusTopic_app, + Name = "cm_servicebus_subscription_default", + Parent = _serviceBusTopic_default, IsClientAffine = false, LockDuration = new StringLiteral("PT30S"), RequiresSession = false, @@ -133,26 +151,26 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") EnableBatchedOperations = true, Status = ServiceBusMessagingEntityStatus.Active }; - _eventGridTopic_Blobs = new("cm_eg_blob", "2022-06-15") + _eventGridTopic_blobs = new("cm_eventgrid_topic_blob", "2022-06-15") { TopicType = "Microsoft.Storage.StorageAccounts", Source = _storage.Id, Identity = managedServiceIdentity, Name = _cmid }; - _systemTopicEventSubscription = new($"cm_eg_blob_sub", "2022-06-15") + _eventGridSubscription_blobs = new("cm_eventgrid_subscription_blob", "2022-06-15") { - Parent = _eventGridTopic_Blobs, + Parent = _eventGridTopic_blobs, DeliveryWithResourceIdentity = new DeliveryWithResourceIdentity { Identity = new EventSubscriptionIdentity { IdentityType = EventSubscriptionIdentityType.UserAssigned, - UserAssignedIdentity = _identity.Id + UserAssignedIdentity = Identity.Id }, Destination = new ServiceBusTopicEventSubscriptionDestination { - ResourceId = _serviceBusTopic_main.Id + ResourceId = _serviceBusTopic_private.Id } }, Filter = new EventSubscriptionFilter @@ -174,48 +192,63 @@ public CloudMachineInfrastructure(string cloudMachineId) : base("cm") }; } - public override ProvisioningPlan Build(ProvisioningContext? context = null) + public void AddResource(NamedProvisioningConstruct resource) + { + _resources.Add(resource); + } + public void AddFeature(CloudMachineFeature resource) + { + resource.AddTo(this); + } + + public ProvisioningPlan Build(ProvisioningContext? context = null) { // Always add a default location parameter. // azd assumes there will be a location parameter for every module. // The Infrastructure location resolver will resolve unset Location properties to this parameter. - Add(new ProvisioningParameter("location", typeof(string)) + _infrastructure.Add(new ProvisioningParameter("location", typeof(string)) { Description = "The location for the resource(s) to be deployed.", Value = BicepFunction.GetResourceGroup().Location }); - Add(PrincipalIdParameter); + _infrastructure.Add(PrincipalIdParameter); //Add(PrincipalTypeParameter); //Add(PrincipalNameParameter); - Add(_identity); - Add(_storage); - Add(_storage.CreateRoleAssignment(StorageBuiltInRole.StorageBlobDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter)); - Add(_storage.CreateRoleAssignment(StorageBuiltInRole.StorageTableDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter)); - Add(_container); - Add(_blobs); - Add(_serviceBusNamespace); - Add(_serviceBusNamespace.CreateRoleAssignment(ServiceBusBuiltInRole.AzureServiceBusDataOwner, RoleManagementPrincipalType.User, PrincipalIdParameter)); - Add(_serviceBusNamespaceAuthorizationRule); - Add(_serviceBusTopic_main); - Add(_serviceBusTopic_app); - Add(_serviceBusSubscription_main); - Add(_serviceBusSubscription_app); - - RoleAssignment roleAssignment = _serviceBusNamespace.CreateRoleAssignment(ServiceBusBuiltInRole.AzureServiceBusDataSender, _identity); - Add(roleAssignment); + _infrastructure.Add(Identity); + _infrastructure.Add(_storage); + _infrastructure.Add(_storage.CreateRoleAssignment(StorageBuiltInRole.StorageBlobDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter)); + _infrastructure.Add(_storage.CreateRoleAssignment(StorageBuiltInRole.StorageTableDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter)); + _infrastructure.Add(_container); + _infrastructure.Add(_blobs); + _infrastructure.Add(_serviceBusNamespace); + _infrastructure.Add(_serviceBusNamespace.CreateRoleAssignment(ServiceBusBuiltInRole.AzureServiceBusDataOwner, RoleManagementPrincipalType.User, PrincipalIdParameter)); + _infrastructure.Add(_serviceBusNamespaceAuthorizationRule); + _infrastructure.Add(_serviceBusTopic_private); + _infrastructure.Add(_serviceBusTopic_default); + _infrastructure.Add(_serviceBusSubscription_private); + _infrastructure.Add(_serviceBusSubscription_default); + + RoleAssignment roleAssignment = _serviceBusNamespace.CreateRoleAssignment(ServiceBusBuiltInRole.AzureServiceBusDataSender, RoleManagementPrincipalType.User, PrincipalIdParameter); + _infrastructure.Add(roleAssignment); // the role assignment must exist before the system topic event subscription is created. - _systemTopicEventSubscription.DependsOn.Add(roleAssignment); + _eventGridSubscription_blobs.DependsOn.Add(roleAssignment); - Add(_systemTopicEventSubscription); - Add(_eventGridTopic_Blobs); + _infrastructure.Add(_eventGridSubscription_blobs); + _infrastructure.Add(_eventGridTopic_blobs); // Placeholders for now. - Add(new ProvisioningOutput($"storage_name", typeof(string)) { Value = _storage.Name }); - Add(new ProvisioningOutput($"servicebus_name", typeof(string)) { Value = _serviceBusNamespace.Name }); + _infrastructure.Add(new ProvisioningOutput($"storage_name", typeof(string)) { Value = _storage.Name }); + _infrastructure.Add(new ProvisioningOutput($"servicebus_name", typeof(string)) { Value = _serviceBusNamespace.Name }); + + // Add any add-on resources to the infrastructure. + foreach (Provisionable resource in _resources) + { + _infrastructure.Add(resource); + } - return base.Build(context); + return _infrastructure.Build(context); } public static bool Configure(string[] args, Action? configure = default) diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs new file mode 100644 index 0000000000000..a00782f6d43ac --- /dev/null +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.CloudMachine; +using Azure.Provisioning.Authorization; +using Azure.Provisioning.Expressions; +using Azure.Provisioning.KeyVault; +using Azure.Security.KeyVault.Secrets; + +namespace Azure.Provisioning.CloudMachine.KeyVault; + +public class KeyVaultFeature : CloudMachineFeature +{ + public KeyVaultSku Sku { get; set; } = new KeyVaultSku { Name = KeyVaultSkuName.Standard, Family = KeyVaultSkuFamily.A, }; + + public override void AddTo(CloudMachineInfrastructure cm) + { + // Add a KeyVault to the CloudMachine infrastructure. + KeyVaultService _keyVault = new("cm_kv") + { + Name = cm.Id, + Properties = + new KeyVaultProperties + { + Sku = this.Sku, + TenantId = BicepFunction.GetSubscription().TenantId, + EnabledForDeployment = true, + AccessPolicies = [ + new KeyVaultAccessPolicy() { + ObjectId = cm.PrincipalIdParameter, + Permissions = new IdentityAccessPermissions() { + Secrets = [IdentityAccessSecretPermission.Get, IdentityAccessSecretPermission.Set] + }, + TenantId = cm.Identity.TenantId + } + ] + }, + }; + + cm.AddResource(_keyVault); + + RoleAssignment ra = _keyVault.CreateRoleAssignment(KeyVaultBuiltInRole.KeyVaultAdministrator, RoleManagementPrincipalType.User, cm.PrincipalIdParameter); + cm.AddResource(ra); + + // necessary until ResourceName is settable via AssignRole. + RoleAssignment kvMiRoleAssignment = new RoleAssignment(_keyVault.ResourceName + "_" + cm.Identity.ResourceName + "_" + KeyVaultBuiltInRole.GetBuiltInRoleName(KeyVaultBuiltInRole.KeyVaultAdministrator)); + kvMiRoleAssignment.Name = BicepFunction.CreateGuid(_keyVault.Id, cm.Identity.Id, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", KeyVaultBuiltInRole.KeyVaultAdministrator.ToString())); + kvMiRoleAssignment.Scope = new IdentifierExpression(_keyVault.ResourceName); + kvMiRoleAssignment.PrincipalType = RoleManagementPrincipalType.ServicePrincipal; + kvMiRoleAssignment.RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", KeyVaultBuiltInRole.KeyVaultAdministrator.ToString()); + kvMiRoleAssignment.PrincipalId = cm.Identity.PrincipalId; + cm.AddResource(kvMiRoleAssignment); + } +} + +public static class KeyVaultExtensions +{ + public static SecretClient GetKeyVaultSecretClient(this CloudMachineClient client) + { + return new(new($"https://{client.Id}.vault.azure.net/"), client.Credential); + } +} diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj b/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj index 8e7a090677ad0..ac4afb158ed33 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj @@ -3,7 +3,6 @@ 12 - diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/CloudMachineTests.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/CloudMachineTests.cs index 9522dcf1f35b7..0bcee4f59186b 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/CloudMachineTests.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/tests/CloudMachineTests.cs @@ -5,6 +5,8 @@ using System; using Azure.Provisioning.CloudMachine; +using Azure.Provisioning.CloudMachine.KeyVault; +using Azure.Security.KeyVault.Secrets; using NUnit.Framework; namespace Azure.CloudMachine.Tests; @@ -16,20 +18,43 @@ public class CloudMachineTests [TestCase([new string[] { "" }])] public void Configure(string[] args) { - if (CloudMachineInfrastructure.Configure(args, (cmi) => { + if (CloudMachineInfrastructure.Configure(args, (cm) => { + cm.AddFeature(new KeyVaultFeature() + { + //Sku = new KeyVaultSku { Name = KeyVaultSkuName.Premium, Family = KeyVaultSkuFamily.A, } + }); })) return; CloudMachineClient cm = new(); Console.WriteLine(cm.Id); } + [Ignore("no recordings yet")] + [Theory] + [TestCase([new string[] { "--init" }])] + [TestCase([new string[] { "" }])] + public void KeyVault(string[] args) + { + if (CloudMachineInfrastructure.Configure(args, (cm) => + { + cm.AddFeature(new KeyVaultFeature() + { + //Sku = new KeyVaultSku { Name = KeyVaultSkuName.Premium, Family = KeyVaultSkuFamily.A, } + }); + })) return; + + CloudMachineClient cm = new(); + SecretClient secrets = cm.GetKeyVaultSecretClient(); + secrets.SetSecret("testsecret", "don't tell anybody"); + } + [Ignore("no recordings yet")] [Theory] [TestCase([new string[] { "--init" }])] [TestCase([new string[] { "" }])] public void Storage(string[] args) { - if (CloudMachineInfrastructure.Configure(args, (cmi) => { + if (CloudMachineInfrastructure.Configure(args, (cm) => { })) return; CloudMachineClient cm = new(); @@ -47,7 +72,7 @@ public void Storage(string[] args) [TestCase([new string[] { "" }])] public void Messaging(string[] args) { - if (CloudMachineInfrastructure.Configure(args, (cmi) => { + if (CloudMachineInfrastructure.Configure(args, (cm) => { })) return; CloudMachineClient cm = new(); From 3819e496dcca51cb7beec49d15c1766042ba3319 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:19:02 -0700 Subject: [PATCH 09/43] Increment version for core releases (#46420) * Increment package version after release of System.ClientModel * Increment package version after release of Azure.Core.Experimental * Increment package version after release of Azure.Core --- sdk/core/Azure.Core.Experimental/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Core.Experimental.csproj | 2 +- sdk/core/Azure.Core/CHANGELOG.md | 10 ++++++++++ sdk/core/Azure.Core/src/Azure.Core.csproj | 4 ++-- sdk/core/System.ClientModel/CHANGELOG.md | 10 ++++++++++ .../System.ClientModel/src/System.ClientModel.csproj | 4 ++-- 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/sdk/core/Azure.Core.Experimental/CHANGELOG.md b/sdk/core/Azure.Core.Experimental/CHANGELOG.md index e5f53f4dda383..59417f361d521 100644 --- a/sdk/core/Azure.Core.Experimental/CHANGELOG.md +++ b/sdk/core/Azure.Core.Experimental/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 0.1.0-preview.37 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 0.1.0-preview.36 (2024-10-03) ### Breaking Changes diff --git a/sdk/core/Azure.Core.Experimental/src/Azure.Core.Experimental.csproj b/sdk/core/Azure.Core.Experimental/src/Azure.Core.Experimental.csproj index b3658356714d9..99dcd3baa3f90 100644 --- a/sdk/core/Azure.Core.Experimental/src/Azure.Core.Experimental.csproj +++ b/sdk/core/Azure.Core.Experimental/src/Azure.Core.Experimental.csproj @@ -2,7 +2,7 @@ Experimental types that might eventually move to Azure.Core Microsoft Azure Client Pipeline Experimental Extensions - 0.1.0-preview.36 + 0.1.0-preview.37 Microsoft Azure Client Pipeline enable $(RequiredTargetFrameworks);net461;net6.0 diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index e59fde422f7aa..8ee241db0a11a 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.45.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.44.0 (2024-10-03) ### Features Added diff --git a/sdk/core/Azure.Core/src/Azure.Core.csproj b/sdk/core/Azure.Core/src/Azure.Core.csproj index 1c1f55789fa56..59be7dee7370a 100644 --- a/sdk/core/Azure.Core/src/Azure.Core.csproj +++ b/sdk/core/Azure.Core/src/Azure.Core.csproj @@ -2,9 +2,9 @@ This is the implementation of the Azure Client Pipeline Microsoft Azure Client Pipeline - 1.44.0 + 1.45.0-beta.1 - 1.43.0 + 1.44.0 Microsoft Azure Client Pipeline enable $(DefineConstants);AZURE_NULLABLE;HAS_INTERNALS_VISIBLE_CORE diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index 0628092e36fe7..9261db0fb9fc7 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.3.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.2.0 (2024-10-03) ### Other Changes diff --git a/sdk/core/System.ClientModel/src/System.ClientModel.csproj b/sdk/core/System.ClientModel/src/System.ClientModel.csproj index 51782d64005e5..daa1a5edc47af 100644 --- a/sdk/core/System.ClientModel/src/System.ClientModel.csproj +++ b/sdk/core/System.ClientModel/src/System.ClientModel.csproj @@ -2,9 +2,9 @@ Contains building blocks for clients that call cloud services. - 1.2.0 + 1.3.0-beta.1 - 1.1.0 + 1.2.0 enable netstandard2.0;net6.0 DotNetPackageIcon.png From cbb1d0e1cba051dd949e6847eaa2a9d519695fa5 Mon Sep 17 00:00:00 2001 From: Anne Thompson <21269347+annelo-msft@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:57:50 -0700 Subject: [PATCH 10/43] Update Core library package versions for Az.Core 1.44.0 and SCM 1.2.0 releases. (#46421) --- eng/Packages.Data.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index a1936fec82703..3b762ff7f1523 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -107,9 +107,9 @@ - + - + @@ -349,7 +349,7 @@ - + From cac224bb6f09ebf4d2425129619b8c3ca2fce823 Mon Sep 17 00:00:00 2001 From: Krzysztof Cwalina Date: Thu, 3 Oct 2024 17:58:39 -0700 Subject: [PATCH 11/43] fixing build (#46423) * fixing build * generated api file --- ...rovisioning.CloudMachine.netstandard2.0.cs | 12 +++++++++ .../Azure.Provisioning.CloudMachine.csproj | 1 + .../src/KeyVaultFeature.cs | 4 +-- .../src/OpenAIFeature.cs | 25 +++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 sdk/provisioning/Azure.Provisioning.CloudMachine/src/OpenAIFeature.cs diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs index 56a3ffe03842f..5afe8aa21795b 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs @@ -74,3 +74,15 @@ public KeyVaultFeature() { } public override void AddTo(Azure.Provisioning.CloudMachine.CloudMachineInfrastructure cm) { } } } +namespace Azure.Provisioning.CloudMachine.OpenAI +{ + public partial class OpenAIFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature + { + public OpenAIFeature() { } + public override void AddTo(Azure.Provisioning.CloudMachine.CloudMachineInfrastructure cm) { } + } + public static partial class OpenAIFeatureExtensions + { + public static Azure.Security.KeyVault.Secrets.SecretClient GetOpenAIClient(this Azure.CloudMachine.CloudMachineClient client) { throw null; } + } +} diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj index 0b427e36fba50..58d9db9b883c6 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj @@ -22,5 +22,6 @@ + diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs index a00782f6d43ac..0f79f89479992 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/KeyVaultFeature.cs @@ -43,9 +43,9 @@ public override void AddTo(CloudMachineInfrastructure cm) cm.AddResource(ra); // necessary until ResourceName is settable via AssignRole. - RoleAssignment kvMiRoleAssignment = new RoleAssignment(_keyVault.ResourceName + "_" + cm.Identity.ResourceName + "_" + KeyVaultBuiltInRole.GetBuiltInRoleName(KeyVaultBuiltInRole.KeyVaultAdministrator)); + RoleAssignment kvMiRoleAssignment = new RoleAssignment(_keyVault.IdentifierName + "_" + cm.Identity.IdentifierName + "_" + KeyVaultBuiltInRole.GetBuiltInRoleName(KeyVaultBuiltInRole.KeyVaultAdministrator)); kvMiRoleAssignment.Name = BicepFunction.CreateGuid(_keyVault.Id, cm.Identity.Id, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", KeyVaultBuiltInRole.KeyVaultAdministrator.ToString())); - kvMiRoleAssignment.Scope = new IdentifierExpression(_keyVault.ResourceName); + kvMiRoleAssignment.Scope = new IdentifierExpression(_keyVault.IdentifierName); kvMiRoleAssignment.PrincipalType = RoleManagementPrincipalType.ServicePrincipal; kvMiRoleAssignment.RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", KeyVaultBuiltInRole.KeyVaultAdministrator.ToString()); kvMiRoleAssignment.PrincipalId = cm.Identity.PrincipalId; diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/OpenAIFeature.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/OpenAIFeature.cs new file mode 100644 index 0000000000000..c56476ba98a97 --- /dev/null +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/OpenAIFeature.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.CloudMachine; +using Azure.Security.KeyVault.Secrets; + +namespace Azure.Provisioning.CloudMachine.OpenAI; + +public class OpenAIFeature : CloudMachineFeature +{ + public override void AddTo(CloudMachineInfrastructure cm) + { + throw new NotImplementedException(); + } +} + +public static class OpenAIFeatureExtensions +{ + public static SecretClient GetOpenAIClient(this CloudMachineClient client) + { + throw new NotImplementedException(); + //return new(new($"https://{client.Id}.vault.azure.net/"), client.Credential); + } +} From 0f3c0e6780ebdc023398d2c5089add9ba6f0f6db Mon Sep 17 00:00:00 2001 From: Donnie Goodson <49205731+donnie-msft@users.noreply.github.com> Date: Thu, 3 Oct 2024 22:25:04 -0700 Subject: [PATCH 12/43] Fix minor typo in ImageAnalysisOptions.cs (#45339) Just noticed this tiny typo while playing with your SDK. --- .../src/Custom/ImageAnalysisOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/vision/Azure.AI.Vision.ImageAnalysis/src/Custom/ImageAnalysisOptions.cs b/sdk/vision/Azure.AI.Vision.ImageAnalysis/src/Custom/ImageAnalysisOptions.cs index b52153fc8f16c..5bb401a983556 100644 --- a/sdk/vision/Azure.AI.Vision.ImageAnalysis/src/Custom/ImageAnalysisOptions.cs +++ b/sdk/vision/Azure.AI.Vision.ImageAnalysis/src/Custom/ImageAnalysisOptions.cs @@ -19,7 +19,7 @@ public struct ImageAnalysisOptions /// /// If this option is not specified, the default value 'en' is used (English). /// See https://aka.ms/cv-languages for a list of supported languages. - /// At the moment, only tags can be generated in none-English languages. + /// At the moment, only tags can be generated in non-English languages. /// public string Language { get; set; } From 86ccbe7dddde2c6ffe07220e536efc8133069003 Mon Sep 17 00:00:00 2001 From: Dina Saparbaeva <49748840+dinazavyr@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:59:41 +0300 Subject: [PATCH 13/43] Split public and int tests and fix public tests (#46408) --- .../Azure.Communication.Sms/tests.int.yml | 16 ++++++++++++++++ .../Azure.Communication.Sms/tests.yml | 10 ++++------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 sdk/communication/Azure.Communication.Sms/tests.int.yml diff --git a/sdk/communication/Azure.Communication.Sms/tests.int.yml b/sdk/communication/Azure.Communication.Sms/tests.int.yml new file mode 100644 index 0000000000000..9d2bef9619722 --- /dev/null +++ b/sdk/communication/Azure.Communication.Sms/tests.int.yml @@ -0,0 +1,16 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: communication + Project: Azure.Communication.Sms + CloudConfig: + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-net) + - $(sub-config-communication-sms-int-test-resources) + Clouds: Int + TestResourceDirectories: + - communication/ diff --git a/sdk/communication/Azure.Communication.Sms/tests.yml b/sdk/communication/Azure.Communication.Sms/tests.yml index f8bbddd4229fb..a780be0adb4e5 100644 --- a/sdk/communication/Azure.Communication.Sms/tests.yml +++ b/sdk/communication/Azure.Communication.Sms/tests.yml @@ -7,16 +7,14 @@ extends: Project: Azure.Communication.Sms CloudConfig: Public: + ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json SubscriptionConfigurations: - $(sub-config-azure-cloud-test-resources) - $(sub-config-communication-services-cloud-test-resources-common) - $(sub-config-communication-services-cloud-test-resources-net) - $(sub-config-communication-services-sms-cloud-test-resources) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-net) - - $(sub-config-communication-sms-int-test-resources) - Clouds: Public,Int + Clouds: Public TestResourceDirectories: - communication/ From d3cd1400b9740c1389c82f136abc9daecbecfdbb Mon Sep 17 00:00:00 2001 From: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Date: Fri, 4 Oct 2024 01:50:20 -0700 Subject: [PATCH 14/43] [Search] Update Samples as per Azure OpenAI GA Version (#46397) * [Search] Update Samples as per OpenAI GA Version * Update ApiKeyCredential -> AzureKeyCredential --------- Co-authored-by: ShivangiReja --- eng/Packages.Data.props | 2 +- sdk/search/Azure.Search.Documents/assets.json | 2 +- .../samples/Sample07_VectorSearch_UsingReducedEmbeddings.md | 2 +- .../samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md | 2 +- .../Sample07_VectorSearch_UsingVectorizableTextQuery.md | 2 +- .../samples/Sample07_VectorSearch_UsingVectorizedQuery.md | 2 +- .../tests/Azure.Search.Documents.Tests.csproj | 3 --- .../tests/Samples/Sample07_VectorSearchCommons.cs | 3 ++- .../Samples/Sample07_VectorSearch_UsingReducedEmbeddings.cs | 3 ++- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 3b762ff7f1523..b7169f799d598 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -128,7 +128,7 @@ - + diff --git a/sdk/search/Azure.Search.Documents/assets.json b/sdk/search/Azure.Search.Documents/assets.json index 135e9a903828f..7e35b800eb79e 100644 --- a/sdk/search/Azure.Search.Documents/assets.json +++ b/sdk/search/Azure.Search.Documents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/search/Azure.Search.Documents", - "Tag": "net/search/Azure.Search.Documents_71e5c48d88" + "Tag": "net/search/Azure.Search.Documents_1b05ea0ca5" } diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingReducedEmbeddings.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingReducedEmbeddings.md index c71a933ec69c7..fc4b4647f4b74 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingReducedEmbeddings.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingReducedEmbeddings.md @@ -107,7 +107,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) { Dimensions = 256 }; - Embedding embedding = embeddingClient.GenerateEmbedding(input, embeddingsOptions); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input, embeddingsOptions); return embedding.ToFloats(); } ``` diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md index 2167163afb932..67cae152525f0 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md @@ -98,7 +98,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) AzureOpenAIClient openAIClient = new AzureOpenAIClient(endpoint, credential); EmbeddingClient embeddingClient = openAIClient.GetEmbeddingClient("text-embedding-ada-002"); - Embedding embedding = embeddingClient.GenerateEmbedding(input); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input); return embedding.ToFloats(); } ``` diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md index 68fe7dfd0ba70..115c69a7c6d6a 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md @@ -97,7 +97,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) AzureOpenAIClient openAIClient = new AzureOpenAIClient(endpoint, credential); EmbeddingClient embeddingClient = openAIClient.GetEmbeddingClient("text-embedding-ada-002"); - Embedding embedding = embeddingClient.GenerateEmbedding(input); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input); return embedding.ToFloats(); } ``` diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizedQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizedQuery.md index bdffe804f19ce..5faba64ecd610 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizedQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizedQuery.md @@ -80,7 +80,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) AzureOpenAIClient openAIClient = new AzureOpenAIClient(endpoint, credential); EmbeddingClient embeddingClient = openAIClient.GetEmbeddingClient("text-embedding-ada-002"); - Embedding embedding = embeddingClient.GenerateEmbedding(input); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input); return embedding.ToFloats(); } ``` diff --git a/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj b/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj index a497481316d64..b23eadc793180 100644 --- a/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj +++ b/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj @@ -35,9 +35,6 @@ - - - diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearchCommons.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearchCommons.cs index ce47488e9fb23..6cba30be83cc6 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearchCommons.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearchCommons.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ClientModel; using Azure.AI.OpenAI; using OpenAI.Embeddings; #pragma warning disable SA1402 // File may only contain a single type @@ -20,7 +21,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) AzureOpenAIClient openAIClient = new AzureOpenAIClient(endpoint, credential); EmbeddingClient embeddingClient = openAIClient.GetEmbeddingClient("text-embedding-ada-002"); - Embedding embedding = embeddingClient.GenerateEmbedding(input); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input); return embedding.ToFloats(); } #endregion diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_UsingReducedEmbeddings.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_UsingReducedEmbeddings.cs index fcd91563a82c3..1fcd38a2931b6 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_UsingReducedEmbeddings.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Sample07_VectorSearch_UsingReducedEmbeddings.cs @@ -10,6 +10,7 @@ using Azure.Core.TestFramework; using Azure.AI.OpenAI; using OpenAI.Embeddings; +using System.ClientModel; namespace Azure.Search.Documents.Tests.Samples.VectorSearch { @@ -179,7 +180,7 @@ public static ReadOnlyMemory GetEmbeddings(string input) { Dimensions = 256 }; - Embedding embedding = embeddingClient.GenerateEmbedding(input, embeddingsOptions); + OpenAIEmbedding embedding = embeddingClient.GenerateEmbedding(input, embeddingsOptions); return embedding.ToFloats(); } #endregion From 97ee8caf8856477b997c27d10fc12af805541d13 Mon Sep 17 00:00:00 2001 From: tg-msft Date: Fri, 4 Oct 2024 10:13:12 -0700 Subject: [PATCH 15/43] Azure.Provisioning release prep (#46427) Azure.Provisioning release prep * Temporarily disable name validation test (as that's also temporarily disabled). * Add --prerelease everywhere * Add whitespace changes from the release script and instructions to install the previous GA --- .../CHANGELOG.md | 4 ++-- .../README.md | 4 ++-- ...Azure.Provisioning.AppConfiguration.csproj | 5 ++--- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../README.md | 4 ++-- .../Azure.Provisioning.AppContainers.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../Azure.Provisioning.AppService/README.md | 4 ++-- .../src/Azure.Provisioning.AppService.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../CHANGELOG.md | 4 ++-- .../README.md | 4 ++-- ...re.Provisioning.ApplicationInsights.csproj | 9 +------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.CloudMachine/README.md | 2 +- .../CHANGELOG.md | 4 ++-- .../README.md | 4 ++-- ...zure.Provisioning.CognitiveServices.csproj | 8 +++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../README.md | 4 ++-- .../Azure.Provisioning.Communication.csproj | 7 +++--- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../README.md | 4 ++-- ...zure.Provisioning.ContainerRegistry.csproj | 8 +++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../README.md | 4 ++-- ...Azure.Provisioning.ContainerService.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.CosmosDB/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.CosmosDB/README.md | 4 ++-- .../src/Azure.Provisioning.CosmosDB.csproj | 6 ++--- .../src/Properties/AssemblyInfo.cs | 3 ++- .../CHANGELOG.md | 4 ++-- .../src/Azure.Provisioning.Deployment.csproj | 2 +- .../src/Properties/AssemblyInfo.cs | 6 +++++ .../Azure.Provisioning.EventGrid/Changelog.md | 4 ++-- .../Azure.Provisioning.EventGrid/README.md | 4 ++-- .../src/Azure.Provisioning.EventGrid.csproj | 9 ++++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.EventHubs/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.EventHubs/README.md | 4 ++-- .../src/Azure.Provisioning.EventHubs.csproj | 9 ++++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.KeyVault/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.KeyVault/README.md | 4 ++-- .../src/Azure.Provisioning.KeyVault.csproj | 6 +++-- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../Azure.Provisioning.Kubernetes/README.md | 4 ++-- .../src/Azure.Provisioning.Kubernetes.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Changelog.md | 4 ++-- .../README.md | 4 ++-- ...rovisioning.KubernetesConfiguration.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../CHANGELOG.md | 4 ++-- .../README.md | 4 ++-- ...re.Provisioning.OperationalInsights.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../CHANGELOG.md | 4 ++-- .../Azure.Provisioning.PostgreSql/README.md | 4 ++-- .../src/Azure.Provisioning.PostgreSql.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.Redis/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.Redis/README.md | 4 ++-- .../src/Azure.Provisioning.Redis.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.Search/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.Search/README.md | 4 ++-- .../src/Azure.Provisioning.Search.csproj | 8 +++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../CHANGELOG.md | 4 ++-- .../Azure.Provisioning.ServiceBus/README.md | 4 ++-- .../src/Azure.Provisioning.ServiceBus.csproj | 8 +++---- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.SignalR/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.SignalR/README.md | 4 ++-- .../src/Azure.Provisioning.SignalR.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.Sql/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.Sql/README.md | 4 ++-- .../src/Azure.Provisioning.Sql.csproj | 10 +-------- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.Storage/CHANGELOG.md | 22 ++----------------- .../Azure.Provisioning.Storage/README.md | 2 +- .../src/Azure.Provisioning.Storage.csproj | 6 ++++- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning.WebPubSub/CHANGELOG.md | 4 ++-- .../Azure.Provisioning.WebPubSub/README.md | 4 ++-- .../src/Azure.Provisioning.WebPubSub.csproj | 7 +++--- .../src/Properties/AssemblyInfo.cs | 3 ++- .../Azure.Provisioning/CHANGELOG.md | 4 ++-- sdk/provisioning/Azure.Provisioning/README.md | 6 +++++ .../src/Azure.Provisioning.csproj | 2 +- .../Azure.Provisioning/tests/SampleTests.cs | 3 +++ sdk/provisioning/README.md | 2 +- 101 files changed, 212 insertions(+), 284 deletions(-) create mode 100644 sdk/provisioning/Azure.Provisioning.Deployment/src/Properties/AssemblyInfo.cs diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md index 7faaa8529db49..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.AppConfiguration. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/README.md b/sdk/provisioning/Azure.Provisioning.AppConfiguration/README.md index 8f658da665ef6..09b1bf53633d0 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/README.md +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.AppConfiguration simplifies declarative resource provisioning Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.AppConfiguration +dotnet add package Azure.Provisioning.AppConfiguration --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj index 0a5141093249e..b3c2de96d1cfa 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj @@ -10,10 +10,9 @@ CS1591 - diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md b/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md index 2b931d356d125..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.AppContainers. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/README.md b/sdk/provisioning/Azure.Provisioning.AppContainers/README.md index 64b995c6ccb23..469139e35687c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/README.md +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.AppContainers simplifies declarative resource provisioning in Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.AppContainers +dotnet add package Azure.Provisioning.AppContainers --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj index b51c9db9d672f..58eb367197016 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md b/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md index 81d6b71dd5d33..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.AppService. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.AppService/README.md b/sdk/provisioning/Azure.Provisioning.AppService/README.md index 0b20a0075f9cb..ef06d09495d05 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/README.md +++ b/sdk/provisioning/Azure.Provisioning.AppService/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.AppService simplifies declarative resource provisioning in .N Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.AppService +dotnet add package Azure.Provisioning.AppService --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj b/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj index 68667d2d7cb6e..4513c00da546e 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.AppService/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md index 922e7ede3c9f9..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.ApplicationInsights. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/README.md b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/README.md index 65ab6d264e938..e305282d29ce8 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/README.md +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.ApplicationInsights simplifies declarative resource provision Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.ApplicationInsights +dotnet add package Azure.Provisioning.ApplicationInsights --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj index 787e9dd47c759..f9b12e9c40e60 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj @@ -9,11 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/README.md b/sdk/provisioning/Azure.Provisioning.CloudMachine/README.md index f39ffc5c26e7c..5c2ee512663e5 100644 --- a/sdk/provisioning/Azure.Provisioning.CloudMachine/README.md +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.CloudMachine simplifies declarative resource provisioning in Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.CloudMachine +dotnet add package Azure.Provisioning.CloudMachine --prerelease ``` ### Prerequisites diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md index d51010143dbfc..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.CognitiveServices. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/README.md b/sdk/provisioning/Azure.Provisioning.CognitiveServices/README.md index 92faa542d4c61..2572f768deb69 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/README.md +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.CognitiveServices simplifies declarative resource provisionin Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.CognitiveServices +dotnet add package Azure.Provisioning.CognitiveServices --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj index 16784a6268d51..4d768d80a1b56 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj @@ -10,11 +10,11 @@ CS1591 - - \ No newline at end of file diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md b/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md index 54eba51e33f19..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.Communication. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Communication/README.md b/sdk/provisioning/Azure.Provisioning.Communication/README.md index e2e479188ae1e..bd1a03b8cb6d6 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/README.md +++ b/sdk/provisioning/Azure.Provisioning.Communication/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Communication simplifies declarative resource provisioning in Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Communication +dotnet add package Azure.Provisioning.Communication --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj b/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj index 128db8347f50f..b623b66fa4a33 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj @@ -10,10 +10,11 @@ CS1591 - diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Communication/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md index 049e33d545ee9..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.ContainerRegistry. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/README.md b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/README.md index 91475d458d0e5..9b62f92e672e5 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/README.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.ContainerRegistry simplifies declarative resource provisionin Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.ContainerRegistry +dotnet add package Azure.Provisioning.ContainerRegistry --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj index f9117c6b8b746..5c17421c8b7b8 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj @@ -10,11 +10,9 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md b/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md index 18818ecb1799d..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.ContainerService. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/README.md b/sdk/provisioning/Azure.Provisioning.ContainerService/README.md index 3c7059acaa4e0..2ce00ea86e71a 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/README.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.ContainerService simplifies declarative resource provisioning Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.ContainerService +dotnet add package Azure.Provisioning.ContainerService --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj index 1e5918f499ff3..aa59c9b58bf80 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md index 562fc20444730..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.CosmosDB. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/README.md b/sdk/provisioning/Azure.Provisioning.CosmosDB/README.md index fc0eabea8718c..9c8191bc8d782 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/README.md +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.CosmosDB simplifies declarative resource provisioning in .NET Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.CosmosDB +dotnet add package Azure.Provisioning.CosmosDB --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj index 0288987031bdf..8cb7b5141a56e 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj @@ -10,11 +10,9 @@ CS1591 - - \ No newline at end of file diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md index 25b7d73c73b39..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (2025-01-01) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Preview of new Azure.Provisioning.Deployment. +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj b/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj index 5ec1817997ec6..d243584be1550 100644 --- a/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj +++ b/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj @@ -1,4 +1,4 @@ - + Contains the core functionality for deploying Azure infrastructure with dotnet code. diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Deployment/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..728e3f6e28a29 --- /dev/null +++ b/sdk/provisioning/Azure.Provisioning.Deployment/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md b/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md index 5432567ae7a29..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.EventGrid. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/README.md b/sdk/provisioning/Azure.Provisioning.EventGrid/README.md index 855cc36fee357..4c92d2db97521 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/README.md +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.EventGrid simplifies declarative resource provisioning in .NE Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.EventGrid +dotnet add package Azure.Provisioning.EventGrid --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj index 25b2f4a58c565..d6a662456dc42 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj @@ -10,11 +10,10 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md index aa81eb3d965f7..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.EventHubs. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/README.md b/sdk/provisioning/Azure.Provisioning.EventHubs/README.md index b2b9abd99b198..29c0c253c03a7 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/README.md +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.EventHubs simplifies declarative resource provisioning in .NE Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.EventHubs +dotnet add package Azure.Provisioning.EventHubs --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj index c0197444e7732..6f63aab523b50 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj @@ -10,11 +10,10 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md index 0415cbe496654..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.KeyVault. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/README.md b/sdk/provisioning/Azure.Provisioning.KeyVault/README.md index 25df243ad35c8..537398a46c0c7 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/README.md +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.KeyVault simplifies declarative resource provisioning in .NET Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.KeyVault +dotnet add package Azure.Provisioning.KeyVault --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj index a362f1d9cf480..59917f246e2b9 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj @@ -10,9 +10,11 @@ CS1591 - diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md b/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md index 404d20dd4e625..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.Kubernetes. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/README.md b/sdk/provisioning/Azure.Provisioning.Kubernetes/README.md index 05905f84b0c11..c06b2a0e31687 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/README.md +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Kubernetes simplifies declarative resource provisioning in .N Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Kubernetes +dotnet add package Azure.Provisioning.Kubernetes --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj index 04a1c67e3a513..22d8ff95f9459 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md index c08b5b480dd7e..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.KubernetesConfiguration. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/README.md b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/README.md index 2c5b27168d013..b562cc409c55a 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/README.md +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.KubernetesConfiguration simplifies declarative resource provi Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.KubernetesConfiguration +dotnet add package Azure.Provisioning.KubernetesConfiguration --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj index e28c0682c52fe..1a971496e2949 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md index 97a5c63aa2d63..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.OperationalInsights. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/README.md b/sdk/provisioning/Azure.Provisioning.OperationalInsights/README.md index 0805df9efa0cc..6e29ee2dab0a7 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/README.md +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.OperationalInsights simplifies declarative resource provision Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.OperationalInsights +dotnet add package Azure.Provisioning.OperationalInsights --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj index 3c3595eb807b4..6cc366c39553d 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md index f6dba8d9d0b04..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.PostgreSql. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/README.md b/sdk/provisioning/Azure.Provisioning.PostgreSql/README.md index 816ffe06a1acb..d2cb3eee6a266 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/README.md +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.PostgreSql simplifies declarative resource provisioning in .N Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.PostgreSql +dotnet add package Azure.Provisioning.PostgreSql --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj index abd01c6b94ef3..518b075ab4cbb 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md index 86ff75e31c6c3..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.Redis. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Redis/README.md b/sdk/provisioning/Azure.Provisioning.Redis/README.md index 11c9f232fd865..c83ed6fa15506 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/README.md +++ b/sdk/provisioning/Azure.Provisioning.Redis/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Redis simplifies declarative resource provisioning in .NET. Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Redis +dotnet add package Azure.Provisioning.Redis --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj index f75c192138167..126b0f2fe05c2 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Redis/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md index a38c67ca8c338..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.Search. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Search/README.md b/sdk/provisioning/Azure.Provisioning.Search/README.md index a3dd42778b65d..1a5db6eeabf43 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/README.md +++ b/sdk/provisioning/Azure.Provisioning.Search/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Search simplifies declarative resource provisioning in .NET. Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Search +dotnet add package Azure.Provisioning.Search --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj index b360184d435c7..e6d55edd07496 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj @@ -10,11 +10,9 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Search/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md index 2a585710d94a4..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.ServiceBus. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/README.md b/sdk/provisioning/Azure.Provisioning.ServiceBus/README.md index 623e2cf56d3e9..da60190a35a96 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/README.md +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.ServiceBus simplifies declarative resource provisioning in .N Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.ServiceBus +dotnet add package Azure.Provisioning.ServiceBus --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj index fa86176c9478e..004da76209788 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj @@ -10,11 +10,9 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md index 7514aabd2371b..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.SignalR. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/README.md b/sdk/provisioning/Azure.Provisioning.SignalR/README.md index 26642529795a6..efe3e9505665f 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/README.md +++ b/sdk/provisioning/Azure.Provisioning.SignalR/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.SignalR simplifies declarative resource provisioning in .NET. Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.SignalR +dotnet add package Azure.Provisioning.SignalR --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj index 74e319ba3ab9a..26d6323adb1e7 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.SignalR/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md index e511a507ddc57..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.Sql. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Sql/README.md b/sdk/provisioning/Azure.Provisioning.Sql/README.md index de59f72ec63f7..72057fed6c8ef 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/README.md +++ b/sdk/provisioning/Azure.Provisioning.Sql/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Sql simplifies declarative resource provisioning in .NET. Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Sql +dotnet add package Azure.Provisioning.Sql --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj index 0bc7c03e14a20..533719bfdba28 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj @@ -9,12 +9,4 @@ CS1591 - - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Sql/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md index 6ccd2039d97ad..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md @@ -1,25 +1,7 @@ # Release History -## 1.0.0-beta.1 (2025-01-01) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Preview of new Azure.Provisioning. - -## 0.2.0 (2024-05-14) - -### Other Changes - -- Updated dependency on Azure.ResourceManager.Storage to leverage serialization fix involving property assignments. - -## 0.1.0 (2024-04-24) - -### Features Added - -- Initial non-beta release. - -## 0.1.0-beta.1 (2024-04-04) - -### Features Added - -- Initial beta release of Azure.Provisioning.Storage. +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.Storage/README.md b/sdk/provisioning/Azure.Provisioning.Storage/README.md index 2fb3c69354135..c7bffeec5b616 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/README.md +++ b/sdk/provisioning/Azure.Provisioning.Storage/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.Storage simplifies declarative resource provisioning in .NET Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.Storage +dotnet add package Azure.Provisioning.Storage --prerelease ``` ### Prerequisites diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj index a9a01638a720d..25a060db5f488 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj @@ -1,4 +1,4 @@ - + Azure.Provisioning.Storage simplifies declarative resource provisioning in .NET for Azure Storage. @@ -12,6 +12,10 @@ + diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.Storage/src/Properties/AssemblyInfo.cs index 15a940a47a165..d1a70b976ad3e 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md index 6e67c138794e8..838e93d43ab89 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Initial beta release of new Azure.Provisioning.WebPubSub. \ No newline at end of file +- Preview of the new Azure.Provisioning experience. diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/README.md b/sdk/provisioning/Azure.Provisioning.WebPubSub/README.md index ce152986f26ef..3229c9cc6a6c6 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/README.md +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/README.md @@ -9,7 +9,7 @@ Azure.Provisioning.WebPubSub simplifies declarative resource provisioning in .NE Install the client library for .NET with [NuGet](https://www.nuget.org/ ): ```dotnetcli -dotnet add package Azure.Provisioning.WebPubSub +dotnet add package Azure.Provisioning.WebPubSub --prerelease ``` ### Prerequisites @@ -52,4 +52,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj index 53ab043a42369..2418c058a8545 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj @@ -10,10 +10,9 @@ CS1591 - - - \ No newline at end of file + diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Properties/AssemblyInfo.cs b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Properties/AssemblyInfo.cs index 3fadc7100f718..f5962837f1b7b 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Properties/AssemblyInfo.cs +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Properties/AssemblyInfo.cs @@ -3,4 +3,5 @@ using System.Diagnostics.CodeAnalysis; -[assembly: Experimental("AZPROVISION001")] \ No newline at end of file +// TODO: Uncomment if we need to GA before all the APIs are finalized +// [assembly: Experimental("AZPROVISION001")] diff --git a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md index edcb5b065e1d3..69f3d90946724 100644 --- a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md @@ -1,10 +1,10 @@ # Release History -## 1.0.0-beta.1 (2025-01-01) +## 1.0.0-beta.1 (2024-10-04) ### Features Added -- Preview of new Azure.Provisioning. +- Preview of the new Azure.Provisioning experience. ## 0.3.0 (2024-05-14) diff --git a/sdk/provisioning/Azure.Provisioning/README.md b/sdk/provisioning/Azure.Provisioning/README.md index ce84b41e343ec..f37d79420bf00 100644 --- a/sdk/provisioning/Azure.Provisioning/README.md +++ b/sdk/provisioning/Azure.Provisioning/README.md @@ -8,6 +8,12 @@ Azure.Provisioning makes it easy to declaratively specify Azure infrastructure n Install the client library for .NET with [NuGet](https://www.nuget.org/ ): +```dotnetcli +dotnet add package Azure.Provisioning --prerelease +``` + +You can also install the previous version for use with Aspire 8.x via: + ```dotnetcli dotnet add package Azure.Provisioning ``` diff --git a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj index fba6c2e07fc88..de756e9180807 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj +++ b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj @@ -1,4 +1,4 @@ - + Contains the core functionality for defining Azure infrastructure with dotnet code. diff --git a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs index 9ec9058f479b1..af913de47894f 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs +++ b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs @@ -348,12 +348,15 @@ await test.Define( [Test] public void ValidNames() { + // TODO: Enable when we turn NamedProvisioningConstruct.ValidateIdentifierName back on + /* Assert.Throws(() => new StorageAccount(null!)); Assert.Throws(() => new StorageAccount("")); Assert.Throws(() => new StorageAccount("my-storage")); Assert.Throws(() => new StorageAccount("my storage")); Assert.Throws(() => new StorageAccount("my:storage")); Assert.Throws(() => new StorageAccount("storage$")); + /**/ _ = new StorageAccount("ABCdef123_"); } } diff --git a/sdk/provisioning/README.md b/sdk/provisioning/README.md index 976d0d2f241ec..f4d998f9013fe 100644 --- a/sdk/provisioning/README.md +++ b/sdk/provisioning/README.md @@ -11,7 +11,7 @@ Azure.Provisioning contains the core functionality for the Azure Provisioning li Install the specific service libraries for .NET with [NuGet](https://www.nuget.org/) required for your application. ```dotnetcli -dotnet add package Azure.Provisioning.KeyVault +dotnet add package Azure.Provisioning.KeyVault --prerelease ``` Note that `Azure.Provisioning` will be pulled in as a transitive dependency From 335b888cd2f6eb95d5d1ddd792231b7f949f871b Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Fri, 4 Oct 2024 10:24:42 -0700 Subject: [PATCH 16/43] [Extensions] October 2024 Release Prep (#46422) The focus of these changes is to prepare the `Microsoft.Extensions.Azure` package for its October 2024 release. --- sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md | 8 +------- .../src/Microsoft.Extensions.Azure.csproj | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md index 999d370405dff..a193e82396d4b 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md +++ b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md @@ -1,12 +1,6 @@ # Release History -## 1.8.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 1.7.6 (2024-10-04) ### Other Changes diff --git a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj index 6af37446c12cc..7d3e7705cad6e 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj +++ b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj @@ -4,7 +4,7 @@ $(RequiredTargetFrameworks) Azure Client SDK integration with Microsoft.Extensions libraries Azure Client SDK integration Microsoft.Extensions - 1.8.0-beta.1 + 1.7.6 1.7.5 Microsoft Azure Client Pipeline AspNetCore Extensions From 4607949d1cddef90b96d8f66bdcd74f1db164e87 Mon Sep 17 00:00:00 2001 From: Matthew Steeples Date: Fri, 4 Oct 2024 19:53:50 +0100 Subject: [PATCH 17/43] Dispose of streams that are created (#44510) --- .../Azure.Storage.Blobs/src/BlobClient.cs | 38 ++++++++++++------- .../src/BlockBlobClient.cs | 20 ++++++---- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index 8df652fc58366..c91a776426f0e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -1042,13 +1042,18 @@ public virtual Response Upload( public virtual Response Upload( BinaryData content, BlobUploadOptions options, - CancellationToken cancellationToken = default) => - StagedUploadInternal( - content.ToStream(), - options, - async: false, - cancellationToken: cancellationToken) - .EnsureCompleted(); + CancellationToken cancellationToken = default) + { + using (var stream = content.ToStream()) + { + return StagedUploadInternal( + stream, + options, + async: false, + cancellationToken: cancellationToken) + .EnsureCompleted(); + } + } /// /// The @@ -1360,13 +1365,18 @@ await StagedUploadInternal( public virtual async Task> UploadAsync( BinaryData content, BlobUploadOptions options, - CancellationToken cancellationToken = default) => - await StagedUploadInternal( - content.ToStream(), - options, - async: true, - cancellationToken: cancellationToken) - .ConfigureAwait(false); + CancellationToken cancellationToken = default) + { + using (var stream = content.ToStream()) + { + return await StagedUploadInternal( + stream, + options, + async: true, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + } /// /// The diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index f5348303e57f0..f9269ce6cb893 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -3238,14 +3238,18 @@ await client.StageBlockInternal( LeaseId = args.Conditions.LeaseId }; } - await client.StageBlockInternal( - Shared.StorageExtensions.GenerateBlockId(offset), - content.ToStream(), - validationOptions, - conditions, - progressHandler, - async, - cancellationToken).ConfigureAwait(false); + + using (var stream = content.ToStream()) + { + await client.StageBlockInternal( + Shared.StorageExtensions.GenerateBlockId(offset), + stream, + validationOptions, + conditions, + progressHandler, + async, + cancellationToken).ConfigureAwait(false); + } }, CommitPartitionedUpload = async (partitions, args, async, cancellationToken) => await client.CommitBlockListInternal( From acc57c661c35fe3ee2d7fd445e9901bf17884da5 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen <48961492+amnguye@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:50:21 -0700 Subject: [PATCH 18/43] Updated Changelog (#46431) --- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 981272fedd430..7fb652e464e4c 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed bug where BlobClient.Upload(BinaryData content, ..) did not properly dispose stream after wrapping the BinaryData passed. ### Other Changes From a62096723f7c4a91fd61e14e1dc736cb51cf1bca Mon Sep 17 00:00:00 2001 From: Jacob Lauzon <96087589+jalauzon-msft@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:52:58 -0700 Subject: [PATCH 19/43] [Storage][DataMovement] Add basic perf tests for DataMovement Blobs (#46424) --- .../tests/Shared/RepeatingStream.cs | 14 ++- ...ure.Storage.DataMovement.Blobs.Perf.csproj | 15 +++ .../Infrastructure/DirectoryTransferTest.cs | 107 ++++++++++++++++++ .../Infrastructure/PerfTestEnvironment.cs | 43 +++++++ .../Options/DirectoryTransferOptions.cs | 30 +++++ .../Program.cs | 7 ++ .../Scenarios/CopyDirectory.cs | 47 ++++++++ .../Scenarios/DownloadDirectory.cs | 48 ++++++++ .../Scenarios/UploadDirectory.cs | 48 ++++++++ .../perf/README.md | 32 ++++++ sdk/storage/Azure.Storage.DataMovement.sln | 12 ++ sdk/storage/Azure.Storage.sln | 19 ++-- 12 files changed, 404 insertions(+), 18 deletions(-) create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Azure.Storage.DataMovement.Blobs.Perf.csproj create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/PerfTestEnvironment.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Options/DirectoryTransferOptions.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Program.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md diff --git a/sdk/storage/Azure.Storage.Common/tests/Shared/RepeatingStream.cs b/sdk/storage/Azure.Storage.Common/tests/Shared/RepeatingStream.cs index 4dbbdd57aeb91..240661d5e551b 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Shared/RepeatingStream.cs +++ b/sdk/storage/Azure.Storage.Common/tests/Shared/RepeatingStream.cs @@ -2,10 +2,7 @@ // Licensed under the MIT License. using System; -using System.Buffers; using System.IO; -using Azure.Core; -using Azure.Storage.Common; namespace Azure.Storage.Tests.Shared { @@ -45,9 +42,14 @@ public override void Flush() public override int Read(byte[] buffer, int offset, int count) { - Argument.AssertNotNull(buffer, nameof(buffer)); - Argument.AssertInRange(offset, 0, buffer.Length - 1, nameof(offset)); - Argument.AssertInRange(count, 0, buffer.Length - offset, nameof(count)); + if (offset < 0 || offset > buffer.Length - 1) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + if (count < 0 || count > buffer.Length - offset) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } int dataOffset = (int) (Position % _data.Length); int toRead = (int)Math.Min(Math.Min(count, _length - Position), _data.Length - dataOffset); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Azure.Storage.DataMovement.Blobs.Perf.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Azure.Storage.DataMovement.Blobs.Perf.csproj new file mode 100644 index 0000000000000..81ac16c540ad3 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Azure.Storage.DataMovement.Blobs.Perf.csproj @@ -0,0 +1,15 @@ + + + Exe + + + + + + + + + + + + diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs new file mode 100644 index 0000000000000..e136797bc2498 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Storage.Blobs; +using Azure.Storage.Tests.Shared; +using Azure.Test.Perf; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + public abstract class DirectoryTransferTest : PerfTest where TOptions : DirectoryTransferOptions + { + protected Random Random { get; } + protected BlobServiceClient BlobServiceClient { get; } + protected LocalFilesStorageResourceProvider LocalFileResourceProvider { get; } + protected BlobsStorageResourceProvider BlobResourceProvider { get; } + + public DirectoryTransferTest(TOptions options) : base(options) + { + Random = new Random(); + BlobServiceClient = new BlobServiceClient(PerfTestEnvironment.Instance.BlobStorageEndpoint, PerfTestEnvironment.Instance.Credential); + LocalFileResourceProvider = new LocalFilesStorageResourceProvider(); + BlobResourceProvider = new BlobsStorageResourceProvider(PerfTestEnvironment.Instance.Credential); + } + + protected string CreateLocalDirectory(bool populate = false) + { + string directory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(directory); + + if (populate) + { + foreach (int i in Enumerable.Range(0, Options.Count)) + { + string filePath = Path.Combine(directory, $"file{i}"); + using (RepeatingStream stream = new(1024 * 1024, Options.Size, true)) + using (FileStream file = File.Open(filePath, FileMode.Create)) + { + stream.CopyTo(file); + } + } + } + + return directory; + } + + protected async Task CreateBlobContainerAsync(bool populate = false) + { + string containerName = $"test-{Guid.NewGuid()}".ToLowerInvariant(); + BlobContainerClient container = BlobServiceClient.GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + + if (populate) + { + foreach (int i in Enumerable.Range(0, Options.Count)) + { + BlobClient blob = container.GetBlobClient($"blob{i}"); + using (RepeatingStream stream = new(1024 * 1024, Options.Size, true)) + { + await blob.UploadAsync(stream); + } + } + } + + return container; + } + + protected async Task RunAndVerifyTransferAsync( + StorageResource source, + StorageResource destination, + CancellationToken cancellationToken) + { + TransferManagerOptions managerOptions = new() + { + ErrorHandling = DataTransferErrorMode.StopOnAnyFailure, + CheckpointerOptions = Options.DisableCheckpointer ? TransferCheckpointStoreOptions.Disabled() : default + }; + TransferManager transferManager = new(managerOptions); + + DataTransferOptions options = new() + { + CreationPreference = StorageResourceCreationPreference.OverwriteIfExists, + InitialTransferSize = Options.InitialTransferSize, + MaximumTransferChunkSize = Options.ChunkSize, + }; + options.ItemTransferFailed += HandleFailure; + DataTransfer transfer = await transferManager.StartTransferAsync( + source, destination, options, cancellationToken); + + await transfer.WaitForCompletionAsync(cancellationToken); + if (!transfer.TransferStatus.HasCompletedSuccessfully) + { + throw new Exception("A failure occurred during the transfer."); + } + } + + private Task HandleFailure(TransferItemFailedEventArgs args) + { + Console.WriteLine(args.Exception); + return Task.CompletedTask; + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/PerfTestEnvironment.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/PerfTestEnvironment.cs new file mode 100644 index 0000000000000..22fcef7a6da01 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/PerfTestEnvironment.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.TestFramework; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + /// + /// Represents the ambient environment in which the test suite is being run, offering access to information such as environment variables. + /// + internal sealed class PerfTestEnvironment : TestEnvironment + { + /// + /// The shared instance of the to be used during test runs. + /// + public static PerfTestEnvironment Instance { get; } = new PerfTestEnvironment(); + + /// + /// The storage account endpoint suffix of the cloud to use for testing. + /// + public new string StorageEndpointSuffix => base.StorageEndpointSuffix ?? "core.windows.net"; + + /// + /// The name of the Blob storage account to test against. + /// + /// The Blob storage account name, read from the "AZURE_STORAGE_ACCOUNT_NAME" environment variable. + public string BlobStorageAccountName => GetVariable("AZURE_STORAGE_ACCOUNT_NAME"); + + /// + /// The Blob storage endpoint. + /// + public Uri BlobStorageEndpoint { get; } + + /// + /// Initializes a new instance of the class. + /// + public PerfTestEnvironment() + { + BlobStorageEndpoint = new Uri($"https://{BlobStorageAccountName}.blob.{StorageEndpointSuffix}"); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Options/DirectoryTransferOptions.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Options/DirectoryTransferOptions.cs new file mode 100644 index 0000000000000..9f117615e3dfd --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Options/DirectoryTransferOptions.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Test.Perf; +using CommandLine; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + public class DirectoryTransferOptions : PerfOptions + { + [Option('c', "count", Default = 10, HelpText = "Number of items in each transfer.")] + public int Count { get; set; } + + [Option('s', "size", Default = 1024, HelpText = "Size of each file (in bytes)")] + public long Size { get; set; } + + [Option("initial-transfer-size", HelpText = "The initial size to use during transfers (in bytes)")] + public long? InitialTransferSize { get; set; } + + [Option("chunk-size", HelpText = "The chunk/block size to use during transfers (in bytes)")] + public long? ChunkSize { get; set; } + + [Option("disable-checkpointer", HelpText = "Set to disable checkpointing.")] + public bool DisableCheckpointer { get; set; } + + // Override warmup to set default to 0 + [Option('w', "warmup", Default = 0, HelpText = "Duration of warmup in seconds")] + public new int Warmup { get; set; } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Program.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Program.cs new file mode 100644 index 0000000000000..1ad7284aaa19f --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Program.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Azure.Test.Perf; + +await PerfProgram.Main(Assembly.GetEntryAssembly(), args); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs new file mode 100644 index 0000000000000..c31d4705361d6 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Storage.Blobs; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + public class CopyDirectory : DirectoryTransferTest + { + private BlobContainerClient _sourceContainer; + private BlobContainerClient _destinationContainer; + + public CopyDirectory(DirectoryTransferOptions options) : base(options) + { + } + + public override async Task GlobalSetupAsync() + { + await base.GlobalSetupAsync(); + _sourceContainer = await CreateBlobContainerAsync(populate: true); + _destinationContainer = await CreateBlobContainerAsync(); + } + + public override async Task GlobalCleanupAsync() + { + await _sourceContainer.DeleteIfExistsAsync(); + await _destinationContainer.DeleteIfExistsAsync(); + await base.GlobalCleanupAsync(); + } + + public override void Run(CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + public override async Task RunAsync(CancellationToken cancellationToken) + { + StorageResource source = BlobResourceProvider.FromContainer(_sourceContainer.Uri); + StorageResource destination = BlobResourceProvider.FromContainer(_destinationContainer.Uri); + + await RunAndVerifyTransferAsync(source, destination, cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs new file mode 100644 index 0000000000000..1760f38c9bf38 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.IO; +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Storage.Blobs; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + public class DownloadDirectory : DirectoryTransferTest + { + private BlobContainerClient _sourceContainer; + private string _destinationDirectory; + + public DownloadDirectory(DirectoryTransferOptions options) : base(options) + { + } + + public override async Task GlobalSetupAsync() + { + await base.GlobalSetupAsync(); + _sourceContainer = await CreateBlobContainerAsync(populate: true); + _destinationDirectory = CreateLocalDirectory(); + } + + public override async Task GlobalCleanupAsync() + { + await _sourceContainer.DeleteIfExistsAsync(); + Directory.Delete(_destinationDirectory, true); + await base.GlobalCleanupAsync(); + } + + public override void Run(CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + public override async Task RunAsync(CancellationToken cancellationToken) + { + StorageResource source = BlobResourceProvider.FromContainer(_sourceContainer.Uri); + StorageResource destination = LocalFileResourceProvider.FromDirectory(_destinationDirectory); + + await RunAndVerifyTransferAsync(source, destination, cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs new file mode 100644 index 0000000000000..2a53c450eea26 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Storage.Blobs; + +namespace Azure.Storage.DataMovement.Blobs.Perf +{ + public class UploadDirectory : DirectoryTransferTest + { + private string _sourceDirectory; + private BlobContainerClient _destinationContainer; + + public UploadDirectory(DirectoryTransferOptions options) : base(options) + { + } + + public override async Task GlobalSetupAsync() + { + await base.GlobalSetupAsync(); + _sourceDirectory = CreateLocalDirectory(populate: true); + _destinationContainer = await CreateBlobContainerAsync(); + } + + public override async Task GlobalCleanupAsync() + { + Directory.Delete(_sourceDirectory, true); + await _destinationContainer.DeleteIfExistsAsync(); + await base.GlobalCleanupAsync(); + } + + public override void Run(CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + public override async Task RunAsync(CancellationToken cancellationToken) + { + StorageResource source = LocalFileResourceProvider.FromDirectory(_sourceDirectory); + StorageResource destination = BlobResourceProvider.FromContainer(_destinationContainer.Uri); + + await RunAndVerifyTransferAsync(source, destination, cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md new file mode 100644 index 0000000000000..8cdd410e53827 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md @@ -0,0 +1,32 @@ +# Azure Storage DataMovement Blobs performance tests + +The assets in this area comprise a set of performance tests for the [Azure Storage Blobs Data Movement library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs) and its associated ecosystem. The artifacts in this library are intended to be used primarily with the Azure SDK engineering system's testing infrastructure, but may also be run as stand-alone applications from the command line. + +## Running tests locally +First, build the project either via Visual Studio or the command line. Be sure to build the `Release` build. +``` +dotnet build -c Release -f sdk\storage\Azure.Storage.DataMovement.Blobs\perf\Azure.Storage.DataMovement.Blobs.Perf\Azure.Storage.DataMovement.Blobs.Perf.csproj +``` + +Setup the account you want to use for testing. Note these tests use OAuth using a DefaultAzureCredential, meaning you will need +tot he Storage account as well as a way to authenticate (Visual Studio, Azure CLI, etc.) +``` +set AZURE_STORAGE_ACCOUNT_NAME= +``` + +Then run the desired test via the command line. +``` +dotnet run -c Release -f --no-build --project sdk\storage\Azure.Storage.DataMovement.Blobs\perf\Azure.Storage.DataMovement.Blobs.Perf\Azure.Storage.DataMovement.Blobs.Perf.csproj -- +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Blobs.Perf%2FREADME.png) diff --git a/sdk/storage/Azure.Storage.DataMovement.sln b/sdk/storage/Azure.Storage.DataMovement.sln index f30c8b5ea7a66..7254f76b7e9ce 100644 --- a/sdk/storage/Azure.Storage.DataMovement.sln +++ b/sdk/storage/Azure.Storage.DataMovement.sln @@ -27,6 +27,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.Common", "Azu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core", "..\core\Azure.Core\src\Azure.Core.csproj", "{6FD52DD4-4D28-4713-BA0C-B3F71000E98D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement.Blobs.Perf", "Azure.Storage.DataMovement.Blobs\perf\Azure.Storage.DataMovement.Blobs.Perf\Azure.Storage.DataMovement.Blobs.Perf.csproj", "{8626A2CD-6208-4E25-BA56-726730F40AE6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Test.Perf", "..\..\common\Perf\Azure.Test.Perf\Azure.Test.Perf.csproj", "{06787AFE-CA94-46EE-8F6F-0FD0C057022B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -81,6 +85,14 @@ Global {6FD52DD4-4D28-4713-BA0C-B3F71000E98D}.Debug|Any CPU.Build.0 = Debug|Any CPU {6FD52DD4-4D28-4713-BA0C-B3F71000E98D}.Release|Any CPU.ActiveCfg = Release|Any CPU {6FD52DD4-4D28-4713-BA0C-B3F71000E98D}.Release|Any CPU.Build.0 = Release|Any CPU + {8626A2CD-6208-4E25-BA56-726730F40AE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8626A2CD-6208-4E25-BA56-726730F40AE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8626A2CD-6208-4E25-BA56-726730F40AE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8626A2CD-6208-4E25-BA56-726730F40AE6}.Release|Any CPU.Build.0 = Release|Any CPU + {06787AFE-CA94-46EE-8F6F-0FD0C057022B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06787AFE-CA94-46EE-8F6F-0FD0C057022B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06787AFE-CA94-46EE-8F6F-0FD0C057022B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06787AFE-CA94-46EE-8F6F-0FD0C057022B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/storage/Azure.Storage.sln b/sdk/storage/Azure.Storage.sln index 3a5b59aee5e2b..b6b05f5f1b7de 100644 --- a/sdk/storage/Azure.Storage.sln +++ b/sdk/storage/Azure.Storage.sln @@ -159,6 +159,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Storage", "Azure.ResourceManager.Storage\src\Azure.ResourceManager.Storage.csproj", "{6EA8939A-537F-475E-B16C-F9E80825C6AD}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.DataMovement.Blobs.Perf", "Azure.Storage.DataMovement.Blobs\perf\Azure.Storage.DataMovement.Blobs.Perf\Azure.Storage.DataMovement.Blobs.Perf.csproj", "{45EF1203-EAFF-4BB7-97F1-58DA0C310D97}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -285,18 +287,6 @@ Global {2FB0A438-7DCB-4748-8E95-BA495865AD1D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FB0A438-7DCB-4748-8E95-BA495865AD1D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FB0A438-7DCB-4748-8E95-BA495865AD1D}.Release|Any CPU.Build.0 = Release|Any CPU - {AD469AF8-0675-4159-A5B7-F486E48B29CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD469AF8-0675-4159-A5B7-F486E48B29CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD469AF8-0675-4159-A5B7-F486E48B29CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD469AF8-0675-4159-A5B7-F486E48B29CE}.Release|Any CPU.Build.0 = Release|Any CPU - {11D040BC-3A89-4BA1-A2C7-90A83A872555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11D040BC-3A89-4BA1-A2C7-90A83A872555}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11D040BC-3A89-4BA1-A2C7-90A83A872555}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11D040BC-3A89-4BA1-A2C7-90A83A872555}.Release|Any CPU.Build.0 = Release|Any CPU - {AC65C1AC-82F8-482B-B88D-FA9E752D1BC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC65C1AC-82F8-482B-B88D-FA9E752D1BC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC65C1AC-82F8-482B-B88D-FA9E752D1BC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC65C1AC-82F8-482B-B88D-FA9E752D1BC7}.Release|Any CPU.Build.0 = Release|Any CPU {AF72CEB5-9AED-42BF-8DF3-153F0AF3E7C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AF72CEB5-9AED-42BF-8DF3-153F0AF3E7C5}.Debug|Any CPU.Build.0 = Debug|Any CPU {AF72CEB5-9AED-42BF-8DF3-153F0AF3E7C5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -357,6 +347,10 @@ Global {6EA8939A-537F-475E-B16C-F9E80825C6AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {6EA8939A-537F-475E-B16C-F9E80825C6AD}.Release|Any CPU.ActiveCfg = Release|Any CPU {6EA8939A-537F-475E-B16C-F9E80825C6AD}.Release|Any CPU.Build.0 = Release|Any CPU + {45EF1203-EAFF-4BB7-97F1-58DA0C310D97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45EF1203-EAFF-4BB7-97F1-58DA0C310D97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45EF1203-EAFF-4BB7-97F1-58DA0C310D97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45EF1203-EAFF-4BB7-97F1-58DA0C310D97}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -373,6 +367,7 @@ Global {CC33E052-9737-42A3-BEB5-060CA659F408} = {FBC7A205-B57A-44E7-A7CA-2E82F79A4D9C} {2FB0A438-7DCB-4748-8E95-BA495865AD1D} = {FBC7A205-B57A-44E7-A7CA-2E82F79A4D9C} {0323A01E-E360-4D22-B1F4-15FD2DB39437} = {FBC7A205-B57A-44E7-A7CA-2E82F79A4D9C} + {45EF1203-EAFF-4BB7-97F1-58DA0C310D97} = {FBC7A205-B57A-44E7-A7CA-2E82F79A4D9C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9F236F49-3FED-4E35-AF93-48BA7EB0D42A} From 3c642628795d30f2dde5493f7e56ed982644ee2e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:20:46 -0700 Subject: [PATCH 20/43] Need to add environment to subscription configuration (#46432) Co-authored-by: Wes Haggard --- eng/common/TestResources/deploy-test-resources.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index a9b224155a111..a0fcc2e3178eb 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -60,6 +60,7 @@ steps: '@ | ConvertFrom-Json -AsHashtable; $context = Get-AzContext + $subscriptionConfiguration["Environment"] = $context.Environment.Name $subscriptionConfiguration["SubscriptionId"] = $context.Subscription.Id $subscriptionConfiguration["TenantId"] = $context.Subscription.TenantId $subscriptionConfiguration["TestApplicationId"] = $context.Account.Id From 5f3cc7dff241c936a393044d2a3f25839d7281a7 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:05:33 -0700 Subject: [PATCH 21/43] Increment package version after release of Microsoft.Extensions.Azure (#46433) --- sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md | 10 ++++++++++ .../src/Microsoft.Extensions.Azure.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md index a193e82396d4b..839e24420542d 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md +++ b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.8.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.7.6 (2024-10-04) ### Other Changes diff --git a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj index 7d3e7705cad6e..9630dbe961ac1 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj +++ b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj @@ -4,9 +4,9 @@ $(RequiredTargetFrameworks) Azure Client SDK integration with Microsoft.Extensions libraries Azure Client SDK integration Microsoft.Extensions - 1.7.6 + 1.8.0-beta.1 - 1.7.5 + 1.7.6 Microsoft Azure Client Pipeline AspNetCore Extensions From c1be0341b185cf421ce5cd80fa03b6ee86bb4f22 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Fri, 4 Oct 2024 14:47:56 -0700 Subject: [PATCH 22/43] [EngSys] Bump central Extenstions version (#46435) The focus of these changes is to bump the central version for the `Microsoft.Extensions.Azure` package so that the improvements are picked up by this month's Function extension package releases. --- eng/Packages.Data.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index b7169f799d598..6f6083dd194a8 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -209,7 +209,7 @@ - + @@ -315,7 +315,7 @@ - + From 160998b260f6cc04b32e7aa5692630cbc1bed9fc Mon Sep 17 00:00:00 2001 From: tg-msft Date: Fri, 4 Oct 2024 16:23:13 -0700 Subject: [PATCH 23/43] Azure.Provisioning: Move name validation to Infrastructure and expose for Aspire (#46437) Azure.Provisioning: Move name validation to Infrastructure and expose for Aspire --- .../api/Azure.Provisioning.netstandard2.0.cs | 3 + .../Azure.Provisioning/src/Infrastructure.cs | 104 ++++++++++++++++++ .../src/Primitives/ProvisioningConstruct.cs | 39 ++----- .../Azure.Provisioning/tests/SampleTests.cs | 36 ++++-- 4 files changed, 146 insertions(+), 36 deletions(-) diff --git a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs index f7323886f23ed..57ca3792b790e 100644 --- a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs +++ b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs @@ -98,9 +98,12 @@ public virtual void Add(Azure.Provisioning.Primitives.Provisionable resource) { protected internal override System.Collections.Generic.IEnumerable Compile() { throw null; } protected internal System.Collections.Generic.IDictionary> CompileModules(Azure.Provisioning.ProvisioningContext? context = null) { throw null; } public override System.Collections.Generic.IEnumerable GetResources() { throw null; } + public static bool IsValidIdentifierName(string? identifierName) { throw null; } + public static string NormalizeIdentifierName(string? identifierName) { throw null; } public virtual void Remove(Azure.Provisioning.Primitives.Provisionable resource) { } protected internal override void Resolve(Azure.Provisioning.ProvisioningContext? context = null) { } protected internal override void Validate(Azure.Provisioning.ProvisioningContext? context = null) { } + public static void ValidateIdentifierName(string? identifierName, string? paramName = null) { } } public partial class ProvisioningContext { diff --git a/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs b/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs index 8e773268cb7a8..caa60880f3e78 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Text; using Azure.Provisioning.Expressions; using Azure.Provisioning.Primitives; @@ -93,6 +94,109 @@ public virtual void Remove(Provisionable resource) } } + private static bool IsAsciiLetterOrDigit(char ch) => + 'a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + '0' <= ch && ch <= '9'; + + /// + /// Checks whether an name is a valid bicep identifier name comprised of + /// letters, digits, and underscores. + /// + /// The proposed identifier name. + /// Whether the name is a valid bicep identifier name. + public static bool IsValidIdentifierName(string? identifierName) + { + if (string.IsNullOrEmpty(identifierName)) { return false; } + if (char.IsDigit(identifierName![0])) { return false; } + foreach (char ch in identifierName) + { + if (!IsAsciiLetterOrDigit(ch) && ch != '_') + { + return false; + } + } + return true; + } + + /// + /// Validates whether a given bicep identifier name is correctly formed of + /// letters, numbers, and underscores. + /// + /// The proposed bicep identifier name. + /// Optional parameter name to use for exceptions. + /// Throws if null. + /// Throws if empty or invalid. + public static void ValidateIdentifierName(string? identifierName, string? paramName = default) + { + paramName ??= nameof(identifierName); + if (identifierName is null) + { + throw new ArgumentNullException(paramName, $"{paramName} cannot be null."); + } + else if (identifierName.Length == 0) + { + throw new ArgumentException($"{paramName} cannot be empty.", paramName); + } + else if (char.IsDigit(identifierName[0])) + { + throw new ArgumentException($"{paramName} cannot start with a number: \"{identifierName}\"", paramName); + } + + foreach (var ch in identifierName) + { + if (!IsAsciiLetterOrDigit(ch) && ch != '_') + { + throw new ArgumentException($"{paramName} should only contain letters, numbers, and underscores: \"{identifierName}\"", paramName); + } + } + } + + /// + /// Normalizes a proposed bicep identifier name. Any invalid characters + /// will be replaced with underscores. + /// + /// The proposed bicep identifier name. + /// A valid bicep identifier name. + /// Throws if null. + /// Throws if empty. + public static string NormalizeIdentifierName(string? identifierName) + { + if (IsValidIdentifierName(identifierName)) + { + return identifierName!; + } + + if (identifierName is null) + { + // TODO: This may be relaxed in the future to generate an automatic + // name rather than throwing + throw new ArgumentNullException(nameof(identifierName), $"{nameof(identifierName)} cannot be null."); + } + else if (identifierName.Length == 0) + { + throw new ArgumentException($"{nameof(identifierName)} cannot be empty.", nameof(identifierName)); + } + + StringBuilder builder = new(identifierName.Length); + + // Digits are not allowed as the first character, so prepend an + // underscore if the identifierName starts with a digit + if (char.IsDigit(identifierName[0])) + { + builder.Append('_'); + } + + foreach (char ch in identifierName) + { + // TODO: Consider opening this up to other naming strategies if + // someone can do something more intelligent for their usage/domain + builder.Append(IsAsciiLetterOrDigit(ch) ? ch : '_'); + } + + return builder.ToString(); + } + /// protected internal override void Validate(ProvisioningContext? context = null) { diff --git a/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs b/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs index dc3f2761fe9f9..a54c3a8a74c55 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisioningConstruct.cs @@ -23,10 +23,15 @@ public abstract class NamedProvisioningConstruct : ProvisioningConstruct public string IdentifierName { get => _identifierName; - set => _identifierName = ValidateIdentifierName(value, nameof(value)); + set + { + Infrastructure.ValidateIdentifierName(value, nameof(value)); + _identifierName = value; + } } private string _identifierName; - // TODO: Listen for feedback, but discuss IdentifierName vs. ProvisioningName in the Arch Board + // TODO: Listen for customer feedback and discuss IdentifierName vs. + // ProvisioningName in the Arch Board /// /// Creates a named Bicep entity, like a resource or parameter. @@ -36,32 +41,12 @@ public string IdentifierName /// refer to the resource in expressions, but is not the Azure name of the /// resource. This value can contain letters, numbers, and underscores. /// - protected NamedProvisioningConstruct(string identifierName) => - _identifierName = ValidateIdentifierName(identifierName, nameof(identifierName)); - - // TODO: Relax this in the future when we make identifier names optional - private static string ValidateIdentifierName(string identifierName, string paramName) + protected NamedProvisioningConstruct(string identifierName) { - // TODO: Enable when Aspire is ready - /* - if (identifierName is null) - { - throw new ArgumentNullException(paramName, $"{nameof(IdentifierName)} cannot be null."); - } - else if (identifierName.Length == 0) - { - throw new ArgumentException($"{nameof(IdentifierName)} cannot be empty.", paramName); - } - - foreach (var ch in identifierName) - { - if (!char.IsLetterOrDigit(ch) && ch != '_') - { - throw new ArgumentException($"{nameof(IdentifierName)} \"{identifierName}\" should only contain letters, numbers, and underscores.", paramName); - } - } - /**/ - return identifierName; + // TODO: In the near future we'll make this optional and only validate + // if the value passed in isn't null. + Infrastructure.ValidateIdentifierName(identifierName, nameof(identifierName)); + _identifierName = identifierName; } } diff --git a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs index af913de47894f..20df89215bdde 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs +++ b/sdk/provisioning/Azure.Provisioning/tests/SampleTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; @@ -348,15 +349,32 @@ await test.Define( [Test] public void ValidNames() { - // TODO: Enable when we turn NamedProvisioningConstruct.ValidateIdentifierName back on - /* + // Check null is invalid + Assert.IsFalse(Infrastructure.IsValidIdentifierName(null)); + Assert.Throws(() => Infrastructure.ValidateIdentifierName(null)); Assert.Throws(() => new StorageAccount(null!)); - Assert.Throws(() => new StorageAccount("")); - Assert.Throws(() => new StorageAccount("my-storage")); - Assert.Throws(() => new StorageAccount("my storage")); - Assert.Throws(() => new StorageAccount("my:storage")); - Assert.Throws(() => new StorageAccount("storage$")); - /**/ - _ = new StorageAccount("ABCdef123_"); + + // Check invalid names + List invalid = ["", "my-storage", "my storage", "my:storage", "storage$", "1storage", "KforKelvin"]; + foreach (string name in invalid) + { + Assert.IsFalse(Infrastructure.IsValidIdentifierName(name)); + Assert.Throws(() => Infrastructure.ValidateIdentifierName(name)); + if (!string.IsNullOrEmpty(name)) + { + Assert.AreNotEqual(name, Infrastructure.NormalizeIdentifierName(name)); + } + Assert.Throws(() => new StorageAccount(name)); + } + + // Check valid names + List valid = ["foo", "FOO", "Foo", "f", "_foo", "_", "foo123", "ABCdef123_"]; + foreach (string name in valid) + { + Assert.IsTrue(Infrastructure.IsValidIdentifierName(name)); + Assert.DoesNotThrow(() => Infrastructure.ValidateIdentifierName(name)); + Assert.AreEqual(name, Infrastructure.NormalizeIdentifierName(name)); + Assert.DoesNotThrow(() => new StorageAccount(name)); + } } } From 4771082c2f07ff27a6fd1cc3fc577d63aa60f0e5 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:38:56 -0700 Subject: [PATCH 24/43] Increment version for provisioning releases (#46440) * Increment package version after release of Azure.Provisioning * Increment package version after release of Azure.Provisioning.SignalR * Increment package version after release of Azure.Provisioning.AppConfiguration * Increment package version after release of Azure.Provisioning.CosmosDB * Increment package version after release of Azure.Provisioning.Search * Increment package version after release of Azure.Provisioning.Redis * Increment package version after release of Azure.Provisioning.Sql * Increment package version after release of Azure.Provisioning.PostgreSql * Increment package version after release of Azure.Provisioning.CognitiveServices * Increment package version after release of Azure.Provisioning.KeyVault * Increment package version after release of Azure.Provisioning.Storage * Increment package version after release of Azure.Provisioning.WebPubSub * Increment package version after release of Azure.Provisioning.ServiceBus * Increment package version after release of Azure.Provisioning.EventHubs --- .../Azure.Provisioning.AppConfiguration/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.AppConfiguration.csproj | 2 +- .../Azure.Provisioning.CognitiveServices/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.CognitiveServices.csproj | 2 +- .../Azure.Provisioning.CosmosDB/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.CosmosDB.csproj | 2 +- .../Azure.Provisioning.EventHubs/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.EventHubs.csproj | 2 +- .../Azure.Provisioning.KeyVault/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.KeyVault.csproj | 2 +- .../Azure.Provisioning.PostgreSql/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.PostgreSql.csproj | 2 +- sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.Redis.csproj | 2 +- .../Azure.Provisioning.Search/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.Search.csproj | 2 +- .../Azure.Provisioning.ServiceBus/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.ServiceBus.csproj | 2 +- .../Azure.Provisioning.SignalR/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.SignalR.csproj | 2 +- sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.Sql.csproj | 2 +- .../Azure.Provisioning.Storage/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.Storage.csproj | 2 +- .../Azure.Provisioning.WebPubSub/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.WebPubSub.csproj | 2 +- sdk/provisioning/Azure.Provisioning/CHANGELOG.md | 10 ++++++++++ .../Azure.Provisioning/src/Azure.Provisioning.csproj | 2 +- 28 files changed, 154 insertions(+), 14 deletions(-) diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj index b3c2de96d1cfa..5cd6a4562c70c 100644 --- a/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.AppConfiguration simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj index 4d768d80a1b56..48d12ee9b2a23 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.CognitiveServices simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj index 8cb7b5141a56e..cc73403be87bd 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.CosmosDB simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj index 6f63aab523b50..0b59500e7af8c 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.EventHubs simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj index 59917f246e2b9..8e3bcd7e79e35 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.KeyVault simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj index 518b075ab4cbb..13f2141b063f0 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.PostgreSql simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj index 126b0f2fe05c2..0a49831944fa7 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Redis simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj index e6d55edd07496..3623aaab7e25b 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Search simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj index 004da76209788..39171c38faf0c 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.ServiceBus simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj index 26d6323adb1e7..e429d0b9ecfc1 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.SignalR simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj index 533719bfdba28..d959284dccd8b 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Sql simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj index 25a060db5f488..72a972287c19a 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Storage simplifies declarative resource provisioning in .NET for Azure Storage. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj index 2418c058a8545..83df0f375620c 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.WebPubSub simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md index 69f3d90946724..6d23cddde8257 100644 --- a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj index de756e9180807..472a88828c207 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj +++ b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj @@ -2,7 +2,7 @@ Contains the core functionality for defining Azure infrastructure with dotnet code. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) enable 12 From fc4ffe0dd38c634b44d0d896a9c23dd115c826a7 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:51:19 -0700 Subject: [PATCH 25/43] Increment version for provisioning releases (#46441) * Increment package version after release of Azure.Provisioning.ApplicationInsights * Increment package version after release of Azure.Provisioning.Communication * Increment package version after release of Azure.Provisioning.KubernetesConfiguration * Increment package version after release of Azure.Provisioning.Deployment * Increment package version after release of Azure.Provisioning.AppService * Increment package version after release of Azure.Provisioning.ContainerRegistry * Increment package version after release of Azure.Provisioning.ContainerService * Increment package version after release of Azure.Provisioning.EventGrid * Increment package version after release of Azure.Provisioning.OperationalInsights --- .../Azure.Provisioning.AppService/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.AppService.csproj | 2 +- .../CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.ApplicationInsights.csproj | 2 +- .../Azure.Provisioning.Communication/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.Communication.csproj | 2 +- .../Azure.Provisioning.ContainerRegistry/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.ContainerRegistry.csproj | 2 +- .../Azure.Provisioning.ContainerService/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.ContainerService.csproj | 2 +- .../Azure.Provisioning.Deployment/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.Deployment.csproj | 2 +- .../Azure.Provisioning.EventGrid/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.EventGrid.csproj | 2 +- .../Azure.Provisioning.Kubernetes/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.Kubernetes.csproj | 2 +- .../Changelog.md | 10 ++++++++++ .../Azure.Provisioning.KubernetesConfiguration.csproj | 2 +- .../CHANGELOG.md | 10 ++++++++++ .../src/Azure.Provisioning.OperationalInsights.csproj | 2 +- 20 files changed, 110 insertions(+), 10 deletions(-) diff --git a/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md b/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.AppService/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj b/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj index 4513c00da546e..16b892597356e 100644 --- a/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppService/src/Azure.Provisioning.AppService.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.AppService simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj index f9b12e9c40e60..95858c8561c15 100644 --- a/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj +++ b/sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.ApplicationInsights simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md b/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.Communication/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj b/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj index b623b66fa4a33..a226d58ddca3b 100644 --- a/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj +++ b/sdk/provisioning/Azure.Provisioning.Communication/src/Azure.Provisioning.Communication.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Communication simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj index 5c17421c8b7b8..55c07c79565a2 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj +++ b/sdk/provisioning/Azure.Provisioning.ContainerRegistry/src/Azure.Provisioning.ContainerRegistry.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.ContainerRegistry simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md b/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj index aa59c9b58bf80..0c0301455c5a8 100644 --- a/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj +++ b/sdk/provisioning/Azure.Provisioning.ContainerService/src/Azure.Provisioning.ContainerService.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.ContainerService simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Deployment/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj b/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj index d243584be1550..3f8def708bf86 100644 --- a/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj +++ b/sdk/provisioning/Azure.Provisioning.Deployment/src/Azure.Provisioning.Deployment.csproj @@ -2,7 +2,7 @@ Contains the core functionality for deploying Azure infrastructure with dotnet code. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) enable 12 diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md b/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj index d6a662456dc42..f7c58e6f981c1 100644 --- a/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj +++ b/sdk/provisioning/Azure.Provisioning.EventGrid/src/Azure.Provisioning.EventGrid.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.EventGrid simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md b/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj index 22d8ff95f9459..673db22ddb142 100644 --- a/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj +++ b/sdk/provisioning/Azure.Provisioning.Kubernetes/src/Azure.Provisioning.Kubernetes.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.Kubernetes simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj index 1a971496e2949..6cb73c9c8cac2 100644 --- a/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj +++ b/sdk/provisioning/Azure.Provisioning.KubernetesConfiguration/src/Azure.Provisioning.KubernetesConfiguration.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.KubernetesConfiguration simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj index 6cc366c39553d..b219c7ddd6bb1 100644 --- a/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj +++ b/sdk/provisioning/Azure.Provisioning.OperationalInsights/src/Azure.Provisioning.OperationalInsights.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.OperationalInsights simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 From 3288d385d85106150bb697d2b37e27f4cfd57d91 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:42:46 -0700 Subject: [PATCH 26/43] Increment version for provisioning releases (#46442) * Increment package version after release of Azure.Provisioning.ApplicationInsights * Increment package version after release of Azure.Provisioning.Communication * Increment package version after release of Azure.Provisioning.KubernetesConfiguration * Increment package version after release of Azure.Provisioning.Deployment * Increment package version after release of Azure.Provisioning.AppService * Increment package version after release of Azure.Provisioning.ContainerRegistry * Increment package version after release of Azure.Provisioning.ContainerService * Increment package version after release of Azure.Provisioning.EventGrid * Increment package version after release of Azure.Provisioning.OperationalInsights * Increment package version after release of Azure.Provisioning.Kubernetes * Increment package version after release of Azure.Provisioning.AppContainers --- .../Azure.Provisioning.AppContainers/Changelog.md | 10 ++++++++++ .../src/Azure.Provisioning.AppContainers.csproj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md b/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md index 838e93d43ab89..4d53137874df9 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/Changelog.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2024-10-04) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj index 58eb367197016..6d9a0f8dcfc95 100644 --- a/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj +++ b/sdk/provisioning/Azure.Provisioning.AppContainers/src/Azure.Provisioning.AppContainers.csproj @@ -2,7 +2,7 @@ Azure.Provisioning.AppContainers simplifies declarative resource provisioning in .NET. - 1.0.0-beta.1 + 1.0.0-beta.2 $(RequiredTargetFrameworks) 12 From 8e1b595e04e037de75d99193cb897356d404bc90 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Mon, 7 Oct 2024 12:47:33 -0400 Subject: [PATCH 27/43] [Storage] [DataMovement] [API-Change] Changed ShareFilesStorageResourceProvider.FromFile/Directory to take a Uri over string (#46446) * Initial commit * Export API --- .../CHANGELOG.md | 2 ++ .../README.md | 6 ++-- ...torage.DataMovement.Files.Shares.net6.0.cs | 10 +++--- ...ataMovement.Files.Shares.netstandard2.0.cs | 10 +++--- .../samples/Sample01b_HelloWorldAsync.cs | 26 +++++++------- .../src/ShareFilesStorageResourceProvider.cs | 34 +++++++++---------- 6 files changed, 45 insertions(+), 43 deletions(-) diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md index aa4d24a6af5d5..eab3f05059c6f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md @@ -5,6 +5,8 @@ ### Features Added ### Breaking Changes +- Changed `FromDirectory(string directoryUri, ShareFileStorageResourceOptions options = default)` to `FromDirectory(Uri directoryUri, ShareFileStorageResourceOptions options = default)` +- Changed `FromFile(string fileUri, ShareFileStorageResourceOptions options = default)` to `FromFile(Uri fileUri, ShareFileStorageResourceOptions options = default)` ### Bugs Fixed - Fixed bug where copying a Azure Storage Blob to a Share File would not be able to convert Content Language and Content Encoding to the `string[]` type. diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md index 33e0c4a02c4f6..df3dd37bdefae 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -84,11 +84,11 @@ To create a share `StorageResource`, use the methods `FromFile` or `FromDirector ```C# Snippet:ResourceConstruction_Shares StorageResource directory = shares.FromDirectory( - "http://myaccount.files.core.windows.net/share/path/to/directory"); + new Uri("http://myaccount.files.core.windows.net/share/path/to/directory")); StorageResource rootDirectory = shares.FromDirectory( - "http://myaccount.files.core.windows.net/share"); + new Uri("http://myaccount.files.core.windows.net/share")); StorageResource file = shares.FromFile( - "http://myaccount.files.core.windows.net/share/path/to/file.txt"); + new Uri("http://myaccount.files.core.windows.net/share/path/to/file.txt")); ``` Storage resources can also be initialized with the appropriate client object from Azure.Storage.Files.Shares. Since these resources will use the credential already present in the client object, no credential is required in the provider when using `FromClient()`. **However**, a `ShareFilesStorageResourceProvider` must still have a credential if it is to be used in `TransferManagerOptions` for resuming a transfer. diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs index 732863c35e7a7..0a0dce98f428a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs @@ -19,12 +19,12 @@ public ShareFilesStorageResourceProvider(Azure.Storage.StorageSharedKeyCredentia public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.DataTransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromDirectory(string directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromFile(string fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public Azure.Storage.DataMovement.StorageResource FromDirectory(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public Azure.Storage.DataMovement.StorageResource FromFile(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.DataTransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(string uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(string uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(string uri, bool readOnly); + public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); + public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); + public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); } public partial class ShareFileStorageResourceOptions { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs index 732863c35e7a7..0a0dce98f428a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs @@ -19,12 +19,12 @@ public ShareFilesStorageResourceProvider(Azure.Storage.StorageSharedKeyCredentia public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.DataTransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromDirectory(string directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromFile(string fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public Azure.Storage.DataMovement.StorageResource FromDirectory(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public Azure.Storage.DataMovement.StorageResource FromFile(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.DataTransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(string uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(string uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(string uri, bool readOnly); + public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); + public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); + public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); } public partial class ShareFileStorageResourceOptions { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs index b9427ce812b27..600ee05a4638f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs @@ -52,11 +52,11 @@ public async Task ResourceConstructionDemonstration() // Construct simple blob resources for data movement #region Snippet:ResourceConstruction_Shares StorageResource directory = shares.FromDirectory( - "http://myaccount.files.core.windows.net/share/path/to/directory"); + new Uri("http://myaccount.files.core.windows.net/share/path/to/directory")); StorageResource rootDirectory = shares.FromDirectory( - "http://myaccount.files.core.windows.net/share"); + new Uri("http://myaccount.files.core.windows.net/share")); StorageResource file = shares.FromFile( - "http://myaccount.files.core.windows.net/share/path/to/file.txt"); + new Uri("http://myaccount.files.core.windows.net/share/path/to/file.txt")); #endregion } { @@ -71,11 +71,11 @@ public async Task ResourceConstructionDemonstration() { StorageSharedKeyCredential sharedKeyCredential = new(StorageAccountName, StorageAccountKey); // Get blobs provider with credential - AzureSasCredential GenerateSas(string uri, bool readOnly) + AzureSasCredential GenerateSas(Uri uri, bool readOnly) { // Quick sample demonstrating minimal steps // Construct your SAS according to your needs - ShareUriBuilder pathUri = new(new Uri(uri)); + ShareUriBuilder pathUri = new(uri); ShareSasBuilder sas = new(ShareSasPermissions.All, DateTimeOffset.Now.AddHours(1)) { ShareName = pathUri.ShareName, @@ -110,8 +110,8 @@ public async Task Upload() LocalFilesStorageResourceProvider files = new(); // Get a reference to a destination blobs - string destinationFolderUri = share.GetDirectoryClient("sample-directory").Uri.ToString(); - string destinationFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file").Uri.ToString(); + Uri destinationFolderUri = share.GetDirectoryClient("sample-directory").Uri; + Uri destinationFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file").Uri; TransferManager transferManager = new TransferManager(new TransferManagerOptions()); // Create simple transfer single blob upload job @@ -153,8 +153,8 @@ public async Task Download() LocalFilesStorageResourceProvider files = new(); // Get a reference to a destination blobs - string sourceDirectoryUri = share.GetDirectoryClient("sample-directory").Uri.ToString(); - string sourceFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file").Uri.ToString(); + Uri sourceDirectoryUri = share.GetDirectoryClient("sample-directory").Uri; + Uri sourceFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file").Uri; TransferManager transferManager = new TransferManager(new TransferManagerOptions()); // Create simple transfer single blob upload job @@ -192,10 +192,10 @@ public async Task Copy() ShareFilesStorageResourceProvider shares = new(new StorageSharedKeyCredential(StorageAccountName, StorageAccountKey)); // Get a reference to a destination blobs - string sourceDirectoryUri = share.GetDirectoryClient("sample-directory-1").Uri.ToString(); - string destinationDirectoryUri = share.GetDirectoryClient("sample-directory-2").Uri.ToString(); - string sourceFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file-1").Uri.ToString(); - string destinationFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file-2").Uri.ToString(); + Uri sourceDirectoryUri = share.GetDirectoryClient("sample-directory-1").Uri; + Uri destinationDirectoryUri = share.GetDirectoryClient("sample-directory-2").Uri; + Uri sourceFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file-1").Uri; + Uri destinationFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file-2").Uri; TransferManager transferManager = new TransferManager(new TransferManagerOptions()); // Create simple transfer single blob upload job diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs index b750781b7419d..16395130b57b6 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs @@ -25,7 +25,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider /// /// Whether the permission can be read-only. /// - public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential(string uri, bool readOnly); + public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential(Uri uri, bool readOnly); /// /// Delegate for fetching a token credential for a given URI. @@ -36,7 +36,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider /// /// Whether the permission can be read-only. /// - public delegate TokenCredential GetTokenCredential(string uri, bool readOnly); + public delegate TokenCredential GetTokenCredential(Uri uri, bool readOnly); /// /// Delegate for fetching a SAS credential for a given URI. @@ -47,7 +47,7 @@ public class ShareFilesStorageResourceProvider : StorageResourceProvider /// /// Whether the permission can be read-only. /// - public delegate AzureSasCredential GetAzureSasCredential(string uri, bool readOnly); + public delegate AzureSasCredential GetAzureSasCredential(Uri uri, bool readOnly); private enum ResourceType { @@ -229,8 +229,8 @@ protected override Task FromSourceAsync(DataTransferProperties // Source share file data currently empty, so no specific properties to grab return Task.FromResult(properties.IsContainer - ? FromDirectory(properties.SourceUri.AbsoluteUri) - : FromFile(properties.SourceUri.AbsoluteUri)); + ? FromDirectory(properties.SourceUri) + : FromFile(properties.SourceUri)); } /// @@ -258,8 +258,8 @@ protected override Task FromDestinationAsync(DataTransferProper FileMetadata = checkpointData.FileMetadata, }; return Task.FromResult(properties.IsContainer - ? FromDirectory(properties.DestinationUri.AbsoluteUri, options) - : FromFile(properties.DestinationUri.AbsoluteUri, options)); + ? FromDirectory(properties.DestinationUri, options) + : FromFile(properties.DestinationUri, options)); } /// @@ -294,14 +294,14 @@ internal async Task FromDestinationInternalHookAsync( /// /// The configured storage resource. /// - public StorageResource FromDirectory(string directoryUri, ShareFileStorageResourceOptions options = default) + public StorageResource FromDirectory(Uri directoryUri, ShareFileStorageResourceOptions options = default) { ShareDirectoryClient client = _credentialType switch { - CredentialType.None => new ShareDirectoryClient(new Uri(directoryUri)), - CredentialType.SharedKey => new ShareDirectoryClient(new Uri(directoryUri), _getStorageSharedKeyCredential(directoryUri, false)), - CredentialType.Token => new ShareDirectoryClient(new Uri(directoryUri), _getTokenCredential(directoryUri, false)), - CredentialType.Sas => new ShareDirectoryClient(new Uri(directoryUri), _getAzureSasCredential(directoryUri, false)), + CredentialType.None => new ShareDirectoryClient(directoryUri), + CredentialType.SharedKey => new ShareDirectoryClient(directoryUri, _getStorageSharedKeyCredential(directoryUri, false)), + CredentialType.Token => new ShareDirectoryClient(directoryUri, _getTokenCredential(directoryUri, false)), + CredentialType.Sas => new ShareDirectoryClient(directoryUri, _getAzureSasCredential(directoryUri, false)), _ => throw BadCredentialTypeException(_credentialType), }; return new ShareDirectoryStorageResourceContainer(client, options); @@ -320,15 +320,15 @@ public StorageResource FromDirectory(string directoryUri, ShareFileStorageResour /// The configured storage resource. /// public StorageResource FromFile( - string fileUri, + Uri fileUri, ShareFileStorageResourceOptions options = default) { ShareFileClient client = _credentialType switch { - CredentialType.None => new ShareFileClient(new Uri(fileUri)), - CredentialType.SharedKey => new ShareFileClient(new Uri(fileUri), _getStorageSharedKeyCredential(fileUri, false)), - CredentialType.Token => new ShareFileClient(new Uri(fileUri), _getTokenCredential(fileUri, false)), - CredentialType.Sas => new ShareFileClient(new Uri(fileUri), _getAzureSasCredential(fileUri, false)), + CredentialType.None => new ShareFileClient(fileUri), + CredentialType.SharedKey => new ShareFileClient(fileUri, _getStorageSharedKeyCredential(fileUri, false)), + CredentialType.Token => new ShareFileClient(fileUri, _getTokenCredential(fileUri, false)), + CredentialType.Sas => new ShareFileClient(fileUri, _getAzureSasCredential(fileUri, false)), _ => throw BadCredentialTypeException(_credentialType), }; return new ShareFileStorageResource(client, options); From 65846ee8e3a947b6533998d38193f819c6864352 Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Mon, 7 Oct 2024 20:36:05 +0300 Subject: [PATCH 28/43] Update Nginx changelog to support API version 2024-06-01-preview (#46447) * Update Nginx changelog to support API version 2024-06-01-preview * Refactor --- sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md index fd8171f2ceeb5..3fd7f7009411b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md +++ b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.1.0 (2024-10-11) + +### Features Added + +- Upgraded api-version tag from 'package-2024-01-01-preview' to 'package-2024-06-01-preview'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/eea7584434f9225cad0327d83d5c6d84257a4d7d/specification/nginx/resource-manager/readme.md + - Added NGINX App Protect Web Application Firewall (WAF) support. + +### Other Changes + ## 1.1.0-beta.2 (Unreleased) ### Features Added From 7f20f77a79f9b9c52ecc4d9c29c3b5e638dfea64 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Mon, 7 Oct 2024 12:32:49 -0700 Subject: [PATCH 29/43] [Service Bus] October 2024 Release Prep (#46438) The focus of these changes is to prepare the Service Bus package for the October 2024 release. --- sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md | 10 +++------- .../src/Azure.Messaging.ServiceBus.csproj | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md index adda7c09ef718..898f85384f2b0 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md @@ -1,15 +1,11 @@ # Release History -## 7.19.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 7.18.2 (2024-10-08) ### Other Changes +- Enhanced the logs emitted when acquiring a session with `ServiceBusClient` times out or is canceled. As these are known and expected exception conditions, they are now correctly logged as verbose information rather than an error. Previously, these scenarios were special-cased for processors, but receivers were treated as standard errors. Going forward, the processor and client/receiver scenarios are handled consistently. + ## 7.18.1 (2024-07-31) ### Other Changes diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj index a04d120f127fa..bb9433abd47ee 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj @@ -1,7 +1,7 @@ Azure Service Bus is a fully managed enterprise integration message broker. Service Bus can decouple applications and services. Service Bus offers a reliable and secure platform for asynchronous transfer of data and state. This client library allows for both sending and receiving messages using Azure Service Bus. For more information about Service Bus, see https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview - 7.19.0-beta.1 + 7.18.2 7.18.1 Azure;Service Bus;ServiceBus;.NET;AMQP;$(PackageCommonTags) From 7275c784d8b96d6db75b63dbcf36116b95c0a4f1 Mon Sep 17 00:00:00 2001 From: Sean McCullough <44180881+seanmcc-msft@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:19:55 -0500 Subject: [PATCH 30/43] Storage STG 96 (#45604) --- .../Azure.Storage.Blobs.Batch/CHANGELOG.md | 7 +- .../CHANGELOG.md | 7 +- .../tests/ChangeFeedTestBase.cs | 1 + .../AzureStorageNetMigrationV12.md | 48 + sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 7 +- .../api/Azure.Storage.Blobs.net6.0.cs | 18 +- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 18 +- .../api/Azure.Storage.Blobs.netstandard2.1.cs | 18 +- sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- .../samples/Sample03_Migrations.cs | 133 +++ .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 223 ++++- .../src/BlobClientOptions.cs | 7 +- .../src/BlobContainerClient.cs | 186 +++- .../Generated/AppendBlobAppendBlockHeaders.cs | 2 + .../src/Generated/AppendBlobRestClient.cs | 24 +- .../src/Generated/BlobDownloadHeaders.cs | 4 + .../src/Generated/BlobRestClient.cs | 84 +- .../src/Generated/BlockBlobRestClient.cs | 46 +- .../Generated/BlockBlobStageBlockHeaders.cs | 2 + .../src/Generated/BlockBlobUploadHeaders.cs | 2 + .../src/Generated/ContainerRestClient.cs | 2 +- .../src/Generated/Models/BlobErrorCode.cs | 3 + .../src/Generated/PageBlobRestClient.cs | 24 +- .../Generated/PageBlobUploadPagesHeaders.cs | 2 + .../src/Generated/ServiceRestClient.cs | 2 +- .../Azure.Storage.Blobs/src/autorest.md | 2 +- .../tests/BlobBaseClientTests.cs | 599 ++++++++++++ .../tests/BlobsClientTestFixtureAttribute.cs | 1 + .../tests/ContainerClientTests.cs | 263 ++++++ .../ImmutableStorageWithVersioningTests.cs | 147 +++ sdk/storage/Azure.Storage.Common/CHANGELOG.md | 7 +- .../api/Azure.Storage.Common.net6.0.cs | 2 +- .../Azure.Storage.Common.netstandard2.0.cs | 2 +- .../src/Shared/Constants.cs | 2 +- .../src/Shared/Errors.Clients.cs | 2 +- .../src/Shared/StorageVersionExtensions.cs | 34 +- .../tests/CommonTestBase.cs | 5 +- .../tests/Shared/DisposingShare.cs | 2 +- .../Azure.Storage.Files.DataLake/CHANGELOG.md | 10 +- .../Azure.Storage.Files.DataLake/README.md | 12 + .../Azure.Storage.Files.DataLake.net6.0.cs | 55 +- ...e.Storage.Files.DataLake.netstandard2.0.cs | 55 +- .../Azure.Storage.Files.DataLake/assets.json | 2 +- .../samples/Sample01a_HelloWorld.cs | 109 +++ .../samples/Sample01b_HelloWorldAsync.cs | 105 +++ .../src/DataLakeClientOptions.cs | 7 +- .../src/DataLakeDirectoryClient.cs | 165 +++- .../src/DataLakeExtensions.cs | 23 + .../src/DataLakeFileClient.cs | 611 ++++++++++++- .../src/DataLakeFileSystemClient.cs | 184 +++- .../src/DataLakePathClient.cs | 210 ++++- .../src/Generated/FileSystemRestClient.cs | 2 +- .../src/Generated/PathAppendDataHeaders.cs | 2 + .../src/Generated/PathRestClient.cs | 46 +- .../src/Generated/PathUpdateHeaders.cs | 2 + .../src/Generated/ServiceRestClient.cs | 2 +- .../src/Models/DataLakeFileReadResult.cs | 25 + .../Models/DataLakeFileReadStreamingResult.cs | 36 + .../src/Models/DataLakeModelFactory.cs | 29 + .../src/autorest.md | 2 +- .../DataLakeClientTestFixtureAttribute.cs | 1 + .../tests/DirectoryClientTests.cs | 419 ++++++++- .../tests/FileClientTests.cs | 854 ++++++++++++++++-- .../tests/FileSystemClientTests.cs | 266 ++++++ .../tests/PathClientTests.cs | 362 ++++++++ .../Azure.Storage.Files.Shares/CHANGELOG.md | 10 +- .../api/Azure.Storage.Files.Shares.net6.0.cs | 28 +- ...ure.Storage.Files.Shares.netstandard2.0.cs | 28 +- .../Azure.Storage.Files.Shares/assets.json | 2 +- .../src/Generated/DirectoryRestClient.cs | 2 +- .../src/Generated/FileDownloadHeaders.cs | 4 + .../src/Generated/FileRestClient.cs | 56 +- .../src/Generated/FileUploadRangeHeaders.cs | 2 + .../src/Generated/Models/ShareAccessTier.cs | 3 + .../src/Generated/Models/ShareErrorCode.cs | 6 + .../SharePropertiesInternal.Serialization.cs | 26 +- .../Models/SharePropertiesInternal.cs | 18 +- .../src/Generated/ServiceRestClient.cs | 2 +- .../src/Generated/ShareCreateHeaders.cs | 10 + .../src/Generated/ShareDeleteHeaders.cs | 4 + .../Generated/ShareGetPropertiesHeaders.cs | 10 +- .../src/Generated/ShareRestClient.cs | 46 +- .../src/Generated/ShareRestoreHeaders.cs | 10 + .../Generated/ShareSetPropertiesHeaders.cs | 16 + .../src/Models/ShareCreateOptions.cs | 13 + .../src/Models/ShareFileCopyOptions.cs | 7 + .../src/Models/ShareModelFactory.cs | 63 +- .../src/Models/ShareProperties.cs | 24 + .../src/Models/ShareSetPropertiesOptions.cs | 14 + .../src/ShareClient.cs | 88 +- .../src/ShareClientOptions.cs | 7 +- .../src/ShareExtensions.cs | 12 +- .../src/ShareFileClient.cs | 12 + .../src/ShareServiceClient.cs | 8 + .../src/autorest.md | 2 +- .../tests/DisposingShare.cs | 7 +- .../tests/FileClientTests.cs | 44 + .../tests/ServiceClientTests.cs | 27 + .../tests/ShareClientTestFixtureAttribute.cs | 5 +- .../tests/ShareClientTests.cs | 120 ++- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 7 +- .../api/Azure.Storage.Queues.net6.0.cs | 5 +- .../Azure.Storage.Queues.netstandard2.0.cs | 5 +- .../Azure.Storage.Queues.netstandard2.1.cs | 5 +- .../src/QueueClientOptions.cs | 7 +- .../tests/QueueClientTestFixtureAttribute.cs | 1 + 106 files changed, 5913 insertions(+), 389 deletions(-) create mode 100644 sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadResult.cs create mode 100644 sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadStreamingResult.cs diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index 5952194b2d2ea..64c9a4b2a297d 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.20.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-01-05. ## 12.19.0 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index 8e03ceb02b5fe..6fccde404a9b0 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.0.0-preview.50 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-01-05. ## 12.0.0-preview.49 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs index cc5c65ae20673..d65ba1264ce66 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs @@ -32,6 +32,7 @@ namespace Azure.Storage.Blobs.ChangeFeed.Tests BlobClientOptions.ServiceVersion.V2024_05_04, BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, + BlobClientOptions.ServiceVersion.V2025_01_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion, RecordingServiceVersion = StorageVersionExtensions.MaxVersion, diff --git a/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md b/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md index 68f523f715716..8faad4f14059e 100644 --- a/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md +++ b/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md @@ -611,6 +611,54 @@ BlobSasBuilder sasBuilder = new BlobSasBuilder }; ``` +To create a simple User Delegation SAS with any optional parameters, use the convenience overload of GenerateUserDelegationSas which only requires taking in permissions and the expiry time. + +```C# Snippet:SampleSnippetsBlobMigration_GenerateUserDelegationSas +// Create a BlobClient +BlobClient blobClient = new BlobClient(blobUri); + +// Create full, self-authenticating URI to the resource from the BlobClient +Uri sasUri = blobClient.GenerateUserDelegationSasUri(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1), userDelegationKey); +``` + +To create a more complex User Delegation SAS, pass the SAS builder to the GenerateUserDelegationSas method. + +```C# Snippet:SampleSnippetsBlobMigration_GenerateUserDelegationSas_Builder +// Create a BlobClient +BlobClient blobClient = new BlobClient(blobUri); +// Create BlobSasBuilder and specify parameters +BlobSasBuilder sasBuilder = new BlobSasBuilder(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1)) +{ + // Since we are generating from the client, the client will have the container and blob name + // Specify any optional paremeters here + StartsOn = DateTimeOffset.UtcNow.AddHours(-1) +}; + +// Create full, self-authenticating URI to the resource from the BlobClient +Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); +``` + +You can also generate an User Delegation SAS without use of the client. + +```C# Snippet:SampleSnippetsBlobMigration_UserDelegationSasBuilder +// Create BlobSasBuilder and specify parameters +BlobSasBuilder sasBuilder = new BlobSasBuilder(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1)) +{ + // with no url in a client to read from, container and blob name must be provided if applicable + BlobContainerName = containerName, + BlobName = blobName +}; + +// Create full, self-authenticating URI to the resource +BlobUriBuilder uriBuilder = new BlobUriBuilder(StorageAccountBlobUri) +{ + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, accountName) +}; +Uri sasUri = uriBuilder.ToUri(); +``` + ### Content Hashes #### Blob Content MD5 diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 7fb652e464e4c..2450bdef7e6cc 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -3,14 +3,13 @@ ## 12.23.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes +- Added support for service version 2025-01-05. +- Added GenerateUserDelegationSasUri() to BlobBaseClient and BlobContainerClient. +- Added BlobErrorCode.BlobAccessTierNotSupportedForAccountType enum value. ### Bugs Fixed - Fixed bug where BlobClient.Upload(BinaryData content, ..) did not properly dispose stream after wrapping the BinaryData passed. -### Other Changes - ## 12.22.1 (2024-09-25) ### Other Changes diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index 22a57254be04d..d93de39ce28c0 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -87,6 +87,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class BlobContainerClient @@ -136,6 +137,12 @@ public BlobContainerClient(System.Uri blobContainerUri, Azure.Storage.StorageSha public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessPolicy(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessPolicyAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -608,6 +615,7 @@ public BlobDownloadToOptions() { } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationResourceTypeMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationServiceMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationSourceIPMismatch { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAccessTierNotSupportedForAccountType { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAlreadyExists { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobArchived { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobBeingRehydrated { get { throw null; } } @@ -1640,6 +1648,12 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccountInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected internal virtual Azure.Storage.Blobs.Specialized.BlobLeaseClient GetBlobLeaseClientCore(string leaseId) { throw null; } @@ -1836,7 +1850,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 22a57254be04d..d93de39ce28c0 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -87,6 +87,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class BlobContainerClient @@ -136,6 +137,12 @@ public BlobContainerClient(System.Uri blobContainerUri, Azure.Storage.StorageSha public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessPolicy(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessPolicyAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -608,6 +615,7 @@ public BlobDownloadToOptions() { } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationResourceTypeMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationServiceMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationSourceIPMismatch { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAccessTierNotSupportedForAccountType { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAlreadyExists { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobArchived { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobBeingRehydrated { get { throw null; } } @@ -1640,6 +1648,12 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccountInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected internal virtual Azure.Storage.Blobs.Specialized.BlobLeaseClient GetBlobLeaseClientCore(string leaseId) { throw null; } @@ -1836,7 +1850,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index 22a57254be04d..d93de39ce28c0 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -87,6 +87,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class BlobContainerClient @@ -136,6 +137,12 @@ public BlobContainerClient(System.Uri blobContainerUri, Azure.Storage.StorageSha public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasBuilder builder, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobContainerSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessPolicy(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessPolicyAsync(Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -608,6 +615,7 @@ public BlobDownloadToOptions() { } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationResourceTypeMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationServiceMismatch { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode AuthorizationSourceIPMismatch { get { throw null; } } + public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAccessTierNotSupportedForAccountType { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobAlreadyExists { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobArchived { get { throw null; } } public static Azure.Storage.Blobs.Models.BlobErrorCode BlobBeingRehydrated { get { throw null; } } @@ -1640,6 +1648,12 @@ public BlobBaseClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasBuilder builder, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.BlobSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Blobs.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccountInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccountInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected internal virtual Azure.Storage.Blobs.Specialized.BlobLeaseClient GetBlobLeaseClientCore(string leaseId) { throw null; } @@ -1836,7 +1850,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index 19f657cf818c5..0facb33e2a026 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_a4e8ca8040" + "Tag": "net/storage/Azure.Storage.Blobs_5c382dfb14" } diff --git a/sdk/storage/Azure.Storage.Blobs/samples/Sample03_Migrations.cs b/sdk/storage/Azure.Storage.Blobs/samples/Sample03_Migrations.cs index d1f81e4c461e0..198c3ba8f9731 100644 --- a/sdk/storage/Azure.Storage.Blobs/samples/Sample03_Migrations.cs +++ b/sdk/storage/Azure.Storage.Blobs/samples/Sample03_Migrations.cs @@ -859,6 +859,139 @@ public async Task SasBuilderIdentifier() } } + [Test] + public async Task UserDelegationSasBuilder() + { + string accountName = StorageAccountName; + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + BlobServiceClient client = new BlobServiceClient(ConnectionString); + Response userDelegationKeyResponse = await client.GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: DateTimeOffset.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // setup blob + BlobContainerClient container = new BlobContainerClient(ConnectionString, containerName); + + try + { + await container.CreateAsync(); + await container.GetBlobClient(blobName).UploadAsync(BinaryData.FromString("hello world")); + + #region Snippet:SampleSnippetsBlobMigration_UserDelegationSasBuilder + // Create BlobSasBuilder and specify parameters + BlobSasBuilder sasBuilder = new BlobSasBuilder(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1)) + { + // with no url in a client to read from, container and blob name must be provided if applicable + BlobContainerName = containerName, + BlobName = blobName + }; + + // Create full, self-authenticating URI to the resource + BlobUriBuilder uriBuilder = new BlobUriBuilder(StorageAccountBlobUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, accountName) + }; + Uri sasUri = uriBuilder.ToUri(); + #endregion + + // successful download indicates pass + await new BlobClient(sasUri).DownloadToAsync(new MemoryStream()); + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task GenerateUserDelegationSas() + { + string accountName = StorageAccountName; + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + BlobServiceClient client = new BlobServiceClient(ConnectionString); + Response userDelegationKeyResponse = await client.GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: DateTimeOffset.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // setup blob + BlobContainerClient container = new BlobContainerClient(ConnectionString, containerName); + BlobUriBuilder uriBuilder = new BlobUriBuilder(container.Uri) { BlobName = blobName }; + Uri blobUri = uriBuilder.ToUri(); + + try + { + await container.CreateAsync(); + await container.GetBlobClient(blobName).UploadAsync(BinaryData.FromString("hello world")); + + #region Snippet:SampleSnippetsBlobMigration_GenerateUserDelegationSas + // Create a BlobClient + BlobClient blobClient = new BlobClient(blobUri); + + // Create full, self-authenticating URI to the resource from the BlobClient + Uri sasUri = blobClient.GenerateUserDelegationSasUri(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1), userDelegationKey); + #endregion + + // Use newly made SAS URI to download the blob + await new BlobClient(sasUri).DownloadToAsync(new MemoryStream()); + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task GenerateUserDelegationSas_Builder() + { + string accountName = StorageAccountName; + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + BlobServiceClient client = new BlobServiceClient(ConnectionString); + Response userDelegationKeyResponse = await client.GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: DateTimeOffset.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // setup blob + BlobContainerClient container = new BlobContainerClient(ConnectionString, containerName); + BlobUriBuilder uriBuilder = new BlobUriBuilder(container.Uri) { BlobName = blobName }; + Uri blobUri = uriBuilder.ToUri(); + + try + { + await container.CreateAsync(); + await container.GetBlobClient(blobName).UploadAsync(BinaryData.FromString("hello world")); + + #region Snippet:SampleSnippetsBlobMigration_GenerateUserDelegationSas_Builder + // Create a BlobClient + BlobClient blobClient = new BlobClient(blobUri); + // Create BlobSasBuilder and specify parameters + BlobSasBuilder sasBuilder = new BlobSasBuilder(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1)) + { + // Since we are generating from the client, the client will have the container and blob name + // Specify any optional paremeters here + StartsOn = DateTimeOffset.UtcNow.AddHours(-1) + }; + + // Create full, self-authenticating URI to the resource from the BlobClient + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + #endregion + + // Use newly made SAS URI to download the blob + await new BlobClient(sasUri).DownloadToAsync(new MemoryStream()); + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + [Test] public async Task BlobContentHash() { diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 40bdafaf1dd08..aa91edb9f6c41 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -6774,42 +6774,167 @@ public virtual Uri GenerateSasUri(BlobSasBuilder builder, out string stringToSig // Deep copy of builder so we don't modify the user's original BlobSasBuilder. builder = BlobSasBuilder.DeepCopy(builder); - // Assign builder's ContainerName, BlobName, Snapshot, BlobVersionId, and EncryptionScope if they are null. - builder.BlobContainerName ??= BlobContainerName; - builder.BlobName ??= Name; - builder.Snapshot ??= _snapshot; - builder.BlobVersionId ??= _blobVersionId; - builder.EncryptionScope ??= _clientConfiguration.EncryptionScope; - - if (!builder.BlobContainerName.Equals(BlobContainerName, StringComparison.InvariantCulture)) - { - throw Errors.SasNamesNotMatching( - nameof(builder.BlobContainerName), - nameof(BlobSasBuilder), - nameof(BlobContainerName)); - } - if (!builder.BlobName.Equals(Name, StringComparison.InvariantCulture)) + SetBuilderAndValidate(builder); + BlobUriBuilder sasUri = new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) { - throw Errors.SasNamesNotMatching( - nameof(builder.BlobName), - nameof(BlobSasBuilder), - nameof(Name)); - } - if (string.Compare(_snapshot, builder.Snapshot, StringComparison.InvariantCulture) != 0) + Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + #region GenerateUserDelegationSas + /// + /// The + /// returns a representing a Blob Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and parameters passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey) => + GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out _); + + /// + /// The + /// returns a representing a Blob Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and parameters passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign) => + GenerateUserDelegationSasUri(new BlobSasBuilder(permissions, expiresOn) { - throw Errors.SasNamesNotMatching( - nameof(builder.Snapshot), - nameof(BlobSasBuilder)); - } - if (string.Compare(_blobVersionId, builder.BlobVersionId, StringComparison.InvariantCulture) != 0) + BlobContainerName = BlobContainerName, + BlobName = Name, + Snapshot = _snapshot, + BlobVersionId = _blobVersionId, + EncryptionScope = _clientConfiguration.EncryptionScope + }, userDelegationKey, out stringToSign); + + /// + /// The + /// returns a representing a Blob Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and builder passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey) => + GenerateUserDelegationSasUri(builder, userDelegationKey, out _); + + /// + /// The + /// returns a representing a Blob Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and builder passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign) + { + builder = builder ?? throw Errors.ArgumentNull(nameof(builder)); + userDelegationKey = userDelegationKey ?? throw Errors.ArgumentNull(nameof(userDelegationKey)); + + // Deep copy of builder so we don't modify the user's origial BlobSasBuilder. + builder = BlobSasBuilder.DeepCopy(builder); + + SetBuilderAndValidate(builder); + if (string.IsNullOrEmpty(AccountName)) { - throw Errors.SasNamesNotMatching( - nameof(builder.BlobVersionId), - nameof(BlobSasBuilder)); + throw Errors.SasClientMissingData(nameof(AccountName)); } + BlobUriBuilder sasUri = new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) { - Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign) }; return sasUri.ToUri(); } @@ -6847,6 +6972,44 @@ protected internal virtual BlobContainerClient GetParentBlobContainerClientCore( return _parentBlobContainerClient; } #endregion + + private void SetBuilderAndValidate(BlobSasBuilder builder) + { + // Assign builder's ContainerName, BlobName, Snapshot, BlobVersionId, and EncryptionScope if they are null. + builder.BlobContainerName ??= BlobContainerName; + builder.BlobName ??= Name; + builder.Snapshot ??= _snapshot; + builder.BlobVersionId ??= _blobVersionId; + builder.EncryptionScope ??= _clientConfiguration.EncryptionScope; + + // Validate that builder is properly set + if (!builder.BlobContainerName.Equals(BlobContainerName, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.BlobContainerName), + nameof(BlobSasBuilder), + nameof(BlobContainerName)); + } + if (!builder.BlobName.Equals(Name, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.BlobName), + nameof(BlobSasBuilder), + nameof(Name)); + } + if (string.Compare(_snapshot, builder.Snapshot, StringComparison.InvariantCulture) != 0) + { + throw Errors.SasNamesNotMatching( + nameof(builder.Snapshot), + nameof(BlobSasBuilder)); + } + if (string.Compare(_blobVersionId, builder.BlobVersionId, StringComparison.InvariantCulture) != 0) + { + throw Errors.SasNamesNotMatching( + nameof(builder.BlobVersionId), + nameof(BlobSasBuilder)); + } + } } /// diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs index b9167baec00dd..b16cefc83a535 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs @@ -151,7 +151,12 @@ public enum ServiceVersion /// /// The 2024-11-04 service version. /// - V2024_11_04 = 24 + V2024_11_04 = 24, + + /// + /// The 2025-01-05 service version. + /// + V2025_01_05 = 25 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs index 97b6985c51918..8b641d58d2fee 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs @@ -3801,26 +3801,160 @@ public virtual Uri GenerateSasUri(BlobSasBuilder builder, out string stringToSig // Deep copy of builder so we don't modify the user's origial BlobSasBuilder. builder = BlobSasBuilder.DeepCopy(builder); - // Assign builder's ContainerName if it is null. - builder.BlobContainerName ??= Name; - - if (!builder.BlobContainerName.Equals(Name, StringComparison.InvariantCulture)) + SetBuilderAndValidate(builder); + BlobUriBuilder sasUri = new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) { - throw Errors.SasNamesNotMatching( - nameof(builder.BlobContainerName), - nameof(BlobSasBuilder), - nameof(Name)); - } - if (!string.IsNullOrEmpty(builder.BlobName)) + Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + #region GenerateUserDelegationSas + /// + /// The + /// returns a representing a Blob Container Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and parameters passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobContainerSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey) => + GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out _); + + /// + /// The + /// returns a representing a Blob Container Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and parameters passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobContainerSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign) => + GenerateUserDelegationSasUri(new BlobSasBuilder(permissions, expiresOn) { BlobContainerName = Name }, userDelegationKey, out stringToSign); + + /// + /// The + /// returns a representing a Blob Container Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and builder passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey) => + GenerateUserDelegationSasUri(builder, userDelegationKey, out _); + + /// + /// The + /// returns a representing a Blob Container Service + /// Shared Access Signature (SAS) Uri based on the Client properties + /// and builder passed. The SAS is signed by the user delegation key + /// that is passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")] + public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign) + { + builder = builder ?? throw Errors.ArgumentNull(nameof(builder)); + userDelegationKey = userDelegationKey ?? throw Errors.ArgumentNull(nameof(userDelegationKey)); + + // Deep copy of builder so we don't modify the user's origial BlobSasBuilder. + builder = BlobSasBuilder.DeepCopy(builder); + + SetBuilderAndValidate(builder); + if (string.IsNullOrEmpty(AccountName)) { - throw Errors.SasBuilderEmptyParam( - nameof(builder), - nameof(builder.BlobName), - nameof(Constants.Blob.Container.Name)); + throw Errors.SasClientMissingData(nameof(AccountName)); } + BlobUriBuilder sasUri = new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) { - Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign) }; return sasUri.ToUri(); } @@ -3860,6 +3994,28 @@ protected internal virtual BlobServiceClient GetParentBlobServiceClientCore() return _parentBlobServiceClient; } #endregion + + private void SetBuilderAndValidate(BlobSasBuilder builder) + { + // Assign builder's ContainerName if it is null. + builder.BlobContainerName ??= Name; + + // Validate that builder is properly set + if (!builder.BlobContainerName.Equals(Name, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.BlobContainerName), + nameof(BlobSasBuilder), + nameof(Name)); + } + if (!string.IsNullOrEmpty(builder.BlobName)) + { + throw Errors.SasBuilderEmptyParam( + nameof(builder), + nameof(builder.BlobName), + nameof(Constants.Blob.Container.Name)); + } + } } namespace Specialized diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobAppendBlockHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobAppendBlockHeaders.cs index 9303ec3a3d653..48139cc16a682 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobAppendBlockHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobAppendBlockHeaders.cs @@ -35,5 +35,7 @@ public AppendBlobAppendBlockHeaders(Response response) public string EncryptionKeySha256 => _response.Headers.TryGetValue("x-ms-encryption-key-sha256", out string value) ? value : null; /// Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. public string EncryptionScope => _response.Headers.TryGetValue("x-ms-encryption-scope", out string value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobRestClient.cs index 88104aa95bb00..a3d0eca1ec405 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/AppendBlobRestClient.cs @@ -29,7 +29,7 @@ internal partial class AppendBlobRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public AppendBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { @@ -219,7 +219,7 @@ public ResponseWithHeaders Create(long contentLength, i } } - internal HttpMessage CreateAppendBlockRequest(long contentLength, Stream body, int? timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, string leaseId, long? maxSize, long? appendPosition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) + internal HttpMessage CreateAppendBlockRequest(long contentLength, Stream body, int? timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, string leaseId, long? maxSize, long? appendPosition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -285,6 +285,14 @@ internal HttpMessage CreateAppendBlockRequest(long contentLength, Stream body, i request.Headers.Add("x-ms-if-tags", ifTags); } request.Headers.Add("x-ms-version", _version); + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Content-Length", contentLength); if (transactionalContentMD5 != null) @@ -314,16 +322,18 @@ internal HttpMessage CreateAppendBlockRequest(long contentLength, Stream body, i /// Specify an ETag value to operate only on blobs with a matching value. /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public async Task> AppendBlockAsync(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, string leaseId = null, long? maxSize = null, long? appendPosition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public async Task> AppendBlockAsync(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, string leaseId = null, long? maxSize = null, long? appendPosition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateAppendBlockRequest(contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateAppendBlockRequest(contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new AppendBlobAppendBlockHeaders(message.Response); switch (message.Response.Status) @@ -353,16 +363,18 @@ public async Task> AppendBlock /// Specify an ETag value to operate only on blobs with a matching value. /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public ResponseWithHeaders AppendBlock(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, string leaseId = null, long? maxSize = null, long? appendPosition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders AppendBlock(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, string leaseId = null, long? maxSize = null, long? appendPosition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateAppendBlockRequest(contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateAppendBlockRequest(contentLength, body, timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new AppendBlobAppendBlockHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobDownloadHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobDownloadHeaders.cs index ad17079901a72..1897117cb01d8 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobDownloadHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobDownloadHeaders.cs @@ -96,6 +96,10 @@ public BlobDownloadHeaders(Response response) public BlobImmutabilityPolicyMode? ImmutabilityPolicyMode => _response.Headers.TryGetValue("x-ms-immutability-policy-mode", out string value) ? value.ToBlobImmutabilityPolicyMode() : null; /// Indicates if a legal hold is present on the blob. public bool? LegalHold => _response.Headers.TryGetValue("x-ms-legal-hold", out bool? value) ? value : null; + /// Indicates the response body contains a structured message and specifies the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; + /// The length of the blob/file content inside the message body when the response body is returned as a structured message. Will always be smaller than Content-Length. + public long? StructuredContentLength => _response.Headers.TryGetValue("x-ms-structured-content-length", out long? value) ? value : null; /// If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, it will fail with 400(Bad Request). public byte[] ContentCrc64 => _response.Headers.TryGetValue("x-ms-content-crc64", out byte[] value) ? value : null; public string ErrorCode => _response.Headers.TryGetValue("x-ms-error-code", out string value) ? value : null; diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index 615257741b781..2702d622e4bd8 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -30,7 +30,7 @@ internal partial class BlobRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public BlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { @@ -40,7 +40,7 @@ public BlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline _version = version ?? throw new ArgumentNullException(nameof(version)); } - internal HttpMessage CreateDownloadRequest(string snapshot, string versionId, int? timeout, string range, string leaseId, bool? rangeGetContentMD5, bool? rangeGetContentCRC64, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) + internal HttpMessage CreateDownloadRequest(string snapshot, string versionId, int? timeout, string range, string leaseId, bool? rangeGetContentMD5, bool? rangeGetContentCRC64, string structuredBodyType, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -77,6 +77,10 @@ internal HttpMessage CreateDownloadRequest(string snapshot, string versionId, in { request.Headers.Add("x-ms-range-get-content-crc64", rangeGetContentCRC64.Value); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } if (encryptionKey != null) { request.Headers.Add("x-ms-encryption-key", encryptionKey); @@ -122,6 +126,7 @@ internal HttpMessage CreateDownloadRequest(string snapshot, string versionId, in /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. /// When set to true and specified together with the Range, the service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size. + /// Specifies the response content should be returned as a structured message and specifies the message schema version and properties. /// Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. @@ -131,9 +136,9 @@ internal HttpMessage CreateDownloadRequest(string snapshot, string versionId, in /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. /// The cancellation token to use. - public async Task> DownloadAsync(string snapshot = null, string versionId = null, int? timeout = null, string range = null, string leaseId = null, bool? rangeGetContentMD5 = null, bool? rangeGetContentCRC64 = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public async Task> DownloadAsync(string snapshot = null, string versionId = null, int? timeout = null, string range = null, string leaseId = null, bool? rangeGetContentMD5 = null, bool? rangeGetContentCRC64 = null, string structuredBodyType = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) { - using var message = CreateDownloadRequest(snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateDownloadRequest(snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, structuredBodyType, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlobDownloadHeaders(message.Response); switch (message.Response.Status) @@ -159,6 +164,7 @@ public async Task> DownloadAsyn /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. /// When set to true and specified together with the Range, the service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size. + /// Specifies the response content should be returned as a structured message and specifies the message schema version and properties. /// Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. @@ -168,9 +174,9 @@ public async Task> DownloadAsyn /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. /// The cancellation token to use. - public ResponseWithHeaders Download(string snapshot = null, string versionId = null, int? timeout = null, string range = null, string leaseId = null, bool? rangeGetContentMD5 = null, bool? rangeGetContentCRC64 = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Download(string snapshot = null, string versionId = null, int? timeout = null, string range = null, string leaseId = null, bool? rangeGetContentMD5 = null, bool? rangeGetContentCRC64 = null, string structuredBodyType = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) { - using var message = CreateDownloadRequest(snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateDownloadRequest(snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, structuredBodyType, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); _pipeline.Send(message, cancellationToken); var headers = new BlobDownloadHeaders(message.Response); switch (message.Response.Status) @@ -778,7 +784,7 @@ public ResponseWithHeaders SetHttpHeaders(int? timeou } } - internal HttpMessage CreateSetImmutabilityPolicyRequest(int? timeout, DateTimeOffset? ifUnmodifiedSince, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode) + internal HttpMessage CreateSetImmutabilityPolicyRequest(int? timeout, DateTimeOffset? ifUnmodifiedSince, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, string snapshot, string versionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -790,6 +796,14 @@ internal HttpMessage CreateSetImmutabilityPolicyRequest(int? timeout, DateTimeOf { uri.AppendQuery("timeout", timeout.Value, true); } + if (snapshot != null) + { + uri.AppendQuery("snapshot", snapshot, true); + } + if (versionId != null) + { + uri.AppendQuery("versionid", versionId, true); + } request.Uri = uri; request.Headers.Add("x-ms-version", _version); if (ifUnmodifiedSince != null) @@ -813,10 +827,12 @@ internal HttpMessage CreateSetImmutabilityPolicyRequest(int? timeout, DateTimeOf /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Specifies the date time when the blobs immutability policy is set to expire. /// Specifies the immutability policy mode to set on the blob. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public async Task> SetImmutabilityPolicyAsync(int? timeout = null, DateTimeOffset? ifUnmodifiedSince = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, CancellationToken cancellationToken = default) + public async Task> SetImmutabilityPolicyAsync(int? timeout = null, DateTimeOffset? ifUnmodifiedSince = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateSetImmutabilityPolicyRequest(timeout, ifUnmodifiedSince, immutabilityPolicyExpiry, immutabilityPolicyMode); + using var message = CreateSetImmutabilityPolicyRequest(timeout, ifUnmodifiedSince, immutabilityPolicyExpiry, immutabilityPolicyMode, snapshot, versionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlobSetImmutabilityPolicyHeaders(message.Response); switch (message.Response.Status) @@ -833,10 +849,12 @@ public async Task> SetImmu /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Specifies the date time when the blobs immutability policy is set to expire. /// Specifies the immutability policy mode to set on the blob. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public ResponseWithHeaders SetImmutabilityPolicy(int? timeout = null, DateTimeOffset? ifUnmodifiedSince = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders SetImmutabilityPolicy(int? timeout = null, DateTimeOffset? ifUnmodifiedSince = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateSetImmutabilityPolicyRequest(timeout, ifUnmodifiedSince, immutabilityPolicyExpiry, immutabilityPolicyMode); + using var message = CreateSetImmutabilityPolicyRequest(timeout, ifUnmodifiedSince, immutabilityPolicyExpiry, immutabilityPolicyMode, snapshot, versionId); _pipeline.Send(message, cancellationToken); var headers = new BlobSetImmutabilityPolicyHeaders(message.Response); switch (message.Response.Status) @@ -848,7 +866,7 @@ public ResponseWithHeaders SetImmutabilityPoli } } - internal HttpMessage CreateDeleteImmutabilityPolicyRequest(int? timeout) + internal HttpMessage CreateDeleteImmutabilityPolicyRequest(int? timeout, string snapshot, string versionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -860,6 +878,14 @@ internal HttpMessage CreateDeleteImmutabilityPolicyRequest(int? timeout) { uri.AppendQuery("timeout", timeout.Value, true); } + if (snapshot != null) + { + uri.AppendQuery("snapshot", snapshot, true); + } + if (versionId != null) + { + uri.AppendQuery("versionid", versionId, true); + } request.Uri = uri; request.Headers.Add("x-ms-version", _version); request.Headers.Add("Accept", "application/xml"); @@ -868,10 +894,12 @@ internal HttpMessage CreateDeleteImmutabilityPolicyRequest(int? timeout) /// The Delete Immutability Policy operation deletes the immutability policy on the blob. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public async Task> DeleteImmutabilityPolicyAsync(int? timeout = null, CancellationToken cancellationToken = default) + public async Task> DeleteImmutabilityPolicyAsync(int? timeout = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateDeleteImmutabilityPolicyRequest(timeout); + using var message = CreateDeleteImmutabilityPolicyRequest(timeout, snapshot, versionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlobDeleteImmutabilityPolicyHeaders(message.Response); switch (message.Response.Status) @@ -885,10 +913,12 @@ public async Task> Dele /// The Delete Immutability Policy operation deletes the immutability policy on the blob. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public ResponseWithHeaders DeleteImmutabilityPolicy(int? timeout = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders DeleteImmutabilityPolicy(int? timeout = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateDeleteImmutabilityPolicyRequest(timeout); + using var message = CreateDeleteImmutabilityPolicyRequest(timeout, snapshot, versionId); _pipeline.Send(message, cancellationToken); var headers = new BlobDeleteImmutabilityPolicyHeaders(message.Response); switch (message.Response.Status) @@ -900,7 +930,7 @@ public ResponseWithHeaders DeleteImmutabili } } - internal HttpMessage CreateSetLegalHoldRequest(bool legalHold, int? timeout) + internal HttpMessage CreateSetLegalHoldRequest(bool legalHold, int? timeout, string snapshot, string versionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -912,6 +942,14 @@ internal HttpMessage CreateSetLegalHoldRequest(bool legalHold, int? timeout) { uri.AppendQuery("timeout", timeout.Value, true); } + if (snapshot != null) + { + uri.AppendQuery("snapshot", snapshot, true); + } + if (versionId != null) + { + uri.AppendQuery("versionid", versionId, true); + } request.Uri = uri; request.Headers.Add("x-ms-version", _version); request.Headers.Add("x-ms-legal-hold", legalHold); @@ -922,10 +960,12 @@ internal HttpMessage CreateSetLegalHoldRequest(bool legalHold, int? timeout) /// The Set Legal Hold operation sets a legal hold on the blob. /// Specified if a legal hold should be set on the blob. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public async Task> SetLegalHoldAsync(bool legalHold, int? timeout = null, CancellationToken cancellationToken = default) + public async Task> SetLegalHoldAsync(bool legalHold, int? timeout = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateSetLegalHoldRequest(legalHold, timeout); + using var message = CreateSetLegalHoldRequest(legalHold, timeout, snapshot, versionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlobSetLegalHoldHeaders(message.Response); switch (message.Response.Status) @@ -940,10 +980,12 @@ public async Task> SetLegalHoldAsyn /// The Set Legal Hold operation sets a legal hold on the blob. /// Specified if a legal hold should be set on the blob. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + /// The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. /// The cancellation token to use. - public ResponseWithHeaders SetLegalHold(bool legalHold, int? timeout = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders SetLegalHold(bool legalHold, int? timeout = null, string snapshot = null, string versionId = null, CancellationToken cancellationToken = default) { - using var message = CreateSetLegalHoldRequest(legalHold, timeout); + using var message = CreateSetLegalHoldRequest(legalHold, timeout, snapshot, versionId); _pipeline.Send(message, cancellationToken); var headers = new BlobSetLegalHoldHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobRestClient.cs index 0723c07204ac2..78ef424f66b13 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobRestClient.cs @@ -30,7 +30,7 @@ internal partial class BlockBlobRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public BlockBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { @@ -40,7 +40,7 @@ public BlockBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pip _version = version ?? throw new ArgumentNullException(nameof(version)); } - internal HttpMessage CreateUploadRequest(long contentLength, Stream body, int? timeout, byte[] transactionalContentMD5, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, string blobCacheControl, IDictionary metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, AccessTier? tier, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string blobTagsString, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, bool? legalHold, byte[] transactionalContentCrc64) + internal HttpMessage CreateUploadRequest(long contentLength, Stream body, int? timeout, byte[] transactionalContentMD5, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, string blobCacheControl, IDictionary metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, AccessTier? tier, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string blobTagsString, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, bool? legalHold, byte[] transactionalContentCrc64, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -146,6 +146,14 @@ internal HttpMessage CreateUploadRequest(long contentLength, Stream body, int? t { request.Headers.Add("x-ms-content-crc64", transactionalContentCrc64, "D"); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/xml"); if (transactionalContentMD5 != null) { @@ -185,16 +193,18 @@ internal HttpMessage CreateUploadRequest(long contentLength, Stream body, int? t /// Specifies the immutability policy mode to set on the blob. /// Specified if a legal hold should be set on the blob. /// Specify the transactional crc64 for the body, to be validated by the service. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public async Task> UploadAsync(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, AccessTier? tier = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, bool? legalHold = null, byte[] transactionalContentCrc64 = null, CancellationToken cancellationToken = default) + public async Task> UploadAsync(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, AccessTier? tier = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, bool? legalHold = null, byte[] transactionalContentCrc64 = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUploadRequest(contentLength, body, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64); + using var message = CreateUploadRequest(contentLength, body, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlockBlobUploadHeaders(message.Response); switch (message.Response.Status) @@ -234,16 +244,18 @@ public async Task> UploadAsync(long /// Specifies the immutability policy mode to set on the blob. /// Specified if a legal hold should be set on the blob. /// Specify the transactional crc64 for the body, to be validated by the service. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public ResponseWithHeaders Upload(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, AccessTier? tier = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, bool? legalHold = null, byte[] transactionalContentCrc64 = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Upload(long contentLength, Stream body, int? timeout = null, byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, AccessTier? tier = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = null, BlobImmutabilityPolicyMode? immutabilityPolicyMode = null, bool? legalHold = null, byte[] transactionalContentCrc64 = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUploadRequest(contentLength, body, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64); + using var message = CreateUploadRequest(contentLength, body, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new BlockBlobUploadHeaders(message.Response); switch (message.Response.Status) @@ -494,7 +506,7 @@ public ResponseWithHeaders PutBlobFromUrl(long c } } - internal HttpMessage CreateStageBlockRequest(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope) + internal HttpMessage CreateStageBlockRequest(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -533,6 +545,14 @@ internal HttpMessage CreateStageBlockRequest(string blockId, long contentLength, request.Headers.Add("x-ms-encryption-scope", encryptionScope); } request.Headers.Add("x-ms-version", _version); + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Content-Length", contentLength); if (transactionalContentMD5 != null) @@ -556,9 +576,11 @@ internal HttpMessage CreateStageBlockRequest(string blockId, long contentLength, /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. /// Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the default account encryption scope. For more information, see Encryption at Rest for Azure Storage Services. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// or is null. - public async Task> StageBlockAsync(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, CancellationToken cancellationToken = default) + public async Task> StageBlockAsync(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (blockId == null) { @@ -569,7 +591,7 @@ public async Task> StageBlockAsy throw new ArgumentNullException(nameof(body)); } - using var message = CreateStageBlockRequest(blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope); + using var message = CreateStageBlockRequest(blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new BlockBlobStageBlockHeaders(message.Response); switch (message.Response.Status) @@ -593,9 +615,11 @@ public async Task> StageBlockAsy /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. /// Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the default account encryption scope. For more information, see Encryption at Rest for Azure Storage Services. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// or is null. - public ResponseWithHeaders StageBlock(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders StageBlock(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (blockId == null) { @@ -606,7 +630,7 @@ public ResponseWithHeaders StageBlock(string blockId throw new ArgumentNullException(nameof(body)); } - using var message = CreateStageBlockRequest(blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope); + using var message = CreateStageBlockRequest(blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new BlockBlobStageBlockHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobStageBlockHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobStageBlockHeaders.cs index 7888b27dd7383..b13a3b7d1609a 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobStageBlockHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobStageBlockHeaders.cs @@ -29,5 +29,7 @@ public BlockBlobStageBlockHeaders(Response response) public string EncryptionKeySha256 => _response.Headers.TryGetValue("x-ms-encryption-key-sha256", out string value) ? value : null; /// Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. public string EncryptionScope => _response.Headers.TryGetValue("x-ms-encryption-scope", out string value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobUploadHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobUploadHeaders.cs index 1cfbd3924fa55..ca024b1fb5d84 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobUploadHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlockBlobUploadHeaders.cs @@ -31,5 +31,7 @@ public BlockBlobUploadHeaders(Response response) public string EncryptionKeySha256 => _response.Headers.TryGetValue("x-ms-encryption-key-sha256", out string value) ? value : null; /// Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. public string EncryptionScope => _response.Headers.TryGetValue("x-ms-encryption-scope", out string value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs index 024bfecd4e90b..9dd20ee7e1811 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs @@ -31,7 +31,7 @@ internal partial class ContainerRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public ContainerRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/Models/BlobErrorCode.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/Models/BlobErrorCode.cs index e48c18188c686..57e03c5078ef5 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/Models/BlobErrorCode.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/Models/BlobErrorCode.cs @@ -135,6 +135,7 @@ public BlobErrorCode(string value) private const string AuthorizationPermissionMismatchValue = "AuthorizationPermissionMismatch"; private const string AuthorizationServiceMismatchValue = "AuthorizationServiceMismatch"; private const string AuthorizationResourceTypeMismatchValue = "AuthorizationResourceTypeMismatch"; + private const string BlobAccessTierNotSupportedForAccountTypeValue = "BlobAccessTierNotSupportedForAccountType"; /// AccountAlreadyExists. public static BlobErrorCode AccountAlreadyExists { get; } = new BlobErrorCode(AccountAlreadyExistsValue); @@ -362,6 +363,8 @@ public BlobErrorCode(string value) public static BlobErrorCode AuthorizationServiceMismatch { get; } = new BlobErrorCode(AuthorizationServiceMismatchValue); /// AuthorizationResourceTypeMismatch. public static BlobErrorCode AuthorizationResourceTypeMismatch { get; } = new BlobErrorCode(AuthorizationResourceTypeMismatchValue); + /// BlobAccessTierNotSupportedForAccountType. + public static BlobErrorCode BlobAccessTierNotSupportedForAccountType { get; } = new BlobErrorCode(BlobAccessTierNotSupportedForAccountTypeValue); /// Determines if two values are the same. public static bool operator ==(BlobErrorCode left, BlobErrorCode right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobRestClient.cs index 260d8021543e2..68a9e85b00d1b 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobRestClient.cs @@ -30,7 +30,7 @@ internal partial class PageBlobRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public PageBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { @@ -235,7 +235,7 @@ public ResponseWithHeaders Create(long contentLength, lon } } - internal HttpMessage CreateUploadPagesRequest(long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string range, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, long? ifSequenceNumberLessThanOrEqualTo, long? ifSequenceNumberLessThan, long? ifSequenceNumberEqualTo, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) + internal HttpMessage CreateUploadPagesRequest(long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string range, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, long? ifSequenceNumberLessThanOrEqualTo, long? ifSequenceNumberLessThan, long? ifSequenceNumberEqualTo, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -310,6 +310,14 @@ internal HttpMessage CreateUploadPagesRequest(long contentLength, Stream body, b request.Headers.Add("x-ms-if-tags", ifTags); } request.Headers.Add("x-ms-version", _version); + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Content-Length", contentLength); if (transactionalContentMD5 != null) @@ -341,16 +349,18 @@ internal HttpMessage CreateUploadPagesRequest(long contentLength, Stream body, b /// Specify an ETag value to operate only on blobs with a matching value. /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public async Task> UploadPagesAsync(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = null, long? ifSequenceNumberLessThan = null, long? ifSequenceNumberEqualTo = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public async Task> UploadPagesAsync(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = null, long? ifSequenceNumberLessThan = null, long? ifSequenceNumberEqualTo = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUploadPagesRequest(contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateUploadPagesRequest(contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new PageBlobUploadPagesHeaders(message.Response); switch (message.Response.Status) @@ -382,16 +392,18 @@ public async Task> UploadPagesAs /// Specify an ETag value to operate only on blobs with a matching value. /// Specify an ETag value to operate only on blobs without a matching value. /// Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public ResponseWithHeaders UploadPages(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = null, long? ifSequenceNumberLessThan = null, long? ifSequenceNumberEqualTo = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders UploadPages(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = null, string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = null, long? ifSequenceNumberLessThan = null, long? ifSequenceNumberEqualTo = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUploadPagesRequest(contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); + using var message = CreateUploadPagesRequest(contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new PageBlobUploadPagesHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobUploadPagesHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobUploadPagesHeaders.cs index 77d37d90027aa..c04659bc43322 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobUploadPagesHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/PageBlobUploadPagesHeaders.cs @@ -33,5 +33,7 @@ public PageBlobUploadPagesHeaders(Response response) public string EncryptionKeySha256 => _response.Headers.TryGetValue("x-ms-encryption-key-sha256", out string value) ? value : null; /// Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. public string EncryptionScope => _response.Headers.TryGetValue("x-ms-encryption-scope", out string value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs index e274940f81e8d..2abac369c0cae 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs @@ -31,7 +31,7 @@ internal partial class ServiceRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-08-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { diff --git a/sdk/storage/Azure.Storage.Blobs/src/autorest.md b/sdk/storage/Azure.Storage.Blobs/src/autorest.md index 85fb92c2349cd..6c18c66066ebd 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/autorest.md +++ b/sdk/storage/Azure.Storage.Blobs/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f6f50c6388fd5836fa142384641b8353a99874ef/specification/storage/data-plane/Microsoft.BlobStorage/stable/2024-08-04/blob.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json generation1-convenience-client: true # https://github.com/Azure/autorest/issues/4075 skip-semantics-validation: true diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 34aad0482c142..8e51aa708c24b 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -7668,6 +7668,605 @@ public async Task GenerateSas_TrimBlobSlashes() } #endregion + #region GenerateUserDelegationSasTests + [RecordedTest] + public async Task GenerateUserDelegationSas_RequiredParameters() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_Builder() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + StartsOn = startsOn + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNull() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(null, userDelegationKey, out stringToSign), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + StartsOn = startsOn + }; + + string stringToSign = null; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(sasBuilder, null, out stringToSign), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullContainerName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobName = GetNewBlobName(); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = null, + BlobName = blobName, + Resource = "b" + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongContainerName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobName = GetNewBlobName(); + string containerName = GetNewContainerName(); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(new Uri($"https://{constants.Sas.Account}.blob.core.windows.net")) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = GetNewContainerName(), // set a different containerName + BlobName = blobName, + Resource = "b" + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. BlobSasBuilder.BlobContainerName does not match BlobContainerName in the Client. BlobSasBuilder.BlobContainerName must either be left empty or match the BlobContainerName in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullBlobName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobName = GetNewBlobName(); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = null, + Resource = "b", + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + StartsOn = startsOn + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongBlobName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(new Uri($"https://{constants.Sas.Account}.blob.core.windows.net")) + { + BlobContainerName = containerName, + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = GetNewBlobName(), // set a different blobName + Resource = "b" + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. BlobSasBuilder.BlobName does not match Name in the Client. BlobSasBuilder.BlobName must either be left empty or match the Name in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullSnapshot() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobName = GetNewBlobName(); + string containerName = GetNewContainerName(); + string snapshot = "2020-07-03T12:45:46.1234567Z"; + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Snapshot = snapshot + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + Snapshot = null, + Resource = "b", + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + Snapshot = snapshot, + StartsOn = startsOn + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + Snapshot = snapshot, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongSnapshot() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string snapshot = "2020-07-03T12:45:46.1234567Z"; + string differentSnapshot = "2019-07-03T12:45:46.1234567Z"; + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(new Uri($"https://{constants.Sas.Account}.blob.core.windows.net")) + { + BlobContainerName = containerName, + BlobName = blobName, + Snapshot = snapshot + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + Resource = "bs", + Snapshot = differentSnapshot + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. BlobSasBuilder.Snapshot does not match snapshot value in the URI in the Client. BlobSasBuilder.Snapshot must either be left empty or match the snapshot value in the URI in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullVersion() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobName = GetNewBlobName(); + string containerName = GetNewContainerName(); + string versionId = "2020-07-03T12:45:46.1234567Z"; + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + VersionId = versionId + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + BlobVersionId = null, + Resource = "b", + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + BlobVersionId = versionId, + StartsOn = startsOn + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName, + VersionId = versionId, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongVersion() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string blobVersionId = "2020-07-03T12:45:46.1234567Z"; + string diffBlobVersionId = "2019-07-03T12:45:46.1234567Z"; + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri blobEndpoint = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(blobEndpoint) + { + BlobContainerName = containerName, + BlobName = blobName, + VersionId = blobVersionId + }; + + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName, + Resource = "bs", + BlobVersionId = diffBlobVersionId, + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => blobClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. BlobSasBuilder.BlobVersionId does not match snapshot value in the URI in the Client. BlobSasBuilder.BlobVersionId must either be left empty or match the snapshot value in the URI in the Client")); + } + + [LiveOnly] + public async Task GenerateUserDelegationSas_TrimBlobSlashes() + { + // Arrange + BlobServiceClient serviceClient = GetServiceClient_OAuth(); + await using DisposingContainer test = await GetTestContainerAsync( + service: serviceClient); + string containerName = test.Container.Name; + string blobName = $"/{GetNewBlobName()}"; + + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(test.Container.Uri, false) + { + BlobContainerName = containerName, + BlobName = blobName, + }; + + // Set up options with TrimBlobNameSlashes set to false + BlobClientOptions options = GetOptions(); + options.TrimBlobNameSlashes = false; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + AppendBlobClient createClient = InstrumentClient(new AppendBlobClient( + blobUriBuilder.ToUri(), + TestEnvironment.Credential, + options)); + + await createClient.CreateAsync(); + + string stringToSign = null; + Response userDelegationKeyResponse = await serviceClient.GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + BlobBaseClient blobClient = InstrumentClient(new BlobBaseClient( + blobUriBuilder.ToUri(), + options)); + + Uri sasUri = blobClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(test.Container.Uri, false) + { + BlobContainerName = containerName, + BlobName = blobName, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, blobClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + + BlobBaseClient sasClient = InstrumentClient(new BlobBaseClient(sasUri, options)); + Assert.IsTrue(await sasClient.ExistsAsync()); + } + #endregion + [Test] [TestCase(null, false)] [TestCase("ContainerNotFound", true)] diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs index bb82aeae55ff2..d0372ab20cf47 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs @@ -35,6 +35,7 @@ public BlobsClientTestFixtureAttribute(params object[] additionalParameters) BlobClientOptions.ServiceVersion.V2024_05_04, BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, + BlobClientOptions.ServiceVersion.V2025_01_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs index f1e69e70bb4e5..451586836669f 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs @@ -3659,6 +3659,269 @@ public void GenerateSas_BuilderWrongName() } #endregion + #region GenerateUserDelegationSas + [RecordedTest] + public async Task GenerateUserDelegationSas_RequiredParameters() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + }; + BlobContainerSasPermissions permissions = BlobContainerSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = InstrumentClient( + new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + //Act + Uri sasUri = containerClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, containerClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_Builder() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName + }; + BlobContainerSasPermissions permissions = BlobContainerSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = + InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = containerClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, containerClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNull() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName + }; + BlobContainerClient containerClient = + InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => containerClient.GenerateUserDelegationSasUri(null, userDelegationKey, out stringToSign), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName + }; + BlobContainerSasPermissions permissions = BlobContainerSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = + InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName + }; + + string stringToSign = null; + + // Act + TestHelper.AssertExpectedException( + () => containerClient.GenerateUserDelegationSasUri(sasBuilder, null, out stringToSign), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullName() + { + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName + }; + BlobContainerSasPermissions permissions = BlobContainerSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = + InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = null + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = containerClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + BlobSasBuilder sasBuilder2 = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName + }; + BlobUriBuilder expectedUri = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, containerClient.AccountName) + }; + + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = GetNewContainerName(), // set a different containerName + Resource = "b" + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => containerClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. BlobSasBuilder.BlobContainerName does not match Name in the Client. BlobSasBuilder.BlobContainerName must either be left empty or match the Name in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIncorrectlySettingBlobName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string containerName = GetNewContainerName(); + string blobName = GetNewBlobName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.blob.core.windows.net"); + BlobUriBuilder blobUriBuilder = new BlobUriBuilder(serviceUri) + { + BlobContainerName = containerName, + BlobName = blobName + }; + BlobSasPermissions permissions = BlobSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + BlobContainerClient containerClient = InstrumentClient(new BlobContainerClient( + blobUriBuilder.ToUri(), + GetOptions())); + + BlobSasBuilder sasBuilder = new BlobSasBuilder(permissions, expiresOn) + { + BlobContainerName = containerName, + BlobName = blobName + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => containerClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign), + new InvalidOperationException("SAS Uri cannot be generated. builder.BlobName cannot be set to create a Name SAS.")); + } + #endregion + [RecordedTest] public void CanMockBlobClientsRetrieval() { diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ImmutableStorageWithVersioningTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ImmutableStorageWithVersioningTests.cs index 3eac647db9cf8..af473b946047f 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ImmutableStorageWithVersioningTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ImmutableStorageWithVersioningTests.cs @@ -562,6 +562,92 @@ public async Task DeleteImmutibilityPolicyAsync() Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); } + [Test] + [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] + public async Task SetDeleteImmutibilityPolicyAsync_Snapshot() + { + // Arrange + BlobBaseClient blob = await GetNewBlobClient(_containerClient); + + Response createSnapshotResponse = await blob.CreateSnapshotAsync(); + BlobBaseClient snapshotClient = blob.WithSnapshot(createSnapshotResponse.Value.Snapshot); + try + { + BlobImmutabilityPolicy immutabilityPolicy = new BlobImmutabilityPolicy + { + ExpiresOn = Recording.UtcNow.AddSeconds(5), + PolicyMode = BlobImmutabilityPolicyMode.Unlocked + }; + + // Act + await snapshotClient.SetImmutabilityPolicyAsync(immutabilityPolicy); + + // Assert that the base blob does not have an immutability policy. + Response propertiesResponse = await blob.GetPropertiesAsync(); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + + // Assert that the blob snapshot has an immuability policy. + propertiesResponse = await snapshotClient.GetPropertiesAsync(); + Assert.IsNotNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNotNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + + await snapshotClient.DeleteImmutabilityPolicyAsync(); + + // Assert + propertiesResponse = await snapshotClient.GetPropertiesAsync(); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + } + finally + { + await snapshotClient.DeleteAsync(); + } + } + + [Test] + [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] + public async Task SetDeleteImmutibilityPolicyAsync_BlobVersion() + { + // Arrange + BlobBaseClient blob = await GetNewBlobClient(_containerClient); + + IDictionary metadata = BuildMetadata(); + + // Create Blob Version + Response setMetadataResponse = await blob.SetMetadataAsync(metadata); + BlobBaseClient versionClient = blob.WithVersion(setMetadataResponse.Value.VersionId); + + // Create another blob Version + await blob.SetMetadataAsync(new Dictionary()); + + BlobImmutabilityPolicy immutabilityPolicy = new BlobImmutabilityPolicy + { + ExpiresOn = Recording.UtcNow.AddSeconds(5), + PolicyMode = BlobImmutabilityPolicyMode.Unlocked + }; + + // Act + await versionClient.SetImmutabilityPolicyAsync(immutabilityPolicy); + + // Assert that the base blob does not have an immutability policy + Response propertiesResponse = await blob.GetPropertiesAsync(); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + + // Assert that the blob version does have an immutability policy + propertiesResponse = await versionClient.GetPropertiesAsync(); + Assert.IsNotNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNotNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + + await versionClient.DeleteImmutabilityPolicyAsync(); + + // Assert blob version does not have an immutability policy + propertiesResponse = await versionClient.GetPropertiesAsync(); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.ExpiresOn); + Assert.IsNull(propertiesResponse.Value.ImmutabilityPolicy.PolicyMode); + } + [Test] [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] public async Task DeleteImmutibilityPolicyAsync_Error() @@ -621,6 +707,67 @@ public async Task SetLegalHoldAsync() Assert.IsFalse(response.Value.HasLegalHold); } + [Test] + [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] + public async Task SetLegalHoldAsync_Snapshot() + { + // Arrange + BlobBaseClient blob = await GetNewBlobClient(_containerClient); + + Response createSnapshotResponse = await blob.CreateSnapshotAsync(); + BlobBaseClient snapshotClient = blob.WithSnapshot(createSnapshotResponse.Value.Snapshot); + + try + { + // Act + await snapshotClient.SetLegalHoldAsync(true); + + // Assert the blob snapshot has a legal hold + Response propertiesResponse = await snapshotClient.GetPropertiesAsync(); + Assert.IsTrue(propertiesResponse.Value.HasLegalHold); + + // Assert the base blob does not have a legal hold + propertiesResponse = await blob.GetPropertiesAsync(); + Assert.IsFalse(propertiesResponse.Value.HasLegalHold); + + await snapshotClient.SetLegalHoldAsync(false); + } + finally + { + await snapshotClient.DeleteAsync(); + } + } + + [Test] + [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] + public async Task SetLegalHoldAsync_BlobVersion() + { + // Arrange + BlobBaseClient blob = await GetNewBlobClient(_containerClient); + + IDictionary metadata = BuildMetadata(); + + // Create Blob Version + Response setMetadataResponse = await blob.SetMetadataAsync(metadata); + BlobBaseClient versionClient = blob.WithVersion(setMetadataResponse.Value.VersionId); + + // Create another blob Version + await blob.SetMetadataAsync(new Dictionary()); + + // Act + await versionClient.SetLegalHoldAsync(true); + + // Assert the blob version has a legal hold + Response propertiesResponse = await versionClient.GetPropertiesAsync(); + Assert.IsTrue(propertiesResponse.Value.HasLegalHold); + + // Assert the base blob does not have a legal hold + propertiesResponse = await blob.GetPropertiesAsync(); + Assert.IsFalse(propertiesResponse.Value.HasLegalHold); + + await versionClient.SetLegalHoldAsync(false); + } + [Test] [ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2020_06_12)] public async Task SetLegalHoldAsync_Error() diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index b45093ef4fdce..aad2683bdfb5b 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.22.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- This release contains bug fixes to improve quality. ## 12.21.0 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs index 39ffce6f73614..121838723ee4f 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs @@ -183,7 +183,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2024-11-04"; + public const string DefaultSasVersion = "2025-01-05"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs index 55ce1a3aa640e..9b59550e809d0 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs @@ -182,7 +182,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2024-11-04"; + public const string DefaultSasVersion = "2025-01-05"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs index f8ddc5731affb..3e00882188fba 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs @@ -25,7 +25,7 @@ internal static class Constants /// Gets the default service version to use when building shared access /// signatures. /// - public const string DefaultSasVersion = "2024-11-04"; + public const string DefaultSasVersion = "2025-01-05"; /// /// Max download range size while requesting a transactional hash. diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Errors.Clients.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Errors.Clients.cs index 4e5464fa17e6e..2a5fe38668104 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/Errors.Clients.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/Errors.Clients.cs @@ -78,7 +78,7 @@ public static InvalidOperationException SasBuilderEmptyParam(string builderName, => new InvalidOperationException($"SAS Uri cannot be generated. {builderName}.{paramName} cannot be set to create a {sasType} SAS."); public static InvalidOperationException SasIncorrectResourceType(string builderName, string builderParam, string value, string clientName) - => new InvalidOperationException($"SAS Uri cannot be generated. Expected {builderName}.{builderParam} to be set to {value} to generate" + + => new InvalidOperationException($"SAS Uri cannot be generated. Expected {builderName}.{builderParam} to be set to {value} to generate " + $"the respective SAS for the client, {clientName}"); public static ArgumentException InvalidPermission(char s) diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs index 979dbbcf20ddc..44c0973ea9be1 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs @@ -46,7 +46,7 @@ internal static class StorageVersionExtensions /// public const ServiceVersion LatestVersion = #if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK - ServiceVersion.V2024_11_04; + ServiceVersion.V2025_01_05; #else ERROR_STORAGE_SERVICE_NOT_DEFINED; #endif @@ -56,7 +56,7 @@ internal static class StorageVersionExtensions /// internal const ServiceVersion MaxVersion = #if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK - ServiceVersion.V2024_11_04; + ServiceVersion.V2025_01_05; #else ERROR_STORAGE_SERVICE_NOT_DEFINED; #endif @@ -69,32 +69,7 @@ internal static class StorageVersionExtensions public static string ToVersionString(this ServiceVersion version) => version switch { -#if BlobSDK || FileSDK || DataLakeSDK - ServiceVersion.V2019_02_02 => "2019-02-02", - ServiceVersion.V2019_07_07 => "2019-07-07", - ServiceVersion.V2019_12_12 => "2019-12-12", - ServiceVersion.V2020_02_10 => "2020-02-10", - ServiceVersion.V2020_04_08 => "2020-04-08", - ServiceVersion.V2020_06_12 => "2020-06-12", - ServiceVersion.V2020_08_04 => "2020-08-04", - ServiceVersion.V2020_10_02 => "2020-10-02", - ServiceVersion.V2020_12_06 => "2020-12-06", - ServiceVersion.V2021_02_12 => "2021-02-12", - ServiceVersion.V2021_04_10 => "2021-04-10", - ServiceVersion.V2021_06_08 => "2021-06-08", - ServiceVersion.V2021_08_06 => "2021-08-06", - ServiceVersion.V2021_10_04 => "2021-10-04", - ServiceVersion.V2021_12_02 => "2021-12-02", - ServiceVersion.V2022_11_02 => "2022-11-02", - ServiceVersion.V2023_01_03 => "2023-01-03", - ServiceVersion.V2023_05_03 => "2023-05-03", - ServiceVersion.V2023_08_03 => "2023-08-03", - ServiceVersion.V2023_11_03 => "2023-11-03", - ServiceVersion.V2024_02_04 => "2024-02-04", - ServiceVersion.V2024_05_04 => "2024-05-04", - ServiceVersion.V2024_08_04 => "2024-08-04", - ServiceVersion.V2024_11_04 => "2024-11-04", -#elif QueueSDK +#if BlobSDK || FileSDK || DataLakeSDK || QueueSDK ServiceVersion.V2019_02_02 => "2019-02-02", ServiceVersion.V2019_07_07 => "2019-07-07", ServiceVersion.V2019_12_12 => "2019-12-12", @@ -119,6 +94,7 @@ public static string ToVersionString(this ServiceVersion version) => ServiceVersion.V2024_05_04 => "2024-05-04", ServiceVersion.V2024_08_04 => "2024-08-04", ServiceVersion.V2024_11_04 => "2024-11-04", + ServiceVersion.V2025_01_05 => "2025-01-05", #endif _ => throw Errors.VersionNotSupported(nameof(version)) }; @@ -180,6 +156,8 @@ public static Azure.Storage.Blobs.BlobClientOptions.ServiceVersion AsBlobsVersio Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_08_04, Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2024_11_04 => Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04, + Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05 => + Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05, _ => throw Errors.VersionNotSupported(nameof(version)) }; #endif diff --git a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs index 42d3ed10c84ba..5694c805d3550 100644 --- a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs +++ b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs @@ -34,8 +34,9 @@ namespace Azure.Storage.Test BlobClientOptions.ServiceVersion.V2024_05_04, BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, - RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2024_11_04, - LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2024_08_04, })] + BlobClientOptions.ServiceVersion.V2025_01_05, + RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2025_01_05, + LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2024_11_04, })] public abstract class CommonTestBase : StorageTestBase { protected readonly BlobClientOptions.ServiceVersion _serviceVersion; diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Shared/DisposingShare.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Shared/DisposingShare.cs index ec0d618c397d5..b703b5cdb55cf 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Shared/DisposingShare.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Shared/DisposingShare.cs @@ -18,7 +18,7 @@ public class DisposingShare : IDisposingContainer public static async Task CreateAsync(ShareClient share, IDictionary metadata) { - ShareCreateOptions options = new ShareCreateOptions + BaseShares::Azure.Storage.Files.Shares.Models.ShareCreateOptions options = new() { Metadata = metadata }; diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index 72b41ecd74dbd..33308a624cadd 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -3,12 +3,10 @@ ## 12.21.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-01-05. +- Added GenerateUserDelegationSasUri() for DataLakePathClient, DataLakeFileSystemClient, and DataLakeDirectoryClient +- Deprecated Read()/ReadAsync() in favor of ReadStreaming()/ReadStreamingAsync() and ReadContent()/ReadContentAsync() for DataLake #45418 +- Added GenerateUserDelegationSasUri() to DataLakeFileSystemClient, DataLakePathClient, DataLakeDirectoryClient, and DataLakeFileClient. ## 12.20.0 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/README.md b/sdk/storage/Azure.Storage.Files.DataLake/README.md index 249a5c0dced06..e5136a042ff56 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/README.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/README.md @@ -156,6 +156,18 @@ file.Flush(SampleFileContent.Length); Response fileContents = file.Read(); ``` +### Reading Streaming Data from a DataLake File +```C# Snippet:SampleSnippetDataLakeFileClient_ReadStreaming +Response fileContents = file.ReadStreaming(); +Stream readStream = fileContents.Value.Content; +``` + +### Reading Content Data from a DataLake File +```C# Snippet:SampleSnippetDataLakeFileClient_ReadContent +Response fileContents = file.ReadContent(); +BinaryData readData = fileContents.Value.Content; +``` + ### Listing/Traversing through a DataLake Filesystem ```C# Snippet:SampleSnippetDataLakeFileClient_List foreach (PathItem pathItem in filesystem.GetPaths()) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs index efd9e87cdaeff..c5b8a7798a0cf 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2024_11_04) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } } public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -35,6 +35,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient @@ -88,6 +89,12 @@ public DataLakeDirectoryClient(System.Uri directoryUri, Azure.Storage.StorageSha public override System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public override Azure.Response GetAccessControl(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override System.Threading.Tasks.Task> GetAccessControlAsync(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Storage.Files.DataLake.DataLakeFileClient GetFileClient(string fileName) { throw null; } @@ -170,16 +177,34 @@ public DataLakeFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCred public virtual System.Threading.Tasks.Task OpenWriteAsync(bool overwrite, Azure.Storage.Files.DataLake.Models.DataLakeFileOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Query(string querySqlExpression, Azure.Storage.Files.DataLake.Models.DataLakeQueryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> QueryAsync(string querySqlExpression, Azure.Storage.Files.DataLake.Models.DataLakeQueryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(Azure.HttpRange range, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, bool rangeGetContentHash, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(Azure.HttpRange range, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, bool rangeGetContentHash, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadContent() { throw null; } + public virtual Azure.Response ReadContent(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadContent(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync() { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response ReadStreaming() { throw null; } + public virtual Azure.Response ReadStreaming(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadStreaming(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync() { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response ReadTo(System.IO.Stream destination, Azure.Storage.Files.DataLake.Models.DataLakeFileReadToOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response ReadTo(System.IO.Stream destination, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, Azure.Storage.StorageTransferOptions transferOptions, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -283,6 +308,12 @@ public DataLakeFileSystemClient(System.Uri fileSystemUri, Azure.Storage.StorageS public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeFileSystemSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeFileSystemSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessPolicy(Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessPolicyAsync(Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDeletedPaths(string pathPrefix = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -369,6 +400,12 @@ public DataLakePathClient(System.Uri pathUri, Azure.Storage.StorageSharedKeyCred public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessControl(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessControlAsync(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected internal virtual Azure.Storage.Files.DataLake.DataLakeDirectoryClient GetParentDirectoryClientCore() { throw null; } @@ -644,6 +681,19 @@ public DataLakeFileReadOptions() { } public Azure.HttpRange Range { get { throw null; } set { } } public Azure.Storage.DownloadTransferValidationOptions TransferValidation { get { throw null; } set { } } } + public partial class DataLakeFileReadResult + { + internal DataLakeFileReadResult() { } + public System.BinaryData Content { get { throw null; } } + public Azure.Storage.Files.DataLake.Models.FileDownloadDetails Details { get { throw null; } } + } + public partial class DataLakeFileReadStreamingResult : System.IDisposable + { + internal DataLakeFileReadStreamingResult() { } + public System.IO.Stream Content { get { throw null; } } + public Azure.Storage.Files.DataLake.Models.FileDownloadDetails Details { get { throw null; } } + public void Dispose() { } + } public partial class DataLakeFileReadToOptions { public DataLakeFileReadToOptions() { } @@ -730,6 +780,8 @@ public DataLakeMetrics() { } } public static partial class DataLakeModelFactory { + public static Azure.Storage.Files.DataLake.Models.DataLakeFileReadResult DataLakeFileReadResult(System.BinaryData content, Azure.Storage.Files.DataLake.Models.FileDownloadDetails details) { throw null; } + public static Azure.Storage.Files.DataLake.Models.DataLakeFileReadStreamingResult DataLakeFileReadStreamingResult(System.IO.Stream content, Azure.Storage.Files.DataLake.Models.FileDownloadDetails details) { throw null; } public static Azure.Storage.Files.DataLake.Models.DataLakeQueryError DataLakeQueryError(string name = null, string description = null, bool isFatal = false, long position = (long)0) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash) { throw null; } @@ -738,6 +790,7 @@ public static partial class DataLakeModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash, System.DateTimeOffset createdOn, string encryptionContext) { throw null; } public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash, System.DateTimeOffset createdOn, string encryptionContext, System.Collections.Generic.IList accessControlList) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadInfo FileDownloadInfo(long contentLength, System.IO.Stream content, byte[] contentHash, Azure.Storage.Files.DataLake.Models.FileDownloadDetails properties) { throw null; } public static Azure.Storage.Files.DataLake.Models.FileSystemInfo FileSystemInfo(Azure.ETag etag, System.DateTimeOffset lastModified) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs index efd9e87cdaeff..c5b8a7798a0cf 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2024_11_04) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } } public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -35,6 +35,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient @@ -88,6 +89,12 @@ public DataLakeDirectoryClient(System.Uri directoryUri, Azure.Storage.StorageSha public override System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public override Azure.Response GetAccessControl(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override System.Threading.Tasks.Task> GetAccessControlAsync(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Storage.Files.DataLake.DataLakeFileClient GetFileClient(string fileName) { throw null; } @@ -170,16 +177,34 @@ public DataLakeFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCred public virtual System.Threading.Tasks.Task OpenWriteAsync(bool overwrite, Azure.Storage.Files.DataLake.Models.DataLakeFileOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Query(string querySqlExpression, Azure.Storage.Files.DataLake.Models.DataLakeQueryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> QueryAsync(string querySqlExpression, Azure.Storage.Files.DataLake.Models.DataLakeQueryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(Azure.HttpRange range, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, bool rangeGetContentHash, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Read(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(Azure.HttpRange range, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, bool rangeGetContentHash, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> ReadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadContent() { throw null; } + public virtual Azure.Response ReadContent(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadContent(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync() { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ReadContentAsync(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response ReadStreaming() { throw null; } + public virtual Azure.Response ReadStreaming(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReadStreaming(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync() { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync(Azure.Storage.Files.DataLake.Models.DataLakeFileReadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ReadStreamingAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response ReadTo(System.IO.Stream destination, Azure.Storage.Files.DataLake.Models.DataLakeFileReadToOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response ReadTo(System.IO.Stream destination, Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions, Azure.Storage.StorageTransferOptions transferOptions, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -283,6 +308,12 @@ public DataLakeFileSystemClient(System.Uri fileSystemUri, Azure.Storage.StorageS public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeFileSystemSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeFileSystemSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessPolicy(Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessPolicyAsync(Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDeletedPaths(string pathPrefix = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -369,6 +400,12 @@ public DataLakePathClient(System.Uri pathUri, Azure.Storage.StorageSharedKeyCred public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Uri GenerateSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasBuilder builder, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Uri GenerateUserDelegationSasUri(Azure.Storage.Sas.DataLakeSasPermissions permissions, System.DateTimeOffset expiresOn, Azure.Storage.Files.DataLake.Models.UserDelegationKey userDelegationKey, out string stringToSign) { throw null; } public virtual Azure.Response GetAccessControl(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAccessControlAsync(bool? userPrincipalName = default(bool?), Azure.Storage.Files.DataLake.Models.DataLakeRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected internal virtual Azure.Storage.Files.DataLake.DataLakeDirectoryClient GetParentDirectoryClientCore() { throw null; } @@ -644,6 +681,19 @@ public DataLakeFileReadOptions() { } public Azure.HttpRange Range { get { throw null; } set { } } public Azure.Storage.DownloadTransferValidationOptions TransferValidation { get { throw null; } set { } } } + public partial class DataLakeFileReadResult + { + internal DataLakeFileReadResult() { } + public System.BinaryData Content { get { throw null; } } + public Azure.Storage.Files.DataLake.Models.FileDownloadDetails Details { get { throw null; } } + } + public partial class DataLakeFileReadStreamingResult : System.IDisposable + { + internal DataLakeFileReadStreamingResult() { } + public System.IO.Stream Content { get { throw null; } } + public Azure.Storage.Files.DataLake.Models.FileDownloadDetails Details { get { throw null; } } + public void Dispose() { } + } public partial class DataLakeFileReadToOptions { public DataLakeFileReadToOptions() { } @@ -730,6 +780,8 @@ public DataLakeMetrics() { } } public static partial class DataLakeModelFactory { + public static Azure.Storage.Files.DataLake.Models.DataLakeFileReadResult DataLakeFileReadResult(System.BinaryData content, Azure.Storage.Files.DataLake.Models.FileDownloadDetails details) { throw null; } + public static Azure.Storage.Files.DataLake.Models.DataLakeFileReadStreamingResult DataLakeFileReadStreamingResult(System.IO.Stream content, Azure.Storage.Files.DataLake.Models.FileDownloadDetails details) { throw null; } public static Azure.Storage.Files.DataLake.Models.DataLakeQueryError DataLakeQueryError(string name = null, string description = null, bool isFatal = false, long position = (long)0) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash) { throw null; } @@ -738,6 +790,7 @@ public static partial class DataLakeModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash, System.DateTimeOffset createdOn, string encryptionContext) { throw null; } public static Azure.Storage.Files.DataLake.Models.FileDownloadDetails FileDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, Azure.ETag eTag, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, System.DateTimeOffset copyCompletionTime, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.DataLake.Models.CopyStatus copyStatus, Azure.Storage.Files.DataLake.Models.DataLakeLeaseDuration leaseDuration, Azure.Storage.Files.DataLake.Models.DataLakeLeaseState leaseState, Azure.Storage.Files.DataLake.Models.DataLakeLeaseStatus leaseStatus, string acceptRanges, bool isServerEncrypted, string encryptionKeySha256, byte[] contentHash, System.DateTimeOffset createdOn, string encryptionContext, System.Collections.Generic.IList accessControlList) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.DataLake.Models.FileDownloadInfo FileDownloadInfo(long contentLength, System.IO.Stream content, byte[] contentHash, Azure.Storage.Files.DataLake.Models.FileDownloadDetails properties) { throw null; } public static Azure.Storage.Files.DataLake.Models.FileSystemInfo FileSystemInfo(Azure.ETag etag, System.DateTimeOffset lastModified) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index 4bb0d300192cf..4a64b8398f656 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/assets.json +++ b/sdk/storage/Azure.Storage.Files.DataLake/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.DataLake", - "Tag": "net/storage/Azure.Storage.Files.DataLake_c97d1635f5" + "Tag": "net/storage/Azure.Storage.Files.DataLake_d74597f1e3" } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01a_HelloWorld.cs b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01a_HelloWorld.cs index 3f8cfdd32c7c5..f8369e587453a 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01a_HelloWorld.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01a_HelloWorld.cs @@ -325,6 +325,115 @@ public void Read() } } + /// + /// Download a DataLake File's streaming data to a file. + /// + [Test] + public void ReadStreaming() + { + // Create a temporary Lorem Ipsum file on disk that we can upload + string originalPath = CreateTempFile(SampleFileContent); + + // Get a temporary path on disk where we can download the file + string downloadPath = CreateTempPath(); + + // Make StorageSharedKeyCredential to pass to the serviceClient + string storageAccountName = StorageAccountName; + string storageAccountKey = StorageAccountKey; + Uri serviceUri = StorageAccountBlobUri; + StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey); + + // Create DataLakeServiceClient using StorageSharedKeyCredentials + DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential); + + // Get a reference to a filesystem named "sample-filesystem-read" and then create it + DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("sample-filesystem-read"); + filesystem.Create(); + try + { + // Get a reference to a file named "sample-file" in a filesystem + DataLakeFileClient file = filesystem.GetFileClient("sample-file"); + + // First upload something the DataLake file so we have something to download + file.Upload(File.OpenRead(originalPath)); + + // Download the DataLake file's contents and save it to a file + // The ReadStreamingAsync() API downloads a file in a single requests. + // For large files, it may be faster to call ReadTo() + #region Snippet:SampleSnippetDataLakeFileClient_ReadStreaming + Response fileContents = file.ReadStreaming(); + Stream readStream = fileContents.Value.Content; + #endregion Snippet:SampleSnippetDataLakeFileClient_ReadStreaming + using (FileStream stream = File.OpenWrite(downloadPath)) + { + readStream.CopyTo(stream); + } + + // Verify the contents + Assert.AreEqual(SampleFileContent, File.ReadAllText(downloadPath)); + } + finally + { + // Clean up after the test when we're finished + filesystem.Delete(); + } + } + + /// + /// Download a DataLake File's content data to a file. + /// + [Test] + public void ReadContent() + { + // Create a temporary Lorem Ipsum file on disk that we can upload + string originalPath = CreateTempFile(SampleFileContent); + + // Get a temporary path on disk where we can download the file + string downloadPath = CreateTempPath(); + + // Make StorageSharedKeyCredential to pass to the serviceClient + string storageAccountName = StorageAccountName; + string storageAccountKey = StorageAccountKey; + Uri serviceUri = StorageAccountBlobUri; + StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey); + + // Create DataLakeServiceClient using StorageSharedKeyCredentials + DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential); + + // Get a reference to a filesystem named "sample-filesystem-read" and then create it + DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("sample-filesystem-read"); + filesystem.Create(); + try + { + // Get a reference to a file named "sample-file" in a filesystem + DataLakeFileClient file = filesystem.GetFileClient("sample-file"); + + // First upload something the DataLake file so we have something to download + file.Upload(File.OpenRead(originalPath)); + + // Download the DataLake file's contents and save it to a file + // The ReadContentAsync() API downloads a file in a single requests. + // For large files, it may be faster to call ReadTo() + #region Snippet:SampleSnippetDataLakeFileClient_ReadContent + Response fileContents = file.ReadContent(); + BinaryData readData = fileContents.Value.Content; + #endregion Snippet:SampleSnippetDataLakeFileClient_ReadContent + byte[] data = readData.ToArray(); + using (FileStream stream = File.OpenWrite(downloadPath)) + { + stream.Write(data, 0, data.Length); + } + + // Verify the contents + Assert.AreEqual(SampleFileContent, File.ReadAllText(downloadPath)); + } + finally + { + // Clean up after the test when we're finished + filesystem.Delete(); + } + } + /// /// Download a DataLake File to a file. /// diff --git a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs index c00d412854193..227cdfaf27a7b 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs @@ -327,6 +327,111 @@ public async Task ReadAsync() } } + /// + /// Download a DataLake File's streaming data to a file. + /// + [Test] + public async Task ReadStreamingAsync() + { + // Create a temporary Lorem Ipsum file on disk that we can upload + string originalPath = CreateTempFile(SampleFileContent); + + // Get a temporary path on disk where we can download the file + string downloadPath = CreateTempPath(); + + // Make StorageSharedKeyCredential to pass to the serviceClient + string storageAccountName = StorageAccountName; + string storageAccountKey = StorageAccountKey; + Uri serviceUri = StorageAccountBlobUri; + StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey); + + // Create DataLakeServiceClient using StorageSharedKeyCredentials + DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential); + + // Get a reference to a filesystem named "sample-filesystem-readasync" and then create it + DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient(Randomize("sample-filesystem-read")); + await filesystem.CreateAsync(); + try + { + // Get a reference to a file named "sample-file" in a filesystem + DataLakeFileClient file = filesystem.GetFileClient(Randomize("sample-file")); + + // First upload something the DataLake file so we have something to download + await file.UploadAsync(File.OpenRead(originalPath)); + + // Download the DataLake file's contents and save it to a file + // The ReadStreamingAsync() API downloads a file in a single requests. + // For large files, it may be faster to call ReadToAsync() + Response fileContents = await file.ReadStreamingAsync(); + Stream readStream = fileContents.Value.Content; + using (FileStream stream = File.OpenWrite(downloadPath)) + { + readStream.CopyTo(stream); + } + + // Verify the contents + Assert.AreEqual(SampleFileContent, File.ReadAllText(downloadPath)); + } + finally + { + // Clean up after the test when we're finished + await filesystem.DeleteAsync(); + } + } + + /// + /// Download a DataLake File's content data to a file. + /// + [Test] + public async Task ReadContentAsync() + { + // Create a temporary Lorem Ipsum file on disk that we can upload + string originalPath = CreateTempFile(SampleFileContent); + + // Get a temporary path on disk where we can download the file + string downloadPath = CreateTempPath(); + + // Make StorageSharedKeyCredential to pass to the serviceClient + string storageAccountName = StorageAccountName; + string storageAccountKey = StorageAccountKey; + Uri serviceUri = StorageAccountBlobUri; + StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey); + + // Create DataLakeServiceClient using StorageSharedKeyCredentials + DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential); + + // Get a reference to a filesystem named "sample-filesystem-readasync" and then create it + DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient(Randomize("sample-filesystem-read")); + await filesystem.CreateAsync(); + try + { + // Get a reference to a file named "sample-file" in a filesystem + DataLakeFileClient file = filesystem.GetFileClient(Randomize("sample-file")); + + // First upload something the DataLake file so we have something to download + await file.UploadAsync(File.OpenRead(originalPath)); + + // Download the DataLake file's contents and save it to a file + // The ReadContentAsync() API downloads a file in a single requests. + // For large files, it may be faster to call ReadToAsync() + Response fileContents = await file.ReadContentAsync(); + BinaryData readData = fileContents.Value.Content; + byte[] data = readData.ToArray(); + using (FileStream stream = File.OpenWrite(downloadPath)) + { + stream.Write(data, 0, data.Length); + } + + // Verify the contents + Assert.AreEqual(SampleFileContent, File.ReadAllText(downloadPath)); + } + finally + { + // Clean up after the test when we're finished + await filesystem.DeleteAsync(); + } + } + /// /// Download a DataLake File directly to file. /// diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs index 6fa6ec5166bbd..5f8fd0849ba0f 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs @@ -151,7 +151,12 @@ public enum ServiceVersion /// /// The 2024-11-04 service version. /// - V2024_11_04 = 24 + V2024_11_04 = 24, + + /// + /// The 2025-01-05 service version. + /// + V2025_01_05 = 25 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs index 41b75adc88d1f..7b2ba5c7cee3b 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeDirectoryClient.cs @@ -3059,11 +3059,170 @@ public override Uri GenerateSasUri(DataLakeSasBuilder builder, out string string // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. builder = DataLakeSasBuilder.DeepCopy(builder); + SetBuilderAndValidate(builder); + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) + { + Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + #region GenerateUserDelegationSas + /// + /// The + /// returns a that generates a DataLake Directory Service Shared Access Signature (SAS) + /// Uri based on the Client properties and parameter passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public override Uri GenerateUserDelegationSasUri(DataLakeSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey) + => GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out _); + + /// + /// The + /// returns a that generates a DataLake Directory Service Shared Access Signature (SAS) + /// Uri based on the Client properties and parameter passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public override Uri GenerateUserDelegationSasUri(DataLakeSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign) => + GenerateUserDelegationSasUri(new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = FileSystemName, + Path = Path, + IsDirectory = true + }, userDelegationKey, out stringToSign); + + /// + /// The + /// returns a that generates a DataLake Directory Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public override Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey) + => GenerateUserDelegationSasUri(builder, userDelegationKey, out _); + + /// + /// The + /// returns a that generates a DataLake Directory Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public override Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign) + { + builder = builder ?? throw Errors.ArgumentNull(nameof(builder)); + userDelegationKey = userDelegationKey ?? throw Errors.ArgumentNull(nameof(userDelegationKey)); + + // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. + builder = DataLakeSasBuilder.DeepCopy(builder); + + SetBuilderAndValidate(builder); + if (string.IsNullOrEmpty(AccountName)) + { + throw Errors.SasClientMissingData(nameof(AccountName)); + } + + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) + { + Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + private void SetBuilderAndValidate(DataLakeSasBuilder builder) + { // Assign builder's IsDirectory, FileSystemName, and Path, if they are null. builder.IsDirectory ??= GetType() == typeof(DataLakeDirectoryClient); builder.FileSystemName ??= FileSystemName; builder.Path ??= Path; + // Validate that builder is properly set if (!builder.IsDirectory.GetValueOrDefault(false)) { throw Errors.SasIncorrectResourceType( @@ -3086,12 +3245,6 @@ public override Uri GenerateSasUri(DataLakeSasBuilder builder, out string string nameof(DataLakeSasBuilder), nameof(Path)); } - DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) - { - Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) - }; - return sasUri.ToUri(); } - #endregion } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeExtensions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeExtensions.cs index 9d50525a1120c..77f5257c56923 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeExtensions.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeExtensions.cs @@ -99,6 +99,29 @@ internal static FileDownloadInfo ToFileDownloadInfo(this Response blobDownloadStreamingResultResponse) + { + blobDownloadStreamingResultResponse.GetRawResponse().Headers.TryGetValue(Constants.DataLake.EncryptionContextHeaderName, out string encryptionContext); + blobDownloadStreamingResultResponse.GetRawResponse().Headers.TryGetValue(Constants.DataLake.AclHeaderName, out string accessControlList); + DataLakeFileReadStreamingResult dataLakeFileReadStreamingResult = new DataLakeFileReadStreamingResult() + { + Content = blobDownloadStreamingResultResponse.Value.Content, + Details = blobDownloadStreamingResultResponse.Value.Details.ToFileDownloadDetails(encryptionContext, accessControlList) + }; + return dataLakeFileReadStreamingResult; + } + + internal static DataLakeFileReadResult ToDataLakeFileReadResult(this Response blobDownloadResult) + { + blobDownloadResult.GetRawResponse().Headers.TryGetValue(Constants.DataLake.EncryptionContextHeaderName, out string encryptionContext); + blobDownloadResult.GetRawResponse().Headers.TryGetValue(Constants.DataLake.AclHeaderName, out string accessControlList); + DataLakeFileReadResult dataLakeFileReadResult = new DataLakeFileReadResult() + { + Content = blobDownloadResult.Value.Content, + Details = blobDownloadResult.Value.Details.ToFileDownloadDetails(encryptionContext, accessControlList) + }; + return dataLakeFileReadResult; + } internal static PathProperties ToPathProperties(this Response blobPropertiesResponse) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs index b2221f513461e..e755faff2f5a7 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileClient.cs @@ -2827,6 +2827,8 @@ internal virtual async Task> FlushInternal( #endregion #region Read Data + + #region Deprecated /// /// The operation downloads a file from /// the service, including its metadata and properties. @@ -2844,6 +2846,7 @@ internal virtual async Task> FlushInternal( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Read() { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); @@ -2886,6 +2889,7 @@ public virtual Response Read() /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> ReadAsync() { DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(Read)}"); @@ -2933,6 +2937,7 @@ public virtual async Task> ReadAsync() /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Read( CancellationToken cancellationToken = default) { @@ -2980,6 +2985,7 @@ public virtual Response Read( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> ReadAsync( CancellationToken cancellationToken = default) { @@ -3017,12 +3023,12 @@ public virtual async Task> ReadAsync( /// Get Blob. /// /// - /// If provided, only donwload the bytes of the file in the specified + /// If provided, only download the bytes of the file in the specified /// range. If not provided, download the entire file. /// /// /// Optional to add conditions on - /// donwloading this file. + /// downloading this file. /// /// /// When set to true and specified together with the , @@ -3091,12 +3097,12 @@ public virtual Response Read( /// Get Blob. /// /// - /// If provided, only donwload the bytes of the file in the specified + /// If provided, only download the bytes of the file in the specified /// range. If not provided, download the entire file. /// /// /// Optional to add conditions on - /// donwloading this file. + /// downloading this file. /// /// /// When set to true and specified together with the , @@ -3157,7 +3163,7 @@ public virtual async Task> ReadAsync( } /// - /// The + /// The /// operation downloads a file from the service, including its metadata /// and properties. /// @@ -3181,6 +3187,7 @@ public virtual async Task> ReadAsync( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response Read( DataLakeFileReadOptions options = default, CancellationToken cancellationToken = default) @@ -3211,7 +3218,7 @@ public virtual Response Read( } /// - /// The + /// The /// operation downloads a file from the service, including its metadata /// and properties. /// @@ -3235,6 +3242,7 @@ public virtual Response Read( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> ReadAsync( DataLakeFileReadOptions options = default, CancellationToken cancellationToken = default) @@ -3264,6 +3272,597 @@ public virtual async Task> ReadAsync( scope.Dispose(); } } + #endregion Deprecated + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadStreaming() + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadStreaming(); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadStreamingAsync() + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadStreamingAsync() + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadStreaming( + CancellationToken cancellationToken) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadStreaming( + cancellationToken: cancellationToken); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadStreamingAsync( + CancellationToken cancellationToken) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadStreamingAsync( + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadStreaming( + DataLakeFileReadOptions options, + CancellationToken cancellationToken = default) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadStreaming( + options: options.ToBlobBaseDownloadOptions(), + cancellationToken: cancellationToken); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadStreamingAsync( + DataLakeFileReadOptions options, + CancellationToken cancellationToken = default) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadStreaming)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadStreamingAsync( + options: options.ToBlobBaseDownloadOptions(), + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadStreamingResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadContent() + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadContent(); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadContentAsync() + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadContentAsync() + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadContent( + CancellationToken cancellationToken) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadContent( + cancellationToken: cancellationToken); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadContentAsync( + CancellationToken cancellationToken) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadContentAsync( + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ReadContent( + DataLakeFileReadOptions options, + CancellationToken cancellationToken = default) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = _blockBlobClient.DownloadContent( + options: options.ToBlobBaseDownloadOptions(), + cancellationToken: cancellationToken); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } + + /// + /// The + /// operation downloads a file from the service, including its metadata + /// and properties. + /// + /// For more information, see + /// + /// Get Blob. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// downloaded file. contains + /// the file's data. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> ReadContentAsync( + DataLakeFileReadOptions options, + CancellationToken cancellationToken = default) + { + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(DataLakeFileClient)}.{nameof(ReadContent)}"); + + try + { + scope.Start(); + + Response response = await _blockBlobClient.DownloadContentAsync( + options: options.ToBlobBaseDownloadOptions(), + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + return Response.FromValue( + response.ToDataLakeFileReadResult(), + response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + finally + { + scope.Dispose(); + } + } #endregion Read Data #region Read To diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs index 96cccd792d8cc..5a5e9ca8650cc 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeFileSystemClient.cs @@ -3287,26 +3287,158 @@ public virtual Uri GenerateSasUri( // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. builder = DataLakeSasBuilder.DeepCopy(builder); - // Assign builder's FileSystemName, if it is null. - builder.FileSystemName ??= Name; - - if (!builder.FileSystemName.Equals(Name, StringComparison.InvariantCulture)) + SetBuilderAndValidate(builder); + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) { - throw Errors.SasNamesNotMatching( - nameof(builder.FileSystemName), - nameof(DataLakeSasBuilder), - nameof(Name)); - } - if (!string.IsNullOrEmpty(builder.Path)) + Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + #region GenerateUserDelegationSas + /// + /// The + /// returns a that generates a DataLake FileSystem Service + /// Shared Access Signature (SAS) Uri based on the Client properties and parameters passed. + /// The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn, Models.UserDelegationKey userDelegationKey) => + GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out _); + + /// + /// The + /// returns a that generates a DataLake FileSystem Service + /// Shared Access Signature (SAS) Uri based on the Client properties and parameters passed. + /// The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn, Models.UserDelegationKey userDelegationKey, out string stringToSign) => + GenerateUserDelegationSasUri(new DataLakeSasBuilder(permissions, expiresOn) { FileSystemName = Name }, userDelegationKey, out stringToSign); + + /// + /// The returns a + /// that generates a DataLake FileSystem Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. + /// The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A on successfully deleting. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, Models.UserDelegationKey userDelegationKey) + => GenerateUserDelegationSasUri(builder, userDelegationKey, out _); + + /// + /// The returns a + /// that generates a DataLake FileSystem Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. + /// The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A on successfully deleting. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, Models.UserDelegationKey userDelegationKey, out string stringToSign) + { + builder = builder ?? throw Errors.ArgumentNull(nameof(builder)); + userDelegationKey = userDelegationKey ?? throw Errors.ArgumentNull(nameof(userDelegationKey)); + + // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. + builder = DataLakeSasBuilder.DeepCopy(builder); + + SetBuilderAndValidate(builder); + if (string.IsNullOrEmpty(AccountName)) { - throw Errors.SasBuilderEmptyParam( - nameof(builder), - nameof(builder.Path), - nameof(Constants.DataLake.FileSystemName)); + throw Errors.SasClientMissingData(nameof(AccountName)); } + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) { - Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign) }; return sasUri.ToUri(); } @@ -3622,6 +3754,28 @@ protected internal virtual DataLakeServiceClient GetParentServiceClientCore() return _parentServiceClient; } #endregion + + private void SetBuilderAndValidate(DataLakeSasBuilder builder) + { + // Assign builder's FileSystemName, if it is null. + builder.FileSystemName ??= Name; + + // Validate that builder is properly set + if (!builder.FileSystemName.Equals(Name, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.FileSystemName), + nameof(DataLakeSasBuilder), + nameof(Name)); + } + if (!string.IsNullOrEmpty(builder.Path)) + { + throw Errors.SasBuilderEmptyParam( + nameof(builder), + nameof(builder.Path), + nameof(Constants.DataLake.FileSystemName)); + } + } } namespace Specialized diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs index c876715c2f7b0..cd7d7e0ec75d3 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs @@ -529,7 +529,7 @@ internal DataLakePathClient( (PathRestClient dfsPathRestClient, PathRestClient blobPathRestClient) = BuildPathRestClients(_dfsUri, _blobUri); _pathRestClient = dfsPathRestClient; - _blobPathRestClient = blobPathRestClient; + _blobPathRestClient = blobPathRestClient; DataLakeErrors.VerifyHttpsCustomerProvidedKey(_uri, _clientConfiguration.CustomerProvidedKey); } @@ -1166,7 +1166,7 @@ internal virtual async Task> CreateInternal( if (expiresOn.HasValue && timeToExpire.HasValue) { - throw new ArgumentException($"{nameof(DataLakePathCreateOptions)}.{nameof(DataLakePathCreateOptions.ScheduleDeletionOptions.ExpiresOn)} and {nameof(DataLakePathCreateOptions)}.{nameof(DataLakePathCreateOptions.ScheduleDeletionOptions.TimeToExpire)} cannot both be set."); + throw new ArgumentException($"{nameof(DataLakePathCreateOptions)}.{nameof(DataLakePathCreateOptions.ScheduleDeletionOptions.ExpiresOn)} and {nameof(DataLakePathCreateOptions)}.{nameof(DataLakePathCreateOptions.ScheduleDeletionOptions.TimeToExpire)} cannot both be set."); } try @@ -1418,10 +1418,10 @@ public virtual async Task> CreateIfNotExistsAsync( public virtual Response CreateIfNotExists( #pragma warning restore AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken. PathResourceType resourceType, - PathHttpHeaders httpHeaders , + PathHttpHeaders httpHeaders, Metadata metadata, string permissions, - string umask , + string umask, CancellationToken cancellationToken) => CreateIfNotExistsInternal( resourceType: resourceType, @@ -3946,36 +3946,158 @@ public virtual Uri GenerateSasUri(DataLakeSasBuilder builder, out string stringT // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. builder = DataLakeSasBuilder.DeepCopy(builder); - // Assign builder's IsDirectory, FileSystemName, and Path, if they are null. - builder.IsDirectory ??= GetType() == typeof(DataLakeDirectoryClient); - builder.FileSystemName ??= FileSystemName; - builder.Path ??= Path; - - if (builder.IsDirectory.GetValueOrDefault(false)) + SetBuilderAndValidate(builder); + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) { - throw Errors.SasIncorrectResourceType( - nameof(builder), - nameof(builder.IsDirectory), - nameof(Constants.FalseName), - nameof(this.GetType)); - } - if (!builder.FileSystemName.Equals(FileSystemName, StringComparison.InvariantCulture)) + Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + }; + return sasUri.ToUri(); + } + #endregion + + #region GenerateUserDelegationSas + /// + /// The + /// returns a that generates a DataLake Path Service Shared Access Signature (SAS) + /// Uri based on the Client properties and parameter passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey) + => GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out _); + + /// + /// The + /// returns a that generates a DataLake Path Service Shared Access Signature (SAS) + /// Uri based on the Client properties and parameter passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Specifies the list of permissions to be associated with the SAS. + /// See . + /// + /// + /// Required. Specifies the time at which the SAS becomes invalid. This field + /// must be omitted if it has been specified in an associated stored access policy. + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign) => + GenerateUserDelegationSasUri(new DataLakeSasBuilder(permissions, expiresOn) { - throw Errors.SasNamesNotMatching( - nameof(builder.FileSystemName), - nameof(DataLakeSasBuilder), - nameof(FileSystemName)); - } - if (!builder.Path.Equals(Path, StringComparison.InvariantCulture)) + FileSystemName = FileSystemName, + Path = Path + }, userDelegationKey, out stringToSign); + + /// + /// The + /// returns a that generates a DataLake Path Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey) + => GenerateUserDelegationSasUri(builder, userDelegationKey, out _); + + /// + /// The + /// returns a that generates a DataLake Path Service Shared Access Signature (SAS) + /// Uri based on the Client properties and builder passed. The SAS is signed by the user delegation key passed in. + /// + /// For more information, see + /// + /// Creating an user delegation SAS. + /// + /// + /// Required. Used to generate a Shared Access Signature (SAS). + /// + /// + /// Required. A returned from + /// . + /// + /// + /// For debugging purposes only. This string will be overwritten with the string to sign that was used to generate the SAS Uri. + /// + /// + /// A containing the SAS Uri. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-files-datalake")] + public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign) + { + builder = builder ?? throw Errors.ArgumentNull(nameof(builder)); + userDelegationKey = userDelegationKey ?? throw Errors.ArgumentNull(nameof(userDelegationKey)); + + // Deep copy of builder so we don't modify the user's original DataLakeSasBuilder. + builder = DataLakeSasBuilder.DeepCopy(builder); + + SetBuilderAndValidate(builder); + if (string.IsNullOrEmpty(AccountName)) { - throw Errors.SasNamesNotMatching( - nameof(builder.Path), - nameof(DataLakeSasBuilder), - nameof(Path)); + throw Errors.SasClientMissingData(nameof(AccountName)); } + DataLakeUriBuilder sasUri = new DataLakeUriBuilder(Uri) { - Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign) + Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign) }; return sasUri.ToUri(); } @@ -4042,6 +4164,38 @@ protected internal virtual DataLakeDirectoryClient GetParentDirectoryClientCore( return _parentDirectoryClient; } #endregion + + private void SetBuilderAndValidate(DataLakeSasBuilder builder) + { + // Assign builder's IsDirectory, FileSystemName, and Path, if they are null. + builder.IsDirectory ??= GetType() == typeof(DataLakeDirectoryClient); + builder.FileSystemName ??= FileSystemName; + builder.Path ??= Path; + + // Validate that builder is properly set + if (builder.IsDirectory.GetValueOrDefault(false)) + { + throw Errors.SasIncorrectResourceType( + nameof(builder), + nameof(builder.IsDirectory), + Constants.FalseName, + nameof(this.GetType)); + } + if (!builder.FileSystemName.Equals(FileSystemName, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.FileSystemName), + nameof(DataLakeSasBuilder), + nameof(FileSystemName)); + } + if (!builder.Path.Equals(Path, StringComparison.InvariantCulture)) + { + throw Errors.SasNamesNotMatching( + nameof(builder.Path), + nameof(DataLakeSasBuilder), + nameof(Path)); + } + } } namespace Specialized diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/FileSystemRestClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/FileSystemRestClient.cs index 719932d5cd500..4144d908b7549 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/FileSystemRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/FileSystemRestClient.cs @@ -33,7 +33,7 @@ internal partial class FileSystemRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. /// The value must be "filesystem" for all filesystem operations. The default value is "filesystem". - /// Specifies the version of the operation to use for this request. The default value is "2023-05-03". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , , or is null. public FileSystemRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string resource, string version) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathAppendDataHeaders.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathAppendDataHeaders.cs index 6ec456a438564..502dd557f4822 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathAppendDataHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathAppendDataHeaders.cs @@ -29,5 +29,7 @@ public PathAppendDataHeaders(Response response) public string EncryptionKeySha256 => _response.Headers.TryGetValue("x-ms-encryption-key-sha256", out string value) ? value : null; /// If the lease was auto-renewed with this request. public bool? LeaseRenewed => _response.Headers.TryGetValue("x-ms-lease-renewed", out bool? value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathRestClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathRestClient.cs index 6b1e970bd2fc8..d328c3079de6b 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathRestClient.cs @@ -30,7 +30,7 @@ internal partial class PathRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2023-05-03". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// The lease duration is required to acquire a lease, and specifies the duration of the lease in seconds. The lease duration must be between 15 and 60 seconds or -1 for infinite lease. /// , , or is null. public PathRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, int? xMsLeaseDuration = null) @@ -293,7 +293,7 @@ public ResponseWithHeaders Create(int? timeout = null, PathRe } } - internal HttpMessage CreateUpdateRequest(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout, int? maxRecords, string continuation, bool? forceFlag, long? position, bool? retainUncommittedData, bool? close, long? contentLength, byte[] contentMD5, string leaseId, string cacheControl, string contentType, string contentDisposition, string contentEncoding, string contentLanguage, string properties, string owner, string group, string permissions, string acl, string ifMatch, string ifNoneMatch, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince) + internal HttpMessage CreateUpdateRequest(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout, int? maxRecords, string continuation, bool? forceFlag, long? position, bool? retainUncommittedData, bool? close, long? contentLength, byte[] contentMD5, string leaseId, string cacheControl, string contentType, string contentDisposition, string contentEncoding, string contentLanguage, string properties, string owner, string group, string permissions, string acl, string ifMatch, string ifNoneMatch, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -396,6 +396,14 @@ internal HttpMessage CreateUpdateRequest(PathUpdateAction action, PathSetAccessC { request.Headers.Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/json"); if (contentLength != null) { @@ -434,17 +442,19 @@ internal HttpMessage CreateUpdateRequest(PathUpdateAction action, PathSetAccessC /// Specify an ETag value to operate only on blobs without a matching value. /// Specify this header value to operate only on a blob if it has been modified since the specified date/time. /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. /// Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a file or directory, or sets access control for a file or directory. Data can only be appended to a file. Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - public async Task> UpdateAsync(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout = null, int? maxRecords = null, string continuation = null, bool? forceFlag = null, long? position = null, bool? retainUncommittedData = null, bool? close = null, long? contentLength = null, byte[] contentMD5 = null, string leaseId = null, string cacheControl = null, string contentType = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string properties = null, string owner = null, string group = null, string permissions = null, string acl = null, string ifMatch = null, string ifNoneMatch = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout = null, int? maxRecords = null, string continuation = null, bool? forceFlag = null, long? position = null, bool? retainUncommittedData = null, bool? close = null, long? contentLength = null, byte[] contentMD5 = null, string leaseId = null, string cacheControl = null, string contentType = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string properties = null, string owner = null, string group = null, string permissions = null, string acl = null, string ifMatch = null, string ifNoneMatch = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUpdateRequest(action, mode, body, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, contentMD5, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince); + using var message = CreateUpdateRequest(action, mode, body, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, contentMD5, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new PathUpdateHeaders(message.Response); switch (message.Response.Status) @@ -491,17 +501,19 @@ public async Task Specify an ETag value to operate only on blobs without a matching value. /// Specify this header value to operate only on a blob if it has been modified since the specified date/time. /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. /// Uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties for a file or directory, or sets access control for a file or directory. Data can only be appended to a file. Concurrent writes to the same file using multiple clients are not supported. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). - public ResponseWithHeaders Update(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout = null, int? maxRecords = null, string continuation = null, bool? forceFlag = null, long? position = null, bool? retainUncommittedData = null, bool? close = null, long? contentLength = null, byte[] contentMD5 = null, string leaseId = null, string cacheControl = null, string contentType = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string properties = null, string owner = null, string group = null, string permissions = null, string acl = null, string ifMatch = null, string ifNoneMatch = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Update(PathUpdateAction action, PathSetAccessControlRecursiveMode mode, Stream body, int? timeout = null, int? maxRecords = null, string continuation = null, bool? forceFlag = null, long? position = null, bool? retainUncommittedData = null, bool? close = null, long? contentLength = null, byte[] contentMD5 = null, string leaseId = null, string cacheControl = null, string contentType = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string properties = null, string owner = null, string group = null, string permissions = null, string acl = null, string ifMatch = null, string ifNoneMatch = null, DateTimeOffset? ifModifiedSince = null, DateTimeOffset? ifUnmodifiedSince = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateUpdateRequest(action, mode, body, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, contentMD5, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince); + using var message = CreateUpdateRequest(action, mode, body, timeout, maxRecords, continuation, forceFlag, position, retainUncommittedData, close, contentLength, contentMD5, leaseId, cacheControl, contentType, contentDisposition, contentEncoding, contentLanguage, properties, owner, group, permissions, acl, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new PathUpdateHeaders(message.Response); switch (message.Response.Status) @@ -1315,7 +1327,7 @@ public ResponseWithHeaders FlushData(int? timeout = null, } } - internal HttpMessage CreateAppendDataRequest(Stream body, long? position, int? timeout, long? contentLength, byte[] transactionalContentHash, byte[] transactionalContentCrc64, string leaseId, DataLakeLeaseAction? leaseAction, long? leaseDuration, string proposedLeaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, bool? flush) + internal HttpMessage CreateAppendDataRequest(Stream body, long? position, int? timeout, long? contentLength, byte[] transactionalContentHash, byte[] transactionalContentCrc64, string leaseId, DataLakeLeaseAction? leaseAction, long? leaseDuration, string proposedLeaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, bool? flush, string structuredBodyType, long? structuredContentLength) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1369,6 +1381,14 @@ internal HttpMessage CreateAppendDataRequest(Stream body, long? position, int? t { request.Headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/json"); if (contentLength != null) { @@ -1398,16 +1418,18 @@ internal HttpMessage CreateAppendDataRequest(Stream body, long? position, int? t /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. /// If file should be flushed after the append. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public async Task> AppendDataAsync(Stream body, long? position = null, int? timeout = null, long? contentLength = null, byte[] transactionalContentHash = null, byte[] transactionalContentCrc64 = null, string leaseId = null, DataLakeLeaseAction? leaseAction = null, long? leaseDuration = null, string proposedLeaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, bool? flush = null, CancellationToken cancellationToken = default) + public async Task> AppendDataAsync(Stream body, long? position = null, int? timeout = null, long? contentLength = null, byte[] transactionalContentHash = null, byte[] transactionalContentCrc64 = null, string leaseId = null, DataLakeLeaseAction? leaseAction = null, long? leaseDuration = null, string proposedLeaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, bool? flush = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateAppendDataRequest(body, position, timeout, contentLength, transactionalContentHash, transactionalContentCrc64, leaseId, leaseAction, leaseDuration, proposedLeaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush); + using var message = CreateAppendDataRequest(body, position, timeout, contentLength, transactionalContentHash, transactionalContentCrc64, leaseId, leaseAction, leaseDuration, proposedLeaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, structuredBodyType, structuredContentLength); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new PathAppendDataHeaders(message.Response); switch (message.Response.Status) @@ -1434,16 +1456,18 @@ public async Task> AppendDataAsync(St /// The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. /// The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. /// If file should be flushed after the append. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// The cancellation token to use. /// is null. - public ResponseWithHeaders AppendData(Stream body, long? position = null, int? timeout = null, long? contentLength = null, byte[] transactionalContentHash = null, byte[] transactionalContentCrc64 = null, string leaseId = null, DataLakeLeaseAction? leaseAction = null, long? leaseDuration = null, string proposedLeaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, bool? flush = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders AppendData(Stream body, long? position = null, int? timeout = null, long? contentLength = null, byte[] transactionalContentHash = null, byte[] transactionalContentCrc64 = null, string leaseId = null, DataLakeLeaseAction? leaseAction = null, long? leaseDuration = null, string proposedLeaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = null, bool? flush = null, string structuredBodyType = null, long? structuredContentLength = null, CancellationToken cancellationToken = default) { if (body == null) { throw new ArgumentNullException(nameof(body)); } - using var message = CreateAppendDataRequest(body, position, timeout, contentLength, transactionalContentHash, transactionalContentCrc64, leaseId, leaseAction, leaseDuration, proposedLeaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush); + using var message = CreateAppendDataRequest(body, position, timeout, contentLength, transactionalContentHash, transactionalContentCrc64, leaseId, leaseAction, leaseDuration, proposedLeaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, flush, structuredBodyType, structuredContentLength); _pipeline.Send(message, cancellationToken); var headers = new PathAppendDataHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathUpdateHeaders.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathUpdateHeaders.cs index 35668cb1c3a1d..026c78e72481a 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathUpdateHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/PathUpdateHeaders.cs @@ -43,5 +43,7 @@ public PathUpdateHeaders(Response response) public string XMsContinuation => _response.Headers.TryGetValue("x-ms-continuation", out string value) ? value : null; /// The version of the REST protocol used to process the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/ServiceRestClient.cs index 118595b4d87d1..b00fa12238f4e 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/ServiceRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Generated/ServiceRestClient.cs @@ -28,7 +28,7 @@ internal partial class ServiceRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, container, or blob that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2023-05-03". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// , , or is null. public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadResult.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadResult.cs new file mode 100644 index 0000000000000..6059019eb6cdd --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadResult.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Storage.Files.DataLake.Models +{ + /// + /// The details and content returned from reading a DataLake File. + /// + public class DataLakeFileReadResult + { + internal DataLakeFileReadResult() { } + + /// + /// Details returned when reading a DataLake file + /// + public FileDownloadDetails Details { get; internal set; } + + /// + /// Content. + /// + public BinaryData Content { get; internal set; } + } +} diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadStreamingResult.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadStreamingResult.cs new file mode 100644 index 0000000000000..985b1e9ab8374 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeFileReadStreamingResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Azure.Storage.Shared; + +namespace Azure.Storage.Files.DataLake.Models +{ + /// + /// The details and content returned from reading a datalake file. + /// + public class DataLakeFileReadStreamingResult : IDisposable + { + internal DataLakeFileReadStreamingResult() { } + + /// + /// Details returned when reading a datalake file. + /// + public FileDownloadDetails Details { get; internal set; } + + /// + /// Content. + /// + public Stream Content { get; internal set; } + + /// + /// Disposes the by calling Dispose on the underlying stream. + /// + public void Dispose() + { + Content?.Dispose(); + GC.SuppressFinalize(this); + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeModelFactory.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeModelFactory.cs index f4b7370f69f4e..34e280c2b2f63 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeModelFactory.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Models/DataLakeModelFactory.cs @@ -13,6 +13,34 @@ namespace Azure.Storage.Files.DataLake.Models /// public static partial class DataLakeModelFactory { + #region DataLakeFileReadResult + /// + /// Creates a new instance for mocking. + /// + public static DataLakeFileReadResult DataLakeFileReadResult( + BinaryData content, + FileDownloadDetails details) + => new DataLakeFileReadResult() + { + Content = content, + Details = details + }; + #endregion DataLakeFileReadResult + + #region DataLakeFileReadStreamingResult + /// + /// Creates a new instance for mocking. + /// + public static DataLakeFileReadStreamingResult DataLakeFileReadStreamingResult( + Stream content, + FileDownloadDetails details) + => new DataLakeFileReadStreamingResult() + { + Content = content, + Details = details + }; + #endregion DataLakeFileReadStreamingResult + #region FileDownloadDetails /// /// Creates a new FileDownloadDetails instance for mocking. @@ -235,6 +263,7 @@ public static FileDownloadDetails FileDownloadDetails( /// /// Creates a new instance for mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static FileDownloadInfo FileDownloadInfo( long contentLength, Stream content, diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md b/sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md index 4121ebab9932e..ec9675a014f70 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5da3c08b92d05858b728b013b69502dc93485373/specification/storage/data-plane/Azure.Storage.Files.DataLake/stable/2023-05-03/DataLakeStorage.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a936baeb45003f1d31ce855084b2e54365af78af/specification/storage/data-plane/Azure.Storage.Files.DataLake/stable/2025-01-05/DataLakeStorage.json generation1-convenience-client: true modelerfour: seal-single-value-enum-by-default: true diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs index 1a3cee805c368..eab0498c5dfcc 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs @@ -33,6 +33,7 @@ public DataLakeClientTestFixtureAttribute() DataLakeClientOptions.ServiceVersion.V2024_05_04, DataLakeClientOptions.ServiceVersion.V2024_08_04, DataLakeClientOptions.ServiceVersion.V2024_11_04, + DataLakeClientOptions.ServiceVersion.V2025_01_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion) { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs index 44f5b378e26df..83938361fb0d0 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DirectoryClientTests.cs @@ -6470,7 +6470,424 @@ public void GenerateSas_BuilderIsDirectoryError() // Act TestHelper.AssertExpectedException( () => directoryClient.GenerateSasUri(sasBuilder), - new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to true to generatethe respective SAS for the client, GetType")); + new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to true to generate the respective SAS for the client, GetType")); + } + #endregion + + #region GenerateUserDelegationSasTests + [RecordedTest] + public async Task GenerateUserDelegationSas_RequiredParameters() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = directoryClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder.ToSasQueryParameters(userDelegationKey, directoryClient.AccountName) + }; + + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_Builder() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, directoryClient.AccountName); + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNull() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => directoryClient.GenerateUserDelegationSasUri(null, userDelegationKey, out stringToSign), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + + string stringToSign = null; + + // Assert + TestHelper.AssertExpectedException( + () => directoryClient.GenerateUserDelegationSasUri(sasBuilder, null, out stringToSign), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullFileSystemName() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = null, + Path = path, + IsDirectory = true, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, directoryClient.AccountName); + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongFileSystemName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string directoryName = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = directoryName + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = GetNewFileSystemName(), // different filesytem name + Path = directoryName, + IsDirectory = true + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.FileSystemName does not match FileSystemName in the Client. DataLakeSasBuilder.FileSystemName must either be left empty or match the FileSystemName in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullPath() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = null, + IsDirectory = true, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, directoryClient.AccountName); + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongPathName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string directoryName = GetNewDirectoryName(); + string fileSystemName = GetNewFileSystemName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = directoryName + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = GetNewDirectoryName(), // different directory name + IsDirectory = true, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.Path does not match Path in the Client. DataLakeSasBuilder.Path must either be left empty or match the Path in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIsDirectoryNull() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = null, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = true, + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, directoryClient.AccountName); + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIsDirectoryError() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string directoryName = GetNewDirectoryName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = directoryName + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeDirectoryClient directoryClient = InstrumentClient(new DataLakeDirectoryClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = directoryName, + IsDirectory = false, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => directoryClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to true to generate the respective SAS for the client, GetType")); } #endregion diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 6d9f0d5750800..ef9f73e40e18d 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -3455,6 +3455,71 @@ public async Task ReadAsync() TestHelper.AssertSequenceEqual(data, actual.ToArray()); } + [RecordedTest] + public async Task ReadStreamingAsync() + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + byte[] data = GetRandomBuffer(Constants.KB); + DataLakeFileClient fileClient = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (MemoryStream stream = new MemoryStream(data)) + { + await fileClient.AppendAsync(stream, 0); + } + + await fileClient.FlushAsync(Constants.KB); + + // Act + Response response = await fileClient.ReadStreamingAsync(); + + // Assert + Assert.IsNotNull(response.Value.Details.LastModified); + Assert.IsNotNull(response.Value.Details.AcceptRanges); + Assert.IsNotNull(response.Value.Details.ETag); + Assert.IsNotNull(response.Value.Details.LeaseStatus); + Assert.IsNotNull(response.Value.Details.LeaseState); + Assert.IsNotNull(response.Value.Details.IsServerEncrypted); + Assert.IsNotNull(response.Value.Details.CreatedOn); + Assert.IsNotNull(response.Value.Details.Metadata); + + MemoryStream actual = new MemoryStream(); + await response.Value.Content.CopyToAsync(actual); + TestHelper.AssertSequenceEqual(data, actual.ToArray()); + } + + [RecordedTest] + public async Task ReadContentAsync() + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + byte[] data = GetRandomBuffer(Constants.KB); + DataLakeFileClient fileClient = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (MemoryStream stream = new MemoryStream(data)) + { + await fileClient.AppendAsync(stream, 0); + } + + await fileClient.FlushAsync(Constants.KB); + + // Act + Response response = await fileClient.ReadContentAsync(); + + // Assert + Assert.IsNotNull(response.Value.Details.LastModified); + Assert.IsNotNull(response.Value.Details.AcceptRanges); + Assert.IsNotNull(response.Value.Details.ETag); + Assert.IsNotNull(response.Value.Details.LeaseStatus); + Assert.IsNotNull(response.Value.Details.LeaseState); + Assert.IsNotNull(response.Value.Details.IsServerEncrypted); + Assert.IsNotNull(response.Value.Details.CreatedOn); + Assert.IsNotNull(response.Value.Details.Metadata); + + byte[] actual = response.Value.Content.ToArray(); + TestHelper.AssertSequenceEqual(data, actual); + } + [RecordedTest] [ServiceVersion(Min = DataLakeClientOptions.ServiceVersion.V2024_05_04)] public async Task ReadAsyncACL() @@ -3502,6 +3567,97 @@ public async Task ReadAsyncACL() TestHelper.AssertSequenceEqual(data, actual.ToArray()); } + [RecordedTest] + [ServiceVersion(Min = DataLakeClientOptions.ServiceVersion.V2024_05_04)] + public async Task ReadStreamingAsyncACL() + { + await using DisposingFileSystem test = await GetNewFileSystem(publicAccessType: PublicAccessType.None); + DataLakeDirectoryClient directory = await test.FileSystem.CreateDirectoryAsync(GetNewDirectoryName()); + + DataLakeFileClient fileClient = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + DataLakePathCreateOptions options = new DataLakePathCreateOptions + { + AccessOptions = new DataLakeAccessOptions + { + AccessControlList = AccessControlList + } + }; + + await fileClient.CreateAsync(options: options); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + using (var stream = new MemoryStream(data)) + { + await fileClient.AppendAsync(stream, 0); + } + + await fileClient.FlushAsync(Constants.KB); + + // Act + Response response = await fileClient.ReadStreamingAsync(); + + // Assert + Assert.IsNotNull(response.Value.Details.LastModified); + Assert.IsNotNull(response.Value.Details.AcceptRanges); + Assert.IsNotNull(response.Value.Details.ETag); + Assert.IsNotNull(response.Value.Details.LeaseStatus); + Assert.IsNotNull(response.Value.Details.LeaseState); + Assert.IsNotNull(response.Value.Details.IsServerEncrypted); + Assert.IsNotNull(response.Value.Details.CreatedOn); + AssertAccessControlListEquality(AccessControlList, response.Value.Details.AccessControlList.ToList()); + + var actual = new MemoryStream(); + await response.Value.Content.CopyToAsync(actual); + TestHelper.AssertSequenceEqual(data, actual.ToArray()); + } + + [RecordedTest] + [ServiceVersion(Min = DataLakeClientOptions.ServiceVersion.V2024_05_04)] + public async Task ReadContentAsyncACL() + { + await using DisposingFileSystem test = await GetNewFileSystem(publicAccessType: PublicAccessType.None); + DataLakeDirectoryClient directory = await test.FileSystem.CreateDirectoryAsync(GetNewDirectoryName()); + + DataLakeFileClient fileClient = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + DataLakePathCreateOptions options = new DataLakePathCreateOptions + { + AccessOptions = new DataLakeAccessOptions + { + AccessControlList = AccessControlList + } + }; + + await fileClient.CreateAsync(options: options); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + using (var stream = new MemoryStream(data)) + { + await fileClient.AppendAsync(stream, 0); + } + + await fileClient.FlushAsync(Constants.KB); + + // Act + Response response = await fileClient.ReadContentAsync(); + + // Assert + Assert.IsNotNull(response.Value.Details.LastModified); + Assert.IsNotNull(response.Value.Details.AcceptRanges); + Assert.IsNotNull(response.Value.Details.ETag); + Assert.IsNotNull(response.Value.Details.LeaseStatus); + Assert.IsNotNull(response.Value.Details.LeaseState); + Assert.IsNotNull(response.Value.Details.IsServerEncrypted); + Assert.IsNotNull(response.Value.Details.CreatedOn); + AssertAccessControlListEquality(AccessControlList, response.Value.Details.AccessControlList.ToList()); + + byte[] actual = response.Value.Content.ToArray(); + TestHelper.AssertSequenceEqual(data, actual); + } + [RecordedTest] [ServiceVersion(Min = DataLakeClientOptions.ServiceVersion.V2024_05_04)] public async Task GetPropertiesAsyncACL() @@ -3630,6 +3786,76 @@ public async Task ReadAsync_Conditions() } } + [RecordedTest] + public async Task ReadStreamingAsync_Conditions() + { + var garbageLeaseId = GetGarbageLeaseId(); + foreach (AccessConditionParameters parameters in Conditions_Data) + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + DataLakeFileClient file = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (var stream = new MemoryStream(data)) + { + await file.AppendAsync(stream, 0); + } + + await file.FlushAsync(Constants.KB); + + parameters.Match = await SetupPathMatchCondition(file, parameters.Match); + parameters.LeaseId = await SetupPathLeaseCondition(file, parameters.LeaseId, garbageLeaseId); + DataLakeRequestConditions conditions = BuildDataLakeRequestConditions( + parameters: parameters, + lease: true); + + // Act + Response response = await file.ReadStreamingAsync(new DataLakeFileReadOptions + { + Conditions = conditions + }); + + // Assert + Assert.IsNotNull(response.GetRawResponse().Headers.RequestId); + } + } + + [RecordedTest] + public async Task ReadContentAsync_Conditions() + { + var garbageLeaseId = GetGarbageLeaseId(); + foreach (AccessConditionParameters parameters in Conditions_Data) + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + DataLakeFileClient file = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (var stream = new MemoryStream(data)) + { + await file.AppendAsync(stream, 0); + } + + await file.FlushAsync(Constants.KB); + + parameters.Match = await SetupPathMatchCondition(file, parameters.Match); + parameters.LeaseId = await SetupPathLeaseCondition(file, parameters.LeaseId, garbageLeaseId); + DataLakeRequestConditions conditions = BuildDataLakeRequestConditions( + parameters: parameters, + lease: true); + + // Act + Response response = await file.ReadContentAsync(new DataLakeFileReadOptions + { + Conditions = conditions + }); + + // Assert + Assert.IsNotNull(response.GetRawResponse().Headers.RequestId); + } + } + [RecordedTest] public async Task ReadAsync_ConditionsFail() { @@ -3663,6 +3889,72 @@ await TestHelper.CatchAsync( } } + [RecordedTest] + public async Task ReadStreamingAsync_ConditionsFail() + { + var garbageLeaseId = GetGarbageLeaseId(); + foreach (AccessConditionParameters parameters in GetConditionsFail_Data(garbageLeaseId)) + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + DataLakeFileClient file = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (var stream = new MemoryStream(data)) + { + await file.AppendAsync(stream, 0); + } + + await file.FlushAsync(Constants.KB); + + parameters.NoneMatch = await SetupPathMatchCondition(file, parameters.NoneMatch); + DataLakeRequestConditions conditions = BuildDataLakeRequestConditions(parameters); + + // Act + await TestHelper.CatchAsync( + async () => + { + var _ = (await file.ReadStreamingAsync(new DataLakeFileReadOptions + { + Conditions = conditions + })).Value; + }); + } + } + + [RecordedTest] + public async Task ReadContentAsync_ConditionsFail() + { + var garbageLeaseId = GetGarbageLeaseId(); + foreach (AccessConditionParameters parameters in GetConditionsFail_Data(garbageLeaseId)) + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + var data = GetRandomBuffer(Constants.KB); + DataLakeFileClient file = await test.FileSystem.CreateFileAsync(GetNewFileName()); + using (var stream = new MemoryStream(data)) + { + await file.AppendAsync(stream, 0); + } + + await file.FlushAsync(Constants.KB); + + parameters.NoneMatch = await SetupPathMatchCondition(file, parameters.NoneMatch); + DataLakeRequestConditions conditions = BuildDataLakeRequestConditions(parameters); + + // Act + await TestHelper.CatchAsync( + async () => + { + var _ = (await file.ReadContentAsync(new DataLakeFileReadOptions + { + Conditions = conditions + })).Value; + }); + } + } + [RecordedTest] public async Task ReadAsync_Error() { @@ -3677,6 +3969,34 @@ await TestHelper.AssertExpectedExceptionAsync( e => Assert.AreEqual("BlobNotFound", e.ErrorCode)); } + [RecordedTest] + public async Task ReadStreamingAsync_Error() + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + DataLakeFileClient file = InstrumentClient(test.FileSystem.GetFileClient(GetNewFileName())); + + // Act + await TestHelper.AssertExpectedExceptionAsync( + file.ReadStreamingAsync(), + e => Assert.AreEqual("BlobNotFound", e.ErrorCode)); + } + + [RecordedTest] + public async Task ReadContentAsync_Error() + { + await using DisposingFileSystem test = await GetNewFileSystem(); + + // Arrange + DataLakeFileClient file = InstrumentClient(test.FileSystem.GetFileClient(GetNewFileName())); + + // Act + await TestHelper.AssertExpectedExceptionAsync( + file.ReadContentAsync(), + e => Assert.AreEqual("BlobNotFound", e.ErrorCode)); + } + [RecordedTest] public async Task AcquireLeaseAsync() { @@ -5712,69 +6032,337 @@ public async Task OpenWriteAsync_Close() byte[] data = GetRandomBuffer(Constants.KB); using Stream stream = new MemoryStream(data); - DataLakeFileOpenWriteOptions options = new DataLakeFileOpenWriteOptions + DataLakeFileOpenWriteOptions options = new DataLakeFileOpenWriteOptions + { + Close = true, + BufferSize = 256 + }; + + // Act + Stream openWriteStream = await file.OpenWriteAsync( + overwrite: false, + options); + await stream.CopyToAsync(openWriteStream); + await openWriteStream.FlushAsync(); + } + + #region GenerateSasTests + [RecordedTest] + public void CanGenerateSas_ClientConstructors() + { + // Arrange + var constants = TestConstants.Create(this); + var blobEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account); + + // Act - DataLakeFileClient(Uri blobContainerUri, fileClientOptions options = default) + DataLakeFileClient file = InstrumentClient(new DataLakeFileClient( + blobEndpoint, + GetOptions())); + Assert.IsFalse(file.CanGenerateSasUri); + + // Act - DataLakeFileClient(Uri blobContainerUri, StorageSharedKeyCredential credential, fileClientOptions options = default) + DataLakeFileClient file2 = InstrumentClient(new DataLakeFileClient( + blobEndpoint, + constants.Sas.SharedKeyCredential, + GetOptions())); + Assert.IsTrue(file2.CanGenerateSasUri); + + // Act - DataLakeFileClient(Uri blobContainerUri, TokenCredential credential, fileClientOptions options = default) + var tokenCredentials = new DefaultAzureCredential(); + DataLakeFileClient file3 = InstrumentClient(new DataLakeFileClient( + blobEndpoint, + tokenCredentials, + GetOptions())); + Assert.IsFalse(file3.CanGenerateSasUri); + } + + [RecordedTest] + public void CanGenerateSas_Mockable() + { + // Act + var file = new Mock(); + file.Setup(x => x.CanGenerateSasUri).Returns(false); + + // Assert + Assert.IsFalse(file.Object.CanGenerateSasUri); + + // Act + file.Setup(x => x.CanGenerateSasUri).Returns(true); + + // Assert + Assert.IsTrue(file.Object.CanGenerateSasUri); + } + + [RecordedTest] + public void GenerateSas_RequiredParameters() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); + + // Act + Uri sasUri = fileClient.GenerateSasUri(permissions, expiresOn); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public void GenerateSas_Builder() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path + }; + + // Act + Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public void GenerateSas_BuilderNullFileSystemName() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = null, + Path = path + }; + + // Act + Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public void GenerateSas_BuilderWrongFileSystemName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = GetNewFileSystemName(), // different filesystem name + Path = path, + }; + + // Act + TestHelper.AssertExpectedException( + () => fileClient.GenerateSasUri(sasBuilder), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.FileSystemName does not match FileSystemName in the Client. DataLakeSasBuilder.FileSystemName must either be left empty or match the FileSystemName in the Client")); + } + + [RecordedTest] + public void GenerateSas_BuilderNullFileName() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) { - Close = true, - BufferSize = 256 + FileSystemName = fileSystemName, + Path = null }; // Act - Stream openWriteStream = await file.OpenWriteAsync( - overwrite: false, - options); - await stream.CopyToAsync(openWriteStream); - await openWriteStream.FlushAsync(); + Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); } - #region GenerateSasTests [RecordedTest] - public void CanGenerateSas_ClientConstructors() + public void GenerateSas_BuilderWrongFileName() { // Arrange - var constants = TestConstants.Create(this); - var blobEndpoint = new Uri("https://127.0.0.1/" + constants.Sas.Account); - - // Act - DataLakeFileClient(Uri blobContainerUri, fileClientOptions options = default) - DataLakeFileClient file = InstrumentClient(new DataLakeFileClient( - blobEndpoint, - GetOptions())); - Assert.IsFalse(file.CanGenerateSasUri); - - // Act - DataLakeFileClient(Uri blobContainerUri, StorageSharedKeyCredential credential, fileClientOptions options = default) - DataLakeFileClient file2 = InstrumentClient(new DataLakeFileClient( - blobEndpoint, + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), constants.Sas.SharedKeyCredential, GetOptions())); - Assert.IsTrue(file2.CanGenerateSasUri); - // Act - DataLakeFileClient(Uri blobContainerUri, TokenCredential credential, fileClientOptions options = default) - var tokenCredentials = new DefaultAzureCredential(); - DataLakeFileClient file3 = InstrumentClient(new DataLakeFileClient( - blobEndpoint, - tokenCredentials, - GetOptions())); - Assert.IsFalse(file3.CanGenerateSasUri); + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = GetNewFileName(), // different path + }; + + // Act + TestHelper.AssertExpectedException( + () => fileClient.GenerateSasUri(sasBuilder), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.Path does not match Path in the Client. DataLakeSasBuilder.Path must either be left empty or match the Path in the Client")); } [RecordedTest] - public void CanGenerateSas_Mockable() + public void GenerateSas_BuilderIsDirectoryError() { - // Act - var file = new Mock(); - file.Setup(x => x.CanGenerateSasUri).Returns(false); + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string fileName = GetNewFileName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = fileName + }; + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); - // Assert - Assert.IsFalse(file.Object.CanGenerateSasUri); + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + constants.Sas.SharedKeyCredential, + GetOptions())); - // Act - file.Setup(x => x.CanGenerateSasUri).Returns(true); + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = GetNewFileName(), + IsDirectory = true, + IPRange = new SasIPRange(System.Net.IPAddress.None, System.Net.IPAddress.None), + ExpiresOn = Recording.UtcNow.AddHours(+1) + }; - // Assert - Assert.IsTrue(file.Object.CanGenerateSasUri); + // Act + TestHelper.AssertExpectedException( + () => fileClient.GenerateSasUri(sasBuilder), + new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to false to generate the respective SAS for the client, GetType")); } + #endregion + #region GenerateUserDelegationSasTests [RecordedTest] - public void GenerateSas_RequiredParameters() + public async Task GenerateUserDelegationSas_RequiredParameters() { // Arrange TestConstants constants = TestConstants.Create(this); @@ -5790,11 +6378,15 @@ public void GenerateSas_RequiredParameters() }; DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act - Uri sasUri = fileClient.GenerateSasUri(permissions, expiresOn); + Uri sasUri = fileClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey); // Assert DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) @@ -5806,13 +6398,13 @@ public void GenerateSas_RequiredParameters() { FileSystemName = fileSystemName, DirectoryOrFilePath = path, - Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileClient.AccountName) }; Assert.AreEqual(expectedUri.ToUri(), sasUri); } [RecordedTest] - public void GenerateSas_Builder() + public async Task GenerateUserDelegationSas_Builder() { TestConstants constants = TestConstants.Create(this); string fileSystemName = GetNewFileSystemName(); @@ -5827,7 +6419,6 @@ public void GenerateSas_Builder() }; DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -5836,8 +6427,13 @@ public void GenerateSas_Builder() Path = path }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act - Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + Uri sasUri = fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); // Assert DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) @@ -5849,13 +6445,70 @@ public void GenerateSas_Builder() { FileSystemName = fileSystemName, DirectoryOrFilePath = path, - Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileClient.AccountName) }; Assert.AreEqual(expectedUri.ToUri(), sasUri); } [RecordedTest] - public void GenerateSas_BuilderNullFileSystemName() + public async Task GenerateUserDelegationSas_BuilderNull() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => fileClient.GenerateUserDelegationSasUri(null, userDelegationKey), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path + }; + + // Act + TestHelper.AssertExpectedException( + () => fileClient.GenerateUserDelegationSasUri(sasBuilder, null), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullFileSystemName() { TestConstants constants = TestConstants.Create(this); string fileSystemName = GetNewFileSystemName(); @@ -5870,7 +6523,6 @@ public void GenerateSas_BuilderNullFileSystemName() }; DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -5879,8 +6531,13 @@ public void GenerateSas_BuilderNullFileSystemName() Path = path }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act - Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + Uri sasUri = fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); // Assert DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) @@ -5892,13 +6549,13 @@ public void GenerateSas_BuilderNullFileSystemName() { FileSystemName = fileSystemName, DirectoryOrFilePath = path, - Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileClient.AccountName) }; Assert.AreEqual(expectedUri.ToUri(), sasUri); } [RecordedTest] - public void GenerateSas_BuilderWrongFileSystemName() + public async Task GenerateUserDelegationSas_BuilderWrongFileSystemName() { // Arrange TestConstants constants = TestConstants.Create(this); @@ -5914,7 +6571,6 @@ public void GenerateSas_BuilderWrongFileSystemName() DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -5923,14 +6579,19 @@ public void GenerateSas_BuilderWrongFileSystemName() Path = path, }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act TestHelper.AssertExpectedException( - () => fileClient.GenerateSasUri(sasBuilder), + () => fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.FileSystemName does not match FileSystemName in the Client. DataLakeSasBuilder.FileSystemName must either be left empty or match the FileSystemName in the Client")); } [RecordedTest] - public void GenerateSas_BuilderNullFileName() + public async Task GenerateUserDelegationSas_BuilderNullFileName() { TestConstants constants = TestConstants.Create(this); string fileSystemName = GetNewFileSystemName(); @@ -5945,7 +6606,6 @@ public void GenerateSas_BuilderNullFileName() }; DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -5954,8 +6614,13 @@ public void GenerateSas_BuilderNullFileName() Path = null }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act - Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + Uri sasUri = fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); // Assert DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) @@ -5967,13 +6632,13 @@ public void GenerateSas_BuilderNullFileName() { FileSystemName = fileSystemName, DirectoryOrFilePath = path, - Sas = sasBuilder2.ToSasQueryParameters(constants.Sas.SharedKeyCredential) + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileClient.AccountName) }; Assert.AreEqual(expectedUri.ToUri(), sasUri); } [RecordedTest] - public void GenerateSas_BuilderWrongFileName() + public async Task GenerateUserDelegationSas_BuilderWrongFileName() { // Arrange TestConstants constants = TestConstants.Create(this); @@ -5989,7 +6654,6 @@ public void GenerateSas_BuilderWrongFileName() DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -5998,14 +6662,68 @@ public void GenerateSas_BuilderWrongFileName() Path = GetNewFileName(), // different path }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act TestHelper.AssertExpectedException( - () => fileClient.GenerateSasUri(sasBuilder), + () => fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.Path does not match Path in the Client. DataLakeSasBuilder.Path must either be left empty or match the Path in the Client")); } [RecordedTest] - public void GenerateSas_BuilderIsDirectoryError() + public async Task GenerateUserDelegationSas_BuilderNullIsDirectory() + { + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path + }; + DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = null + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + IsDirectory = false + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + DirectoryOrFilePath = path, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIsDirectoryError() { TestConstants constants = TestConstants.Create(this); string fileSystemName = GetNewFileSystemName(); @@ -6021,7 +6739,6 @@ public void GenerateSas_BuilderIsDirectoryError() DataLakeFileClient fileClient = InstrumentClient(new DataLakeFileClient( dataLakeUriBuilder.ToUri(), - constants.Sas.SharedKeyCredential, GetOptions())); DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) @@ -6033,10 +6750,15 @@ public void GenerateSas_BuilderIsDirectoryError() ExpiresOn = Recording.UtcNow.AddHours(+1) }; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + // Act TestHelper.AssertExpectedException( - () => fileClient.GenerateSasUri(sasBuilder), - new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to FalseName to generatethe respective SAS for the client, GetType")); + () => fileClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to false to generate the respective SAS for the client, GetType")); } #endregion diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs index 2c0af9ceaf4eb..6f719cb694eba 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileSystemClientTests.cs @@ -3329,6 +3329,272 @@ public void GenerateSas_BuilderWrongName() } #endregion + #region GenerateUserDelegationSasTests + [RecordedTest] + public async Task GenerateUserDelegationSas_RequiredParameters() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = fileSystemClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileSystemClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_Builder() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemClient.Name + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = fileSystemClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileSystemClient.AccountName) + }; + + Assert.AreEqual(expectedUri.ToUri(), sasUri); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNull() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => fileSystemClient.GenerateUserDelegationSasUri(null, userDelegationKey, out stringToSign), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemClient.Name + }; + + string stringToSign = null; + + // Act + TestHelper.AssertExpectedException( + () => fileSystemClient.GenerateUserDelegationSasUri(sasBuilder, null, out stringToSign), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullName() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = null + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = fileSystemClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName, + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, fileSystemClient.AccountName) + }; + + Assert.AreEqual(expectedUri.ToUri(), sasUri); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongName() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = GetNewFileSystemName(), // different filesytem name + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => fileSystemClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.FileSystemName does not match Name in the Client. DataLakeSasBuilder.FileSystemName must either be left empty or match the Name in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIncorrectlySetPath() + { + // Arrange + TestConstants constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + + Uri serviceUri = new Uri($"https://{constants.Sas.Account}.dfs.core.windows.net"); + DataLakeUriBuilder dataLakeUriBuilder = new DataLakeUriBuilder(serviceUri) + { + FileSystemName = fileSystemName + }; + + DataLakeFileSystemSasPermissions permissions = DataLakeFileSystemSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DataLakeFileSystemClient fileSystemClient = InstrumentClient(new DataLakeFileSystemClient( + dataLakeUriBuilder.ToUri(), + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = GetNewFileName() + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => fileSystemClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. builder.Path cannot be set to create a FileSystemName SAS.")); + } + #endregion + [RecordedTest] public void CanMockClientConstructors() { diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/PathClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/PathClientTests.cs index 64d119eb3c860..f95ecaeac8d59 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/PathClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/PathClientTests.cs @@ -409,6 +409,368 @@ public void GenerateSas_BuilderIsDirectoryError() } #endregion + #region GenerateUserDelegationSasTests + [RecordedTest] + public async Task GenerateUserDelegationSas_RequiredParameters() + { + // Arrange + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = pathClient.GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign); + + // Assert + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path + }; + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(blobEndpoint) + { + Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, pathClient.AccountName) + }; + Assert.AreEqual(expectedUri.ToUri().ToString(), sasUri.ToString()); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_Builder() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(blobEndpoint); + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, pathClient.AccountName); + Assert.AreEqual(expectedUri.ToUri().ToString(), sasUri.ToString()); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNull() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => pathClient.GenerateUserDelegationSasUri(null, userDelegationKey, out stringToSign), + new ArgumentNullException("builder")); + } + + [RecordedTest] + public void GenerateUserDelegationSas_UserDelegationKeyNull() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn + }; + + string stringToSign = null; + + // Act + TestHelper.AssertExpectedException( + () => pathClient.GenerateUserDelegationSasUri(sasBuilder, null, out stringToSign), + new ArgumentNullException("userDelegationKey")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullFileSystemName() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = null, + Path = path, + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(blobEndpoint); + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, pathClient.AccountName); + Assert.AreEqual(expectedUri.ToUri().ToString(), sasUri.ToString()); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongFileSystemName() + { + // Arrange + var constants = TestConstants.Create(this); + var blobEndpoint = new Uri("http://127.0.0.1/"); + UriBuilder blobUriBuilder = new UriBuilder(blobEndpoint); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + blobUriBuilder.Path += constants.Sas.Account + "/" + GetNewFileSystemName() + "/" + path; + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobUriBuilder.Uri, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = GetNewFileSystemName(), // different filesystem name + Path = path, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.FileSystemName does not match FileSystemName in the Client. DataLakeSasBuilder.FileSystemName must either be left empty or match the FileSystemName in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullPath() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = null, + StartsOn = startsOn + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(blobEndpoint); + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, pathClient.AccountName); + Assert.AreEqual(expectedUri.ToUri().ToString(), sasUri.ToString()); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderWrongPath() + { + // Arrange + var constants = TestConstants.Create(this); + var blobEndpoint = new Uri("http://127.0.0.1/"); + UriBuilder blobUriBuilder = new UriBuilder(blobEndpoint); + string fileSystemName = GetNewFileSystemName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + blobUriBuilder.Path += constants.Sas.Account + "/" + fileSystemName + "/" + GetNewFileName(); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobUriBuilder.Uri, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = GetNewFileName(), // different path + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. DataLakeSasBuilder.Path does not match Path in the Client. DataLakeSasBuilder.Path must either be left empty or match the Path in the Client")); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderNullIsDirectory() + { + var constants = TestConstants.Create(this); + string fileSystemName = GetNewFileSystemName(); + string path = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + DateTimeOffset startsOn = Recording.UtcNow.AddHours(-1); + var blobEndpoint = new Uri("http://127.0.0.1/" + constants.Sas.Account + "/" + fileSystemName + "/" + path); + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobEndpoint, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn, + IsDirectory = null + }; + + string stringToSign = null; + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + Uri sasUri = pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey, out stringToSign); + + // Assert + DataLakeUriBuilder expectedUri = new DataLakeUriBuilder(blobEndpoint); + DataLakeSasBuilder sasBuilder2 = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = path, + StartsOn = startsOn, + IsDirectory = false + }; + expectedUri.Sas = sasBuilder2.ToSasQueryParameters(userDelegationKey, pathClient.AccountName); + Assert.AreEqual(expectedUri.ToUri().ToString(), sasUri.ToString()); + Assert.IsNotNull(stringToSign); + } + + [RecordedTest] + public async Task GenerateUserDelegationSas_BuilderIsDirectoryError() + { + var constants = TestConstants.Create(this); + var blobEndpoint = new Uri("http://127.0.0.1/"); + UriBuilder blobUriBuilder = new UriBuilder(blobEndpoint); + string fileSystemName = GetNewFileSystemName(); + string fileName = GetNewFileName(); + DataLakeSasPermissions permissions = DataLakeSasPermissions.Read; + DateTimeOffset expiresOn = Recording.UtcNow.AddHours(+1); + blobUriBuilder.Path += constants.Sas.Account + "/" + fileSystemName + "/" + fileName; + DataLakePathClient pathClient = InstrumentClient(new DataLakePathClient( + blobUriBuilder.Uri, + GetOptions())); + + DataLakeSasBuilder sasBuilder = new DataLakeSasBuilder(permissions, expiresOn) + { + FileSystemName = fileSystemName, + Path = fileName, + IsDirectory = true, + }; + + Response userDelegationKeyResponse = await GetServiceClient_OAuth().GetUserDelegationKeyAsync( + startsOn: null, + expiresOn: Recording.UtcNow.AddHours(1)); + UserDelegationKey userDelegationKey = userDelegationKeyResponse.Value; + + // Act + TestHelper.AssertExpectedException( + () => pathClient.GenerateUserDelegationSasUri(sasBuilder, userDelegationKey), + new InvalidOperationException("SAS Uri cannot be generated. Expected builder.IsDirectory to be set to false to generate the respective SAS for the client, GetType")); + } + #endregion + [RecordedTest] public void CanMockClientConstructors() { diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index d4dca5b45c76f..554b55af32ad5 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -3,12 +3,10 @@ ## 12.21.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-01-05. +- Added support for the provisioned V2 billing model. +- Added support for specifying the binary file permission format for ShareFileClient.StartCopy() and .StartCopyAsync(). +- Added ShareAccessTier.Premium enum value. ## 12.20.0 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs index 4c5f277eb6166..b1b355dda471c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs @@ -25,11 +25,12 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential public virtual System.Threading.Tasks.Task> CreateDirectoryAsync(string directoryName, Azure.Storage.Files.Shares.Models.ShareDirectoryCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> CreateDirectoryAsync(string directoryName, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.Response CreateIfNotExists(Azure.Storage.Files.Shares.Models.ShareCreateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIfNotExists(Azure.Storage.Files.Shares.Models.ShareCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response CreateIfNotExists(System.Collections.Generic.IDictionary metadata = null, int? quotaInGB = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(Azure.Storage.Files.Shares.Models.ShareCreateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(System.Collections.Generic.IDictionary metadata = null, int? quotaInGB = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIfNotExists(System.Collections.Generic.IDictionary metadata, int? quotaInGB, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(Azure.Storage.Files.Shares.Models.ShareCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(System.Collections.Generic.IDictionary metadata, int? quotaInGB, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response CreatePermission(Azure.Storage.Files.Shares.Models.ShareFilePermission permission, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response CreatePermission(string permission, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -114,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2024_11_04) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { } public bool? AllowSourceTrailingDot { get { throw null; } set { } } public bool? AllowTrailingDot { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } } @@ -147,6 +148,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class ShareDirectoryClient @@ -562,6 +564,7 @@ public ShareAccessPolicy() { } public ShareAccessTier(string value) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareAccessTier Cool { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareAccessTier Hot { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAccessTier Premium { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareAccessTier TransactionOptimized { get { throw null; } } public bool Equals(Azure.Storage.Files.Shares.Models.ShareAccessTier other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -610,6 +613,8 @@ public ShareCreateOptions() { } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } set { } } public long? PaidBurstingMaxIops { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareProtocols? Protocols { get { throw null; } set { } } + public long? ProvisionedMaxBandwidthMibps { get { throw null; } set { } } + public long? ProvisionedMaxIops { get { throw null; } set { } } public int? QuotaInGB { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareRootSquash? RootSquash { get { throw null; } set { } } } @@ -681,6 +686,8 @@ public ShareDirectorySetHttpHeadersOptions() { } public static Azure.Storage.Files.Shares.Models.ShareErrorCode EmptyMetadataKey { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode FeatureVersionMismatch { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileLockConflict { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileShareProvisionedBandwidthDowngradeNotAllowed { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileShareProvisionedIopsDowngradeNotAllowed { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InsufficientAccountPermissions { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InternalError { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidAuthenticationInfo { get { throw null; } } @@ -760,6 +767,7 @@ public ShareFileCopyOptions() { } public Azure.Storage.Files.Shares.Models.PermissionCopyMode? FilePermissionCopyMode { get { throw null; } set { } } public bool? IgnoreReadOnly { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } } } @@ -1115,7 +1123,9 @@ public static partial class ShareModelFactory public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier, System.DateTimeOffset? lastModified, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, System.DateTimeOffset? nextAllowedQuotaDowngradeTime, System.DateTimeOffset? deletedOn, int? remainingRetentionDays, Azure.ETag? eTag, System.DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus, Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState, Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration, int? quotaInGB, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols, Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess) { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?), bool? enableSnapshotVirtualDirectoryAccess = default(bool?), bool? enablePaidBursting = default(bool?), long? paidBurstingMaxIops = default(long?), long? paidBustingMaxBandwidthMibps = default(long?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier, System.DateTimeOffset? lastModified, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, System.DateTimeOffset? nextAllowedQuotaDowngradeTime, System.DateTimeOffset? deletedOn, int? remainingRetentionDays, Azure.ETag? eTag, System.DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus, Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState, Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration, int? quotaInGB, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols, Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? enablePaidBursting, long? paidBurstingMaxIops, long? paidBustingMaxBandwidthMibps) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?), bool? enableSnapshotVirtualDirectoryAccess = default(bool?), bool? enablePaidBursting = default(bool?), long? paidBurstingMaxIops = default(long?), long? paidBustingMaxBandwidthMibps = default(long?), long? includedBurstIops = default(long?), long? maxBurstCreditsForIops = default(long?), System.DateTimeOffset? nextAllowedProvisionedIopsDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? nextAllowedProvisionedBandwidthDowngradeTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareSnapshotInfo ShareSnapshotInfo(string snapshot, Azure.ETag eTag, System.DateTimeOffset lastModified) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareStatistics ShareStatistics(int shareUsageBytes) { throw null; } @@ -1134,11 +1144,15 @@ internal ShareProperties() { } public bool? EnablePaidBursting { get { throw null; } } public bool? EnableSnapshotVirtualDirectoryAccess { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } + public long? IncludedBurstIops { get { throw null; } } public System.DateTimeOffset? LastModified { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseDuration? LeaseDuration { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseState? LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus? LeaseStatus { get { throw null; } } + public long? MaxBurstCreditsForIops { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public System.DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime { get { throw null; } } + public System.DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime { get { throw null; } } public System.DateTimeOffset? NextAllowedQuotaDowngradeTime { get { throw null; } } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } } public long? PaidBurstingMaxIops { get { throw null; } } @@ -1193,6 +1207,8 @@ public ShareSetPropertiesOptions() { } public bool? EnableSnapshotVirtualDirectoryAccess { get { throw null; } set { } } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } set { } } public long? PaidBurstingMaxIops { get { throw null; } set { } } + public long? ProvisionedMaxBandwidthMibps { get { throw null; } set { } } + public long? ProvisionedMaxIops { get { throw null; } set { } } public int? QuotaInGB { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareRootSquash? RootSquash { get { throw null; } set { } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs index 4c5f277eb6166..b1b355dda471c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs @@ -25,11 +25,12 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential public virtual System.Threading.Tasks.Task> CreateDirectoryAsync(string directoryName, Azure.Storage.Files.Shares.Models.ShareDirectoryCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> CreateDirectoryAsync(string directoryName, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; } - public virtual Azure.Response CreateIfNotExists(Azure.Storage.Files.Shares.Models.ShareCreateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIfNotExists(Azure.Storage.Files.Shares.Models.ShareCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response CreateIfNotExists(System.Collections.Generic.IDictionary metadata = null, int? quotaInGB = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(Azure.Storage.Files.Shares.Models.ShareCreateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(System.Collections.Generic.IDictionary metadata = null, int? quotaInGB = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIfNotExists(System.Collections.Generic.IDictionary metadata, int? quotaInGB, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(Azure.Storage.Files.Shares.Models.ShareCreateOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> CreateIfNotExistsAsync(System.Collections.Generic.IDictionary metadata, int? quotaInGB, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.Response CreatePermission(Azure.Storage.Files.Shares.Models.ShareFilePermission permission, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response CreatePermission(string permission, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -114,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2024_11_04) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { } public bool? AllowSourceTrailingDot { get { throw null; } set { } } public bool? AllowTrailingDot { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } } @@ -147,6 +148,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class ShareDirectoryClient @@ -562,6 +564,7 @@ public ShareAccessPolicy() { } public ShareAccessTier(string value) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareAccessTier Cool { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareAccessTier Hot { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareAccessTier Premium { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareAccessTier TransactionOptimized { get { throw null; } } public bool Equals(Azure.Storage.Files.Shares.Models.ShareAccessTier other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -610,6 +613,8 @@ public ShareCreateOptions() { } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } set { } } public long? PaidBurstingMaxIops { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareProtocols? Protocols { get { throw null; } set { } } + public long? ProvisionedMaxBandwidthMibps { get { throw null; } set { } } + public long? ProvisionedMaxIops { get { throw null; } set { } } public int? QuotaInGB { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareRootSquash? RootSquash { get { throw null; } set { } } } @@ -681,6 +686,8 @@ public ShareDirectorySetHttpHeadersOptions() { } public static Azure.Storage.Files.Shares.Models.ShareErrorCode EmptyMetadataKey { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode FeatureVersionMismatch { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileLockConflict { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileShareProvisionedBandwidthDowngradeNotAllowed { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileShareProvisionedIopsDowngradeNotAllowed { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InsufficientAccountPermissions { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InternalError { get { throw null; } } public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidAuthenticationInfo { get { throw null; } } @@ -760,6 +767,7 @@ public ShareFileCopyOptions() { } public Azure.Storage.Files.Shares.Models.PermissionCopyMode? FilePermissionCopyMode { get { throw null; } set { } } public bool? IgnoreReadOnly { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } } } @@ -1115,7 +1123,9 @@ public static partial class ShareModelFactory public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier, System.DateTimeOffset? lastModified, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, System.DateTimeOffset? nextAllowedQuotaDowngradeTime, System.DateTimeOffset? deletedOn, int? remainingRetentionDays, Azure.ETag? eTag, System.DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus, Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState, Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration, int? quotaInGB, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols, Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess) { throw null; } - public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?), bool? enableSnapshotVirtualDirectoryAccess = default(bool?), bool? enablePaidBursting = default(bool?), long? paidBurstingMaxIops = default(long?), long? paidBustingMaxBandwidthMibps = default(long?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier, System.DateTimeOffset? lastModified, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, System.DateTimeOffset? nextAllowedQuotaDowngradeTime, System.DateTimeOffset? deletedOn, int? remainingRetentionDays, Azure.ETag? eTag, System.DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus, Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState, Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration, int? quotaInGB, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols, Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? enablePaidBursting, long? paidBurstingMaxIops, long? paidBustingMaxBandwidthMibps) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareProperties ShareProperties(string accessTier = null, System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), int? provisionedIops = default(int?), int? provisionedIngressMBps = default(int?), int? provisionedEgressMBps = default(int?), System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), int? remainingRetentionDays = default(int?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? accessTierChangeTime = default(System.DateTimeOffset?), string accessTierTransitionState = null, Azure.Storage.Files.Shares.Models.ShareLeaseStatus? leaseStatus = default(Azure.Storage.Files.Shares.Models.ShareLeaseStatus?), Azure.Storage.Files.Shares.Models.ShareLeaseState? leaseState = default(Azure.Storage.Files.Shares.Models.ShareLeaseState?), Azure.Storage.Files.Shares.Models.ShareLeaseDuration? leaseDuration = default(Azure.Storage.Files.Shares.Models.ShareLeaseDuration?), int? quotaInGB = default(int?), System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Files.Shares.Models.ShareProtocols? protocols = default(Azure.Storage.Files.Shares.Models.ShareProtocols?), Azure.Storage.Files.Shares.Models.ShareRootSquash? rootSquash = default(Azure.Storage.Files.Shares.Models.ShareRootSquash?), bool? enableSnapshotVirtualDirectoryAccess = default(bool?), bool? enablePaidBursting = default(bool?), long? paidBurstingMaxIops = default(long?), long? paidBustingMaxBandwidthMibps = default(long?), long? includedBurstIops = default(long?), long? maxBurstCreditsForIops = default(long?), System.DateTimeOffset? nextAllowedProvisionedIopsDowngradeTime = default(System.DateTimeOffset?), System.DateTimeOffset? nextAllowedProvisionedBandwidthDowngradeTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareSnapshotInfo ShareSnapshotInfo(string snapshot, Azure.ETag eTag, System.DateTimeOffset lastModified) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareStatistics ShareStatistics(int shareUsageBytes) { throw null; } @@ -1134,11 +1144,15 @@ internal ShareProperties() { } public bool? EnablePaidBursting { get { throw null; } } public bool? EnableSnapshotVirtualDirectoryAccess { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } + public long? IncludedBurstIops { get { throw null; } } public System.DateTimeOffset? LastModified { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseDuration? LeaseDuration { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseState? LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus? LeaseStatus { get { throw null; } } + public long? MaxBurstCreditsForIops { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public System.DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime { get { throw null; } } + public System.DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime { get { throw null; } } public System.DateTimeOffset? NextAllowedQuotaDowngradeTime { get { throw null; } } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } } public long? PaidBurstingMaxIops { get { throw null; } } @@ -1193,6 +1207,8 @@ public ShareSetPropertiesOptions() { } public bool? EnableSnapshotVirtualDirectoryAccess { get { throw null; } set { } } public long? PaidBurstingMaxBandwidthMibps { get { throw null; } set { } } public long? PaidBurstingMaxIops { get { throw null; } set { } } + public long? ProvisionedMaxBandwidthMibps { get { throw null; } set { } } + public long? ProvisionedMaxIops { get { throw null; } set { } } public int? QuotaInGB { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareRootSquash? RootSquash { get { throw null; } set { } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json index 43af8c5e92a84..c2b5c3d31e6a2 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.Shares", - "Tag": "net/storage/Azure.Storage.Files.Shares_772bdf674f" + "Tag": "net/storage/Azure.Storage.Files.Shares_df67d82d59" } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs index 961c6ff47ce59..8a2edb8b99134 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs @@ -33,7 +33,7 @@ internal partial class DirectoryRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-11-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// If true, the trailing dot will not be trimmed from the target URI. /// Valid value is backup. /// If true, the trailing dot will not be trimmed from the source URI. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs index 61384dee810d4..c4d7056a5cfa3 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs @@ -79,5 +79,9 @@ public FileDownloadHeaders(Response response) public ShareLeaseState? LeaseState => _response.Headers.TryGetValue("x-ms-lease-state", out string value) ? value.ToShareLeaseState() : null; /// The current lease status of the file. public ShareLeaseStatus? LeaseStatus => _response.Headers.TryGetValue("x-ms-lease-status", out string value) ? value.ToShareLeaseStatus() : null; + /// Indicates the response body contains a structured message and specifies the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; + /// The length of the blob/file content inside the message body when the response body is returned as a structured message. Will always be smaller than Content-Length. + public long? StructuredContentLength => _response.Headers.TryGetValue("x-ms-structured-content-length", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs index d4b584e6660ee..07f88af545aec 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs @@ -34,7 +34,7 @@ internal partial class FileRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-11-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. The default value is "update". /// If true, the trailing dot will not be trimmed from the target URI. /// Valid value is backup. @@ -204,7 +204,7 @@ public ResponseWithHeaders Create(long fileContentLength, str } } - internal HttpMessage CreateDownloadRequest(int? timeout, string range, bool? rangeGetContentMD5, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateDownloadRequest(int? timeout, string range, bool? rangeGetContentMD5, string structuredBodyType, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -230,6 +230,10 @@ internal HttpMessage CreateDownloadRequest(int? timeout, string range, bool? ran { request.Headers.Add("x-ms-range-get-content-md5", rangeGetContentMD5.Value); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } if (shareFileRequestConditions?.LeaseId != null) { request.Headers.Add("x-ms-lease-id", shareFileRequestConditions.LeaseId); @@ -246,11 +250,12 @@ internal HttpMessage CreateDownloadRequest(int? timeout, string range, bool? ran /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// Return file data only from the specified byte range. /// When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. + /// Specifies the response content should be returned as a structured message and specifies the message schema version and properties. /// Parameter group. /// The cancellation token to use. - public async Task> DownloadAsync(int? timeout = null, string range = null, bool? rangeGetContentMD5 = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> DownloadAsync(int? timeout = null, string range = null, bool? rangeGetContentMD5 = null, string structuredBodyType = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - using var message = CreateDownloadRequest(timeout, range, rangeGetContentMD5, shareFileRequestConditions); + using var message = CreateDownloadRequest(timeout, range, rangeGetContentMD5, structuredBodyType, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileDownloadHeaders(message.Response); switch (message.Response.Status) @@ -270,11 +275,12 @@ public async Task> DownloadAsyn /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// Return file data only from the specified byte range. /// When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. + /// Specifies the response content should be returned as a structured message and specifies the message schema version and properties. /// Parameter group. /// The cancellation token to use. - public ResponseWithHeaders Download(int? timeout = null, string range = null, bool? rangeGetContentMD5 = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Download(int? timeout = null, string range = null, bool? rangeGetContentMD5 = null, string structuredBodyType = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - using var message = CreateDownloadRequest(timeout, range, rangeGetContentMD5, shareFileRequestConditions); + using var message = CreateDownloadRequest(timeout, range, rangeGetContentMD5, structuredBodyType, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileDownloadHeaders(message.Response); switch (message.Response.Status) @@ -945,7 +951,7 @@ public ResponseWithHeaders BreakLease(int? timeout = null } } - internal HttpMessage CreateUploadRangeRequest(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout, byte[] contentMD5, FileLastWrittenMode? fileLastWrittenMode, Stream optionalbody, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateUploadRangeRequest(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout, byte[] contentMD5, FileLastWrittenMode? fileLastWrittenMode, string structuredBodyType, long? structuredContentLength, Stream optionalbody, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -977,6 +983,14 @@ internal HttpMessage CreateUploadRangeRequest(string range, ShareFileRangeWriteT { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (structuredBodyType != null) + { + request.Headers.Add("x-ms-structured-body", structuredBodyType); + } + if (structuredContentLength != null) + { + request.Headers.Add("x-ms-structured-content-length", structuredContentLength.Value); + } request.Headers.Add("Accept", "application/xml"); if (optionalbody != null) { @@ -998,18 +1012,20 @@ internal HttpMessage CreateUploadRangeRequest(string range, ShareFileRangeWriteT /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). /// If the file last write time should be preserved or overwritten. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// Initial data. /// Parameter group. /// The cancellation token to use. /// is null. - public async Task> UploadRangeAsync(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout = null, byte[] contentMD5 = null, FileLastWrittenMode? fileLastWrittenMode = null, Stream optionalbody = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> UploadRangeAsync(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout = null, byte[] contentMD5 = null, FileLastWrittenMode? fileLastWrittenMode = null, string structuredBodyType = null, long? structuredContentLength = null, Stream optionalbody = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (range == null) { throw new ArgumentNullException(nameof(range)); } - using var message = CreateUploadRangeRequest(range, fileRangeWrite, contentLength, timeout, contentMD5, fileLastWrittenMode, optionalbody, shareFileRequestConditions); + using var message = CreateUploadRangeRequest(range, fileRangeWrite, contentLength, timeout, contentMD5, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileUploadRangeHeaders(message.Response); switch (message.Response.Status) @@ -1028,18 +1044,20 @@ public async Task> UploadRangeAsync( /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). /// If the file last write time should be preserved or overwritten. + /// Required if the request body is a structured message. Specifies the message schema version and properties. + /// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller than Content-Length. /// Initial data. /// Parameter group. /// The cancellation token to use. /// is null. - public ResponseWithHeaders UploadRange(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout = null, byte[] contentMD5 = null, FileLastWrittenMode? fileLastWrittenMode = null, Stream optionalbody = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders UploadRange(string range, ShareFileRangeWriteType fileRangeWrite, long contentLength, int? timeout = null, byte[] contentMD5 = null, FileLastWrittenMode? fileLastWrittenMode = null, string structuredBodyType = null, long? structuredContentLength = null, Stream optionalbody = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (range == null) { throw new ArgumentNullException(nameof(range)); } - using var message = CreateUploadRangeRequest(range, fileRangeWrite, contentLength, timeout, contentMD5, fileLastWrittenMode, optionalbody, shareFileRequestConditions); + using var message = CreateUploadRangeRequest(range, fileRangeWrite, contentLength, timeout, contentMD5, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileUploadRangeHeaders(message.Response); switch (message.Response.Status) @@ -1290,7 +1308,7 @@ public ResponseWithHeaders GetRange } } - internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, string filePermissionKey, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1312,6 +1330,10 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi { request.Headers.Add("x-ms-file-permission", filePermission); } + if (filePermissionFormat != null) + { + request.Headers.Add("x-ms-file-permission-format", filePermissionFormat.Value.ToSerialString()); + } if (filePermissionKey != null) { request.Headers.Add("x-ms-file-permission-key", filePermissionKey); @@ -1369,19 +1391,20 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Parameter group. /// Parameter group. /// The cancellation token to use. /// is null. - public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (copySource == null) { throw new ArgumentNullException(nameof(copySource)); } - using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); + using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileStartCopyHeaders(message.Response); switch (message.Response.Status) @@ -1398,19 +1421,20 @@ public async Task> StartCopyAsync(stri /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Parameter group. /// Parameter group. /// The cancellation token to use. /// is null. - public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (copySource == null) { throw new ArgumentNullException(nameof(copySource)); } - using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); + using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileStartCopyHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileUploadRangeHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileUploadRangeHeaders.cs index db079c2692663..322bfcd1b6d83 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileUploadRangeHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileUploadRangeHeaders.cs @@ -27,5 +27,7 @@ public FileUploadRangeHeaders(Response response) public bool? IsServerEncrypted => _response.Headers.TryGetValue("x-ms-request-server-encrypted", out bool? value) ? value : null; /// Last write time for the file. public DateTimeOffset? FileLastWriteTime => _response.Headers.TryGetValue("x-ms-file-last-write-time", out DateTimeOffset? value) ? value : null; + /// Indicates the structured message body was accepted and mirrors back the message schema version and properties. + public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareAccessTier.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareAccessTier.cs index 1143539ec7749..13a41351e9229 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareAccessTier.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareAccessTier.cs @@ -25,6 +25,7 @@ public ShareAccessTier(string value) private const string TransactionOptimizedValue = "TransactionOptimized"; private const string HotValue = "Hot"; private const string CoolValue = "Cool"; + private const string PremiumValue = "Premium"; /// TransactionOptimized. public static ShareAccessTier TransactionOptimized { get; } = new ShareAccessTier(TransactionOptimizedValue); @@ -32,6 +33,8 @@ public ShareAccessTier(string value) public static ShareAccessTier Hot { get; } = new ShareAccessTier(HotValue); /// Cool. public static ShareAccessTier Cool { get; } = new ShareAccessTier(CoolValue); + /// Premium. + public static ShareAccessTier Premium { get; } = new ShareAccessTier(PremiumValue); /// Determines if two values are the same. public static bool operator ==(ShareAccessTier left, ShareAccessTier right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareErrorCode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareErrorCode.cs index 86018fa5cd082..c61baa145e37c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareErrorCode.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ShareErrorCode.cs @@ -30,6 +30,8 @@ public ShareErrorCode(string value) private const string ConditionHeadersNotSupportedValue = "ConditionHeadersNotSupported"; private const string ConditionNotMetValue = "ConditionNotMet"; private const string EmptyMetadataKeyValue = "EmptyMetadataKey"; + private const string FileShareProvisionedBandwidthDowngradeNotAllowedValue = "FileShareProvisionedBandwidthDowngradeNotAllowed"; + private const string FileShareProvisionedIopsDowngradeNotAllowedValue = "FileShareProvisionedIopsDowngradeNotAllowed"; private const string InsufficientAccountPermissionsValue = "InsufficientAccountPermissions"; private const string InternalErrorValue = "InternalError"; private const string InvalidAuthenticationInfoValue = "InvalidAuthenticationInfo"; @@ -106,6 +108,10 @@ public ShareErrorCode(string value) public static ShareErrorCode ConditionNotMet { get; } = new ShareErrorCode(ConditionNotMetValue); /// EmptyMetadataKey. public static ShareErrorCode EmptyMetadataKey { get; } = new ShareErrorCode(EmptyMetadataKeyValue); + /// FileShareProvisionedBandwidthDowngradeNotAllowed. + public static ShareErrorCode FileShareProvisionedBandwidthDowngradeNotAllowed { get; } = new ShareErrorCode(FileShareProvisionedBandwidthDowngradeNotAllowedValue); + /// FileShareProvisionedIopsDowngradeNotAllowed. + public static ShareErrorCode FileShareProvisionedIopsDowngradeNotAllowed { get; } = new ShareErrorCode(FileShareProvisionedIopsDowngradeNotAllowedValue); /// InsufficientAccountPermissions. public static ShareErrorCode InsufficientAccountPermissions { get; } = new ShareErrorCode(InsufficientAccountPermissionsValue); /// InternalError. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.Serialization.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.Serialization.cs index bccf5b4b21fba..b01f216bb03d6 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.Serialization.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.Serialization.cs @@ -37,6 +37,10 @@ internal static SharePropertiesInternal DeserializeSharePropertiesInternal(XElem bool? paidBurstingEnabled = default; long? paidBurstingMaxIops = default; long? paidBurstingMaxBandwidthMibps = default; + long? includedBurstIops = default; + long? maxBurstCreditsForIops = default; + DateTimeOffset? nextAllowedProvisionedIopsDowngradeTime = default; + DateTimeOffset? nextAllowedProvisionedBandwidthDowngradeTime = default; if (element.Element("Last-Modified") is XElement lastModifiedElement) { lastModified = lastModifiedElement.GetDateTimeOffsetValue("R"); @@ -125,6 +129,22 @@ internal static SharePropertiesInternal DeserializeSharePropertiesInternal(XElem { paidBurstingMaxBandwidthMibps = (long?)paidBurstingMaxBandwidthMibpsElement; } + if (element.Element("IncludedBurstIops") is XElement includedBurstIopsElement) + { + includedBurstIops = (long?)includedBurstIopsElement; + } + if (element.Element("MaxBurstCreditsForIops") is XElement maxBurstCreditsForIopsElement) + { + maxBurstCreditsForIops = (long?)maxBurstCreditsForIopsElement; + } + if (element.Element("NextAllowedProvisionedIopsDowngradeTime") is XElement nextAllowedProvisionedIopsDowngradeTimeElement) + { + nextAllowedProvisionedIopsDowngradeTime = nextAllowedProvisionedIopsDowngradeTimeElement.GetDateTimeOffsetValue("R"); + } + if (element.Element("NextAllowedProvisionedBandwidthDowngradeTime") is XElement nextAllowedProvisionedBandwidthDowngradeTimeElement) + { + nextAllowedProvisionedBandwidthDowngradeTime = nextAllowedProvisionedBandwidthDowngradeTimeElement.GetDateTimeOffsetValue("R"); + } return new SharePropertiesInternal( lastModified, etag, @@ -147,7 +167,11 @@ internal static SharePropertiesInternal DeserializeSharePropertiesInternal(XElem enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxIops, - paidBurstingMaxBandwidthMibps); + paidBurstingMaxBandwidthMibps, + includedBurstIops, + maxBurstCreditsForIops, + nextAllowedProvisionedIopsDowngradeTime, + nextAllowedProvisionedBandwidthDowngradeTime); } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.cs index b550b3e07bd7e..eeb13840f2042 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/SharePropertiesInternal.cs @@ -50,7 +50,11 @@ internal SharePropertiesInternal(DateTimeOffset lastModified, string etag, int q /// /// /// - internal SharePropertiesInternal(DateTimeOffset lastModified, string etag, int quota, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, int? provisionedBandwidthMiBps, DateTimeOffset? nextAllowedQuotaDowngradeTime, DateTimeOffset? deletedTime, int? remainingRetentionDays, string accessTier, DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, ShareLeaseStatus? leaseStatus, ShareLeaseState? leaseState, ShareLeaseDuration? leaseDuration, string enabledProtocols, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxIops, long? paidBurstingMaxBandwidthMibps) + /// + /// + /// + /// + internal SharePropertiesInternal(DateTimeOffset lastModified, string etag, int quota, int? provisionedIops, int? provisionedIngressMBps, int? provisionedEgressMBps, int? provisionedBandwidthMiBps, DateTimeOffset? nextAllowedQuotaDowngradeTime, DateTimeOffset? deletedTime, int? remainingRetentionDays, string accessTier, DateTimeOffset? accessTierChangeTime, string accessTierTransitionState, ShareLeaseStatus? leaseStatus, ShareLeaseState? leaseState, ShareLeaseDuration? leaseDuration, string enabledProtocols, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxIops, long? paidBurstingMaxBandwidthMibps, long? includedBurstIops, long? maxBurstCreditsForIops, DateTimeOffset? nextAllowedProvisionedIopsDowngradeTime, DateTimeOffset? nextAllowedProvisionedBandwidthDowngradeTime) { LastModified = lastModified; Etag = etag; @@ -74,6 +78,10 @@ internal SharePropertiesInternal(DateTimeOffset lastModified, string etag, int q PaidBurstingEnabled = paidBurstingEnabled; PaidBurstingMaxIops = paidBurstingMaxIops; PaidBurstingMaxBandwidthMibps = paidBurstingMaxBandwidthMibps; + IncludedBurstIops = includedBurstIops; + MaxBurstCreditsForIops = maxBurstCreditsForIops; + NextAllowedProvisionedIopsDowngradeTime = nextAllowedProvisionedIopsDowngradeTime; + NextAllowedProvisionedBandwidthDowngradeTime = nextAllowedProvisionedBandwidthDowngradeTime; } /// Gets the last modified. @@ -120,5 +128,13 @@ internal SharePropertiesInternal(DateTimeOffset lastModified, string etag, int q public long? PaidBurstingMaxIops { get; } /// Gets the paid bursting max bandwidth mibps. public long? PaidBurstingMaxBandwidthMibps { get; } + /// Gets the included burst iops. + public long? IncludedBurstIops { get; } + /// Gets the max burst credits for iops. + public long? MaxBurstCreditsForIops { get; } + /// Gets the next allowed provisioned iops downgrade time. + public DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime { get; } + /// Gets the next allowed provisioned bandwidth downgrade time. + public DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime { get; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs index ef4c21b9a33c7..fe5ea495a7a15 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs @@ -31,7 +31,7 @@ internal partial class ServiceRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-11-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// Valid value is backup. /// , , or is null. public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareCreateHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareCreateHeaders.cs index 6f22731fa70ca..c06e37fdb62dc 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareCreateHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareCreateHeaders.cs @@ -21,5 +21,15 @@ public ShareCreateHeaders(Response response) public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; /// Indicates the version of the File service used to execute the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Returns the current share quota in GB. + public long? Quota => _response.Headers.TryGetValue("x-ms-share-quota", out long? value) ? value : null; + /// The provisioned IOPS of the share. + public long? ShareProvisionedIops => _response.Headers.TryGetValue("x-ms-share-provisioned-iops", out long? value) ? value : null; + /// The provisioned throughput of the share. + public long? ShareProvisionedBandwidthMibps => _response.Headers.TryGetValue("x-ms-share-provisioned-bandwidth-mibps", out long? value) ? value : null; + /// Returns the calculated burst IOPS of the share. + public long? ShareIncludedBurstIops => _response.Headers.TryGetValue("x-ms-share-included-burst-iops", out long? value) ? value : null; + /// Returned the calculated maximum burst credits. + public long? MaxBurstCreditsForIops => _response.Headers.TryGetValue("x-ms-share-max-burst-credits-for-iops", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareDeleteHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareDeleteHeaders.cs index 980991becbeb8..c0521e8c8e75a 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareDeleteHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareDeleteHeaders.cs @@ -18,5 +18,9 @@ public ShareDeleteHeaders(Response response) } /// Indicates the version of the File service used to execute the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Returned only for provisioned v2 file shares. Returns an approximate used storage size of the share, in bytes. + public long? XMsFileShareUsageBytes => _response.Headers.TryGetValue("x-ms-file-share-usage-bytes", out long? value) ? value : null; + /// Returned only for provisioned v2 file shares. Returns an approximate used snapshot storage size of the share, in bytes. + public long? XMsFileShareSnapshotUsageBytes => _response.Headers.TryGetValue("x-ms-file-share-snapshot-usage-bytes", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareGetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareGetPropertiesHeaders.cs index 86a01b76969d8..a0a18081ee687 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareGetPropertiesHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareGetPropertiesHeaders.cs @@ -35,7 +35,7 @@ public ShareGetPropertiesHeaders(Response response) public int? ProvisionedEgressMBps => _response.Headers.TryGetValue("x-ms-share-provisioned-egress-mbps", out int? value) ? value : null; /// Returns the current share next allowed quota downgrade time. public DateTimeOffset? NextAllowedQuotaDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-quota-downgrade-time", out DateTimeOffset? value) ? value : null; - /// Returns the current share provisioned bandwidth in megabits per second. + /// Returns the current share provisioned bandwidth in mebibytes per second. public int? ProvisionedBandwidthMibps => _response.Headers.TryGetValue("x-ms-share-provisioned-bandwidth-mibps", out int? value) ? value : null; /// When a share is leased, specifies whether the lease is of infinite or fixed duration. public ShareLeaseDuration? LeaseDuration => _response.Headers.TryGetValue("x-ms-lease-duration", out string value) ? value.ToShareLeaseDuration() : null; @@ -61,5 +61,13 @@ public ShareGetPropertiesHeaders(Response response) public long? PaidBurstingMaxIops => _response.Headers.TryGetValue("x-ms-share-paid-bursting-max-iops", out long? value) ? value : null; /// Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. public long? PaidBurstingMaxBandwidthMibps => _response.Headers.TryGetValue("x-ms-share-paid-bursting-max-bandwidth-mibps", out long? value) ? value : null; + /// Return the calculated burst IOPS of the share. + public long? IncludedBurstIops => _response.Headers.TryGetValue("x-ms-share-included-burst-iops", out long? value) ? value : null; + /// Returned the calculated maximum burst credits. This is not the current burst credit level, but the maximum burst credits the share can have. + public long? MaxBurstCreditsForIops => _response.Headers.TryGetValue("x-ms-share-max-burst-credits-for-iops", out long? value) ? value : null; + /// Returns the current share next allowed provisioned iops downgrade time. + public DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-provisioned-iops-downgrade-time", out DateTimeOffset? value) ? value : null; + /// Returns the current share next allowed provisioned bandwidth downgrade time. + public DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-provisioned-bandwidth-downgrade-time", out DateTimeOffset? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs index 599aacf2c6287..69bb02404dd49 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs @@ -32,7 +32,7 @@ internal partial class ShareRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2024-11-04". + /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". /// Valid value is backup. /// , , or is null. public ShareRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null) @@ -44,7 +44,7 @@ public ShareRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipelin _fileRequestIntent = fileRequestIntent; } - internal HttpMessage CreateCreateRequest(int? timeout, IDictionary metadata, int? quota, ShareAccessTier? accessTier, string enabledProtocols, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxBandwidthMibps, long? paidBurstingMaxIops) + internal HttpMessage CreateCreateRequest(int? timeout, IDictionary metadata, int? quota, ShareAccessTier? accessTier, string enabledProtocols, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxBandwidthMibps, long? paidBurstingMaxIops, long? shareProvisionedIops, long? shareProvisionedBandwidthMibps) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -98,6 +98,14 @@ internal HttpMessage CreateCreateRequest(int? timeout, IDictionary Optional. Boolean. Default if not specified is false. This property enables paid bursting. /// Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. /// The cancellation token to use. - public async Task> CreateAsync(int? timeout = null, IDictionary metadata = null, int? quota = null, ShareAccessTier? accessTier = null, string enabledProtocols = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, CancellationToken cancellationToken = default) + public async Task> CreateAsync(int? timeout = null, IDictionary metadata = null, int? quota = null, ShareAccessTier? accessTier = null, string enabledProtocols = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, long? shareProvisionedIops = null, long? shareProvisionedBandwidthMibps = null, CancellationToken cancellationToken = default) { - using var message = CreateCreateRequest(timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops); + using var message = CreateCreateRequest(timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new ShareCreateHeaders(message.Response); switch (message.Response.Status) @@ -139,10 +149,12 @@ public async Task> CreateAsync(int? time /// Optional. Boolean. Default if not specified is false. This property enables paid bursting. /// Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. /// The cancellation token to use. - public ResponseWithHeaders Create(int? timeout = null, IDictionary metadata = null, int? quota = null, ShareAccessTier? accessTier = null, string enabledProtocols = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Create(int? timeout = null, IDictionary metadata = null, int? quota = null, ShareAccessTier? accessTier = null, string enabledProtocols = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, long? shareProvisionedIops = null, long? shareProvisionedBandwidthMibps = null, CancellationToken cancellationToken = default) { - using var message = CreateCreateRequest(timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops); + using var message = CreateCreateRequest(timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps); _pipeline.Send(message, cancellationToken); var headers = new ShareCreateHeaders(message.Response); switch (message.Response.Status) @@ -917,7 +929,7 @@ public ResponseWithHeaders GetPermis } } - internal HttpMessage CreateSetPropertiesRequest(int? timeout, int? quota, ShareAccessTier? accessTier, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxBandwidthMibps, long? paidBurstingMaxIops, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateSetPropertiesRequest(int? timeout, int? quota, ShareAccessTier? accessTier, ShareRootSquash? rootSquash, bool? enableSnapshotVirtualDirectoryAccess, bool? paidBurstingEnabled, long? paidBurstingMaxBandwidthMibps, long? paidBurstingMaxIops, long? shareProvisionedIops, long? shareProvisionedBandwidthMibps, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -968,6 +980,14 @@ internal HttpMessage CreateSetPropertiesRequest(int? timeout, int? quota, ShareA { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (shareProvisionedIops != null) + { + request.Headers.Add("x-ms-share-provisioned-iops", shareProvisionedIops.Value); + } + if (shareProvisionedBandwidthMibps != null) + { + request.Headers.Add("x-ms-share-provisioned-bandwidth-mibps", shareProvisionedBandwidthMibps.Value); + } request.Headers.Add("Accept", "application/xml"); return message; } @@ -981,11 +1001,13 @@ internal HttpMessage CreateSetPropertiesRequest(int? timeout, int? quota, ShareA /// Optional. Boolean. Default if not specified is false. This property enables paid bursting. /// Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. /// Parameter group. /// The cancellation token to use. - public async Task> SetPropertiesAsync(int? timeout = null, int? quota = null, ShareAccessTier? accessTier = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> SetPropertiesAsync(int? timeout = null, int? quota = null, ShareAccessTier? accessTier = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, long? shareProvisionedIops = null, long? shareProvisionedBandwidthMibps = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - using var message = CreateSetPropertiesRequest(timeout, quota, accessTier, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareFileRequestConditions); + using var message = CreateSetPropertiesRequest(timeout, quota, accessTier, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new ShareSetPropertiesHeaders(message.Response); switch (message.Response.Status) @@ -1006,11 +1028,13 @@ public async Task> SetPropertiesA /// Optional. Boolean. Default if not specified is false. This property enables paid bursting. /// Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. + /// Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. /// Parameter group. /// The cancellation token to use. - public ResponseWithHeaders SetProperties(int? timeout = null, int? quota = null, ShareAccessTier? accessTier = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders SetProperties(int? timeout = null, int? quota = null, ShareAccessTier? accessTier = null, ShareRootSquash? rootSquash = null, bool? enableSnapshotVirtualDirectoryAccess = null, bool? paidBurstingEnabled = null, long? paidBurstingMaxBandwidthMibps = null, long? paidBurstingMaxIops = null, long? shareProvisionedIops = null, long? shareProvisionedBandwidthMibps = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - using var message = CreateSetPropertiesRequest(timeout, quota, accessTier, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareFileRequestConditions); + using var message = CreateSetPropertiesRequest(timeout, quota, accessTier, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new ShareSetPropertiesHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestoreHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestoreHeaders.cs index cd5411eee99d0..7cbb4e511e775 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestoreHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestoreHeaders.cs @@ -21,5 +21,15 @@ public ShareRestoreHeaders(Response response) public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; /// Indicates the version of the File service used to execute the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Returns the current share quota in GB. + public long? Quota => _response.Headers.TryGetValue("x-ms-share-quota", out long? value) ? value : null; + /// Returns the current share provisioned ipos. + public long? ProvisionedIops => _response.Headers.TryGetValue("x-ms-share-provisioned-iops", out long? value) ? value : null; + /// Returns the current share provisioned bandwidth in mebibytes per second. + public long? ProvisionedBandwidthMibps => _response.Headers.TryGetValue("x-ms-share-provisioned-bandwidth-mibps", out long? value) ? value : null; + /// Return the calculated burst IOPS of the share. + public long? IncludedBurstIops => _response.Headers.TryGetValue("x-ms-share-included-burst-iops", out long? value) ? value : null; + /// Returned the calculated maximum burst credits. This is not the current burst credit level, but the maximum burst credits the share can have. + public long? MaxBurstCreditsForIops => _response.Headers.TryGetValue("x-ms-share-max-burst-credits-for-iops", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareSetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareSetPropertiesHeaders.cs index 85e942d84cf1f..d12ce08289db9 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareSetPropertiesHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareSetPropertiesHeaders.cs @@ -21,5 +21,21 @@ public ShareSetPropertiesHeaders(Response response) public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; /// Indicates the version of the File service used to execute the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Returns the current share quota in GB. + public long? Quota => _response.Headers.TryGetValue("x-ms-share-quota", out long? value) ? value : null; + /// Returns the current share provisioned ipos. + public long? ProvisionedIops => _response.Headers.TryGetValue("x-ms-share-provisioned-iops", out long? value) ? value : null; + /// Returns the current share provisioned bandwidth in mebibytes per second. + public long? ProvisionedBandwidthMibps => _response.Headers.TryGetValue("x-ms-share-provisioned-bandwidth-mibps", out long? value) ? value : null; + /// Return the calculated burst IOPS of the share. + public long? IncludedBurstIops => _response.Headers.TryGetValue("x-ms-share-included-burst-iops", out long? value) ? value : null; + /// Returned the calculated maximum burst credits. This is not the current burst credit level, but the maximum burst credits the share can have. + public long? MaxBurstCreditsForIops => _response.Headers.TryGetValue("x-ms-share-max-burst-credits-for-iops", out long? value) ? value : null; + /// Returns the current share next allowed quota downgrade time. + public DateTimeOffset? NextAllowedQuotaDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-quota-downgrade-time", out DateTimeOffset? value) ? value : null; + /// Returns the current share next allowed provisioned iops downgrade time. + public DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-provisioned-iops-downgrade-time", out DateTimeOffset? value) ? value : null; + /// Returns the current share next allowed provisioned bandwidth downgrade time. + public DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime => _response.Headers.TryGetValue("x-ms-share-next-allowed-provisioned-bandwidth-downgrade-time", out DateTimeOffset? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareCreateOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareCreateOptions.cs index 5da39cf3fb5cc..39ebe5d6ea003 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareCreateOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareCreateOptions.cs @@ -64,5 +64,18 @@ public class ShareCreateOptions /// Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// public long? PaidBurstingMaxBandwidthMibps { get; set; } + + /// + /// Optional. Only applicable to provisioned v2 storage accounts. + /// The provisioned IOPS of the share. For SSD, minimum IOPS is 3,000 and maximum is 100,000. For HDD, minimum IOPS is 500 and maximum is 50,000. + /// + public long? ProvisionedMaxIops { get; set; } + + /// + /// Optional. Only applicable to provisioned v2 storage accounts. + /// The provisioned throughput of the share. For SSD, minimum throughput is 125 MiB/sec and maximum is 10,340 MiB/sec. + /// For HDD, minimum throughput is 60 MiB/sec and maximum is 5,125 MiB/sec. + /// + public long? ProvisionedMaxBandwidthMibps { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs index db7f3bc017ab9..d74113002f182 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs @@ -27,6 +27,13 @@ public class ShareFileCopyOptions /// public string FilePermission { get; set; } + /// + /// Specifies the format in which the file permission is returned. If unspecified or explicitly set to SDDL, + /// the permission is returned in SDDL format. If explicitly set to binary, the permission is returned as a base64 + /// string representing the binary encoding of the permission. + /// + public FilePermissionFormat? PermissionFormat { get; set; } + /// /// Specifies the option to copy file security descriptor from source file or /// to set it using the value which is defined by the header value of FilePermission diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareModelFactory.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareModelFactory.cs index 618fdfc0c6aba..a708316d026fc 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareModelFactory.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareModelFactory.cs @@ -48,7 +48,68 @@ public static ShareProperties ShareProperties( bool? enableSnapshotVirtualDirectoryAccess = default, bool? enablePaidBursting = default, long? paidBurstingMaxIops = default, - long? paidBustingMaxBandwidthMibps = default) + long? paidBustingMaxBandwidthMibps = default, + long? includedBurstIops = default, + long? maxBurstCreditsForIops = default, + DateTimeOffset? nextAllowedProvisionedIopsDowngradeTime = default, + DateTimeOffset? nextAllowedProvisionedBandwidthDowngradeTime = default) + => new ShareProperties() + { + AccessTier = accessTier, + LastModified = lastModified, + ProvisionedIops = provisionedIops, + ProvisionedIngressMBps = provisionedIngressMBps, + ProvisionedEgressMBps = provisionedEgressMBps, + NextAllowedQuotaDowngradeTime = nextAllowedQuotaDowngradeTime, + DeletedOn = deletedOn, + RemainingRetentionDays = remainingRetentionDays, + ETag = eTag, + AccessTierChangeTime = accessTierChangeTime, + AccessTierTransitionState = accessTierTransitionState, + LeaseStatus = leaseStatus, + LeaseState = leaseState, + LeaseDuration = leaseDuration, + QuotaInGB = quotaInGB, + Metadata = metadata, + Protocols = protocols, + RootSquash = rootSquash, + EnableSnapshotVirtualDirectoryAccess = enableSnapshotVirtualDirectoryAccess, + EnablePaidBursting = enablePaidBursting, + PaidBurstingMaxIops = paidBurstingMaxIops, + PaidBurstingMaxBandwidthMibps = paidBustingMaxBandwidthMibps, + IncludedBurstIops = includedBurstIops, + MaxBurstCreditsForIops = maxBurstCreditsForIops, + NextAllowedProvisionedIopsDowngradeTime = nextAllowedProvisionedIopsDowngradeTime, + NextAllowedProvisionedBandwidthDowngradeTime = nextAllowedProvisionedBandwidthDowngradeTime, + }; + + /// + /// Creates a new ShareProperties instance for mocking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static ShareProperties ShareProperties( + string accessTier, + DateTimeOffset? lastModified, + int? provisionedIops, + int? provisionedIngressMBps, + int? provisionedEgressMBps, + DateTimeOffset? nextAllowedQuotaDowngradeTime, + DateTimeOffset? deletedOn, + int? remainingRetentionDays, + ETag? eTag, + DateTimeOffset? accessTierChangeTime, + string accessTierTransitionState, + ShareLeaseStatus? leaseStatus, + ShareLeaseState? leaseState, + ShareLeaseDuration? leaseDuration, + int? quotaInGB, + IDictionary metadata, + ShareProtocols? protocols, + ShareRootSquash? rootSquash, + bool? enableSnapshotVirtualDirectoryAccess, + bool? enablePaidBursting, + long? paidBurstingMaxIops, + long? paidBustingMaxBandwidthMibps) => new ShareProperties() { AccessTier = accessTier, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareProperties.cs index 743ad88232164..ef2ec2569f595 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareProperties.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareProperties.cs @@ -137,6 +137,30 @@ public class ShareProperties /// public long? PaidBurstingMaxBandwidthMibps { get; internal set; } + /// + /// Only applicable to provisioned v2 storage accounts. + /// The calculated burst IOPS of the share. + /// + public long? IncludedBurstIops { get; internal set; } + + /// + /// Only applicable to provisioned v2 storage accounts. + /// The calculated maximum burst credits. This is not the current burst credit level, but the maximum burst credits the share can have. + /// + public long? MaxBurstCreditsForIops { get; internal set; } + + /// + /// Only applicable to provisioned v2 storage accounts. + /// The time the share can be downgraded to lower provisioned IOPs. + /// + public DateTimeOffset? NextAllowedProvisionedIopsDowngradeTime { get; internal set; } + + /// + /// Only applicable to provisioned v2 storage accounts. + /// The time the shaare can be downgraded to lower provisioned bandwidth. + /// + public DateTimeOffset? NextAllowedProvisionedBandwidthDowngradeTime { get; internal set; } + /// /// Internal constructor. /// diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareSetPropertiesOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareSetPropertiesOptions.cs index 81dfbf4a5c0be..fd4b4f1b0a061 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareSetPropertiesOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareSetPropertiesOptions.cs @@ -49,6 +49,20 @@ public class ShareSetPropertiesOptions /// public long? PaidBurstingMaxBandwidthMibps { get; set; } + /// + /// Optional. Supported in version 2025-01-05 and above. Only applicable to provisioned v2 storage accounts. + /// Sets the max provisioned IOPs for a share. For SSD, min IOPs is 3,000 and max is 100,000. + /// For HDD, min IOPs is 500 and max is 50,000. + /// + public long? ProvisionedMaxIops { get; set; } + + /// + /// Optional. Supported in version 2025-01-05 and above. Only applicable to provisioned v2 storage accounts. + /// Sets the max provisioned brandwith for a share. For SSD, min bandwidth is 125 MiB/sec and max is 10,340 MiB/sec. + /// For HDD, min bandwidth is 60 MiB/sec and max is 5,120 MiB/sec. + /// + public long? ProvisionedMaxBandwidthMibps { get; set; } + /// /// Optional to add conditions /// on setting the share's properties. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs index 7c683888ee9d0..75d4430e5b26d 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs @@ -490,6 +490,8 @@ public virtual Response Create( options?.EnablePaidBursting, options?.PaidBurstingMaxIops, options?.PaidBurstingMaxBandwidthMibps, + options?.ProvisionedMaxIops, + options?.ProvisionedMaxBandwidthMibps, async: false, cancellationToken) .EnsureCompleted(); @@ -531,6 +533,8 @@ await CreateInternal( options?.EnablePaidBursting, options?.PaidBurstingMaxIops, options?.PaidBurstingMaxBandwidthMibps, + options?.ProvisionedMaxIops, + options?.ProvisionedMaxBandwidthMibps, async: true, cancellationToken) .ConfigureAwait(false); @@ -577,6 +581,8 @@ public virtual Response Create( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: false, cancellationToken) .EnsureCompleted(); @@ -623,6 +629,8 @@ await CreateInternal( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: true, cancellationToken) .ConfigureAwait(false); @@ -668,6 +676,12 @@ await CreateInternal( /// Optional. Supported in version 2024-11-04 and above. Only applicable for premium file storage accounts. /// Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// + /// + /// Provisioned max IOPS. + /// + /// + /// Provisioned max bandwidth MiBps. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -696,6 +710,8 @@ internal async Task> CreateInternal( bool? enablePaidBursting, long? paidBurstingMaxIops, long? paidBurstingMaxBandwidthMibps, + long? provisionedMaxIops, + long? provisionedMaxBandwidthMibps, bool async, CancellationToken cancellationToken, string operationName = default) @@ -728,6 +744,8 @@ internal async Task> CreateInternal( paidBurstingEnabled: enablePaidBursting, paidBurstingMaxIops: paidBurstingMaxIops, paidBurstingMaxBandwidthMibps: paidBurstingMaxBandwidthMibps, + shareProvisionedIops: provisionedMaxIops, + shareProvisionedBandwidthMibps: provisionedMaxBandwidthMibps, cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -743,6 +761,8 @@ internal async Task> CreateInternal( paidBurstingEnabled: enablePaidBursting, paidBurstingMaxIops: paidBurstingMaxIops, paidBurstingMaxBandwidthMibps: paidBurstingMaxBandwidthMibps, + shareProvisionedIops: provisionedMaxIops, + shareProvisionedBandwidthMibps: provisionedMaxBandwidthMibps, cancellationToken: cancellationToken); } @@ -791,7 +811,7 @@ internal async Task> CreateInternal( /// a failure occurs. /// public virtual Response CreateIfNotExists( - ShareCreateOptions options, + ShareCreateOptions options = default, CancellationToken cancellationToken = default) => CreateIfNotExistsInternal( options?.Metadata, @@ -803,6 +823,8 @@ public virtual Response CreateIfNotExists( options?.EnablePaidBursting, options?.PaidBurstingMaxIops, options?.PaidBurstingMaxBandwidthMibps, + options?.ProvisionedMaxIops, + options?.ProvisionedMaxBandwidthMibps, async: false, cancellationToken).EnsureCompleted(); @@ -831,7 +853,7 @@ public virtual Response CreateIfNotExists( /// a failure occurs. /// public virtual async Task> CreateIfNotExistsAsync( - ShareCreateOptions options, + ShareCreateOptions options = default, CancellationToken cancellationToken = default) => await CreateIfNotExistsInternal( options?.Metadata, @@ -843,6 +865,8 @@ await CreateIfNotExistsInternal( options?.EnablePaidBursting, options?.PaidBurstingMaxIops, options?.PaidBurstingMaxBandwidthMibps, + options?.ProvisionedMaxIops, + options?.ProvisionedMaxBandwidthMibps, async: true, cancellationToken).ConfigureAwait(false); @@ -874,10 +898,12 @@ await CreateIfNotExistsInternal( /// a failure occurs. /// [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken. public virtual Response CreateIfNotExists( - Metadata metadata = default, - int? quotaInGB = default, - CancellationToken cancellationToken = default) => +#pragma warning restore AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken. + Metadata metadata, + int? quotaInGB, + CancellationToken cancellationToken) => CreateIfNotExistsInternal( metadata, quotaInGB, @@ -888,6 +914,8 @@ public virtual Response CreateIfNotExists( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: false, cancellationToken).EnsureCompleted(); @@ -918,10 +946,14 @@ public virtual Response CreateIfNotExists( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken. public virtual async Task> CreateIfNotExistsAsync( - Metadata metadata = default, - int? quotaInGB = default, - CancellationToken cancellationToken = default) => +#pragma warning restore AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken. + + Metadata metadata, + int? quotaInGB, + CancellationToken cancellationToken) => await CreateIfNotExistsInternal( metadata, quotaInGB, @@ -932,6 +964,8 @@ await CreateIfNotExistsInternal( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: true, cancellationToken).ConfigureAwait(false); @@ -976,6 +1010,12 @@ await CreateIfNotExistsInternal( /// Optional. Supported in version 2024-11-04 and above. Only applicable for premium file storage accounts. /// Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// + /// + /// Provisioned max IOPS. + /// + /// + /// Provisioned max bandwidth MiBps. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -1001,6 +1041,8 @@ private async Task> CreateIfNotExistsInternal( bool? enablePaidBursting, long? paidBurstingMaxIops, long? paidBurstingMaxBandwidthMibps, + long? provisionedMaxIops, + long? provisionedMaxBandwidthMibps, bool async, CancellationToken cancellationToken) { @@ -1024,6 +1066,8 @@ private async Task> CreateIfNotExistsInternal( enablePaidBursting, paidBurstingMaxIops, paidBurstingMaxBandwidthMibps, + provisionedMaxIops, + provisionedMaxBandwidthMibps, async, cancellationToken, operationName: $"{nameof(ShareClient)}.{nameof(CreateIfNotExists)}") @@ -1993,6 +2037,8 @@ public virtual Response SetProperties( enablePaidBursting: options?.EnablePaidBursting, paidBurstingMaxIops: options?.PaidBurstingMaxIops, paidBurstingMaxBandwidthMibps: options?.PaidBurstingMaxBandwidthMibps, + provisionedMaxIops: options?.ProvisionedMaxIops, + provisionedMaxBandwidthBandwidthMibps: options?.ProvisionedMaxBandwidthMibps, conditions: options?.Conditions, operationName: $"{nameof(ShareClient)}.{nameof(SetProperties)}", async: false, @@ -2032,6 +2078,8 @@ await SetPropertiesInternal( enablePaidBursting: options?.EnablePaidBursting, paidBurstingMaxIops: options?.PaidBurstingMaxIops, paidBurstingMaxBandwidthMibps: options?.PaidBurstingMaxBandwidthMibps, + provisionedMaxIops: options?.ProvisionedMaxIops, + provisionedMaxBandwidthBandwidthMibps: options?.ProvisionedMaxBandwidthMibps, conditions: options?.Conditions, operationName: $"{nameof(ShareClient)}.{nameof(SetProperties)}", async: true, @@ -2072,6 +2120,16 @@ await SetPropertiesInternal( /// Optional. Supported in version 2024-11-04 and above. Only applicable for premium file storage accounts. /// Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec. /// + /// + /// Optional. Supported in version 2025-01-05 and above. Only applicable to provisioned v2 storage accounts. + /// Sets the max provisioned IOPs for a share. For SSD, min IOPs is 3,000 and max is 100,000. + /// For HDD, min IOPs is 500 and max is 50,000. + /// + /// + /// Optional. Supported in version 2025-01-05 and above. Only applicable to provisioned v2 storage accounts. + /// Sets the max provisioned brandwith for a share. For SSD, min bandwidth is 125 MiB/sec and max is 10,340 MiB/sec. + /// For HDD, min bandwidth is 60 MiB/sec and max is 5,120 MiB/sec. + /// /// /// Optional to add conditions /// on setting the quota. @@ -2102,6 +2160,8 @@ internal virtual async Task> SetPropertiesInternal( bool? enablePaidBursting, long? paidBurstingMaxIops, long? paidBurstingMaxBandwidthMibps, + long? provisionedMaxIops, + long? provisionedMaxBandwidthBandwidthMibps, ShareFileRequestConditions conditions, string operationName, bool async, @@ -2134,6 +2194,8 @@ internal virtual async Task> SetPropertiesInternal( paidBurstingEnabled: enablePaidBursting, paidBurstingMaxIops: paidBurstingMaxIops, paidBurstingMaxBandwidthMibps: paidBurstingMaxBandwidthMibps, + shareProvisionedIops: provisionedMaxIops, + shareProvisionedBandwidthMibps: provisionedMaxBandwidthBandwidthMibps, shareFileRequestConditions: conditions, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -2148,6 +2210,8 @@ internal virtual async Task> SetPropertiesInternal( paidBurstingEnabled: enablePaidBursting, paidBurstingMaxIops: paidBurstingMaxIops, paidBurstingMaxBandwidthMibps: paidBurstingMaxBandwidthMibps, + shareProvisionedIops: provisionedMaxIops, + shareProvisionedBandwidthMibps: provisionedMaxBandwidthBandwidthMibps, shareFileRequestConditions: conditions, cancellationToken: cancellationToken); } @@ -2212,6 +2276,8 @@ public virtual Response SetQuota( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthBandwidthMibps: default, conditions: conditions, operationName: $"{nameof(ShareClient)}.{nameof(SetQuota)}", async: false, @@ -2258,6 +2324,8 @@ await SetPropertiesInternal( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthBandwidthMibps: default, conditions: conditions, operationName: $"{nameof(ShareClient)}.{nameof(SetQuota)}", async: true, @@ -2302,6 +2370,8 @@ public virtual Response SetQuota( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthBandwidthMibps: default, conditions: default, operationName: $"{nameof(ShareClient)}.{nameof(SetQuota)}", async: false, @@ -2345,6 +2415,8 @@ await SetPropertiesInternal( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthBandwidthMibps: default, conditions: default, operationName: $"{nameof(ShareClient)}.{nameof(SetQuota)}", async: true, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs index 787f0c299080b..30c5ab3b05155 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs @@ -148,7 +148,12 @@ public enum ServiceVersion /// /// The 2024-11-04 service version. /// - V2024_11_04 = 24 + V2024_11_04 = 24, + + /// + /// The 2025-01-05 service version. + /// + V2025_01_05 = 25 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs index 00f3c357b5746..4d7a0950ab0d6 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs @@ -713,7 +713,11 @@ internal static ShareProperties ToShareProperties(this ResponseWithHeaders StartCopy( metadata: options?.Metadata, smbProperties: options?.SmbProperties, filePermission: options?.FilePermission, + filePermissionFormat: options?.PermissionFormat, filePermissionCopyMode: options?.FilePermissionCopyMode, ignoreReadOnly: options?.IgnoreReadOnly, setArchiveAttribute: options?.Archive, @@ -1378,6 +1379,7 @@ public virtual Response StartCopy( metadata, smbProperties, filePermission, + filePermissionFormat: default, filePermissionCopyMode, ignoreReadOnly, setArchiveAttribute, @@ -1424,6 +1426,7 @@ public virtual Response StartCopy( metadata, smbProperties: default, filePermission: default, + filePermissionFormat: default, filePermissionCopyMode: default, ignoreReadOnly: default, setArchiveAttribute: default, @@ -1467,6 +1470,7 @@ await StartCopyInternal( metadata: options?.Metadata, smbProperties: options?.SmbProperties, filePermission: options?.FilePermission, + filePermissionFormat: options?.PermissionFormat, filePermissionCopyMode: options?.FilePermissionCopyMode, ignoreReadOnly: options?.IgnoreReadOnly, setArchiveAttribute: options?.Archive, @@ -1543,6 +1547,7 @@ await StartCopyInternal( metadata, smbProperties, filePermission, + filePermissionFormat: default, filePermissionCopyMode, ignoreReadOnly, setArchiveAttribute, @@ -1589,6 +1594,7 @@ await StartCopyInternal( metadata, smbProperties: default, filePermission: default, + filePermissionFormat: default, filePermissionCopyMode: default, ignoreReadOnly: default, setArchiveAttribute: default, @@ -1617,6 +1623,9 @@ await StartCopyInternal( /// /// Optional file permission to set for the file. /// + /// + /// Optional file permission format. + /// /// /// Specifies the option to copy file security descriptor from source file or /// to set it using the value which is defined by the header value of FilePermission @@ -1658,6 +1667,7 @@ private async Task> StartCopyInternal( Metadata metadata, FileSmbProperties smbProperties, string filePermission, + FilePermissionFormat? filePermissionFormat, PermissionCopyMode? filePermissionCopyMode, bool? ignoreReadOnly, bool? setArchiveAttribute, @@ -1768,6 +1778,7 @@ private async Task> StartCopyInternal( copySource: uriBuilder.ToString(), metadata: metadata, filePermission: filePermission, + filePermissionFormat: filePermissionFormat, filePermissionKey: smbProperties?.FilePermissionKey, copyFileSmbInfo: copyFileSmbInfo, shareFileRequestConditions: conditions, @@ -1780,6 +1791,7 @@ private async Task> StartCopyInternal( copySource: uriBuilder.ToString(), metadata: metadata, filePermission: filePermission, + filePermissionFormat: filePermissionFormat, filePermissionKey: smbProperties?.FilePermissionKey, copyFileSmbInfo: copyFileSmbInfo, shareFileRequestConditions: conditions, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs index f6c89f78c214a..b8f3c385d1d22 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareServiceClient.cs @@ -892,6 +892,8 @@ public virtual Response CreateShare( enablePaidBursting: options?.EnablePaidBursting, paidBurstingMaxIops: options?.PaidBurstingMaxIops, paidBurstingMaxBandwidthMibps: options?.PaidBurstingMaxBandwidthMibps, + provisionedMaxIops: options?.PaidBurstingMaxIops, + provisionedMaxBandwidthMibps: options?.ProvisionedMaxBandwidthMibps, async: false, cancellationToken: cancellationToken, operationName: $"{nameof(ShareServiceClient)}.{nameof(CreateShare)}") @@ -944,6 +946,8 @@ public virtual async Task> CreateShareAsync( enablePaidBursting: options?.EnablePaidBursting, paidBurstingMaxIops: options?.PaidBurstingMaxIops, paidBurstingMaxBandwidthMibps: options?.PaidBurstingMaxBandwidthMibps, + provisionedMaxIops: options?.PaidBurstingMaxIops, + provisionedMaxBandwidthMibps: options?.ProvisionedMaxBandwidthMibps, async: true, cancellationToken: cancellationToken, operationName: $"{nameof(ShareServiceClient)}.{nameof(CreateShare)}") @@ -1001,6 +1005,8 @@ public virtual Response CreateShare( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: false, cancellationToken: cancellationToken, operationName: $"{nameof(ShareServiceClient)}.{nameof(CreateShare)}") @@ -1058,6 +1064,8 @@ public virtual async Task> CreateShareAsync( enablePaidBursting: default, paidBurstingMaxIops: default, paidBurstingMaxBandwidthMibps: default, + provisionedMaxIops: default, + provisionedMaxBandwidthMibps: default, async: true, cancellationToken: cancellationToken, operationName: $"{nameof(ShareServiceClient)}.{nameof(CreateShare)}") diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md index 43022bc56d1c1..ed634ae302734 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md +++ b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/98b600498947073c18c2ac5eb7c3c658db5a1a59/specification/storage/data-plane/Microsoft.FileStorage/stable/2024-11-04/file.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json generation1-convenience-client: true # https://github.com/Azure/autorest/issues/4075 skip-semantics-validation: true diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs index 32765a7e04f29..4389023663cf5 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Azure.Storage.Files.Shares.Models; using Azure.Storage.Test.Shared; namespace Azure.Storage.Files.Shares.Tests @@ -16,7 +17,11 @@ public class DisposingShare : IDisposingContainer public static async Task CreateAsync(ShareClient share, IDictionary metadata) { - await share.CreateIfNotExistsAsync(metadata: metadata); + ShareCreateOptions options = new ShareCreateOptions + { + Metadata = metadata + }; + await share.CreateIfNotExistsAsync(options); return new DisposingShare(share); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index 19bd51da71f56..b1ce4cc25987a 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -1952,6 +1952,50 @@ await dest.StartCopyAsync( Assert.AreEqual(smbProperties.FileLastWrittenOn, propertiesResponse.Value.SmbProperties.FileLastWrittenOn); } + [RecordedTest] + [TestCase(null)] + [TestCase(FilePermissionFormat.Sddl)] + [TestCase(FilePermissionFormat.Binary)] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_01_05)] + public async Task StartCopyAsync_FilePermission_Format(FilePermissionFormat? filePermissionFormat) + { + // Arrange + await using DisposingFile testSource = await SharesClientBuilder.GetTestFileAsync(); + ShareFileClient source = testSource.File; + await using DisposingFile testDest = await SharesClientBuilder.GetTestFileAsync(); + ShareFileClient dest = testSource.File; + + var data = GetRandomBuffer(Constants.KB); + using (var stream = new MemoryStream(data)) + { + await source.UploadRangeAsync( + writeType: ShareFileRangeWriteType.Update, + range: new HttpRange(0, Constants.KB), + content: stream); + } + string filePermission; + if (filePermissionFormat == null || filePermissionFormat == FilePermissionFormat.Sddl) + { + filePermission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-188441444-3053964)S:NO_ACCESS_CONTROL"; + } + else + { + filePermission = "AQAUhGwAAACIAAAAAAAAABQAAAACAFgAAwAAAAAAFAD/AR8AAQEAAAAAAAUSAAAAAAAYAP8BHwABAgAAAAAABSAAAAAgAgAAAAAkAKkAEgABBQAAAAAABRUAAABZUbgXZnJdJWRjOwuMmS4AAQUAAAAAAAUVAAAAoGXPfnhLm1/nfIdwr/1IAQEFAAAAAAAFFQAAAKBlz354S5tf53yHcAECAAA="; + } + + ShareFileCopyOptions options = new ShareFileCopyOptions + { + FilePermission = filePermission, + PermissionFormat = filePermissionFormat, + FilePermissionCopyMode = PermissionCopyMode.Override + }; + + // Act + await dest.StartCopyAsync( + sourceUri: source.Uri, + options: options); + } + [RecordedTest] [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2021_06_08)] public async Task StartCopyAsync_ChangeTime() diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs index 01f071ca1dafb..e52b1b2da1bc6 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs @@ -431,6 +431,33 @@ public async Task ListSharesSegmentAsync_OAuth() Assert.IsTrue(shares.All(c => c.Properties.Metadata == null)); } + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/45675")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_01_05)] + public async Task ListSharesSegmentAsync_ProvisionedBilling() + { + // Arrange + ShareServiceClient service = SharesClientBuilder.GetServiceClient_SharedKey(); + + // Ensure at least one share + await using DisposingShare test = await GetTestShareAsync(service); + ShareClient share = test.Share; + + List shares = new List(); + await foreach (ShareItem item in service.GetSharesAsync()) + { + shares.Add(item); + } + + ShareItem shareItem = shares.FirstOrDefault(); + + // Assert + Assert.IsNotNull(shareItem.Properties.IncludedBurstIops); + Assert.IsNotNull(shareItem.Properties.MaxBurstCreditsForIops); + Assert.IsNotNull(shareItem.Properties.NextAllowedProvisionedIopsDowngradeTime); + Assert.IsNotNull(shareItem.Properties.NextAllowedProvisionedBandwidthDowngradeTime); + } + [RecordedTest] public async Task CreateShareAsync() { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs index eb312bb15a31c..7d078484201bc 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs @@ -37,13 +37,14 @@ public ShareClientTestFixtureAttribute(params object[] additionalParameters) ShareClientOptions.ServiceVersion.V2024_05_04, ShareClientOptions.ServiceVersion.V2024_08_04, ShareClientOptions.ServiceVersion.V2024_11_04, + ShareClientOptions.ServiceVersion.V2025_01_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, additionalParameters: additionalParameters) { - RecordingServiceVersion = StorageVersionExtensions.LatestVersion; - LiveServiceVersions = new object[] { StorageVersionExtensions.MaxVersion, }; + RecordingServiceVersion = StorageVersionExtensions.MaxVersion; + LiveServiceVersions = new object[] { StorageVersionExtensions.LatestVersion, }; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs index d6655740584fb..f798d99a933a5 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using System.Threading.Tasks; using Azure.Core.TestFramework; using Azure.Storage.Files.Shares.Models; @@ -13,8 +12,6 @@ using Azure.Storage.Sas; using Azure.Storage.Test; using NUnit.Framework; -using System.Threading; -using Azure.Identity; using Moq; namespace Azure.Storage.Files.Shares.Tests @@ -364,6 +361,57 @@ public async Task CreateAsync_AccessTier() await share.DeleteAsync(); } + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/45675")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_01_05)] + public async Task CreateAsync_ProvisionedMaxIopsAndBandwidth() + { + // Arrange + var shareName = GetNewShareName(); + ShareServiceClient service = SharesClientBuilder.GetServiceClient_SharedKey(); + ShareClient share = InstrumentClient(service.GetShareClient(shareName)); + ShareCreateOptions options = new ShareCreateOptions + { + ProvisionedMaxIops = 500, + ProvisionedMaxBandwidthMibps = 125 + }; + + // Act + Response response = await share.CreateAsync(options); + + // Assert + Response propertiesResponse = await share.GetPropertiesAsync(); + Assert.AreEqual(500, propertiesResponse.Value.ProvisionedIops); + Assert.AreEqual(125, propertiesResponse.Value.ProvisionedBandwidthMiBps); + + // Cleanup + await share.DeleteAsync(); + } + + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2019_12_12)] + public async Task CreateAsync_AccessTier_Premium() + { + // Arrange + var shareName = GetNewShareName(); + ShareServiceClient service = SharesClientBuilder.GetServiceClient_PremiumFile(); + ShareClient share = InstrumentClient(service.GetShareClient(shareName)); + ShareCreateOptions options = new ShareCreateOptions + { + AccessTier = ShareAccessTier.Premium + }; + + // Act + await share.CreateAsync(options); + + // Assert + Response propertiesResponse = await share.GetPropertiesAsync(); + Assert.AreEqual(ShareAccessTier.Premium.ToString(), propertiesResponse.Value.AccessTier); + + // Cleanup + await share.DeleteAsync(); + } + [RecordedTest] public async Task CreateAsync_Error() { @@ -1774,6 +1822,27 @@ public async Task SetPropertiesAsync_AccessTier() Assert.IsNotNull(response.Value.AccessTierChangeTime); } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2019_12_12)] + public async Task SetPropertiesAsync_AccessTier_Premium() + { + // Arrange + await using DisposingShare test = await GetTestShareAsync(SharesClientBuilder.GetServiceClient_PremiumFile()); + ShareClient share = test.Share; + + ShareSetPropertiesOptions options = new ShareSetPropertiesOptions + { + AccessTier = ShareAccessTier.Premium + }; + + // Act + await share.SetPropertiesAsync(options); + + // Assert + Response response = await share.GetPropertiesAsync(); + Assert.AreEqual(ShareAccessTier.Premium.ToString(), response.Value.AccessTier); + } + [RecordedTest] [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/17262")] [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2020_04_08)] @@ -1892,6 +1961,33 @@ public async Task SetPropertiesAsync_PaidBursting() Assert.AreEqual(1000, response.Value.PaidBurstingMaxBandwidthMibps); } + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/45675")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_01_05)] + public async Task SetPropertiesAsync_ProvisionedBilling() + { + // Arrange + await using DisposingShare test = await GetTestShareAsync(); + + ShareSetPropertiesOptions setPropertiesOptions = new ShareSetPropertiesOptions + { + ProvisionedMaxIops = 3000, + ProvisionedMaxBandwidthMibps = 125 + }; + + // Act + await test.Share.SetPropertiesAsync(setPropertiesOptions); + + // Assert + Response response = await test.Share.GetPropertiesAsync(); + Assert.AreEqual(3000, response.Value.ProvisionedIops); + Assert.AreEqual(125, response.Value.ProvisionedBandwidthMiBps); + Assert.IsNotNull(response.Value.IncludedBurstIops); + Assert.IsNotNull(response.Value.MaxBurstCreditsForIops); + Assert.IsNotNull(response.Value.NextAllowedProvisionedIopsDowngradeTime); + Assert.IsNotNull(response.Value.NextAllowedProvisionedBandwidthDowngradeTime); + } + [RecordedTest] public async Task SetQuotaAsync() { @@ -1977,7 +2073,11 @@ public async Task DeleteAsync() var shareName = GetNewShareName(); ShareServiceClient service = SharesClientBuilder.GetServiceClient_SharedKey(); ShareClient share = InstrumentClient(service.GetShareClient(shareName)); - await share.CreateIfNotExistsAsync(quotaInGB: 1); + ShareCreateOptions options = new ShareCreateOptions + { + QuotaInGB = 1 + }; + await share.CreateIfNotExistsAsync(options); // Act Response response = await share.DeleteAsync(false); @@ -1993,7 +2093,11 @@ public async Task DeleteAsync_IncludeLeasedSnapshots() // Arrange ShareServiceClient service = SharesClientBuilder.GetServiceClient_SharedKey(); ShareClient share = InstrumentClient(service.GetShareClient(GetNewShareName())); - await share.CreateIfNotExistsAsync(quotaInGB: 1); + ShareCreateOptions createOptions = new ShareCreateOptions + { + QuotaInGB = 1 + }; + await share.CreateIfNotExistsAsync(createOptions); // Create a snapshot Response snapshotResponse0 = await share.CreateSnapshotAsync(); @@ -2141,7 +2245,11 @@ public async Task DeleteAsync_OAuth() var shareName = GetNewShareName(); ShareServiceClient service = GetServiceClient_OAuth(); ShareClient share = InstrumentClient(service.GetShareClient(shareName)); - await share.CreateIfNotExistsAsync(quotaInGB: 1); + ShareCreateOptions options = new ShareCreateOptions + { + QuotaInGB = 1 + }; + await share.CreateIfNotExistsAsync(options); // Act Response response = await share.DeleteAsync(false); diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index b53155e9f6dae..dc6bb8705a693 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.21.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-01-05. ## 12.20.0 (2024-09-18) diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs index 3659e69cf1f41..9f440eb3639d7 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs @@ -74,7 +74,7 @@ public QueueClient(System.Uri queueUri, Azure.Storage.StorageSharedKeyCredential } public partial class QueueClientOptions : Azure.Core.ClientOptions { - public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2024_11_04) { } + public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2025_01_05) { } public Azure.Storage.Queues.Models.QueueAudience? Audience { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } } @@ -107,6 +107,7 @@ public enum ServiceVersion V2024_05_04 = 22, V2024_08_04 = 23, V2024_11_04 = 24, + V2025_01_05 = 25, } } public partial class QueueMessageDecodingFailedEventArgs : Azure.SyncAsyncEventArgs @@ -425,7 +426,7 @@ public event System.EventHandler /// The 2024-11-04 service version. /// - V2024_11_04 = 24 + V2024_11_04 = 24, + + /// + /// The 2025-01-05 service version. + /// + V2025_01_05 = 25 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs index 0f2a81dbf9e52..b053e71cdf051 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs @@ -36,6 +36,7 @@ public QueueClientTestFixtureAttribute(params object[] additionalParameters) QueueClientOptions.ServiceVersion.V2024_05_04, QueueClientOptions.ServiceVersion.V2024_08_04, QueueClientOptions.ServiceVersion.V2024_11_04, + QueueClientOptions.ServiceVersion.V2025_01_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, From a70001fa0085f344daf9ef0e131f3f5d85fe7971 Mon Sep 17 00:00:00 2001 From: Niels Heeren Date: Tue, 8 Oct 2024 00:28:05 +0200 Subject: [PATCH 31/43] Fix missing HybridSearch in copy method of SearchOptions (#46425) Fix missing HybridSearch in copy SearchOptions --- .../Azure.Search.Documents/src/Options/SearchOptions.cs | 1 + .../tests/DocumentOperations/SearchTests.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs index 805bb24b1898d..d46244da5496f 100644 --- a/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Options/SearchOptions.cs @@ -428,6 +428,7 @@ private static void Copy(SearchOptions source, SearchOptions destination) destination.QuerySpeller = source.QuerySpeller; destination.SemanticSearch = source.SemanticSearch; destination.VectorSearch = source.VectorSearch; + destination.HybridSearch = source.HybridSearch; } /// diff --git a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs index f12f7aa34d9b4..790a35da6b9a6 100644 --- a/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/DocumentOperations/SearchTests.cs @@ -1028,6 +1028,11 @@ public void SearchOptionsCanBeCopied() Queries = { new VectorizedQuery(VectorSearchEmbeddings.SearchVectorizeDescription) { KNearestNeighborsCount = 3, Fields = { "DescriptionVector", "CategoryVector" } } }, FilterMode = VectorFilterMode.PostFilter }; + source.HybridSearch = new HybridSearch() + { + MaxTextRecallSize = 50, + CountAndFacetMode = HybridCountAndFacetMode.CountRetrievableResults + }; SearchOptions clonedSearchOptions = source.Clone(); CollectionAssert.AreEquivalent(source.Facets, clonedSearchOptions.Facets); // A non-null collection with multiple items @@ -1048,6 +1053,8 @@ public void SearchOptionsCanBeCopied() Assert.AreEqual(source.SemanticSearch.MaxWait, clonedSearchOptions.SemanticSearch.MaxWait); Assert.AreEqual(source.VectorSearch.Queries, clonedSearchOptions.VectorSearch.Queries); Assert.AreEqual(source.VectorSearch.FilterMode, clonedSearchOptions.VectorSearch.FilterMode); + Assert.AreEqual(source.HybridSearch.MaxTextRecallSize, clonedSearchOptions.HybridSearch.MaxTextRecallSize); + Assert.AreEqual(source.HybridSearch.CountAndFacetMode, clonedSearchOptions.HybridSearch.CountAndFacetMode); } /* TODO: Enable these Track 1 tests when we have support for index creation From e6fd97ad1c0e946b4327784e2f92a7b5683d6bc8 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:30:28 -0700 Subject: [PATCH 32/43] Update AutoRest C# version to 3.0.0-beta.20241007.1 (#46457) * Update Generator Version 3.0.0-beta.20241007.1 * Update SDK codes he_ma_3 * Update SDK codes de_he_2 * Update SDK codes ma_pu_4 * Update SDK codes sq_wo_6 * Update SDK codes co_de_1 * export api * fix tests --------- Co-authored-by: Arcturus Zhang Co-authored-by: Minghao Chen <30464227+HarveyLink@users.noreply.github.com> --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 30 +++++----- eng/emitter-package.json | 2 +- ...urceManager.ComputeFleet.netstandard2.0.cs | 55 +++++++++++++++++ .../assets.json | 2 +- .../ComputeFleetData.Serialization.cs | 60 ++++--------------- ...apacityReservationProfile.Serialization.cs | 11 +++- .../ComputeFleetApiError.Serialization.cs | 11 +++- .../ComputeFleetApiErrorInfo.Serialization.cs | 11 +++- ...teFleetApplicationProfile.Serialization.cs | 11 +++- ...mputeFleetBootDiagnostics.Serialization.cs | 11 +++- ...omputeFleetComputeProfile.Serialization.cs | 11 +++- ...teFleetDiagnosticsProfile.Serialization.cs | 11 +++- ...puteFleetDiffDiskSettings.Serialization.cs | 11 +++- ...teFleetEncryptionIdentity.Serialization.cs | 11 +++- ...omputeFleetImageReference.Serialization.cs | 11 +++- .../ComputeFleetInnerError.Serialization.cs | 11 +++- ...etKeyVaultSecretReference.Serialization.cs | 11 +++- ...teFleetLinuxConfiguration.Serialization.cs | 11 +++- ...teFleetLinuxPatchSettings.Serialization.cs | 11 +++- ...tomaticByPlatformSettings.Serialization.cs | 11 +++- ...SImageNotificationProfile.Serialization.cs | 11 +++- .../Models/ComputeFleetPatch.Serialization.cs | 11 +++- .../ComputeFleetProperties.Serialization.cs | 11 +++- ...teFleetProxyAgentSettings.Serialization.cs | 11 +++- ...teFleetPublicIPAddressSku.Serialization.cs | 11 +++- ...eetScheduledEventsProfile.Serialization.cs | 11 +++- ...tSecurityPostureReference.Serialization.cs | 11 +++- ...mputeFleetSecurityProfile.Serialization.cs | 11 +++- ...puteFleetSshConfiguration.Serialization.cs | 11 +++- .../ComputeFleetSshPublicKey.Serialization.cs | 11 +++- ...minateNotificationProfile.Serialization.cs | 11 +++- .../ComputeFleetUefiSettings.Serialization.cs | 11 +++- ...puteFleetVaultCertificate.Serialization.cs | 11 +++- ...puteFleetVaultSecretGroup.Serialization.cs | 11 +++- ...mputeFleetVirtualHardDisk.Serialization.cs | 11 +++- ...leetVmDiskSecurityProfile.Serialization.cs | 11 +++- ...FleetVmGalleryApplication.Serialization.cs | 11 +++- ...FleetVmGuestPatchSettings.Serialization.cs | 11 +++- .../ComputeFleetVmProfile.Serialization.cs | 11 +++- ...ComputeFleetVmSizeProfile.Serialization.cs | 11 +++- ...puteFleetVmSizeProperties.Serialization.cs | 11 +++- .../Models/ComputeFleetVmss.Serialization.cs | 11 +++- .../ComputeFleetVmssDataDisk.Serialization.cs | 11 +++- ...ComputeFleetVmssExtension.Serialization.cs | 11 +++- ...FleetVmssExtensionProfile.Serialization.cs | 11 +++- ...etVmssExtensionProperties.Serialization.cs | 11 +++- ...eFleetVmssHardwareProfile.Serialization.cs | 11 +++- ...eFleetVmssIPConfiguration.Serialization.cs | 11 +++- ...IPConfigurationProperties.Serialization.cs | 11 +++- .../ComputeFleetVmssIPTag.Serialization.cs | 11 +++- ...mputeFleetVmssManagedDisk.Serialization.cs | 11 +++- ...tVmssNetworkConfiguration.Serialization.cs | 11 +++- ...rkConfigurationProperties.Serialization.cs | 11 +++- ...eetVmssNetworkDnsSettings.Serialization.cs | 11 +++- ...teFleetVmssNetworkProfile.Serialization.cs | 11 +++- .../ComputeFleetVmssOSDisk.Serialization.cs | 11 +++- ...ComputeFleetVmssOSProfile.Serialization.cs | 11 +++- ...licIPAddressConfiguration.Serialization.cs | 11 +++- ...ssConfigurationProperties.Serialization.cs | 11 +++- ...ublicIPAddressDnsSettings.Serialization.cs | 11 +++- ...teFleetVmssStorageProfile.Serialization.cs | 11 +++- ...ComputeFleetWinRMListener.Serialization.cs | 11 +++- ...FleetWindowsConfiguration.Serialization.cs | 11 +++- ...tomaticByPlatformSettings.Serialization.cs | 11 +++- .../Models/FleetListResult.Serialization.cs | 11 +++- .../RegularPriorityProfile.Serialization.cs | 11 +++- .../SpotPriorityProfile.Serialization.cs | 11 +++- ...MachineScaleSetListResult.Serialization.cs | 11 +++- .../WinRMConfiguration.Serialization.cs | 11 +++- ...etupAdditionalInformation.Serialization.cs | 11 +++- ...eManager.ComputeSchedule.netstandard2.0.cs | 24 ++++++++ .../assets.json | 2 +- .../CancelOperationsContent.Serialization.cs | 11 +++- .../CancelOperationsResult.Serialization.cs | 11 +++- ...teResourceOperationResult.Serialization.cs | 11 +++- .../ExecuteDeallocateContent.Serialization.cs | 11 +++- .../ExecuteHibernateContent.Serialization.cs | 11 +++- .../ExecuteStartContent.Serialization.cs | 11 +++- ...GetOperationErrorsContent.Serialization.cs | 11 +++- .../GetOperationErrorsResult.Serialization.cs | 11 +++- ...GetOperationStatusContent.Serialization.cs | 11 +++- .../GetOperationStatusResult.Serialization.cs | 11 +++- ...teResourceOperationResult.Serialization.cs | 11 +++- .../OperationErrorDetails.Serialization.cs | 11 +++- .../OperationErrorsResult.Serialization.cs | 11 +++- .../ResourceOperationDetails.Serialization.cs | 11 +++- .../ResourceOperationError.Serialization.cs | 11 +++- .../ResourceOperationResult.Serialization.cs | 11 +++- ...nExecutionParameterDetail.Serialization.cs | 11 +++- ...rtResourceOperationResult.Serialization.cs | 11 +++- .../SubmitDeallocateContent.Serialization.cs | 11 +++- .../SubmitHibernateContent.Serialization.cs | 11 +++- .../SubmitStartContent.Serialization.cs | 11 +++- .../UserRequestResources.Serialization.cs | 11 +++- .../UserRequestRetryPolicy.Serialization.cs | 11 +++- .../UserRequestSchedule.Serialization.cs | 11 +++- ...ger.DevOpsInfrastructure.netstandard2.0.cs | 37 ++++++++++++ .../Generated/DevOpsPoolData.Serialization.cs | 60 ++++--------------- ...esourcePredictionsProfile.Serialization.cs | 29 ++++----- ...sAzureOrganizationProfile.Serialization.cs | 29 ++++----- ...OpsAzurePermissionProfile.Serialization.cs | 11 +++- .../Models/DevOpsAzureSku.Serialization.cs | 11 +++- .../Models/DevOpsDataDisk.Serialization.cs | 11 +++- .../DevOpsFabricProfile.Serialization.cs | 11 +++- .../DevOpsGitHubOrganization.Serialization.cs | 11 +++- ...GitHubOrganizationProfile.Serialization.cs | 29 ++++----- .../DevOpsImageVersion.Serialization.cs | 47 ++++----------- .../DevOpsNetworkProfile.Serialization.cs | 11 +++- .../Models/DevOpsOSProfile.Serialization.cs | 11 +++- .../DevOpsOrganization.Serialization.cs | 11 +++- ...DevOpsOrganizationProfile.Serialization.cs | 11 +++- .../DevOpsPoolAgentProfile.Serialization.cs | 11 +++- .../Models/DevOpsPoolPatch.Serialization.cs | 11 +++- .../DevOpsPoolProperties.Serialization.cs | 11 +++- .../Models/DevOpsPoolVmImage.Serialization.cs | 11 +++- .../DevOpsResourceDetails.Serialization.cs | 47 ++++----------- ...ResourceDetailsProperties.Serialization.cs | 11 +++- .../DevOpsResourceQuota.Serialization.cs | 11 +++- .../DevOpsResourceQuotaName.Serialization.cs | 11 +++- .../Models/DevOpsResourceSku.Serialization.cs | 47 ++++----------- ...vOpsResourceSkuProperties.Serialization.cs | 11 +++- .../Models/DevOpsStateful.Serialization.cs | 39 ++++-------- ...vOpsStatelessAgentProfile.Serialization.cs | 39 ++++-------- .../DevOpsStorageProfile.Serialization.cs | 11 +++- .../DevOpsVmssFabricProfile.Serialization.cs | 29 ++++----- .../ImageVersionListResult.Serialization.cs | 11 +++- .../ImageVersionProperties.Serialization.cs | 11 +++- ...esourcePredictionsProfile.Serialization.cs | 29 ++++----- .../Models/PagedQuota.Serialization.cs | 11 +++- .../Models/PoolListResult.Serialization.cs | 11 +++- .../PoolUpdateProperties.Serialization.cs | 11 +++- ...ceDetailsObjectListResult.Serialization.cs | 11 +++- .../ResourcePredictions.Serialization.cs | 11 +++- ...esourcePredictionsProfile.Serialization.cs | 11 +++- .../ResourceSkuCapabilities.Serialization.cs | 11 +++- .../ResourceSkuListResult.Serialization.cs | 11 +++- .../ResourceSkuLocationInfo.Serialization.cs | 11 +++- ...esourceSkuRestrictionInfo.Serialization.cs | 11 +++- .../ResourceSkuRestrictions.Serialization.cs | 11 +++- .../ResourceSkuZoneDetails.Serialization.cs | 11 +++- ...SecretsManagementSettings.Serialization.cs | 11 +++- ...nknownDevOpsFabricProfile.Serialization.cs | 29 ++++----- ...DevOpsOrganizationProfile.Serialization.cs | 29 ++++----- ...ownDevOpsPoolAgentProfile.Serialization.cs | 39 ++++-------- ...esourcePredictionsProfile.Serialization.cs | 29 ++++----- ...e.ResourceManager.Fabric.netstandard2.0.cs | 9 +++ .../Azure.ResourceManager.Fabric/assets.json | 2 +- .../FabricCapacityData.Serialization.cs | 60 ++++--------------- ...ricCapacityAdministration.Serialization.cs | 11 +++- .../FabricCapacityListResult.Serialization.cs | 11 +++- .../FabricCapacityPatch.Serialization.cs | 11 +++- .../FabricCapacityProperties.Serialization.cs | 11 +++- ...cCapacityUpdateProperties.Serialization.cs | 11 +++- ...icNameAvailabilityContent.Serialization.cs | 11 +++- ...ricNameAvailabilityResult.Serialization.cs | 11 +++- .../Models/FabricSku.Serialization.cs | 11 +++- ...etailsForExistingCapacity.Serialization.cs | 11 +++- ...cSkuDetailsForNewCapacity.Serialization.cs | 11 +++- ...ForExistingResourceResult.Serialization.cs | 11 +++- ...ationForNewResourceResult.Serialization.cs | 11 +++- ...ger.HealthDataAIServices.netstandard2.0.cs | 9 +++ .../assets.json | 2 +- .../DeidServiceData.Serialization.cs | 60 ++++--------------- ...intConnectionResourceData.Serialization.cs | 47 ++++----------- .../DeidPropertiesUpdate.Serialization.cs | 11 +++- .../DeidServiceListResult.Serialization.cs | 11 +++- .../Models/DeidServicePatch.Serialization.cs | 11 +++- .../DeidServiceProperties.Serialization.cs | 11 +++- ...PrivateEndpointConnection.Serialization.cs | 47 ++++----------- ...esPrivateLinkResourceData.Serialization.cs | 47 ++++----------- ...ateLinkResourceListResult.Serialization.cs | 11 +++- ...ateLinkResourceProperties.Serialization.cs | 11 +++- ...inkServiceConnectionState.Serialization.cs | 11 +++- ...pointConnectionProperties.Serialization.cs | 11 +++- ...nectionResourceListResult.Serialization.cs | 11 +++- ...nformaticaDataManagement.netstandard2.0.cs | 35 +++++++++++ ...formaticaOrganizationData.Serialization.cs | 60 ++++--------------- ...ticaServerlessRuntimeData.Serialization.cs | 47 ++++----------- .../AdvancedCustomProperties.Serialization.cs | 11 +++- .../CdiConfigProperties.Serialization.cs | 11 +++- .../CheckDependenciesResult.Serialization.cs | 11 +++- .../ComputeUnitsMetadata.Serialization.cs | 11 +++- ...rmaticaApplicationConfigs.Serialization.cs | 11 +++- ...caApplicationTypeMetadata.Serialization.cs | 11 +++- ...InformaticaCompanyDetails.Serialization.cs | 11 +++- ...aticaCompanyDetailsUpdate.Serialization.cs | 11 +++- ...rmaticaMarketplaceDetails.Serialization.cs | 11 +++- ...aMarketplaceDetailsUpdate.Serialization.cs | 11 +++- ...orkInterfaceConfiguration.Serialization.cs | 11 +++- ...erfaceConfigurationUpdate.Serialization.cs | 11 +++- .../InformaticaOfferDetails.Serialization.cs | 11 +++- ...rmaticaOfferDetailsUpdate.Serialization.cs | 11 +++- ...ormaticaOrganizationPatch.Serialization.cs | 11 +++- ...icaOrganizationProperties.Serialization.cs | 11 +++- ...anizationPropertiesUpdate.Serialization.cs | 11 +++- ...izationResourceListResult.Serialization.cs | 11 +++- .../InformaticaProperties.Serialization.cs | 11 +++- ...nformaticaRegionsMetadata.Serialization.cs | 11 +++- ...timeResourceFetchMetadata.Serialization.cs | 11 +++- ...lessFetchConfigProperties.Serialization.cs | 11 +++- ...icaServerlessRuntimePatch.Serialization.cs | 11 +++- ...rverlessRuntimeProperties.Serialization.cs | 11 +++- ...erlessRuntimeResourceList.Serialization.cs | 11 +++- ...RuntimeResourceListResult.Serialization.cs | 11 +++- .../InformaticaUserDetails.Serialization.cs | 11 +++- ...ormaticaUserDetailsUpdate.Serialization.cs | 11 +++- .../Models/LinkOrganization.Serialization.cs | 11 +++- ...erverlessConfigProperties.Serialization.cs | 11 +++- ...erverlessMetadataResponse.Serialization.cs | 11 +++- ...ssRuntimeConfigProperties.Serialization.cs | 11 +++- ...imeConfigPropertiesUpdate.Serialization.cs | 11 +++- ...rverlessRuntimeDependency.Serialization.cs | 11 +++- ...lessRuntimeNetworkProfile.Serialization.cs | 11 +++- ...ntimeNetworkProfileUpdate.Serialization.cs | 11 +++- ...ssRuntimePropertiesUpdate.Serialization.cs | 11 +++- .../ServerlessRuntimeTag.Serialization.cs | 11 +++- ...timeUserContextProperties.Serialization.cs | 11 +++- ...erContextPropertiesUpdate.Serialization.cs | 11 +++- .../src/Generated/Models/BasinId.cs | 2 +- .../src/Generated/Models/DailyDuration.cs | 2 +- .../src/Generated/Models/DayQuarter.cs | 2 +- .../src/Generated/Models/DominantPollutant.cs | 2 +- .../src/Generated/Models/HazardIndex.cs | 2 +- .../src/Generated/Models/HourlyDuration.cs | 2 +- .../src/Generated/Models/IconCode.cs | 2 +- .../src/Generated/Models/JsonFormat.cs | 2 +- .../Generated/Models/LatestStatusKeyword.cs | 2 +- .../src/Generated/Models/PollutantType.cs | 2 +- .../src/Generated/Models/PrecipitationType.cs | 2 +- .../src/Generated/Models/UnitType.cs | 2 +- .../src/Generated/Models/WeatherDataUnit.cs | 2 +- ...urceManager.MongoCluster.netstandard2.0.cs | 22 +++++++ .../Models/BackupProperties.Serialization.cs | 11 +++- .../Models/ComputeProperties.Serialization.cs | 11 +++- .../FirewallRuleListResult.Serialization.cs | 11 +++- ...ighAvailabilityProperties.Serialization.cs | 11 +++- ...erAdministratorProperties.Serialization.cs | 11 +++- ...goClusterConnectionString.Serialization.cs | 11 +++- ...erConnectionStringsResult.Serialization.cs | 11 +++- ...terFirewallRuleProperties.Serialization.cs | 11 +++- .../MongoClusterListResult.Serialization.cs | 11 +++- ...erNameAvailabilityContent.Serialization.cs | 11 +++- ...terNameAvailabilityResult.Serialization.cs | 11 +++- .../Models/MongoClusterPatch.Serialization.cs | 11 +++- ...PrivateEndpointConnection.Serialization.cs | 47 ++++----------- ...pointConnectionProperties.Serialization.cs | 11 +++- ...erPrivateLinkResourceData.Serialization.cs | 47 ++++----------- ...ateLinkResourceListResult.Serialization.cs | 11 +++- ...ateLinkResourceProperties.Serialization.cs | 11 +++- ...inkServiceConnectionState.Serialization.cs | 11 +++- .../MongoClusterProperties.Serialization.cs | 11 +++- .../MongoClusterReplica.Serialization.cs | 47 ++++----------- ...ongoClusterReplicaContent.Serialization.cs | 11 +++- ...sterReplicationProperties.Serialization.cs | 11 +++- ...ongoClusterRestoreContent.Serialization.cs | 11 +++- ...goClusterUpdateProperties.Serialization.cs | 11 +++- ...nectionResourceListResult.Serialization.cs | 11 +++- .../PromoteReplicaContent.Serialization.cs | 11 +++- .../Models/ReplicaListResult.Serialization.cs | 11 +++- .../ShardingProperties.Serialization.cs | 11 +++- .../Models/StorageProperties.Serialization.cs | 11 +++- .../MongoClusterData.Serialization.cs | 60 ++++--------------- ...goClusterFirewallRuleData.Serialization.cs | 47 ++++----------- ...intConnectionResourceData.Serialization.cs | 47 ++++----------- ...ourceManager.StandbyPool.netstandard2.0.cs | 21 +++++++ .../assets.json | 2 +- ...GroupInstanceCountSummary.Serialization.cs | 11 +++- .../PoolResourceStateCount.Serialization.cs | 11 +++- ...roupPoolElasticityProfile.Serialization.cs | 11 +++- ...byContainerGroupPoolPatch.Serialization.cs | 11 +++- ...tainerGroupPoolProperties.Serialization.cs | 11 +++- ...oupPoolResourceListResult.Serialization.cs | 11 +++- ...PoolRuntimeViewProperties.Serialization.cs | 11 +++- ...imeViewResourceListResult.Serialization.cs | 11 +++- ...GroupPoolUpdateProperties.Serialization.cs | 11 +++- ...ndbyContainerGroupProfile.Serialization.cs | 11 +++- ...yContainerGroupProperties.Serialization.cs | 11 +++- ...chineInstanceCountSummary.Serialization.cs | 11 +++- ...hinePoolElasticityProfile.Serialization.cs | 11 +++- ...byVirtualMachinePoolPatch.Serialization.cs | 11 +++- ...tualMachinePoolProperties.Serialization.cs | 11 +++- ...inePoolResourceListResult.Serialization.cs | 11 +++- ...PoolRuntimeViewProperties.Serialization.cs | 11 +++- ...imeViewResourceListResult.Serialization.cs | 11 +++- ...chinePoolUpdateProperties.Serialization.cs | 11 +++- ...yVirtualMachineProperties.Serialization.cs | 11 +++- ...MachineResourceListResult.Serialization.cs | 11 +++- ...dbyContainerGroupPoolData.Serialization.cs | 60 ++++--------------- ...rGroupPoolRuntimeViewData.Serialization.cs | 47 ++++----------- ...StandbyVirtualMachineData.Serialization.cs | 47 ++++----------- ...dbyVirtualMachinePoolData.Serialization.cs | 60 ++++--------------- ...achinePoolRuntimeViewData.Serialization.cs | 47 ++++----------- 293 files changed, 2657 insertions(+), 1689 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 6f6083dd194a8..753a3ebbd1ef2 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -223,7 +223,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index fba3962797ec0..c70a172a3801e 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240926.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20241007.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.46.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240926.1", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240926.1.tgz", - "integrity": "sha512-84mRKH69FZRZMhYQZ8x80L7IhL+T25SR5jGm5Fwl9/3ZW6W3CODZTDCQq7yFa0ScgcYLHZbBZJVS/DQ3uYyZbg==" + "version": "3.0.0-beta.20241007.1", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20241007.1.tgz", + "integrity": "sha512-p63AmGFSIeGO7KWZCoopXmOG7D5dlk0WG7PLipXMa1OvhIm7y8zD4+MFfTxwG9mLRZlEPHWgceZvG7nw8RnMlw==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.46.0", @@ -117,11 +117,11 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240926.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240926.1.tgz", - "integrity": "sha512-4zet79druyMgFbB/R9JIlf2UmprZp4SzK6LfEdq2F24OqQCMGVKzgXI8ghC7dzlyPZFXnY7C9jO7o5Alb1fmxg==", + "version": "0.2.0-beta.20241007.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20241007.1.tgz", + "integrity": "sha512-7RNc2V40NA2jj7LA30ZM1fH9pgzDJJUIGmlt+EjfZN8g257KU1yRlbIZseFbFYg/XDjM3udopEg/uAOfMjVACA==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240926.1", + "@autorest/csharp": "3.0.0-beta.20241007.1", "@typespec/http-client-csharp": "0.1.9-alpha.20240925.1", "json-serialize-refs": "0.1.0-0" }, @@ -153,21 +153,21 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 98e1417bc1b70..a1fa1296afdad 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240926.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20241007.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.46.0", diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs index df5f5a8b381b8..7968f3f304d63 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs @@ -24,6 +24,7 @@ public ComputeFleetData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -129,6 +130,7 @@ internal ComputeFleetApiError() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError Innererror { get { throw null; } } public string Message { get { throw null; } } public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -141,6 +143,7 @@ internal ComputeFleetApiErrorInfo() { } public string Code { get { throw null; } } public string Message { get { throw null; } } public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -152,6 +155,7 @@ public partial class ComputeFleetBootDiagnostics : System.ClientModel.Primitives public ComputeFleetBootDiagnostics() { } public bool? IsEnabled { get { throw null; } set { } } public System.Uri StorageUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -183,6 +187,7 @@ public ComputeFleetComputeProfile(Azure.ResourceManager.ComputeFleet.Models.Comp public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile BaseVirtualMachineProfile { get { throw null; } set { } } public string ComputeApiVersion { get { throw null; } set { } } public int? PlatformFaultDomainCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -230,6 +235,7 @@ public partial class ComputeFleetDiffDiskSettings : System.ClientModel.Primitive public ComputeFleetDiffDiskSettings() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption? Option { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement? Placement { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -342,6 +348,7 @@ public ComputeFleetImageReference() { } public string SharedGalleryImageId { get { throw null; } set { } } public string Sku { get { throw null; } set { } } public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -353,6 +360,7 @@ public partial class ComputeFleetInnerError : System.ClientModel.Primitives.IJso internal ComputeFleetInnerError() { } public string ErrorDetail { get { throw null; } } public string ExceptionType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -382,6 +390,7 @@ public partial class ComputeFleetKeyVaultSecretReference : System.ClientModel.Pr public ComputeFleetKeyVaultSecretReference(System.Uri secretUri, Azure.ResourceManager.Resources.Models.WritableSubResource sourceVault) { } public System.Uri SecretUri { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -396,6 +405,7 @@ public ComputeFleetLinuxConfiguration() { } public bool? IsVmAgentProvisioned { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings PatchSettings { get { throw null; } set { } } public System.Collections.Generic.IList SshPublicKeys { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -426,6 +436,7 @@ public ComputeFleetLinuxPatchSettings() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode? AssessmentMode { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode? PatchMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -457,6 +468,7 @@ public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings() { } public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -561,6 +573,7 @@ public partial class ComputeFleetOSImageNotificationProfile : System.ClientModel public ComputeFleetOSImageNotificationProfile() { } public bool? IsEnabled { get { throw null; } set { } } public string NotBeforeTimeout { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -574,6 +587,7 @@ public ComputeFleetPatch() { } public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -590,6 +604,7 @@ public ComputeFleetProperties(System.Collections.Generic.IEnumerable VmSizesProfile { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -643,6 +658,7 @@ public ComputeFleetProxyAgentSettings() { } public bool? IsEnabled { get { throw null; } set { } } public int? KeyIncarnationId { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -654,6 +670,7 @@ public partial class ComputeFleetPublicIPAddressSku : System.ClientModel.Primiti public ComputeFleetPublicIPAddressSku() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName? Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -701,6 +718,7 @@ public partial class ComputeFleetScheduledEventsProfile : System.ClientModel.Pri public ComputeFleetScheduledEventsProfile() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile OSImageNotificationProfile { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile TerminateNotificationProfile { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -732,6 +750,7 @@ public ComputeFleetSecurityPostureReference() { } public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } public string Id { get { throw null; } set { } } public bool? IsOverridable { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -746,6 +765,7 @@ public ComputeFleetSecurityProfile() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType? SecurityType { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings UefiSettings { get { throw null; } set { } } public Azure.Core.ResourceIdentifier UserAssignedIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -775,6 +795,7 @@ public partial class ComputeFleetSshPublicKey : System.ClientModel.Primitives.IJ public ComputeFleetSshPublicKey() { } public string KeyData { get { throw null; } set { } } public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -809,6 +830,7 @@ public partial class ComputeFleetTerminateNotificationProfile : System.ClientMod public ComputeFleetTerminateNotificationProfile() { } public bool? IsEnabled { get { throw null; } set { } } public string NotBeforeTimeout { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -820,6 +842,7 @@ public partial class ComputeFleetUefiSettings : System.ClientModel.Primitives.IJ public ComputeFleetUefiSettings() { } public bool? IsSecureBootEnabled { get { throw null; } set { } } public bool? IsVTpmEnabled { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -831,6 +854,7 @@ public partial class ComputeFleetVaultCertificate : System.ClientModel.Primitive public ComputeFleetVaultCertificate() { } public string CertificateStore { get { throw null; } set { } } public System.Uri CertificateUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -842,6 +866,7 @@ public partial class ComputeFleetVaultSecretGroup : System.ClientModel.Primitive public ComputeFleetVaultSecretGroup() { } public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } public System.Collections.Generic.IList VaultCertificates { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -871,6 +896,7 @@ public partial class ComputeFleetVmDiskSecurityProfile : System.ClientModel.Prim public ComputeFleetVmDiskSecurityProfile() { } public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType? SecurityEncryptionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -886,6 +912,7 @@ public ComputeFleetVmGalleryApplication(Azure.Core.ResourceIdentifier packageRef public int? Order { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PackageReferenceId { get { throw null; } set { } } public string Tags { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -899,6 +926,7 @@ public ComputeFleetVmGuestPatchSettings() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } public bool? IsHotPatchingEnabled { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode? PatchMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -923,6 +951,7 @@ public ComputeFleetVmProfile() { } public Azure.Core.ResourceIdentifier ServiceArtifactReferenceId { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile StorageProfile { get { throw null; } set { } } public string UserData { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -934,6 +963,7 @@ public partial class ComputeFleetVmSizeProfile : System.ClientModel.Primitives.I public ComputeFleetVmSizeProfile(string name) { } public string Name { get { throw null; } set { } } public int? Rank { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -945,6 +975,7 @@ public partial class ComputeFleetVmSizeProperties : System.ClientModel.Primitive public ComputeFleetVmSizeProperties() { } public int? VCPUsAvailable { get { throw null; } set { } } public int? VCPUsPerCore { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -958,6 +989,7 @@ internal ComputeFleetVmss() { } public string Id { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState OperationStatus { get { throw null; } } public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -977,6 +1009,7 @@ public ComputeFleetVmssDataDisk(int lun, Azure.ResourceManager.ComputeFleet.Mode public int Lun { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk ManagedDisk { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -990,6 +1023,7 @@ public ComputeFleetVmssExtension() { } public Azure.Core.ResourceIdentifier Id { get { throw null; } } public string Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1001,6 +1035,7 @@ public partial class ComputeFleetVmssExtensionProfile : System.ClientModel.Primi public ComputeFleetVmssExtensionProfile() { } public System.Collections.Generic.IList Extensions { get { throw null; } } public string ExtensionsTimeBudget { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1022,6 +1057,7 @@ public ComputeFleetVmssExtensionProperties() { } public System.Collections.Generic.IDictionary Settings { get { throw null; } } public bool? ShouldAutoUpgradeMinorVersion { get { throw null; } set { } } public string TypeHandlerVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1033,6 +1069,7 @@ public partial class ComputeFleetVmssIPConfiguration : System.ClientModel.Primit public ComputeFleetVmssIPConfiguration(string name) { } public string Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1050,6 +1087,7 @@ public ComputeFleetVmssIPConfigurationProperties() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PrivateIPAddressVersion { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration PublicIPAddressConfiguration { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1061,6 +1099,7 @@ public partial class ComputeFleetVmssIPTag : System.ClientModel.Primitives.IJson public ComputeFleetVmssIPTag() { } public string IPTagType { get { throw null; } set { } } public string Tag { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1073,6 +1112,7 @@ public ComputeFleetVmssManagedDisk() { } public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile SecurityProfile { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType? StorageAccountType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1084,6 +1124,7 @@ public partial class ComputeFleetVmssNetworkConfiguration : System.ClientModel.P public ComputeFleetVmssNetworkConfiguration(string name) { } public string Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1104,6 +1145,7 @@ public ComputeFleetVmssNetworkConfigurationProperties(System.Collections.Generic public bool? IsPrimary { get { throw null; } set { } } public bool? IsTcpStateTrackingDisabled { get { throw null; } set { } } public Azure.Core.ResourceIdentifier NetworkSecurityGroupId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1116,6 +1158,7 @@ public ComputeFleetVmssNetworkProfile() { } public Azure.Core.ResourceIdentifier HealthProbeId { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion? NetworkApiVersion { get { throw null; } set { } } public System.Collections.Generic.IList NetworkInterfaceConfigurations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1136,6 +1179,7 @@ public ComputeFleetVmssOSDisk(Azure.ResourceManager.ComputeFleet.Models.ComputeF public string Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType? OSType { get { throw null; } set { } } public System.Collections.Generic.IList VhdContainers { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1154,6 +1198,7 @@ public ComputeFleetVmssOSProfile() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration LinuxConfiguration { get { throw null; } set { } } public System.Collections.Generic.IList Secrets { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration WindowsConfiguration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1166,6 +1211,7 @@ public ComputeFleetVmssPublicIPAddressConfiguration(string name) { } public string Name { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku Sku { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1181,6 +1227,7 @@ public ComputeFleetVmssPublicIPAddressConfigurationProperties() { } public System.Collections.Generic.IList IPTags { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PublicIPAddressVersion { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PublicIPPrefixId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1192,6 +1239,7 @@ public partial class ComputeFleetVmssPublicIPAddressDnsSettings : System.ClientM public ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel) { } public string DomainNameLabel { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType? DomainNameLabelScope { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1205,6 +1253,7 @@ public ComputeFleetVmssStorageProfile() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType? DiskControllerType { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ImageReference { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk OSDisk { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1221,6 +1270,7 @@ public ComputeFleetWindowsConfiguration() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings PatchSettings { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } public System.Collections.Generic.IList WinRMListeners { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1270,6 +1320,7 @@ public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings() { } public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1300,6 +1351,7 @@ public partial class ComputeFleetWinRMListener : System.ClientModel.Primitives.I public ComputeFleetWinRMListener() { } public System.Uri CertificateUri { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType? Protocol { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1348,6 +1400,7 @@ public RegularPriorityProfile() { } public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy? AllocationStrategy { get { throw null; } set { } } public int? Capacity { get { throw null; } set { } } public int? MinCapacity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1382,6 +1435,7 @@ public SpotPriorityProfile() { } public bool? IsMaintainEnabled { get { throw null; } set { } } public float? MaxPricePerVm { get { throw null; } set { } } public int? MinCapacity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1395,6 +1449,7 @@ public WindowsSetupAdditionalInformation() { } public string Content { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName? PassName { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName? SettingName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json index bd48d8ebefd90..7940819838d9b 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/computefleet/Azure.ResourceManager.ComputeFleet", - "Tag": "net/computefleet/Azure.ResourceManager.ComputeFleet_18fc3c7f41" + "Tag": "net/computefleet/Azure.ResourceManager.ComputeFleet_8c78427dad" } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs index 25e0baf0c9de5..7f59299049571 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs @@ -20,6 +20,15 @@ public partial class ComputeFleetData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ComputeFleetData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -54,55 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("plan"u8); JsonSerializer.Serialize(writer, Plan); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ComputeFleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs index bea5e59707db6..608a897497c46 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.Serialization.cs @@ -19,6 +19,15 @@ internal partial class CapacityReservationProfile : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CapacityReservationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CapacityReservationGroup)) { writer.WritePropertyName("capacityReservationGroup"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CapacityReservationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs index d102ec8a91e47..d1508528dea91 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetApiError : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ComputeFleetApiError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs index 79e521e9c5ac8..7a90fc5dd8c27 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetApiErrorInfo : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ComputeFleetApiErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs index e9b1c78f85dea..1b6184fa7088d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetApplicationProfile : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(GalleryApplications)) { writer.WritePropertyName("galleryApplications"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetApplicationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs index 03f7c0b171489..6b806f93e87a2 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetBootDiagnostics : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsEnabled)) { writer.WritePropertyName("enabled"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ComputeFleetBootDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs index ffb1fc5d58d7e..42537962e2a4a 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetComputeProfile : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ComputeFleetComputeProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("baseVirtualMachineProfile"u8); writer.WriteObjectValue(BaseVirtualMachineProfile, options); if (Optional.IsDefined(ComputeApiVersion)) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ComputeFleetComputeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs index 16ec9939b8431..0656a16e444d2 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetDiagnosticsProfile : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(BootDiagnostics)) { writer.WritePropertyName("bootDiagnostics"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetDiagnosticsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs index 6aca5ab4dda3b..d2071fd6d39eb 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetDiffDiskSettings : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Option)) { writer.WritePropertyName("option"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ComputeFleetDiffDiskSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs index 02179b39f216e..e71698f74dabd 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetEncryptionIdentity : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(UserAssignedIdentityResourceId)) { writer.WritePropertyName("userAssignedIdentityResourceId"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetEncryptionIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs index 774950f0c8e3e..e60e2087676fb 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetImageReference : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -81,7 +89,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ComputeFleetImageReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs index e255795755e6c..6687b3b3b2f9c 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetInnerError : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ExceptionType)) { writer.WritePropertyName("exceptionType"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ComputeFleetInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs index 979a435b17d9b..5e12c63b530b5 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetKeyVaultSecretReference : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("secretUrl"u8); writer.WriteStringValue(SecretUri.AbsoluteUri); writer.WritePropertyName("sourceVault"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } ComputeFleetKeyVaultSecretReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs index 090b425e6ecfb..358f851bb9b5f 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetLinuxConfiguration : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsPasswordAuthenticationDisabled)) { writer.WritePropertyName("disablePasswordAuthentication"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetLinuxConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs index 2df519de962a7..264bd13b6f906 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetLinuxPatchSettings : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PatchMode)) { writer.WritePropertyName("patchMode"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetLinuxPatchSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs index 2b8bbc2bc9932..55dc12dafeff7 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write( throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RebootSetting)) { writer.WritePropertyName("rebootSetting"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write( #endif } } - writer.WriteEndObject(); } ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs index 5e0a8b25b2e57..54ba077e6a9fb 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetOSImageNotificationProfile : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ComputeFleetOSImageNotificationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(NotBeforeTimeout)) { writer.WritePropertyName("notBeforeTimeout"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } ComputeFleetOSImageNotificationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs index d573cb9046d8f..449ed3d12722a 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ComputeFleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs index ef31137b79808..8d2d9757346ed 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetProperties : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ComputeFleetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs index 17a0ed47ddc2e..dd4d8b8d59874 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetProxyAgentSettings : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetProxyAgentSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsEnabled)) { writer.WritePropertyName("enabled"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetProxyAgentSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs index bc2f6b2907b02..d6563124248d7 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetPublicIPAddressSku : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetPublicIPAddressSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs index dcdb4b81dea65..97925e78e614e 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetScheduledEventsProfile : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(TerminateNotificationProfile)) { writer.WritePropertyName("terminateNotificationProfile"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ComputeFleetScheduledEventsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs index 9166503e4d306..75b92a0ad89fa 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetSecurityPostureReference : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ComputeFleetSecurityPostureReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs index 87d89420da588..87859263e1804 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetSecurityProfile : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(UefiSettings)) { writer.WritePropertyName("uefiSettings"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ComputeFleetSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs index 791b7b0424a7b..7996780b2d2af 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetSshConfiguration : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(PublicKeys)) { writer.WritePropertyName("publicKeys"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ComputeFleetSshConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs index 99d8fe18f895b..efe710da75b05 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetSshPublicKey : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ComputeFleetSshPublicKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs index 9eede006c6623..76a473232d1a8 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetTerminateNotificationProfile : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(ComputeFleetTerminateNotificationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(NotBeforeTimeout)) { writer.WritePropertyName("notBeforeTimeout"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } ComputeFleetTerminateNotificationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs index c70fae5c42af1..dcdc1b3ac415d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetUefiSettings : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsSecureBootEnabled)) { writer.WritePropertyName("secureBootEnabled"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ComputeFleetUefiSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs index 2c17ffcb8e9a4..323d66ccd15af 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVaultCertificate : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CertificateUri)) { writer.WritePropertyName("certificateUrl"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ComputeFleetVaultCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs index 2aece832749bb..09e6df63bc1e2 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVaultSecretGroup : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SourceVault)) { writer.WritePropertyName("sourceVault"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ComputeFleetVaultSecretGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs index 268137c084a87..5cb0f20377540 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetVirtualHardDisk : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Uri)) { writer.WritePropertyName("uri"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ComputeFleetVirtualHardDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs index ce40c4d781f36..9cae6090f06db 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmDiskSecurityProfile : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SecurityEncryptionType)) { writer.WritePropertyName("securityEncryptionType"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ComputeFleetVmDiskSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs index f040c5a8b34e0..995427ca5f7eb 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmGalleryApplication : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } ComputeFleetVmGalleryApplication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs index 66632f12580c0..9d92698c436c4 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmGuestPatchSettings : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PatchMode)) { writer.WritePropertyName("patchMode"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } ComputeFleetVmGuestPatchSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs index 71dbc4f837484..516a6dcd90651 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmProfile : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(OSProfile)) { writer.WritePropertyName("osProfile"u8); @@ -117,7 +125,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } ComputeFleetVmProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs index cdfa44806c741..f7f43a67177e2 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmSizeProfile : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Rank)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ComputeFleetVmSizeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs index 643ede08cf192..cffeae7236244 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmSizeProperties : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(VCPUsAvailable)) { writer.WritePropertyName("vCPUsAvailable"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ComputeFleetVmSizeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs index 031e5236b3c64..4f946ccc687bd 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmss : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ComputeFleetVmss)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } ComputeFleetVmss IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs index 56ce2107147ea..2dbdf45d9dd1b 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssDataDisk : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -85,7 +93,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ComputeFleetVmssDataDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs index 362baba232106..e84cc318db259 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssExtension : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ComputeFleetVmssExtension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs index cb116c5385223..d0cf4e88c06e3 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssExtensionProfile : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Extensions)) { writer.WritePropertyName("extensions"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } ComputeFleetVmssExtensionProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs index 932366bdb2358..1da0c1c4a6d42 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssExtensionProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ForceUpdateTag)) { writer.WritePropertyName("forceUpdateTag"u8); @@ -142,7 +150,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } ComputeFleetVmssExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs index b423855e93aac..c487e019b9088 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetVmssHardwareProfile : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(VmSizeProperties)) { writer.WritePropertyName("vmSizeProperties"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } ComputeFleetVmssHardwareProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs index 226c64d6585c6..6fc16fe19fe06 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssIPConfiguration : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Properties)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } ComputeFleetVmssIPConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs index 9156cf8a3db69..b3151a02ffd04 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmssIPConfigurationProperties : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Subnet)) { writer.WritePropertyName("subnet"u8); @@ -102,7 +110,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } ComputeFleetVmssIPConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs index 507e408a603a3..c077b0a96e46d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssIPTag : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ComputeFleetVmssIPTag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IPTagType)) { writer.WritePropertyName("ipTagType"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } ComputeFleetVmssIPTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs index 30355dc68eb15..f816933db8e8f 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmssManagedDisk : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(StorageAccountType)) { writer.WritePropertyName("storageAccountType"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ComputeFleetVmssManagedDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs index 68b09bc5b9473..dba05725f106f 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssNetworkConfiguration : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Properties)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ComputeFleetVmssNetworkConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs index a57d4babc99b7..0ae5c88dc766e 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmssNetworkConfigurationProperties : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsPrimary)) { writer.WritePropertyName("primary"u8); @@ -99,7 +107,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } ComputeFleetVmssNetworkConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs index 5282bc5a80df2..9ffae7245c736 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeFleetVmssNetworkDnsSettings : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(DnsServers)) { writer.WritePropertyName("dnsServers"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ComputeFleetVmssNetworkDnsSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs index 87f624243d6a5..133e402375bf0 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmssNetworkProfile : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(HealthProbe)) { writer.WritePropertyName("healthProbe"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetVmssNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs index 4f726e12f9294..f7569cfea9fdd 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssOSDisk : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -98,7 +106,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ComputeFleetVmssOSDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs index f698a839b3c89..bd812f9d5e634 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssOSProfile : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ComputerNamePrefix)) { writer.WritePropertyName("computerNamePrefix"u8); @@ -91,7 +99,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ComputeFleetVmssOSProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs index 984746b71cf26..a2f7a54c8b93b 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssPublicIPAddressConfiguration : IUtf8JsonSer void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrit throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Properties)) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrit #endif } } - writer.WriteEndObject(); } ComputeFleetVmssPublicIPAddressConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs index 9c5197c3c40b0..0950080c8712c 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties : IU void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Ut throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IdleTimeoutInMinutes)) { writer.WritePropertyName("idleTimeoutInMinutes"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Ut #endif } } - writer.WriteEndObject(); } ComputeFleetVmssPublicIPAddressConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs index 549d22d6b6bc6..b5a5e5f41fadf 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssPublicIPAddressDnsSettings : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("domainNameLabel"u8); writer.WriteStringValue(DomainNameLabel); if (Optional.IsDefined(DomainNameLabelScope)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } ComputeFleetVmssPublicIPAddressDnsSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs index 525485dfa9faf..e83e7076a8a92 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetVmssStorageProfile : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ImageReference)) { writer.WritePropertyName("imageReference"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ComputeFleetVmssStorageProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs index b30770bb281f3..eb8b6cc1fc8aa 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetWinRMListener : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Protocol)) { writer.WritePropertyName("protocol"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ComputeFleetWinRMListener IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs index bb7cfbca2055a..bb712f6e5edc8 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetWindowsConfiguration : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsVmAgentProvisioned)) { writer.WritePropertyName("provisionVMAgent"u8); @@ -81,7 +89,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } ComputeFleetWindowsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs index 6f3e5079e52e7..1bf93ef80fd97 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Writ throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RebootSetting)) { writer.WritePropertyName("rebootSetting"u8); @@ -51,7 +59,6 @@ void IJsonModel.Writ #endif } } - writer.WriteEndObject(); } ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs index 30afe9e74fd6c..69b7df578526c 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs index 2db980f8d3f75..ced91c0af7f7e 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class RegularPriorityProfile : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Capacity)) { writer.WritePropertyName("capacity"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } RegularPriorityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs index b9fa2a9b128a1..169a556fd74a1 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class SpotPriorityProfile : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Capacity)) { writer.WritePropertyName("capacity"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } SpotPriorityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs index 33c194673c99f..ae42f39606fde 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class VirtualMachineScaleSetListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } VirtualMachineScaleSetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs index 669582afd846b..d08e8948107c0 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs @@ -18,6 +18,15 @@ internal partial class WinRMConfiguration : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Listeners)) { writer.WritePropertyName("listeners"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } WinRMConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs index b4b958c1bef36..e042f711ac959 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs @@ -18,6 +18,15 @@ public partial class WindowsSetupAdditionalInformation : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PassName)) { writer.WritePropertyName("passName"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } WindowsSetupAdditionalInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs index a3f22d7e3d5e0..836b8e83b6dbc 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs @@ -68,6 +68,7 @@ public partial class CancelOperationsContent : System.ClientModel.Primitives.IJs public CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -78,6 +79,7 @@ public partial class CancelOperationsResult : System.ClientModel.Primitives.IJso { internal CancelOperationsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -91,6 +93,7 @@ internal DeallocateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -103,6 +106,7 @@ public ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.Sch public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -115,6 +119,7 @@ public ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.Sche public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -127,6 +132,7 @@ public ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.Schedule public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -137,6 +143,7 @@ public partial class GetOperationErrorsContent : System.ClientModel.Primitives.I { public GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds) { } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -147,6 +154,7 @@ public partial class GetOperationErrorsResult : System.ClientModel.Primitives.IJ { internal GetOperationErrorsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -158,6 +166,7 @@ public partial class GetOperationStatusContent : System.ClientModel.Primitives.I public GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -168,6 +177,7 @@ public partial class GetOperationStatusResult : System.ClientModel.Primitives.IJ { internal GetOperationStatusResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -181,6 +191,7 @@ internal HibernateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -194,6 +205,7 @@ internal OperationErrorDetails() { } public string ErrorCode { get { throw null; } } public System.DateTimeOffset ErrorDetails { get { throw null; } } public System.DateTimeOffset TimeStamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -210,6 +222,7 @@ internal OperationErrorsResult() { } public string OperationId { get { throw null; } } public string RequestErrorCode { get { throw null; } } public string RequestErrorDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -230,6 +243,7 @@ internal ResourceOperationDetails() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState State { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TimeZone { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -241,6 +255,7 @@ public partial class ResourceOperationError : System.ClientModel.Primitives.IJso internal ResourceOperationError() { } public string ErrorCode { get { throw null; } } public string ErrorDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -254,6 +269,7 @@ internal ResourceOperationResult() { } public string ErrorDetails { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails Operation { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -304,6 +320,7 @@ public partial class ScheduledActionExecutionParameterDetail : System.ClientMode public ScheduledActionExecutionParameterDetail() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? OptimizationPreference { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy RetryPolicy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -361,6 +378,7 @@ internal StartResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -374,6 +392,7 @@ public SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.User public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -387,6 +406,7 @@ public SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserR public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -400,6 +420,7 @@ public SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserReque public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -410,6 +431,7 @@ public partial class UserRequestResources : System.ClientModel.Primitives.IJsonM { public UserRequestResources(System.Collections.Generic.IEnumerable ids) { } public System.Collections.Generic.IList Ids { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -421,6 +443,7 @@ public partial class UserRequestRetryPolicy : System.ClientModel.Primitives.IJso public UserRequestRetryPolicy() { } public int? RetryCount { get { throw null; } set { } } public int? RetryWindowInMinutes { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -433,6 +456,7 @@ public UserRequestSchedule(System.DateTimeOffset deadLine, string timeZone, Azur public System.DateTimeOffset DeadLine { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType DeadlineType { get { throw null; } } public string TimeZone { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/assets.json b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/assets.json index ef6dcf4efe9e9..5a77c1cb1ceee 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/assets.json +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/computeschedule/Azure.ResourceManager.ComputeSchedule", - "Tag": "net/computeschedule/Azure.ResourceManager.ComputeSchedule_f16d0a9f7e" + "Tag": "net/computeschedule/Azure.ResourceManager.ComputeSchedule_1309f68d38" } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs index 379799a092d43..b620d54aea163 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CancelOperationsContent : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CancelOperationsContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); foreach (var item in OperationIds) @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CancelOperationsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs index 05732e4013625..6ea83eb6cb2e0 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class CancelOperationsResult : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CancelOperationsResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("results"u8); writer.WriteStartArray(); foreach (var item in Results) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } CancelOperationsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs index d9a7c7f85f564..caa2a1bb07b87 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class DeallocateResourceOperationResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(DeallocateResourceOperationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } DeallocateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs index d0ab9097a2111..b7dffb300cb07 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExecuteDeallocateContent : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ExecuteDeallocateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ExecuteDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs index 0fe943868771f..e2490489b16e0 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExecuteHibernateContent : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ExecuteHibernateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ExecuteHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs index 961eb10a1b0ed..f61dc1e28e3c5 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExecuteStartContent : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ExecuteStartContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ExecuteStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs index 7708a8ccb5439..6c491c5106b81 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class GetOperationErrorsContent : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(GetOperationErrorsContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); foreach (var item in OperationIds) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } GetOperationErrorsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs index b6e96c0f97872..d557775833c84 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class GetOperationErrorsResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(GetOperationErrorsResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("results"u8); writer.WriteStartArray(); foreach (var item in Results) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } GetOperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs index e8633fe4bb25b..e91804c0bb9f8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class GetOperationStatusContent : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(GetOperationStatusContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); foreach (var item in OperationIds) @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } GetOperationStatusContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs index 0a59ecebb2746..fea46ab80fb03 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class GetOperationStatusResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(GetOperationStatusResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("results"u8); writer.WriteStartArray(); foreach (var item in Results) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } GetOperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs index 74aa2354ea2ba..5b13d98aa7419 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class HibernateResourceOperationResult : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(HibernateResourceOperationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } HibernateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs index 08a8469c9f9bd..560418b707c30 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class OperationErrorDetails : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(OperationErrorDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("errorCode"u8); writer.WriteStringValue(ErrorCode); writer.WritePropertyName("errorDetails"u8); @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } OperationErrorDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs index 32733cded89f1..3ca357addee43 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class OperationErrorsResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(OperationErrorsResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(OperationId)) { writer.WritePropertyName("operationId"u8); @@ -81,7 +89,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } OperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs index 4aa0e24533b5b..bc1c5b836cef8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceOperationDetails : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ResourceOperationDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("operationId"u8); writer.WriteStringValue(OperationId); writer.WritePropertyName("resourceId"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ResourceOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs index bdc9472c4342d..0a06364ffdbfc 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceOperationError : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ResourceOperationError)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("errorCode"u8); writer.WriteStringValue(ErrorCode); writer.WritePropertyName("errorDetails"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ResourceOperationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs index 6bdfcfa35dac7..fec8dcde22078 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceOperationResult : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceOperationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceId)) { writer.WritePropertyName("resourceId"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs index f746bd79997ff..cd668a789db37 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs @@ -18,6 +18,15 @@ public partial class ScheduledActionExecutionParameterDetail : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(ScheduledActionExecutionParameterDetail)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(OptimizationPreference)) { writer.WritePropertyName("optimizationPreference"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } ScheduledActionExecutionParameterDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs index 46cab8bf532ea..0ffb43b1a567e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class StartResourceOperationResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(StartResourceOperationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } StartResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs index 6a1085778c9b8..b153a98ff3763 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class SubmitDeallocateContent : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(SubmitDeallocateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } SubmitDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs index eee692b405c97..1af0e226bc2d2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class SubmitHibernateContent : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(SubmitHibernateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } SubmitHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs index f92ab1feca5b1..134c7853d85c3 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class SubmitStartContent : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SubmitStartContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } SubmitStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs index 5f89e94e1e76a..d7c8284a1da0e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs @@ -18,6 +18,15 @@ public partial class UserRequestResources : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(UserRequestResources)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("ids"u8); writer.WriteStartArray(); foreach (var item in Ids) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } UserRequestResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs index 4099ea4aab6fe..951a434f9c77a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs @@ -18,6 +18,15 @@ public partial class UserRequestRetryPolicy : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(UserRequestRetryPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RetryCount)) { writer.WritePropertyName("retryCount"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } UserRequestRetryPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs index 2e270d710f9a7..cf6efb6988ca1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs @@ -18,6 +18,15 @@ public partial class UserRequestSchedule : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(UserRequestSchedule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("deadLine"u8); writer.WriteStringValue(DeadLine, "O"); writer.WritePropertyName("timeZone"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } UserRequestSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs index e442d25585f9d..86448afdc6378 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/api/Azure.ResourceManager.DevOpsInfrastructure.netstandard2.0.cs @@ -37,6 +37,7 @@ public partial class DevOpsPoolData : Azure.ResourceManager.Models.TrackedResour public DevOpsPoolData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.DevOpsPoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -120,6 +121,7 @@ public partial class AutomaticResourcePredictionsProfile : Azure.ResourceManager { public AutomaticResourcePredictionsProfile() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.PredictionPreference? PredictionPreference { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.AutomaticResourcePredictionsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.AutomaticResourcePredictionsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -131,6 +133,7 @@ public partial class DevOpsAzureOrganizationProfile : Azure.ResourceManager.DevO public DevOpsAzureOrganizationProfile(System.Collections.Generic.IEnumerable organizations) { } public System.Collections.Generic.IList Organizations { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzurePermissionProfile PermissionProfile { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzureOrganizationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzureOrganizationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -143,6 +146,7 @@ public DevOpsAzurePermissionProfile(Azure.ResourceManager.DevOpsInfrastructure.M public System.Collections.Generic.IList Groups { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzurePermissionType Kind { get { throw null; } set { } } public System.Collections.Generic.IList Users { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzurePermissionProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzurePermissionProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -172,6 +176,7 @@ public partial class DevOpsAzureSku : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsAzureSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -185,6 +190,7 @@ public DevOpsDataDisk() { } public int? DiskSizeGiB { get { throw null; } set { } } public string DriveLetter { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStorageAccountType? StorageAccountType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -213,6 +219,7 @@ public DevOpsDataDisk() { } public abstract partial class DevOpsFabricProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected DevOpsFabricProfile() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsFabricProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsFabricProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -224,6 +231,7 @@ public partial class DevOpsGitHubOrganization : System.ClientModel.Primitives.IJ public DevOpsGitHubOrganization(System.Uri uri) { } public System.Collections.Generic.IList Repositories { get { throw null; } } public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsGitHubOrganization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsGitHubOrganization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -234,6 +242,7 @@ public partial class DevOpsGitHubOrganizationProfile : Azure.ResourceManager.Dev { public DevOpsGitHubOrganizationProfile(System.Collections.Generic.IEnumerable organizations) { } public System.Collections.Generic.IList Organizations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsGitHubOrganizationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsGitHubOrganizationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -244,6 +253,7 @@ public partial class DevOpsImageVersion : Azure.ResourceManager.Models.ResourceD { internal DevOpsImageVersion() { } public string ImageVersion { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsImageVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsImageVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -297,6 +307,7 @@ public DevOpsOrganization(System.Uri uri) { } public int? Parallelism { get { throw null; } set { } } public System.Collections.Generic.IList Projects { get { throw null; } } public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -306,6 +317,7 @@ public DevOpsOrganization(System.Uri uri) { } public abstract partial class DevOpsOrganizationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected DevOpsOrganizationProfile() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -317,6 +329,7 @@ public partial class DevOpsOSProfile : System.ClientModel.Primitives.IJsonModel< public DevOpsOSProfile() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsLogonType? LogonType { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.SecretsManagementSettings SecretsManagementSettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOSProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOSProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -328,6 +341,7 @@ public abstract partial class DevOpsPoolAgentProfile : System.ClientModel.Primit protected DevOpsPoolAgentProfile() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictions ResourcePredictions { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile ResourcePredictionsProfile { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolAgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolAgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -340,6 +354,7 @@ public DevOpsPoolPatch() { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.PoolUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -355,6 +370,7 @@ public DevOpsPoolProperties(int maximumConcurrency, Azure.ResourceManager.DevOps public int MaximumConcurrency { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile OrganizationProfile { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureProvisioningState? ProvisioningState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -368,6 +384,7 @@ public DevOpsPoolVmImage() { } public string Buffer { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } public string WellKnownImageName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolVmImage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolVmImage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -378,6 +395,7 @@ public partial class DevOpsResourceDetails : Azure.ResourceManager.Models.Resour { internal DevOpsResourceDetails() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetailsProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -390,6 +408,7 @@ internal DevOpsResourceDetailsProperties() { } public string Image { get { throw null; } } public string ImageVersion { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetailsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceDetailsProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -404,6 +423,7 @@ internal DevOpsResourceQuota() { } public long Limit { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceQuotaName Name { get { throw null; } } public string Unit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceQuota System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceQuota System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -415,6 +435,7 @@ public partial class DevOpsResourceQuotaName : System.ClientModel.Primitives.IJs internal DevOpsResourceQuotaName() { } public string LocalizedValue { get { throw null; } } public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceQuotaName System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceQuotaName System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -425,6 +446,7 @@ public partial class DevOpsResourceSku : Azure.ResourceManager.Models.ResourceDa { internal DevOpsResourceSku() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceSkuProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,6 +464,7 @@ internal DevOpsResourceSkuProperties() { } public System.Collections.Generic.IReadOnlyList Restrictions { get { throw null; } } public string Size { get { throw null; } } public string Tier { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceSkuProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsResourceSkuProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -480,6 +503,7 @@ public partial class DevOpsStateful : Azure.ResourceManager.DevOpsInfrastructure public DevOpsStateful() { } public string GracePeriodTimeSpan { get { throw null; } set { } } public string MaxAgentLifetime { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStateful System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStateful System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -489,6 +513,7 @@ public DevOpsStateful() { } public partial class DevOpsStatelessAgentProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsPoolAgentProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DevOpsStatelessAgentProfile() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStatelessAgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStatelessAgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -521,6 +546,7 @@ public partial class DevOpsStorageProfile : System.ClientModel.Primitives.IJsonM public DevOpsStorageProfile() { } public System.Collections.Generic.IList DataDisks { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.OSDiskStorageAccountType? OSDiskStorageAccountType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStorageProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStorageProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -535,6 +561,7 @@ public DevOpsVmssFabricProfile(Azure.ResourceManager.DevOpsInfrastructure.Models public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOSProfile OSProfile { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsStorageProfile StorageProfile { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsVmssFabricProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsVmssFabricProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -544,6 +571,7 @@ public DevOpsVmssFabricProfile(Azure.ResourceManager.DevOpsInfrastructure.Models public partial class ManualResourcePredictionsProfile : Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManualResourcePredictionsProfile() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ManualResourcePredictionsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ManualResourcePredictionsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -578,6 +606,7 @@ public PoolUpdateProperties() { } public int? MaximumConcurrency { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsOrganizationProfile OrganizationProfile { get { throw null; } set { } } public Azure.ResourceManager.DevOpsInfrastructure.Models.DevOpsInfrastructureProvisioningState? ProvisioningState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.PoolUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.PoolUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -608,6 +637,7 @@ public PoolUpdateProperties() { } public partial class ResourcePredictions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ResourcePredictions() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -617,6 +647,7 @@ public ResourcePredictions() { } public abstract partial class ResourcePredictionsProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ResourcePredictionsProfile() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourcePredictionsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -628,6 +659,7 @@ public partial class ResourceSkuCapabilities : System.ClientModel.Primitives.IJs internal ResourceSkuCapabilities() { } public string Name { get { throw null; } } public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuCapabilities System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuCapabilities System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -640,6 +672,7 @@ internal ResourceSkuLocationInfo() { } public Azure.Core.AzureLocation Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList ZoneDetails { get { throw null; } } public System.Collections.Generic.IReadOnlyList Zones { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuLocationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuLocationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -651,6 +684,7 @@ public partial class ResourceSkuRestrictionInfo : System.ClientModel.Primitives. internal ResourceSkuRestrictionInfo() { } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } public System.Collections.Generic.IReadOnlyList Zones { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -664,6 +698,7 @@ internal ResourceSkuRestrictions() { } public Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictionInfo RestrictionInfo { get { throw null; } } public Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictionsType? RestrictionsType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuRestrictions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -711,6 +746,7 @@ public partial class ResourceSkuZoneDetails : System.ClientModel.Primitives.IJso internal ResourceSkuZoneDetails() { } public System.Collections.Generic.IReadOnlyList Capabilities { get { throw null; } } public System.Collections.Generic.IReadOnlyList Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuZoneDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.ResourceSkuZoneDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -723,6 +759,7 @@ public SecretsManagementSettings(System.Collections.Generic.IEnumerable ObservedCertificates { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.SecretsManagementSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DevOpsInfrastructure.Models.SecretsManagementSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolData.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolData.Serialization.cs index 8fcebc8349970..e7a3eaf366e9a 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolData.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/DevOpsPoolData.Serialization.cs @@ -20,6 +20,15 @@ public partial class DevOpsPoolData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DevOpsPoolData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -39,55 +48,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AutomaticResourcePredictionsProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AutomaticResourcePredictionsProfile.Serialization.cs index 00065e571c2ea..0c0ab9b71d7b5 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AutomaticResourcePredictionsProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/AutomaticResourcePredictionsProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class AutomaticResourcePredictionsProfile : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,30 +34,12 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(AutomaticResourcePredictionsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(PredictionPreference)) { writer.WritePropertyName("predictionPreference"u8); writer.WriteStringValue(PredictionPreference.Value.ToString()); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } AutomaticResourcePredictionsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureOrganizationProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureOrganizationProfile.Serialization.cs index 998f14f7e4d70..028b2221e5554 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureOrganizationProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureOrganizationProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsAzureOrganizationProfile : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(DevOpsAzureOrganizationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("organizations"u8); writer.WriteStartArray(); foreach (var item in Organizations) @@ -38,24 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("permissionProfile"u8); writer.WriteObjectValue(PermissionProfile, options); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsAzureOrganizationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzurePermissionProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzurePermissionProfile.Serialization.cs index 07499a6b34876..aec8b360045cc 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzurePermissionProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzurePermissionProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsAzurePermissionProfile : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(DevOpsAzurePermissionProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (Optional.IsCollectionDefined(Users)) @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } DevOpsAzurePermissionProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureSku.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureSku.Serialization.cs index 1b252ecda8195..e2d99dba5b86b 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureSku.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsAzureSku.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsAzureSku : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DevOpsAzureSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } DevOpsAzureSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsDataDisk.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsDataDisk.Serialization.cs index d19917eb6bf1d..9c4bda04dbce8 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsDataDisk.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsDataDisk.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsDataDisk : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DevOpsDataDisk)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Caching)) { writer.WritePropertyName("caching"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } DevOpsDataDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsFabricProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsFabricProfile.Serialization.cs index 9210aaf661a0f..b739cbdd6ce1b 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsFabricProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsFabricProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsFabricProfile : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(DevOpsFabricProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } DevOpsFabricProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganization.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganization.Serialization.cs index f4211c7661f71..96a04d3ed9038 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganization.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganization.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsGitHubOrganization : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(DevOpsGitHubOrganization)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("url"u8); writer.WriteStringValue(Uri.AbsoluteUri); if (Optional.IsCollectionDefined(Repositories)) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } DevOpsGitHubOrganization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganizationProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganizationProfile.Serialization.cs index dcc96683c0dd6..09652452fc43a 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganizationProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsGitHubOrganizationProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsGitHubOrganizationProfile : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(DevOpsGitHubOrganizationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("organizations"u8); writer.WriteStartArray(); foreach (var item in Organizations) @@ -33,24 +42,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsGitHubOrganizationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsImageVersion.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsImageVersion.Serialization.cs index 9f05796cb7b34..9619cd3aea4d4 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsImageVersion.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsImageVersion.Serialization.cs @@ -19,6 +19,15 @@ public partial class DevOpsImageVersion : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DevOpsImageVersion)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsImageVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsNetworkProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsNetworkProfile.Serialization.cs index 7d57069867235..377e037073551 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsNetworkProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsNetworkProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class DevOpsNetworkProfile : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DevOpsNetworkProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("subnetId"u8); writer.WriteStringValue(SubnetId); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DevOpsNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOSProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOSProfile.Serialization.cs index 7f485e953d66f..608bce5f3d147 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOSProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOSProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsOSProfile : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(DevOpsOSProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SecretsManagementSettings)) { writer.WritePropertyName("secretsManagementSettings"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } DevOpsOSProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs index 6898a14e3970e..c5fe16dff19b4 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganization.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsOrganization : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DevOpsOrganization)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("url"u8); writer.WriteStringValue(Uri.AbsoluteUri); if (Optional.IsCollectionDefined(Projects)) @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } DevOpsOrganization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganizationProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganizationProfile.Serialization.cs index 744bade7b9b78..d0704281aa73c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganizationProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsOrganizationProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsOrganizationProfile : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(DevOpsOrganizationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } DevOpsOrganizationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolAgentProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolAgentProfile.Serialization.cs index 22629940ae40d..648dce4100960 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolAgentProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolAgentProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsPoolAgentProfile : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(DevOpsPoolAgentProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind); if (Optional.IsDefined(ResourcePredictions)) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } DevOpsPoolAgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolPatch.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolPatch.Serialization.cs index c4b90c62290ad..e38bb428bbf43 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolPatch.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolPatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class DevOpsPoolPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(DevOpsPoolPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } DevOpsPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolProperties.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolProperties.Serialization.cs index ceca3c0c668c9..c377d1a2a91ac 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolProperties.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsPoolProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DevOpsPoolProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DevOpsPoolProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs index 243dceeaa2077..899cb9091b97f 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsPoolVmImage.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsPoolVmImage : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(DevOpsPoolVmImage)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceId)) { writer.WritePropertyName("resourceId"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } DevOpsPoolVmImage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetails.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetails.Serialization.cs index 4b2bb7a61e962..14599e133777c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetails.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetails.Serialization.cs @@ -19,6 +19,15 @@ public partial class DevOpsResourceDetails : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(DevOpsResourceDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsResourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetailsProperties.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetailsProperties.Serialization.cs index dd4ffca851b66..e000da3def692 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetailsProperties.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceDetailsProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsResourceDetailsProperties : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(DevOpsResourceDetailsProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); writer.WritePropertyName("image"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } DevOpsResourceDetailsProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuota.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuota.Serialization.cs index a9171f48574c6..06a7449c37277 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuota.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuota.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsResourceQuota : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(DevOpsResourceQuota)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } DevOpsResourceQuota IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuotaName.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuotaName.Serialization.cs index 0148e2bdf29f9..b2fa5081643d8 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuotaName.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceQuotaName.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsResourceQuotaName : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(DevOpsResourceQuotaName)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } DevOpsResourceQuotaName IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSku.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSku.Serialization.cs index 93e0527931453..2c31403eff475 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSku.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSku.Serialization.cs @@ -19,6 +19,15 @@ public partial class DevOpsResourceSku : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(DevOpsResourceSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsResourceSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSkuProperties.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSkuProperties.Serialization.cs index a24f43426193b..c4769042d001d 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSkuProperties.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsResourceSkuProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsResourceSkuProperties : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(DevOpsResourceSkuProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("resourceType"u8); writer.WriteStringValue(ResourceType); writer.WritePropertyName("tier"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } DevOpsResourceSkuProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStateful.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStateful.Serialization.cs index a7761657f6da2..ccda30adaaf09 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStateful.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStateful.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsStateful : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DevOpsStateful)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(MaxAgentLifetime)) { writer.WritePropertyName("maxAgentLifetime"u8); @@ -36,34 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WritePropertyName("gracePeriodTimeSpan"u8); writer.WriteStringValue(GracePeriodTimeSpan); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (Optional.IsDefined(ResourcePredictions)) - { - writer.WritePropertyName("resourcePredictions"u8); - writer.WriteObjectValue(ResourcePredictions, options); - } - if (Optional.IsDefined(ResourcePredictionsProfile)) - { - writer.WritePropertyName("resourcePredictionsProfile"u8); - writer.WriteObjectValue(ResourcePredictionsProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsStateful IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStatelessAgentProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStatelessAgentProfile.Serialization.cs index 87ab6674bd3d4..0dd3862730eae 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStatelessAgentProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStatelessAgentProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsStatelessAgentProfile : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(DevOpsStatelessAgentProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (Optional.IsDefined(ResourcePredictions)) - { - writer.WritePropertyName("resourcePredictions"u8); - writer.WriteObjectValue(ResourcePredictions, options); - } - if (Optional.IsDefined(ResourcePredictionsProfile)) - { - writer.WritePropertyName("resourcePredictionsProfile"u8); - writer.WriteObjectValue(ResourcePredictionsProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DevOpsStatelessAgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStorageProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStorageProfile.Serialization.cs index 054c49753c6d7..89a0b03a40f7a 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStorageProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsStorageProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsStorageProfile : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DevOpsStorageProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(OSDiskStorageAccountType)) { writer.WritePropertyName("osDiskStorageAccountType"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DevOpsStorageProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsVmssFabricProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsVmssFabricProfile.Serialization.cs index cdf037d387f25..1fa07bdeda656 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsVmssFabricProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/DevOpsVmssFabricProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class DevOpsVmssFabricProfile : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(DevOpsVmssFabricProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); writer.WritePropertyName("images"u8); @@ -50,24 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DevOpsVmssFabricProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionListResult.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionListResult.Serialization.cs index 46848a65f1408..071c7dbc662d5 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionListResult.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ImageVersionListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ImageVersionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ImageVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionProperties.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionProperties.Serialization.cs index 5db6dc664b628..07a5f57215dfe 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionProperties.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ImageVersionProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ImageVersionProperties : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ImageVersionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ImageVersionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ManualResourcePredictionsProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ManualResourcePredictionsProfile.Serialization.cs index 26c0d6338c1c8..2cfc2a23f4d1d 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ManualResourcePredictionsProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ManualResourcePredictionsProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManualResourcePredictionsProfile : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ManualResourcePredictionsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ManualResourcePredictionsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PagedQuota.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PagedQuota.Serialization.cs index 44ca51dcf734f..2054ee4bf72dd 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PagedQuota.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PagedQuota.Serialization.cs @@ -18,6 +18,15 @@ internal partial class PagedQuota : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(PagedQuota)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } PagedQuota IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolListResult.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolListResult.Serialization.cs index de2998264bd87..50403fa492dc9 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolListResult.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class PoolListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(PoolListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } PoolListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolUpdateProperties.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolUpdateProperties.Serialization.cs index d883ecb32722b..33977e54ec534 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolUpdateProperties.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/PoolUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class PoolUpdateProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(PoolUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } PoolUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceDetailsObjectListResult.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceDetailsObjectListResult.Serialization.cs index 6679c7aa0f5a1..e163c1ae65f7f 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceDetailsObjectListResult.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceDetailsObjectListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ResourceDetailsObjectListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ResourceDetailsObjectListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } ResourceDetailsObjectListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictions.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictions.Serialization.cs index 8e7ed5d9faf62..966dee375dc24 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictions.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourcePredictions : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ResourcePredictions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ResourcePredictions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictionsProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictionsProfile.Serialization.cs index 94186c99a4a54..06c40df17bbe5 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictionsProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourcePredictionsProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourcePredictionsProfile : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourcePredictionsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourcePredictionsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuCapabilities.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuCapabilities.Serialization.cs index 833dda3bdede2..95fdacf6e4df2 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuCapabilities.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuCapabilities.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceSkuCapabilities : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceSkuCapabilities)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("value"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceSkuCapabilities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuListResult.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuListResult.Serialization.cs index 538c9004dceb1..bb65ba3499205 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuListResult.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ResourceSkuListResult : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ResourceSkuListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } ResourceSkuListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuLocationInfo.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuLocationInfo.Serialization.cs index d0367c6da6821..7fe16ae7e942d 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuLocationInfo.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuLocationInfo.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceSkuLocationInfo : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceSkuLocationInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); writer.WritePropertyName("zones"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceSkuLocationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictionInfo.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictionInfo.Serialization.cs index 9bece7615b285..47884f1a1e741 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictionInfo.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictionInfo.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceSkuRestrictionInfo : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourceSkuRestrictionInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Locations)) { writer.WritePropertyName("locations"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourceSkuRestrictionInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictions.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictions.Serialization.cs index a7aeb1722c278..cca5172f8e109 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictions.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuRestrictions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceSkuRestrictions : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceSkuRestrictions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RestrictionsType)) { writer.WritePropertyName("type"u8); @@ -60,7 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceSkuRestrictions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuZoneDetails.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuZoneDetails.Serialization.cs index 7072eb02e5fcc..30fb5d3b04a91 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuZoneDetails.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/ResourceSkuZoneDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceSkuZoneDetails : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ResourceSkuZoneDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStartArray(); foreach (var item in Name) @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } ResourceSkuZoneDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs index e1581b2fd763f..8586fc37da269 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/SecretsManagementSettings.Serialization.cs @@ -18,6 +18,15 @@ public partial class SecretsManagementSettings : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(SecretsManagementSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CertificateStoreLocation)) { writer.WritePropertyName("certificateStoreLocation"u8); @@ -60,7 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } SecretsManagementSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsFabricProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsFabricProfile.Serialization.cs index 948fd70a39db8..d4f1624f1b97c 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsFabricProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsFabricProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownDevOpsFabricProfile : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(DevOpsFabricProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DevOpsFabricProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsOrganizationProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsOrganizationProfile.Serialization.cs index ac042593eb90f..0d0df67a1e547 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsOrganizationProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsOrganizationProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownDevOpsOrganizationProfile : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(DevOpsOrganizationProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DevOpsOrganizationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsPoolAgentProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsPoolAgentProfile.Serialization.cs index 9e690608365fd..71080d649c8bf 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsPoolAgentProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownDevOpsPoolAgentProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownDevOpsPoolAgentProfile : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(DevOpsPoolAgentProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - if (Optional.IsDefined(ResourcePredictions)) - { - writer.WritePropertyName("resourcePredictions"u8); - writer.WriteObjectValue(ResourcePredictions, options); - } - if (Optional.IsDefined(ResourcePredictionsProfile)) - { - writer.WritePropertyName("resourcePredictionsProfile"u8); - writer.WriteObjectValue(ResourcePredictionsProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DevOpsPoolAgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownResourcePredictionsProfile.Serialization.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownResourcePredictionsProfile.Serialization.cs index ad142d7a43553..bbbbf275ea433 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownResourcePredictionsProfile.Serialization.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/src/Generated/Models/UnknownResourcePredictionsProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownResourcePredictionsProfile : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourcePredictionsProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ResourcePredictionsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/api/Azure.ResourceManager.Fabric.netstandard2.0.cs b/sdk/fabric/Azure.ResourceManager.Fabric/api/Azure.ResourceManager.Fabric.netstandard2.0.cs index bf79428af9d66..dcb36b2354938 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/api/Azure.ResourceManager.Fabric.netstandard2.0.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/api/Azure.ResourceManager.Fabric.netstandard2.0.cs @@ -22,6 +22,7 @@ public partial class FabricCapacityData : Azure.ResourceManager.Models.TrackedRe public FabricCapacityData(Azure.Core.AzureLocation location, Azure.ResourceManager.Fabric.Models.FabricCapacityProperties properties, Azure.ResourceManager.Fabric.Models.FabricSku sku) { } public Azure.ResourceManager.Fabric.Models.FabricCapacityProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.Fabric.Models.FabricSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.FabricCapacityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.FabricCapacityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -112,6 +113,7 @@ public partial class FabricCapacityAdministration : System.ClientModel.Primitive { public FabricCapacityAdministration(System.Collections.Generic.IEnumerable members) { } public System.Collections.Generic.IList Members { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityAdministration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityAdministration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -124,6 +126,7 @@ public FabricCapacityPatch() { } public System.Collections.Generic.IList AdministrationMembers { get { throw null; } } public Azure.ResourceManager.Fabric.Models.FabricSku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -136,6 +139,7 @@ public FabricCapacityProperties(Azure.ResourceManager.Fabric.Models.FabricCapaci public System.Collections.Generic.IList AdministrationMembers { get { throw null; } set { } } public Azure.ResourceManager.Fabric.Models.FabricProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Fabric.Models.FabricResourceState? State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricCapacityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -147,6 +151,7 @@ public partial class FabricNameAvailabilityContent : System.ClientModel.Primitiv public FabricNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public string ResourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -159,6 +164,7 @@ internal FabricNameAvailabilityResult() { } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public Azure.ResourceManager.Fabric.Models.FabricNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -238,6 +244,7 @@ public partial class FabricSku : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -249,6 +256,7 @@ public partial class FabricSkuDetailsForExistingCapacity : System.ClientModel.Pr internal FabricSkuDetailsForExistingCapacity() { } public string ResourceType { get { throw null; } } public Azure.ResourceManager.Fabric.Models.FabricSku Sku { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricSkuDetailsForExistingCapacity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricSkuDetailsForExistingCapacity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -261,6 +269,7 @@ internal FabricSkuDetailsForNewCapacity() { } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } public string Name { get { throw null; } } public string ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricSkuDetailsForNewCapacity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Fabric.Models.FabricSkuDetailsForNewCapacity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/assets.json b/sdk/fabric/Azure.ResourceManager.Fabric/assets.json index c3c46b4a847b6..3cc388845072b 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/assets.json +++ b/sdk/fabric/Azure.ResourceManager.Fabric/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/fabric/Azure.ResourceManager.Fabric", - "Tag": "net/fabric/Azure.ResourceManager.Fabric_534510186b" + "Tag": "net/fabric/Azure.ResourceManager.Fabric_b752e2691a" } diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/FabricCapacityData.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/FabricCapacityData.Serialization.cs index e91f40c852513..19036f77d3de2 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/FabricCapacityData.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/FabricCapacityData.Serialization.cs @@ -20,6 +20,15 @@ public partial class FabricCapacityData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,60 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(FabricCapacityData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } FabricCapacityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityAdministration.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityAdministration.Serialization.cs index 1cb046e48eca7..98592a37013be 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityAdministration.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityAdministration.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricCapacityAdministration : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(FabricCapacityAdministration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("members"u8); writer.WriteStartArray(); foreach (var item in Members) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } FabricCapacityAdministration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityListResult.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityListResult.Serialization.cs index bccd53b92842a..c5a9015a38241 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityListResult.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class FabricCapacityListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(FabricCapacityListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } FabricCapacityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityPatch.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityPatch.Serialization.cs index f0b2dc018e88f..462bc4bf56f1a 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityPatch.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricCapacityPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(FabricCapacityPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } FabricCapacityPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityProperties.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityProperties.Serialization.cs index 39710deaff0ee..69159aea4ecdd 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityProperties.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricCapacityProperties : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(FabricCapacityProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } FabricCapacityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityUpdateProperties.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityUpdateProperties.Serialization.cs index 9a303843fe284..bea6678019619 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityUpdateProperties.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricCapacityUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class FabricCapacityUpdateProperties : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(FabricCapacityUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Administration)) { writer.WritePropertyName("administration"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } FabricCapacityUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityContent.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityContent.Serialization.cs index e721dc3f66038..a6f5b87e0f869 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityContent.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricNameAvailabilityContent : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(FabricNameAvailabilityContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } FabricNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityResult.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityResult.Serialization.cs index aca8cb51ea554..5fdc3a9f6013a 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityResult.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricNameAvailabilityResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricNameAvailabilityResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(FabricNameAvailabilityResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsNameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } FabricNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSku.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSku.Serialization.cs index 926eb2f4a52ab..dbc3919d5ffd9 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSku.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSku.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricSku : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions throw new FormatException($"The model {nameof(FabricSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("tier"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions #endif } } - writer.WriteEndObject(); } FabricSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForExistingCapacity.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForExistingCapacity.Serialization.cs index fd454e930dd39..b6d9abf1d7fed 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForExistingCapacity.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForExistingCapacity.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricSkuDetailsForExistingCapacity : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(FabricSkuDetailsForExistingCapacity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("resourceType"u8); writer.WriteStringValue(ResourceType); writer.WritePropertyName("sku"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } FabricSkuDetailsForExistingCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForNewCapacity.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForNewCapacity.Serialization.cs index d89ffaa655805..4c587c23347af 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForNewCapacity.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/FabricSkuDetailsForNewCapacity.Serialization.cs @@ -18,6 +18,15 @@ public partial class FabricSkuDetailsForNewCapacity : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(FabricSkuDetailsForNewCapacity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("resourceType"u8); writer.WriteStringValue(ResourceType); writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } FabricSkuDetailsForNewCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForExistingResourceResult.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForExistingResourceResult.Serialization.cs index f16c83c65faec..0ed7a81f51600 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForExistingResourceResult.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForExistingResourceResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class RpSkuEnumerationForExistingResourceResult : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(RpSkuEnumerationForExistingResourceResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } RpSkuEnumerationForExistingResourceResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForNewResourceResult.Serialization.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForNewResourceResult.Serialization.cs index 95453a73fdd83..5705868116f5e 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForNewResourceResult.Serialization.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/Models/RpSkuEnumerationForNewResourceResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class RpSkuEnumerationForNewResourceResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RpSkuEnumerationForNewResourceResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RpSkuEnumerationForNewResourceResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/api/Azure.ResourceManager.HealthDataAIServices.netstandard2.0.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/api/Azure.ResourceManager.HealthDataAIServices.netstandard2.0.cs index ef2206f0f5ad1..e466e88116496 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/api/Azure.ResourceManager.HealthDataAIServices.netstandard2.0.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/api/Azure.ResourceManager.HealthDataAIServices.netstandard2.0.cs @@ -22,6 +22,7 @@ public partial class DeidServiceData : Azure.ResourceManager.Models.TrackedResou public DeidServiceData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.HealthDataAIServices.Models.DeidServiceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.DeidServiceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.DeidServiceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -108,6 +109,7 @@ public partial class HealthDataAIServicesPrivateEndpointConnectionResourceData : { public HealthDataAIServicesPrivateEndpointConnectionResourceData() { } public Azure.ResourceManager.HealthDataAIServices.Models.PrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.HealthDataAIServicesPrivateEndpointConnectionResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.HealthDataAIServicesPrivateEndpointConnectionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,6 +157,7 @@ public DeidServicePatch() { } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPublicNetworkAccess? DeidPropertiesUpdatePublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.DeidServicePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.DeidServicePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -168,6 +171,7 @@ public DeidServiceProperties() { } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string ServiceUri { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.DeidServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.DeidServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -178,6 +182,7 @@ public partial class HealthDataAIServicesPrivateEndpointConnection : Azure.Resou { internal HealthDataAIServicesPrivateEndpointConnection() { } public Azure.ResourceManager.HealthDataAIServices.Models.PrivateEndpointConnectionProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateEndpointConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateEndpointConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -227,6 +232,7 @@ public partial class HealthDataAIServicesPrivateLinkResourceData : Azure.Resourc { internal HealthDataAIServicesPrivateLinkResourceData() { } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -239,6 +245,7 @@ internal HealthDataAIServicesPrivateLinkResourceProperties() { } public string GroupId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -251,6 +258,7 @@ public HealthDataAIServicesPrivateLinkServiceConnectionState() { } public string ActionsRequired { get { throw null; } set { } } public string Description { get { throw null; } set { } } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -292,6 +300,7 @@ public PrivateEndpointConnectionProperties(Azure.ResourceManager.HealthDataAISer public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.ResourceManager.HealthDataAIServices.Models.HealthDataAIServicesPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.PrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthDataAIServices.Models.PrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/assets.json b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/assets.json index 62304798e4a69..6e31362b2d356 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/assets.json +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices", - "Tag": "net/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices_6c7dfd610c" + "Tag": "net/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices_8a59071fed" } diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/DeidServiceData.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/DeidServiceData.Serialization.cs index bb49433618c6c..c4b45de1ae0d9 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/DeidServiceData.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/DeidServiceData.Serialization.cs @@ -20,6 +20,15 @@ public partial class DeidServiceData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(DeidServiceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -39,55 +48,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DeidServiceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/HealthDataAIServicesPrivateEndpointConnectionResourceData.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/HealthDataAIServicesPrivateEndpointConnectionResourceData.Serialization.cs index 3d047b5c69ba0..90d1cd3dd2cd7 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/HealthDataAIServicesPrivateEndpointConnectionResourceData.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/HealthDataAIServicesPrivateEndpointConnectionResourceData.Serialization.cs @@ -20,6 +20,15 @@ public partial class HealthDataAIServicesPrivateEndpointConnectionResourceData : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateEndpointConnectionResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } HealthDataAIServicesPrivateEndpointConnectionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidPropertiesUpdate.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidPropertiesUpdate.Serialization.cs index f8f6079419912..5ae709e0e03a5 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidPropertiesUpdate.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidPropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ internal partial class DeidPropertiesUpdate : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DeidPropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PublicNetworkAccess)) { writer.WritePropertyName("publicNetworkAccess"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DeidPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceListResult.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceListResult.Serialization.cs index e0f6f33af2b16..af05a218c0226 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceListResult.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class DeidServiceListResult : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(DeidServiceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } DeidServiceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServicePatch.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServicePatch.Serialization.cs index f21fb909cd7af..f483a647eb8f5 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServicePatch.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServicePatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class DeidServicePatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(DeidServicePatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } DeidServicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceProperties.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceProperties.Serialization.cs index 3d787bc55c045..adfe781498231 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceProperties.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/DeidServiceProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class DeidServiceProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(DeidServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } DeidServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateEndpointConnection.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateEndpointConnection.Serialization.cs index 9941382557841..d8f24e6aa4b3d 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateEndpointConnection.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateEndpointConnection.Serialization.cs @@ -19,6 +19,15 @@ public partial class HealthDataAIServicesPrivateEndpointConnection : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWri throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateEndpointConnection)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } HealthDataAIServicesPrivateEndpointConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceData.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceData.Serialization.cs index 3ddc89fd2aa8a..f2d4cc1ac5237 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceData.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceData.Serialization.cs @@ -19,6 +19,15 @@ public partial class HealthDataAIServicesPrivateLinkResourceData : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateLinkResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } HealthDataAIServicesPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceListResult.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceListResult.Serialization.cs index 9d46162613ebc..771110a84fb46 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceListResult.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class HealthDataAIServicesPrivateLinkResourceListResult : IUtf8 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateLinkResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8Jso #endif } } - writer.WriteEndObject(); } HealthDataAIServicesPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceProperties.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceProperties.Serialization.cs index 23f405425eb58..541063bd06170 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceProperties.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkResourceProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class HealthDataAIServicesPrivateLinkResourceProperties : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateLinkResourceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(GroupId)) { writer.WritePropertyName("groupId"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8Jso #endif } } - writer.WriteEndObject(); } HealthDataAIServicesPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkServiceConnectionState.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkServiceConnectionState.Serialization.cs index 81a00ba010099..ff852da9e2bd0 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkServiceConnectionState.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/HealthDataAIServicesPrivateLinkServiceConnectionState.Serialization.cs @@ -18,6 +18,15 @@ public partial class HealthDataAIServicesPrivateLinkServiceConnectionState : IUt void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf throw new FormatException($"The model {nameof(HealthDataAIServicesPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf #endif } } - writer.WriteEndObject(); } HealthDataAIServicesPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs index 66bd95504a875..01ef5ce237cb6 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class PrivateEndpointConnectionProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(PrivateEndpointConnectionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(GroupIds)) { writer.WritePropertyName("groupIds"u8); @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } PrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs index d6daebc226d1d..5b5568bf73e6c 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class PrivateEndpointConnectionResourceListResult : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(PrivateEndpointConnectionResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } PrivateEndpointConnectionResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/api/Azure.ResourceManager.InformaticaDataManagement.netstandard2.0.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/api/Azure.ResourceManager.InformaticaDataManagement.netstandard2.0.cs index b5e180d103eeb..9ab59e4090e05 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/api/Azure.ResourceManager.InformaticaDataManagement.netstandard2.0.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/api/Azure.ResourceManager.InformaticaDataManagement.netstandard2.0.cs @@ -31,6 +31,7 @@ public partial class InformaticaOrganizationData : Azure.ResourceManager.Models. { public InformaticaOrganizationData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.InformaticaOrganizationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.InformaticaOrganizationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -90,6 +91,7 @@ public partial class InformaticaServerlessRuntimeData : Azure.ResourceManager.Mo { public InformaticaServerlessRuntimeData() { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimeProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.InformaticaServerlessRuntimeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.InformaticaServerlessRuntimeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -151,6 +153,7 @@ public partial class AdvancedCustomProperties : System.ClientModel.Primitives.IJ public AdvancedCustomProperties() { } public string Key { get { throw null; } set { } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.AdvancedCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.AdvancedCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -180,6 +183,7 @@ public CdiConfigProperties(string engineName, string engineVersion, System.Colle public System.Collections.Generic.IList ApplicationConfigs { get { throw null; } } public string EngineName { get { throw null; } set { } } public string EngineVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.CdiConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.CdiConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -192,6 +196,7 @@ internal CheckDependenciesResult() { } public int Count { get { throw null; } } public string Id { get { throw null; } } public System.Collections.Generic.IReadOnlyList References { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.CheckDependenciesResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.CheckDependenciesResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -203,6 +208,7 @@ public partial class ComputeUnitsMetadata : System.ClientModel.Primitives.IJsonM internal ComputeUnitsMetadata() { } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ComputeUnitsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ComputeUnitsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -218,6 +224,7 @@ public InformaticaApplicationConfigs(string applicationConfigsType, string name, public string Name { get { throw null; } set { } } public string Platform { get { throw null; } set { } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaApplicationConfigs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaApplicationConfigs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -247,6 +254,7 @@ public partial class InformaticaApplicationTypeMetadata : System.ClientModel.Pri internal InformaticaApplicationTypeMetadata() { } public string Name { get { throw null; } } public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaApplicationTypeMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaApplicationTypeMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -262,6 +270,7 @@ public InformaticaCompanyDetails() { } public string Domain { get { throw null; } set { } } public int? NumberOfEmployees { get { throw null; } set { } } public string OfficeAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaCompanyDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaCompanyDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -277,6 +286,7 @@ public InformaticaCompanyDetailsUpdate() { } public string Domain { get { throw null; } set { } } public int? NumberOfEmployees { get { throw null; } set { } } public string OfficeAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaCompanyDetailsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaCompanyDetailsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -288,6 +298,7 @@ public partial class InformaticaMarketplaceDetails : System.ClientModel.Primitiv public InformaticaMarketplaceDetails(Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetails offerDetails) { } public string MarketplaceSubscriptionId { get { throw null; } set { } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetails OfferDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -299,6 +310,7 @@ public partial class InformaticaMarketplaceDetailsUpdate : System.ClientModel.Pr public InformaticaMarketplaceDetailsUpdate() { } public string MarketplaceSubscriptionId { get { throw null; } set { } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetailsUpdate OfferDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetailsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetailsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -311,6 +323,7 @@ public InformaticaNetworkInterfaceConfiguration(Azure.Core.ResourceIdentifier vn public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier VnetId { get { throw null; } set { } } public string VnetResourceGuid { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaNetworkInterfaceConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaNetworkInterfaceConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -323,6 +336,7 @@ public InformaticaNetworkInterfaceConfigurationUpdate() { } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier VnetId { get { throw null; } set { } } public string VnetResourceGuid { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaNetworkInterfaceConfigurationUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaNetworkInterfaceConfigurationUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -338,6 +352,7 @@ public InformaticaOfferDetails(string publisherId, string offerId, string planId public string PublisherId { get { throw null; } set { } } public string TermId { get { throw null; } set { } } public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -353,6 +368,7 @@ public InformaticaOfferDetailsUpdate() { } public string PublisherId { get { throw null; } set { } } public string TermId { get { throw null; } set { } } public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetailsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOfferDetailsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -364,6 +380,7 @@ public partial class InformaticaOrganizationPatch : System.ClientModel.Primitive public InformaticaOrganizationPatch() { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPropertiesUpdate Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -379,6 +396,7 @@ public InformaticaOrganizationProperties() { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetails MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetails UserDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -393,6 +411,7 @@ public InformaticaOrganizationPropertiesUpdate() { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPatch InformaticaOrganizationProperties { get { throw null; } set { } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaMarketplaceDetailsUpdate MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetailsUpdate UserDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaOrganizationPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -423,6 +442,7 @@ public InformaticaProperties() { } public string OrganizationId { get { throw null; } set { } } public string OrganizationName { get { throw null; } set { } } public System.Uri SingleSignOnUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -459,6 +479,7 @@ public partial class InformaticaRegionsMetadata : System.ClientModel.Primitives. internal InformaticaRegionsMetadata() { } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaRegionsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaRegionsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -480,6 +501,7 @@ internal InformaticaRuntimeResourceFetchMetadata() { } public string StatusMessage { get { throw null; } } public string UpdatedBy { get { throw null; } } public string UpdatedTime { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaRuntimeResourceFetchMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaRuntimeResourceFetchMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -520,6 +542,7 @@ internal InformaticaServerlessFetchConfigProperties() { } public string Tags { get { throw null; } } public System.Guid? TenantId { get { throw null; } } public string Vnet { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessFetchConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessFetchConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -530,6 +553,7 @@ public partial class InformaticaServerlessRuntimePatch : System.ClientModel.Prim { public InformaticaServerlessRuntimePatch() { } public Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimePropertiesUpdate Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -552,6 +576,7 @@ public InformaticaServerlessRuntimeProperties(string serverlessAccountLocation) public System.Collections.Generic.IList ServerlessRuntimeTags { get { throw null; } } public string SupplementaryFileLocation { get { throw null; } set { } } public string UserContextToken { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -562,6 +587,7 @@ public partial class InformaticaServerlessRuntimeResourceList : System.ClientMod { internal InformaticaServerlessRuntimeResourceList() { } public System.Collections.Generic.IReadOnlyList InformaticaRuntimeResources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimeResourceList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaServerlessRuntimeResourceList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -576,6 +602,7 @@ public InformaticaUserDetails() { } public string LastName { get { throw null; } set { } } public string PhoneNumber { get { throw null; } set { } } public string Upn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -590,6 +617,7 @@ public InformaticaUserDetailsUpdate() { } public string LastName { get { throw null; } set { } } public string PhoneNumber { get { throw null; } set { } } public string Upn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetailsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaUserDetailsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -604,6 +632,7 @@ internal ServerlessConfigProperties() { } public string ExecutionTimeout { get { throw null; } } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaPlatformType? Platform { get { throw null; } } public System.Collections.Generic.IReadOnlyList Regions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -616,6 +645,7 @@ internal ServerlessMetadataResponse() { } public Azure.ResourceManager.InformaticaDataManagement.Models.InformaticaRuntimeType? RuntimeType { get { throw null; } } public Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessConfigProperties ServerlessConfigProperties { get { throw null; } } public Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeConfigProperties ServerlessRuntimeConfigProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessMetadataResponse System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessMetadataResponse System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -627,6 +657,7 @@ public partial class ServerlessRuntimeConfigProperties : System.ClientModel.Prim public ServerlessRuntimeConfigProperties() { } public System.Collections.Generic.IList CdiConfigProps { get { throw null; } } public System.Collections.Generic.IList CdieConfigProps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -638,6 +669,7 @@ public partial class ServerlessRuntimeConfigPropertiesUpdate : System.ClientMode public ServerlessRuntimeConfigPropertiesUpdate() { } public System.Collections.Generic.IList CdiConfigProps { get { throw null; } } public System.Collections.Generic.IList CdieConfigProps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeConfigPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeConfigPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -653,6 +685,7 @@ internal ServerlessRuntimeDependency() { } public string Id { get { throw null; } } public string LastUpdatedTime { get { throw null; } } public string Path { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeDependency System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeDependency System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -674,6 +707,7 @@ public ServerlessRuntimePropertiesUpdate() { } public System.Collections.Generic.IList ServerlessRuntimeTags { get { throw null; } } public string SupplementaryFileLocation { get { throw null; } set { } } public string UserContextToken { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimePropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimePropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -685,6 +719,7 @@ public partial class ServerlessRuntimeTag : System.ClientModel.Primitives.IJsonM public ServerlessRuntimeTag() { } public string Name { get { throw null; } set { } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.InformaticaDataManagement.Models.ServerlessRuntimeTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaOrganizationData.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaOrganizationData.Serialization.cs index ffac8f6674f42..850877814eb91 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaOrganizationData.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaOrganizationData.Serialization.cs @@ -20,6 +20,15 @@ public partial class InformaticaOrganizationData : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,61 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(InformaticaOrganizationData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } InformaticaOrganizationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaServerlessRuntimeData.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaServerlessRuntimeData.Serialization.cs index 3517cce46dd7c..a3e7c66a9806a 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaServerlessRuntimeData.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/InformaticaServerlessRuntimeData.Serialization.cs @@ -20,6 +20,15 @@ public partial class InformaticaServerlessRuntimeData : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(InformaticaServerlessRuntimeData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } InformaticaServerlessRuntimeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/AdvancedCustomProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/AdvancedCustomProperties.Serialization.cs index 3a5174e7ca268..afe408887856b 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/AdvancedCustomProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/AdvancedCustomProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class AdvancedCustomProperties : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(AdvancedCustomProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Key)) { writer.WritePropertyName("key"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } AdvancedCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CdiConfigProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CdiConfigProperties.Serialization.cs index 487d6da707d24..c13440b6b6ab8 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CdiConfigProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CdiConfigProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class CdiConfigProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CdiConfigProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("engineName"u8); writer.WriteStringValue(EngineName); writer.WritePropertyName("engineVersion"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } CdiConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CheckDependenciesResult.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CheckDependenciesResult.Serialization.cs index b871088b578ba..3b70acf4f3be8 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CheckDependenciesResult.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/CheckDependenciesResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class CheckDependenciesResult : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CheckDependenciesResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("count"u8); writer.WriteNumberValue(Count); writer.WritePropertyName("id"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CheckDependenciesResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ComputeUnitsMetadata.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ComputeUnitsMetadata.Serialization.cs index 37f9119a54dfe..9dbbfd7abf8f5 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ComputeUnitsMetadata.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ComputeUnitsMetadata.Serialization.cs @@ -18,6 +18,15 @@ public partial class ComputeUnitsMetadata : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ComputeUnitsMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ComputeUnitsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationConfigs.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationConfigs.Serialization.cs index e18e137197233..8df04fafa7206 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationConfigs.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationConfigs.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaApplicationConfigs : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(InformaticaApplicationConfigs)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("type"u8); writer.WriteStringValue(ApplicationConfigsType); writer.WritePropertyName("name"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } InformaticaApplicationConfigs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationTypeMetadata.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationTypeMetadata.Serialization.cs index b5e47bc707fdd..1fa4d7e83c7fd 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationTypeMetadata.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaApplicationTypeMetadata.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaApplicationTypeMetadata : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(InformaticaApplicationTypeMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } InformaticaApplicationTypeMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetails.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetails.Serialization.cs index 742020b31c6c6..eee4184521e4c 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetails.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaCompanyDetails : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(InformaticaCompanyDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CompanyName)) { writer.WritePropertyName("companyName"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } InformaticaCompanyDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetailsUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetailsUpdate.Serialization.cs index 50ad29e29764a..bfc8c3645a4a7 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetailsUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaCompanyDetailsUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaCompanyDetailsUpdate : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(InformaticaCompanyDetailsUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CompanyName)) { writer.WritePropertyName("companyName"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } InformaticaCompanyDetailsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetails.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetails.Serialization.cs index 809fa88934fc3..aa8a130af3fa1 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetails.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaMarketplaceDetails : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(InformaticaMarketplaceDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(MarketplaceSubscriptionId)) { writer.WritePropertyName("marketplaceSubscriptionId"u8); @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } InformaticaMarketplaceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetailsUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetailsUpdate.Serialization.cs index bb068658e0847..9b4129e65c1a6 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetailsUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaMarketplaceDetailsUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaMarketplaceDetailsUpdate : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(InformaticaMarketplaceDetailsUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(MarketplaceSubscriptionId)) { writer.WritePropertyName("marketplaceSubscriptionId"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } InformaticaMarketplaceDetailsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfiguration.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfiguration.Serialization.cs index 04a24131e1361..21d10b1907170 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfiguration.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfiguration.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaNetworkInterfaceConfiguration : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(InformaticaNetworkInterfaceConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("vnetId"u8); writer.WriteStringValue(VnetId); writer.WritePropertyName("subnetId"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } InformaticaNetworkInterfaceConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfigurationUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfigurationUpdate.Serialization.cs index 47fa28079a4d5..db8e2864c1b78 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfigurationUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaNetworkInterfaceConfigurationUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaNetworkInterfaceConfigurationUpdate : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(InformaticaNetworkInterfaceConfigurationUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(VnetId)) { writer.WritePropertyName("vnetId"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } InformaticaNetworkInterfaceConfigurationUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetails.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetails.Serialization.cs index f82f6a455fd63..0c29b43c4eaa4 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetails.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaOfferDetails : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(InformaticaOfferDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("publisherId"u8); writer.WriteStringValue(PublisherId); writer.WritePropertyName("offerId"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } InformaticaOfferDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetailsUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetailsUpdate.Serialization.cs index f7eb03d2c16f5..ca741d3fafd13 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetailsUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOfferDetailsUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaOfferDetailsUpdate : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(InformaticaOfferDetailsUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PublisherId)) { writer.WritePropertyName("publisherId"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } InformaticaOfferDetailsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPatch.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPatch.Serialization.cs index 271a5c3aed7b7..a7215f7c434db 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPatch.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaOrganizationPatch : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(InformaticaOrganizationPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } InformaticaOrganizationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationProperties.Serialization.cs index e74222c9a359e..5f87b7bc34fae 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaOrganizationProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(InformaticaOrganizationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } InformaticaOrganizationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPropertiesUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPropertiesUpdate.Serialization.cs index 83dfec5f65e43..28fd1249314a2 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPropertiesUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationPropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaOrganizationPropertiesUpdate : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(InformaticaOrganizationPropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(InformaticaOrganizationProperties)) { writer.WritePropertyName("informaticaOrganizationProperties"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } InformaticaOrganizationPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationResourceListResult.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationResourceListResult.Serialization.cs index 66536dc11df01..633fd4f7379df 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationResourceListResult.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaOrganizationResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class InformaticaOrganizationResourceListResult : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(InformaticaOrganizationResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } InformaticaOrganizationResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaProperties.Serialization.cs index 20afd74da4ff8..93fb6b44b24ce 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(InformaticaProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(OrganizationId)) { writer.WritePropertyName("organizationId"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } InformaticaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRegionsMetadata.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRegionsMetadata.Serialization.cs index e37ab8b8f3d50..4d1f4943e810d 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRegionsMetadata.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRegionsMetadata.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaRegionsMetadata : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(InformaticaRegionsMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } InformaticaRegionsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRuntimeResourceFetchMetadata.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRuntimeResourceFetchMetadata.Serialization.cs index a109fff59f2da..530cbe44ecb22 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRuntimeResourceFetchMetadata.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaRuntimeResourceFetchMetadata.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaRuntimeResourceFetchMetadata : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(InformaticaRuntimeResourceFetchMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("createdTime"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } InformaticaRuntimeResourceFetchMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessFetchConfigProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessFetchConfigProperties.Serialization.cs index d73d1b57a226a..fc6b72f9666b3 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessFetchConfigProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessFetchConfigProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaServerlessFetchConfigProperties : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(InformaticaServerlessFetchConfigProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Subnet)) { writer.WritePropertyName("subnet"u8); @@ -111,7 +119,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } InformaticaServerlessFetchConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimePatch.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimePatch.Serialization.cs index 871b2596fec2a..0a8436086549f 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimePatch.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimePatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaServerlessRuntimePatch : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(InformaticaServerlessRuntimePatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } InformaticaServerlessRuntimePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeProperties.Serialization.cs index fc563e168ec24..ec37fabe638d0 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaServerlessRuntimeProperties : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(InformaticaServerlessRuntimeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -113,7 +121,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } InformaticaServerlessRuntimeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceList.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceList.Serialization.cs index e6dc80e29191d..cf688af5ae723 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceList.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceList.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaServerlessRuntimeResourceList : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(InformaticaServerlessRuntimeResourceList)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("informaticaRuntimeResources"u8); writer.WriteStartArray(); foreach (var item in InformaticaRuntimeResources) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } InformaticaServerlessRuntimeResourceList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceListResult.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceListResult.Serialization.cs index d18b347016de5..18be5be2229a7 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceListResult.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaServerlessRuntimeResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class InformaticaServerlessRuntimeResourceListResult : IUtf8Jso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(InformaticaServerlessRuntimeResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } InformaticaServerlessRuntimeResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetails.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetails.Serialization.cs index 38546066ebb8c..a59e931449564 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetails.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaUserDetails : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(InformaticaUserDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(FirstName)) { writer.WritePropertyName("firstName"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } InformaticaUserDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetailsUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetailsUpdate.Serialization.cs index 0d42a0a79d75a..6ab231f789230 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetailsUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/InformaticaUserDetailsUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class InformaticaUserDetailsUpdate : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(InformaticaUserDetailsUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(FirstName)) { writer.WritePropertyName("firstName"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } InformaticaUserDetailsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/LinkOrganization.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/LinkOrganization.Serialization.cs index 800d2a79560ee..6cdbded66b972 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/LinkOrganization.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/LinkOrganization.Serialization.cs @@ -18,6 +18,15 @@ internal partial class LinkOrganization : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(LinkOrganization)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Token)) { writer.WritePropertyName("token"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } LinkOrganization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessConfigProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessConfigProperties.Serialization.cs index 18c7a110f6a6f..967db84bc6b27 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessConfigProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessConfigProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessConfigProperties : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ServerlessConfigProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Platform)) { writer.WritePropertyName("platform"u8); @@ -81,7 +89,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ServerlessConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessMetadataResponse.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessMetadataResponse.Serialization.cs index 6b4b217f80f86..f75368cdf7593 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessMetadataResponse.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessMetadataResponse.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessMetadataResponse : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ServerlessMetadataResponse)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RuntimeType)) { writer.WritePropertyName("type"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ServerlessMetadataResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigProperties.Serialization.cs index 4f5eafb4801ef..cad661a48c934 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessRuntimeConfigProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ServerlessRuntimeConfigProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(CdiConfigProps)) { writer.WritePropertyName("cdiConfigProps"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ServerlessRuntimeConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigPropertiesUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigPropertiesUpdate.Serialization.cs index 9fb3a4132cefb..d2c8f7f713f1a 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigPropertiesUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeConfigPropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessRuntimeConfigPropertiesUpdate : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(ServerlessRuntimeConfigPropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(CdiConfigProps)) { writer.WritePropertyName("cdiConfigProps"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } ServerlessRuntimeConfigPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeDependency.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeDependency.Serialization.cs index baea546a45ed6..1f937e7a59cc7 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeDependency.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeDependency.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessRuntimeDependency : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ServerlessRuntimeDependency)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("appContextId"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ServerlessRuntimeDependency IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfile.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfile.Serialization.cs index d61cf86d4a234..710a884b48212 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfile.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfile.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ServerlessRuntimeNetworkProfile : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ServerlessRuntimeNetworkProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("networkInterfaceConfiguration"u8); writer.WriteObjectValue(NetworkInterfaceConfiguration, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } ServerlessRuntimeNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfileUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfileUpdate.Serialization.cs index d581226d1dec0..3afea9ca14139 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfileUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeNetworkProfileUpdate.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ServerlessRuntimeNetworkProfileUpdate : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ServerlessRuntimeNetworkProfileUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("networkInterfaceConfiguration"u8); writer.WriteObjectValue(NetworkInterfaceConfiguration, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writ #endif } } - writer.WriteEndObject(); } ServerlessRuntimeNetworkProfileUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimePropertiesUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimePropertiesUpdate.Serialization.cs index 5bcde39f312a1..dc6c5e042cbd8 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimePropertiesUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimePropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessRuntimePropertiesUpdate : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ServerlessRuntimePropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); @@ -111,7 +119,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ServerlessRuntimePropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeTag.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeTag.Serialization.cs index f45cbda6b5aa8..25aff8297bae0 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeTag.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeTag.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServerlessRuntimeTag : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ServerlessRuntimeTag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ServerlessRuntimeTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextProperties.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextProperties.Serialization.cs index 36c574e5cb3b9..3fe21689f8960 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextProperties.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ServerlessRuntimeUserContextProperties : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ServerlessRuntimeUserContextProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("userContextToken"u8); writer.WriteStringValue(UserContextToken); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } ServerlessRuntimeUserContextProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextPropertiesUpdate.Serialization.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextPropertiesUpdate.Serialization.cs index d0f6c504fd8c5..68c69d19c4a20 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextPropertiesUpdate.Serialization.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/src/Generated/Models/ServerlessRuntimeUserContextPropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ServerlessRuntimeUserContextPropertiesUpdate : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrit throw new FormatException($"The model {nameof(ServerlessRuntimeUserContextPropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(UserContextToken)) { writer.WritePropertyName("userContextToken"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWrit #endif } } - writer.WriteEndObject(); } ServerlessRuntimeUserContextPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs index c535885022a7b..cfc9682f016b3 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs @@ -48,7 +48,7 @@ public BasinId(string value) public static bool operator ==(BasinId left, BasinId right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(BasinId left, BasinId right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator BasinId(string value) => new BasinId(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyDuration.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyDuration.cs index 221df219ab481..1131198fdb854 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyDuration.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyDuration.cs @@ -51,7 +51,7 @@ public DailyDuration(int value) public static bool operator ==(DailyDuration left, DailyDuration right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(DailyDuration left, DailyDuration right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator DailyDuration(int value) => new DailyDuration(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayQuarter.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayQuarter.cs index 1317a2aa34b02..0fa3073e427d3 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayQuarter.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayQuarter.cs @@ -42,7 +42,7 @@ public DayQuarter(int value) public static bool operator ==(DayQuarter left, DayQuarter right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(DayQuarter left, DayQuarter right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator DayQuarter(int value) => new DayQuarter(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs index 582d708ac6659..a13146b92484a 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs @@ -45,7 +45,7 @@ public DominantPollutant(string value) public static bool operator ==(DominantPollutant left, DominantPollutant right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(DominantPollutant left, DominantPollutant right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator DominantPollutant(string value) => new DominantPollutant(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardIndex.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardIndex.cs index 4541ee747d867..ed95282d63743 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardIndex.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardIndex.cs @@ -52,7 +52,7 @@ public HazardIndex(int value) public static bool operator ==(HazardIndex left, HazardIndex right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(HazardIndex left, HazardIndex right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator HazardIndex(int value) => new HazardIndex(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyDuration.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyDuration.cs index 76a4008c64ed8..cc9fbcf19c72c 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyDuration.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyDuration.cs @@ -48,7 +48,7 @@ public HourlyDuration(int value) public static bool operator ==(HourlyDuration left, HourlyDuration right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(HourlyDuration left, HourlyDuration right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator HourlyDuration(int value) => new HourlyDuration(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IconCode.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IconCode.cs index 1ec85b7399a79..3068ce5588b75 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IconCode.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IconCode.cs @@ -150,7 +150,7 @@ public IconCode(int value) public static bool operator ==(IconCode left, IconCode right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(IconCode left, IconCode right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator IconCode(int value) => new IconCode(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/JsonFormat.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/JsonFormat.cs index c1cd6e71854b1..44ff3fa0b3d72 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/JsonFormat.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/JsonFormat.cs @@ -30,7 +30,7 @@ public JsonFormat(string value) public static bool operator ==(JsonFormat left, JsonFormat right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(JsonFormat left, JsonFormat right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator JsonFormat(string value) => new JsonFormat(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs index c0068a22fe97d..c41e5bee53a64 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs @@ -51,7 +51,7 @@ public LatestStatusKeyword(string value) public static bool operator ==(LatestStatusKeyword left, LatestStatusKeyword right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(LatestStatusKeyword left, LatestStatusKeyword right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator LatestStatusKeyword(string value) => new LatestStatusKeyword(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs index 2d7efc532f32e..8370e8fcd2c15 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs @@ -45,7 +45,7 @@ public PollutantType(string value) public static bool operator ==(PollutantType left, PollutantType right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(PollutantType left, PollutantType right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator PollutantType(string value) => new PollutantType(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs index 7fab0f4723632..26e4a2837e44d 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs @@ -39,7 +39,7 @@ public PrecipitationType(string value) public static bool operator ==(PrecipitationType left, PrecipitationType right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(PrecipitationType left, PrecipitationType right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator PrecipitationType(string value) => new PrecipitationType(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/UnitType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/UnitType.cs index 3857c65b85289..86c4394a8c896 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/UnitType.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/UnitType.cs @@ -102,7 +102,7 @@ public UnitType(int value) public static bool operator ==(UnitType left, UnitType right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(UnitType left, UnitType right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator UnitType(int value) => new UnitType(value); /// diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs index 59d164b16031b..0ca37af345cc6 100644 --- a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs @@ -33,7 +33,7 @@ public WeatherDataUnit(string value) public static bool operator ==(WeatherDataUnit left, WeatherDataUnit right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(WeatherDataUnit left, WeatherDataUnit right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator WeatherDataUnit(string value) => new WeatherDataUnit(value); /// diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs index 7655abf73796d..be41ef5b289c9 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs @@ -21,6 +21,7 @@ public partial class MongoClusterData : Azure.ResourceManager.Models.TrackedReso { public MongoClusterData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -61,6 +62,7 @@ public partial class MongoClusterFirewallRuleData : Azure.ResourceManager.Models { public MongoClusterFirewallRuleData() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -126,6 +128,7 @@ public partial class MongoClusterPrivateEndpointConnectionResourceData : Azure.R { public MongoClusterPrivateEndpointConnectionResourceData() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -241,6 +244,7 @@ public partial class MongoClusterAdministratorProperties : System.ClientModel.Pr public MongoClusterAdministratorProperties() { } public string Password { get { throw null; } set { } } public string UserName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -253,6 +257,7 @@ internal MongoClusterConnectionString() { } public string Description { get { throw null; } } public string Name { get { throw null; } } public string Uri { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionString System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionString System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -263,6 +268,7 @@ public partial class MongoClusterConnectionStringsResult : System.ClientModel.Pr { internal MongoClusterConnectionStringsResult() { } public System.Collections.Generic.IReadOnlyList ConnectionStrings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionStringsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionStringsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -295,6 +301,7 @@ public MongoClusterFirewallRuleProperties(string startIPAddress, string endIPAdd public string EndIPAddress { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? ProvisioningState { get { throw null; } } public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -306,6 +313,7 @@ public partial class MongoClusterNameAvailabilityContent : System.ClientModel.Pr public MongoClusterNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public string ResourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -318,6 +326,7 @@ internal MongoClusterNameAvailabilityResult() { } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -347,6 +356,7 @@ public partial class MongoClusterPatch : System.ClientModel.Primitives.IJsonMode public MongoClusterPatch() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -374,6 +384,7 @@ public partial class MongoClusterPrivateEndpointConnection : Azure.ResourceManag { internal MongoClusterPrivateEndpointConnection() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -387,6 +398,7 @@ public MongoClusterPrivateEndpointConnectionProperties(Azure.ResourceManager.Mon public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -436,6 +448,7 @@ public partial class MongoClusterPrivateLinkResourceData : Azure.ResourceManager { internal MongoClusterPrivateLinkResourceData() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -448,6 +461,7 @@ internal MongoClusterPrivateLinkResourceProperties() { } public string GroupId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -460,6 +474,7 @@ public MongoClusterPrivateLinkServiceConnectionState() { } public string ActionsRequired { get { throw null; } set { } } public string Description { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -521,6 +536,7 @@ public MongoClusterProperties() { } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } public long? StorageSizeGb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -571,6 +587,7 @@ public partial class MongoClusterReplica : Azure.ResourceManager.Models.Resource { internal MongoClusterReplica() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -582,6 +599,7 @@ public partial class MongoClusterReplicaContent : System.ClientModel.Primitives. public MongoClusterReplicaContent(Azure.Core.ResourceIdentifier sourceResourceId, Azure.Core.AzureLocation sourceLocation) { } public Azure.Core.AzureLocation SourceLocation { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -594,6 +612,7 @@ internal MongoClusterReplicationProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState? ReplicationState { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole? Role { get { throw null; } } public Azure.Core.ResourceIdentifier SourceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -646,6 +665,7 @@ public partial class MongoClusterRestoreContent : System.ClientModel.Primitives. public MongoClusterRestoreContent() { } public System.DateTimeOffset? PointInTimeUTC { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -687,6 +707,7 @@ public MongoClusterUpdateProperties() { } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } public long? StorageSizeGb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -698,6 +719,7 @@ public partial class PromoteReplicaContent : System.ClientModel.Primitives.IJson public PromoteReplicaContent(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption promoteOption) { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode? Mode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption PromoteOption { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/BackupProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/BackupProperties.Serialization.cs index 5cad177f5f6ef..a524a64fc3587 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/BackupProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/BackupProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class BackupProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(BackupProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(EarliestRestoreTime)) { writer.WritePropertyName("earliestRestoreTime"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } BackupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ComputeProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ComputeProperties.Serialization.cs index 6a8ee6187473e..b6d5ca86c9fdc 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ComputeProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ComputeProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ComputeProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ComputeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Tier)) { writer.WritePropertyName("tier"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ComputeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/FirewallRuleListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/FirewallRuleListResult.Serialization.cs index 39ed51d71adb0..41f8da91d178e 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/FirewallRuleListResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/FirewallRuleListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class FirewallRuleListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } FirewallRuleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/HighAvailabilityProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/HighAvailabilityProperties.Serialization.cs index 823c21c9d4426..e85d32d4ce189 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/HighAvailabilityProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/HighAvailabilityProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class HighAvailabilityProperties : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(HighAvailabilityProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(TargetMode)) { writer.WritePropertyName("targetMode"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } HighAvailabilityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterAdministratorProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterAdministratorProperties.Serialization.cs index 015b3f293a5c9..892256fb8aa7f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterAdministratorProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterAdministratorProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterAdministratorProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(MongoClusterAdministratorProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(UserName)) { writer.WritePropertyName("userName"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } MongoClusterAdministratorProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionString.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionString.Serialization.cs index f9bbe3bb0fc0b..e907a5057d530 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionString.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionString.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterConnectionString : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(MongoClusterConnectionString)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Uri)) { writer.WritePropertyName("connectionString"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } MongoClusterConnectionString IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionStringsResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionStringsResult.Serialization.cs index eaa4f71882673..6f5054627eab2 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionStringsResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterConnectionStringsResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterConnectionStringsResult : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(MongoClusterConnectionStringsResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(ConnectionStrings)) { writer.WritePropertyName("connectionStrings"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } MongoClusterConnectionStringsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterFirewallRuleProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterFirewallRuleProperties.Serialization.cs index 4b4a9eac1af10..b0088571fd02f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterFirewallRuleProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterFirewallRuleProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterFirewallRuleProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(MongoClusterFirewallRuleProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } MongoClusterFirewallRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterListResult.Serialization.cs index cf3ea8e0c7777..bb902ce5d921f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterListResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class MongoClusterListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(MongoClusterListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } MongoClusterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityContent.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityContent.Serialization.cs index 2644176b0fee9..1ffecee7c7dee 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityContent.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterNameAvailabilityContent : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(MongoClusterNameAvailabilityContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } MongoClusterNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityResult.Serialization.cs index ed9cad52f9b37..22a108d595e17 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterNameAvailabilityResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterNameAvailabilityResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(MongoClusterNameAvailabilityResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsNameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } MongoClusterNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs index 927be2be32cd5..893f438810b10 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(MongoClusterPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } MongoClusterPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnection.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnection.Serialization.cs index f7ab05b014890..28f6c2492bf2b 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnection.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnection.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoClusterPrivateEndpointConnection : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(MongoClusterPrivateEndpointConnection)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterPrivateEndpointConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnectionProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnectionProperties.Serialization.cs index 4b32315b2ded1..3a53f30998483 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnectionProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateEndpointConnectionProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoClusterPrivateEndpointConnectionProperties : IUtf8Json void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(MongoClusterPrivateEndpointConnectionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(GroupIds)) { writer.WritePropertyName("groupIds"u8); @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonW #endif } } - writer.WriteEndObject(); } MongoClusterPrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceData.Serialization.cs index 671cf30064e30..5df82f3e581b5 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceData.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceData.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoClusterPrivateLinkResourceData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(MongoClusterPrivateLinkResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceListResult.Serialization.cs index debe43ec3523c..90b386faf4410 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceListResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class MongoClusterPrivateLinkResourceListResult : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(MongoClusterPrivateLinkResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } MongoClusterPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceProperties.Serialization.cs index 6670ff76a7f4f..8da9ee9348906 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkResourceProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterPrivateLinkResourceProperties : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(MongoClusterPrivateLinkResourceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(GroupId)) { writer.WritePropertyName("groupId"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } MongoClusterPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkServiceConnectionState.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkServiceConnectionState.Serialization.cs index 7b4b3ac16911e..b6d527be7cedf 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkServiceConnectionState.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPrivateLinkServiceConnectionState.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterPrivateLinkServiceConnectionState : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWri throw new FormatException($"The model {nameof(MongoClusterPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWri #endif } } - writer.WriteEndObject(); } MongoClusterPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs index 6880346345dff..c1ab76b6b8b58 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterProperties : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(MongoClusterProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CreateMode)) { writer.WritePropertyName("createMode"u8); @@ -141,7 +149,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } MongoClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplica.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplica.Serialization.cs index 23db72c11d7db..4802a8c95cf62 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplica.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplica.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoClusterReplica : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,48 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(MongoClusterReplica)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterReplica IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicaContent.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicaContent.Serialization.cs index a95cb15d3fd01..004bd6d0cad76 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicaContent.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicaContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterReplicaContent : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(MongoClusterReplicaContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("sourceResourceId"u8); writer.WriteStringValue(SourceResourceId); writer.WritePropertyName("sourceLocation"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } MongoClusterReplicaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicationProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicationProperties.Serialization.cs index d749aa1d8d5fa..9b4ad2e231404 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicationProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterReplicationProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterReplicationProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(MongoClusterReplicationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(SourceResourceId)) { writer.WritePropertyName("sourceResourceId"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } MongoClusterReplicationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterRestoreContent.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterRestoreContent.Serialization.cs index 3d028e2438424..f9c859d43afc3 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterRestoreContent.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterRestoreContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterRestoreContent : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(MongoClusterRestoreContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PointInTimeUTC)) { writer.WritePropertyName("pointInTimeUTC"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } MongoClusterRestoreContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs index 9cccac5479170..f2db8c5c6527f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoClusterUpdateProperties : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(MongoClusterUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Administrator)) { writer.WritePropertyName("administrator"u8); @@ -91,7 +99,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } MongoClusterUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs index 6d396a4e0299d..9224ece6a0e36 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PrivateEndpointConnectionResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class PrivateEndpointConnectionResourceListResult : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(PrivateEndpointConnectionResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } PrivateEndpointConnectionResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PromoteReplicaContent.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PromoteReplicaContent.Serialization.cs index c827c747bdc5e..f98aa500b1d2d 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PromoteReplicaContent.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/PromoteReplicaContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class PromoteReplicaContent : IUtf8JsonSerializable, IJsonModel

((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PromoteReplicaContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("promoteOption"u8); writer.WriteStringValue(PromoteOption.ToString()); if (Optional.IsDefined(Mode)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PromoteReplicaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ReplicaListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ReplicaListResult.Serialization.cs index 810e3a5d67713..b0a923a304bae 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ReplicaListResult.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ReplicaListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ReplicaListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ReplicaListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ReplicaListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ShardingProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ShardingProperties.Serialization.cs index 54a278209f613..535eb8aacad34 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ShardingProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/ShardingProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ShardingProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ShardingProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ShardCount)) { writer.WritePropertyName("shardCount"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ShardingProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs index 78062fb8776a4..6c8dd218b8072 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StorageProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(StorageProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SizeGb)) { writer.WritePropertyName("sizeGb"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } StorageProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs index 63eba6944bf5b..958689ba2f7e4 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs @@ -20,6 +20,15 @@ public partial class MongoClusterData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,61 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(MongoClusterData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleData.Serialization.cs index d773ef25a78e7..9f69912197b10 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleData.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleData.Serialization.cs @@ -20,6 +20,15 @@ public partial class MongoClusterFirewallRuleData : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(MongoClusterFirewallRuleData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterFirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceData.Serialization.cs index 61cb27935df8a..70ad73fc83b92 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceData.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceData.Serialization.cs @@ -20,6 +20,15 @@ public partial class MongoClusterPrivateEndpointConnectionResourceData : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(MongoClusterPrivateEndpointConnectionResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoClusterPrivateEndpointConnectionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs index 2b38e446f4fbf..7f1f78f6cafa7 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs @@ -21,6 +21,7 @@ public partial class StandbyContainerGroupPoolData : Azure.ResourceManager.Model { public StandbyContainerGroupPoolData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -74,6 +75,7 @@ public partial class StandbyContainerGroupPoolRuntimeViewData : Azure.ResourceMa { internal StandbyContainerGroupPoolRuntimeViewData() { } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolRuntimeViewData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolRuntimeViewData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -132,6 +134,7 @@ public partial class StandbyVirtualMachineData : Azure.ResourceManager.Models.Re { internal StandbyVirtualMachineData() { } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -159,6 +162,7 @@ public partial class StandbyVirtualMachinePoolData : Azure.ResourceManager.Model { public StandbyVirtualMachinePoolData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -215,6 +219,7 @@ public partial class StandbyVirtualMachinePoolRuntimeViewData : Azure.ResourceMa { internal StandbyVirtualMachinePoolRuntimeViewData() { } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolRuntimeViewData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolRuntimeViewData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -304,6 +309,7 @@ public partial class ContainerGroupInstanceCountSummary : System.ClientModel.Pri { internal ContainerGroupInstanceCountSummary() { } public System.Collections.Generic.IReadOnlyList InstanceCountsByState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.ContainerGroupInstanceCountSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.ContainerGroupInstanceCountSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -315,6 +321,7 @@ public partial class PoolResourceStateCount : System.ClientModel.Primitives.IJso internal PoolResourceStateCount() { } public long Count { get { throw null; } } public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.PoolResourceStateCount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.PoolResourceStateCount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -326,6 +333,7 @@ public partial class StandbyContainerGroupPoolElasticityProfile : System.ClientM public StandbyContainerGroupPoolElasticityProfile(long maxReadyCapacity) { } public long MaxReadyCapacity { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyRefillPolicy? RefillPolicy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -337,6 +345,7 @@ public partial class StandbyContainerGroupPoolPatch : System.ClientModel.Primiti public StandbyContainerGroupPoolPatch() { } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -349,6 +358,7 @@ public StandbyContainerGroupPoolProperties(Azure.ResourceManager.StandbyPool.Mod public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties ContainerGroupProperties { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile ElasticityProfile { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -360,6 +370,7 @@ public partial class StandbyContainerGroupPoolRuntimeViewProperties : System.Cli internal StandbyContainerGroupPoolRuntimeViewProperties() { } public System.Collections.Generic.IReadOnlyList InstanceCountSummary { get { throw null; } } public Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -371,6 +382,7 @@ public partial class StandbyContainerGroupPoolUpdateProperties : System.ClientMo public StandbyContainerGroupPoolUpdateProperties() { } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties ContainerGroupProperties { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile ElasticityProfile { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -382,6 +394,7 @@ public partial class StandbyContainerGroupProfile : System.ClientModel.Primitive public StandbyContainerGroupProfile(Azure.Core.ResourceIdentifier id) { } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } public long? Revision { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -393,6 +406,7 @@ public partial class StandbyContainerGroupProperties : System.ClientModel.Primit public StandbyContainerGroupProperties(Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProfile containerGroupProfile) { } public Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProfile ContainerGroupProfile { get { throw null; } set { } } public System.Collections.Generic.IList SubnetIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -441,6 +455,7 @@ public partial class StandbyVirtualMachineInstanceCountSummary : System.ClientMo internal StandbyVirtualMachineInstanceCountSummary() { } public System.Collections.Generic.IReadOnlyList InstanceCountsByState { get { throw null; } } public long? Zone { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineInstanceCountSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineInstanceCountSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -452,6 +467,7 @@ public partial class StandbyVirtualMachinePoolElasticityProfile : System.ClientM public StandbyVirtualMachinePoolElasticityProfile(long maxReadyCapacity) { } public long MaxReadyCapacity { get { throw null; } set { } } public long? MinReadyCapacity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -463,6 +479,7 @@ public partial class StandbyVirtualMachinePoolPatch : System.ClientModel.Primiti public StandbyVirtualMachinePoolPatch() { } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -476,6 +493,7 @@ public StandbyVirtualMachinePoolProperties(Azure.ResourceManager.StandbyPool.Mod public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile ElasticityProfile { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState VirtualMachineState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -487,6 +505,7 @@ public partial class StandbyVirtualMachinePoolRuntimeViewProperties : System.Cli internal StandbyVirtualMachinePoolRuntimeViewProperties() { } public System.Collections.Generic.IReadOnlyList InstanceCountSummary { get { throw null; } } public Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -499,6 +518,7 @@ public StandbyVirtualMachinePoolUpdateProperties() { } public Azure.Core.ResourceIdentifier AttachedVirtualMachineScaleSetId { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile ElasticityProfile { get { throw null; } set { } } public Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState? VirtualMachineState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -510,6 +530,7 @@ public partial class StandbyVirtualMachineProperties : System.ClientModel.Primit internal StandbyVirtualMachineProperties() { } public Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier VirtualMachineResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/assets.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/assets.json index 67a59e1fa3cae..180260b3c34b6 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/assets.json +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/standbypool/Azure.ResourceManager.StandbyPool", - "Tag": "net/standbypool/Azure.ResourceManager.StandbyPool_d210a1a9c5" + "Tag": "net/standbypool/Azure.ResourceManager.StandbyPool_8b4dab0039" } diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/ContainerGroupInstanceCountSummary.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/ContainerGroupInstanceCountSummary.Serialization.cs index acb719ce82112..e4754b0d1c591 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/ContainerGroupInstanceCountSummary.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/ContainerGroupInstanceCountSummary.Serialization.cs @@ -18,6 +18,15 @@ public partial class ContainerGroupInstanceCountSummary : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ContainerGroupInstanceCountSummary)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("instanceCountsByState"u8); writer.WriteStartArray(); foreach (var item in InstanceCountsByState) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ContainerGroupInstanceCountSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/PoolResourceStateCount.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/PoolResourceStateCount.Serialization.cs index 9c8719ca7be77..5cff082329012 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/PoolResourceStateCount.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/PoolResourceStateCount.Serialization.cs @@ -18,6 +18,15 @@ public partial class PoolResourceStateCount : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(PoolResourceStateCount)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("state"u8); writer.WriteStringValue(State); writer.WritePropertyName("count"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } PoolResourceStateCount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolElasticityProfile.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolElasticityProfile.Serialization.cs index bbbda4e9ab541..4213deb1f9c60 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolElasticityProfile.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolElasticityProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupPoolElasticityProfile : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(StandbyContainerGroupPoolElasticityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("maxReadyCapacity"u8); writer.WriteNumberValue(MaxReadyCapacity); if (Optional.IsDefined(RefillPolicy)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolElasticityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolPatch.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolPatch.Serialization.cs index 0e43472694de3..a4aef50702925 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolPatch.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupPoolPatch : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(StandbyContainerGroupPoolPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolProperties.Serialization.cs index 772278c31a52e..5fd4f85267261 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupPoolProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(StandbyContainerGroupPoolProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("elasticityProfile"u8); writer.WriteObjectValue(ElasticityProfile, options); writer.WritePropertyName("containerGroupProperties"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolResourceListResult.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolResourceListResult.Serialization.cs index 35d49373a3139..06b1305fe7823 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolResourceListResult.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StandbyContainerGroupPoolResourceListResult : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(StandbyContainerGroupPoolResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewProperties.Serialization.cs index 37502cd0efcf2..88c72fd16904e 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupPoolRuntimeViewProperties : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(StandbyContainerGroupPoolRuntimeViewProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("instanceCountSummary"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolRuntimeViewProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewResourceListResult.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewResourceListResult.Serialization.cs index 301375db35cac..f6ab5e86e2de1 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewResourceListResult.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolRuntimeViewResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StandbyContainerGroupPoolRuntimeViewResourceListResult : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Ut throw new FormatException($"The model {nameof(StandbyContainerGroupPoolRuntimeViewResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Ut #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolRuntimeViewResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolUpdateProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolUpdateProperties.Serialization.cs index fc7ab2d57fdf2..0ef40fd7616d2 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolUpdateProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupPoolUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupPoolUpdateProperties : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(StandbyContainerGroupPoolUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ElasticityProfile)) { writer.WritePropertyName("elasticityProfile"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } StandbyContainerGroupPoolUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProfile.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProfile.Serialization.cs index 835837331c02d..20d24984313bb 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProfile.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyContainerGroupProfile : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(StandbyContainerGroupProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); if (Optional.IsDefined(Revision)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } StandbyContainerGroupProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProperties.Serialization.cs index 94eeb107a7ee1..2c6113aa68ad3 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyContainerGroupProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class StandbyContainerGroupProperties : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(StandbyContainerGroupProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("containerGroupProfile"u8); writer.WriteObjectValue(ContainerGroupProfile, options); if (Optional.IsCollectionDefined(SubnetIds)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } StandbyContainerGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineInstanceCountSummary.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineInstanceCountSummary.Serialization.cs index d985267b0baf5..7a1f167d0a84c 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineInstanceCountSummary.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineInstanceCountSummary.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachineInstanceCountSummary : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(StandbyVirtualMachineInstanceCountSummary)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Zone)) { writer.WritePropertyName("zone"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } StandbyVirtualMachineInstanceCountSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolElasticityProfile.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolElasticityProfile.Serialization.cs index 0bff5e91a7c32..eceac279062bd 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolElasticityProfile.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolElasticityProfile.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachinePoolElasticityProfile : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolElasticityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("maxReadyCapacity"u8); writer.WriteNumberValue(MaxReadyCapacity); if (Optional.IsDefined(MinReadyCapacity)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolElasticityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolPatch.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolPatch.Serialization.cs index 36b6853e7cad6..5c6f895a9c2dd 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolPatch.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachinePoolPatch : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolProperties.Serialization.cs index 33ddfa0ac4ba2..1d4721bbbbf12 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachinePoolProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ElasticityProfile)) { writer.WritePropertyName("elasticityProfile"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolResourceListResult.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolResourceListResult.Serialization.cs index b44d4202a4584..fc7b886542c65 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolResourceListResult.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StandbyVirtualMachinePoolResourceListResult : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewProperties.Serialization.cs index da674891c72f9..dc026c35d973a 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachinePoolRuntimeViewProperties : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolRuntimeViewProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("instanceCountSummary"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolRuntimeViewProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewResourceListResult.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewResourceListResult.Serialization.cs index 9ea8211dac0cd..be786c0e08f85 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewResourceListResult.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolRuntimeViewResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StandbyVirtualMachinePoolRuntimeViewResourceListResult : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Ut throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolRuntimeViewResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Ut #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolRuntimeViewResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolUpdateProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolUpdateProperties.Serialization.cs index 7370fbaba8944..82671fcef2668 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolUpdateProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachinePoolUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachinePoolUpdateProperties : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ElasticityProfile)) { writer.WritePropertyName("elasticityProfile"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } StandbyVirtualMachinePoolUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineProperties.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineProperties.Serialization.cs index 1e4a3f1dfb653..efe6336e5632c 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineProperties.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StandbyVirtualMachineProperties : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(StandbyVirtualMachineProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("virtualMachineResourceId"u8); writer.WriteStringValue(VirtualMachineResourceId); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } StandbyVirtualMachineProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineResourceListResult.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineResourceListResult.Serialization.cs index 45ae9989e7b60..834aa2c7c2a8d 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineResourceListResult.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/Models/StandbyVirtualMachineResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StandbyVirtualMachineResourceListResult : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(StandbyVirtualMachineResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } StandbyVirtualMachineResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolData.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolData.Serialization.cs index b86651b34f75d..e30837932f473 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolData.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolData.Serialization.cs @@ -20,6 +20,15 @@ public partial class StandbyContainerGroupPoolData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,61 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(StandbyContainerGroupPoolData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } StandbyContainerGroupPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolRuntimeViewData.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolRuntimeViewData.Serialization.cs index 3b779936b829a..6d1e70b616318 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolRuntimeViewData.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyContainerGroupPoolRuntimeViewData.Serialization.cs @@ -20,6 +20,15 @@ public partial class StandbyContainerGroupPoolRuntimeViewData : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(StandbyContainerGroupPoolRuntimeViewData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } StandbyContainerGroupPoolRuntimeViewData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachineData.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachineData.Serialization.cs index 62b1c1c04ce74..3c042eba7b2f2 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachineData.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachineData.Serialization.cs @@ -20,6 +20,15 @@ public partial class StandbyVirtualMachineData : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(StandbyVirtualMachineData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } StandbyVirtualMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolData.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolData.Serialization.cs index 6d363bd7a6e31..9cdcbd183656a 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolData.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolData.Serialization.cs @@ -20,6 +20,15 @@ public partial class StandbyVirtualMachinePoolData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,61 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } StandbyVirtualMachinePoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolRuntimeViewData.Serialization.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolRuntimeViewData.Serialization.cs index 9a8abbeeca289..b738add6010a8 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolRuntimeViewData.Serialization.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/StandbyVirtualMachinePoolRuntimeViewData.Serialization.cs @@ -20,6 +20,15 @@ public partial class StandbyVirtualMachinePoolRuntimeViewData : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,48 +36,12 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(StandbyVirtualMachinePoolRuntimeViewData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } StandbyVirtualMachinePoolRuntimeViewData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) From 0598a8e8454c941051a7f9d323b09cfd3f18d893 Mon Sep 17 00:00:00 2001 From: Siddharth Singha Roy Date: Tue, 8 Oct 2024 17:24:14 +0530 Subject: [PATCH 33/43] Onboard Azure.Developer.MicrosoftPlaywrightTesting sdk (#45044) * feat(): onboard Azure.Developer.MicrosoftPlaywrightTesting sdk * chore(): add support for github summary * docs(): sample, CHANGELOG and README * docs(): content of samples * chore():: modify samples as per azure sdk guidelines * refactor(): unit tests as per azure sdk guidelines * chore(): use autorest to generate api clients * fix(): json parsing of error messages * chore(): add live tests * fix(): run id handling across scalable and reporting * Adressing comments * comment * chore(): resolve documentation comments * docs(): import c# code snippets from .cs files * refactor(): update CODEOWNERS with latest labels * chore(): add git commit based display name * feat(): scalable run error handling * refactor(): convert API client class to internal * chore(): apiview review comments addressed for base sdk * refactor(): rename tokenCredential to credential * refactor(): rename PlaywrightServiceSettings to PlaywrightServiceOptions * refactor(): use serviceAuth only * refactor(): remove defaultAuth references * refactor(): convert serviceOs class to internal * refactor(): convert public fields into properties * chore(): add cancellation token in async methods * refactor(): use default for null cancellation tokens * refactor(): added users in CODEOWNERS * fix(): live test resource json * docs(): add missing sections in README files * refactor(): rename base package to Azure.Developer.MicrosoftPlaywrightTesting.TestLogger * docs(): move authenticate client section after prerequisites --------- Co-authored-by: Siddharth Singha Roy Co-authored-by: Vansh Vardhan Singh --- .github/CODEOWNERS | 4 +- eng/Packages.Data.props | 5 + ...loper.MicrosoftPlaywrightTesting.NUnit.sln | 28 + .../CHANGELOG.md | 8 + .../Directory.Build.props | 6 + .../README.md | 119 +++ ...tPlaywrightTesting.NUnit.netstandard2.0.cs | 13 + .../samples/README.md | 15 + .../Sample1_CustomisingServiceParameters.md | 115 +++ ...mple2_SetDefaultAuthenticationMechanism.md | 57 ++ ...er.MicrosoftPlaywrightTesting.NUnit.csproj | 19 + .../src/PlaywrightServiceNUnit.cs | 77 ++ ...rosoftPlaywrightTesting.NUnit.Tests.csproj | 23 + .../tests/samples/README.md | 3 + .../Sample1_CustomisingServiceParameters.cs | 26 + ...mple2_SetDefaultAuthenticationMechanism.cs | 15 + ....MicrosoftPlaywrightTesting.TestLogger.sln | 31 + .../CHANGELOG.md | 8 + .../Directory.Build.props | 6 + .../README.md | 66 ++ ...wrightTesting.TestLogger.netstandard2.0.cs | 64 ++ .../src/AssemblyInfo.cs | 7 + ...crosoftPlaywrightTesting.TestLogger.csproj | 22 + .../src/Client/Internal/Argument.cs | 129 +++ .../src/Client/ReportingTestResultsClient.cs | 159 ++++ .../src/Client/ReportingTestRunsClient.cs | 482 +++++++++++ .../src/Client/TestReportingClientOptions.cs | 37 + .../src/ConnectOptions.cs | 51 ++ .../src/Constants.cs | 206 +++++ .../src/EntraLifecycle.cs | 79 ++ .../src/Model/CIInfo.cs | 17 + .../src/Model/MPTResult.cs | 49 ++ .../src/Model/TestReporting.cs | 313 ++++++++ .../src/PlaywrightReporter.cs | 760 ++++++++++++++++++ .../src/PlaywrightService.cs | 278 +++++++ .../src/PlaywrightServiceOptions.cs | 107 +++ .../src/Utility/CiInfoProvider.cs | 112 +++ .../src/Utility/Constants.cs | 128 +++ .../src/Utility/Logger.cs | 25 + .../src/Utility/ReporterUtils.cs | 98 +++ ...tPlaywrightTesting.TestLogger.Tests.csproj | 23 + .../tests/EntraLifecycleTests.cs | 201 +++++ .../tests/PlaywrightServiceClientTests.cs | 55 ++ .../tests/PlaywrightServiceOptionsTest.cs | 87 ++ .../tests/PlaywrightServiceTestEnvironment.cs | 12 + .../tests/PlaywrightServiceTests.cs | 662 +++++++++++++++ .../tests/TestUtils.cs | 20 + sdk/playwrighttesting/ci.yml | 41 + sdk/playwrighttesting/test-resources.json | 47 ++ sdk/playwrighttesting/tests.yml | 8 + 50 files changed, 4921 insertions(+), 2 deletions(-) create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.sln create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/CHANGELOG.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/Directory.Build.props create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/api/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.netstandard2.0.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample1_CustomisingServiceParameters.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample2_SetDefaultAuthenticationMechanism.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/PlaywrightServiceNUnit.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.Tests.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample1_CustomisingServiceParameters.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample2_SetDefaultAuthenticationMechanism.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.sln create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Directory.Build.props create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/api/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.netstandard2.0.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/AssemblyInfo.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/Internal/Argument.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestResultsClient.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestRunsClient.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/TestReportingClientOptions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/ConnectOptions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Constants.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/EntraLifecycle.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/CIInfo.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/MPTResult.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/TestReporting.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightReporter.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightService.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightServiceOptions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/CiInfoProvider.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Constants.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Logger.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/ReporterUtils.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/EntraLifecycleTests.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceClientTests.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceOptionsTest.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTestEnvironment.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTests.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/TestUtils.cs create mode 100644 sdk/playwrighttesting/ci.yml create mode 100644 sdk/playwrighttesting/test-resources.json create mode 100644 sdk/playwrighttesting/tests.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b4ededd39033d..386ff52431b28 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -756,10 +756,10 @@ # ServiceOwners: @rhurey @dargilco # PRLabel: %Microsoft Playwright Testing -/sdk/playwrighttesting/ @shreyaanand @mjmadhu +/sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand # ServiceLabel: %Microsoft Playwright Testing -# ServiceOwners: @shreyaanand @mjmadhu +# ServiceOwners: @Sid200026 @puagarwa @ShreyaAnand # ServiceLabel: %Policy # ServiceOwners: @aperezcloud @kenieva diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 753a3ebbd1ef2..99681333eaf17 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -178,6 +178,11 @@ + + + + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md new file mode 100644 index 0000000000000..bbca4b74ad9d7 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md @@ -0,0 +1,119 @@ +# Microsoft Azure Playwright Testing NUnit client library for .NET + +Microsoft Playwright Testing is a fully managed service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. The service also enables you to publish test results and related artifacts to the service and view them in the service portal enabling faster and easier troubleshooting. With Microsoft Playwright Testing service, you can release features faster and more confidently. + +Ready to get started? Jump into our [quickstart guide]! + +## Useful links +- [Quickstart: Run end-to-end tests at scale](https://aka.ms/mpt/quickstart) +- [View Microsoft Playwright Testing service demo](https://youtu.be/GenC1jAeTZE) +- [Documentation](https://aka.ms/mpt/docs) +- [Pricing](https://aka.ms/mpt/pricing) +- [Share feedback](https://aka.ms/mpt/feedback) + +## Getting started + +### Install the package + +Install the client library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.Developer.MicrosoftPlaywrightTesting.NUnit --prerelease +``` + +### Prerequisites + +- An [Azure subscription](https://azure.microsoft.com/free/dotnet/) +- Your Azure account must be assigned the [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner), [Contributor](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#contributor), or one of the [classic administrator roles](https://learn.microsoft.com/azure/role-based-access-control/rbac-and-directory-admin-roles#classic-subscription-administrator-roles). + +### Authenticate the client + +To learn more about options for Microsoft Entra Id authentication, refer to [Azure.Identity credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#credentials). You can also refer to [our samples] on how to configurate different Azure Identity credentials. + +#### Create a Workspace + +1. Sign in to the [Playwright portal](https://aka.ms/mpt/portal) with your Azure account. + +2. Create the Workspace + + ![Create new workspace](https://github.com/microsoft/playwright-testing-service/assets/12104064/d571e86b-9d43-48ac-a2b7-63afb9bb86a8) + + |Field |Description | + |---------|---------| + |**Workspace Name** | A unique name to identify your workspace.
The name can't contain special characters or whitespace. | + |**Azure Subscription** | Select an Azure subscription where you want to create the workspace. | + |**Region** | This is where test run data will be stored for your workspace. | + + > [!NOTE] + > If you don't see this screen, select an existing workspace and go to the next section. + ``` + +### Set up Microsoft Playwright Testing + +Create a file `PlaywrightServiceSetup.cs` in the root directory with the below content + +```C# Snippet:Sample2_SetDefaultAuthenticationMechanism +using Azure.Developer.MicrosoftPlaywrightTesting.NUnit; + +namespace PlaywrightATests; // Remember to change this as per your project namespace + +[SetUpFixture] +public class PlaywrightServiceSetup : PlaywrightServiceNUnit {}; +``` + +> [!NOTE] +> Make sure your project uses `Microsoft.Playwright.NUnit` version 1.37 or above. + +### Obtain region endpoint + +1. In the [Playwright portal](https://aka.ms/mpt/portal), copy the command under **Add region endpoint in your set up**. + + ![Set workspace endpoint](https://github.com/microsoft/playwright-testing-service/assets/12104064/d81ca629-2b23-4d34-8b70-67b6f7061a83) + + The endpoint URL corresponds to the workspace region. You might see a different endpoint URL in the Playwright portal, depending on the region you selected when creating the workspace. + +### Set up environment + +Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is available in your environment. + +### Run the tests + +Run Playwright tests against browsers managed by the service using the configuration you created above. + +```dotnetcli +dotnet test --logger "ms-playwright-service" +``` + +## Key concepts + +Key concepts of the Microsoft Playwright Testing NUnit SDK for .NET can be found [here](https://aka.ms/mpt/what-is-mpt) + +## Examples + +Code samples for using this SDK can be found in the following locations +- [.NET Microsoft Playwright Testing NUnit Library Code Samples](https://aka.ms/mpt/sample) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline) + +- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace. + +- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism). + +## Contributing +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. For +details, visit [cla.microsoft.com][cla]. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. +For more information see the [Code of Conduct FAQ][coc_faq] or contact +[opencode@microsoft.com][coc_contact] with any additional questions or comments. + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.png) \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/api/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.netstandard2.0.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/api/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.netstandard2.0.cs new file mode 100644 index 0000000000000..7e6eac3ac4c33 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/api/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.netstandard2.0.cs @@ -0,0 +1,13 @@ +namespace Azure.Developer.MicrosoftPlaywrightTesting.NUnit +{ + [NUnit.Framework.SetUpFixtureAttribute] + public partial class PlaywrightServiceNUnit : Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.PlaywrightService + { + public PlaywrightServiceNUnit(Azure.Core.TokenCredential? credential = null) : base (default(Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.PlaywrightServiceOptions), default(Azure.Core.TokenCredential)) { } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.PlaywrightServiceOptions playwrightServiceOptions { get { throw null; } } + [NUnit.Framework.OneTimeSetUpAttribute] + public System.Threading.Tasks.Task SetupAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [NUnit.Framework.OneTimeTearDownAttribute] + public void Teardown() { } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/README.md new file mode 100644 index 0000000000000..218796676686f --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/README.md @@ -0,0 +1,15 @@ +--- +page_type: sample +languages: +- csharp +products: +- azure +- playwright-testing +name: Azure.Developer.MicrosoftPlaywrightTesting.NUnit samples for .NET +description: Samples for the Azure.Developer.MicrosoftPlaywrightTesting.NUnit client library +--- + +# Azure.Developer.MicrosoftPlaywrightTesting.NUnit samples for .NET + +- [Customising service parameters] +- [Set default authentication mechanism] \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample1_CustomisingServiceParameters.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample1_CustomisingServiceParameters.md new file mode 100644 index 0000000000000..ef62a3929fe6a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample1_CustomisingServiceParameters.md @@ -0,0 +1,115 @@ +## Learn about different available service parameters and how to use them + +Follow the steps listed in this [README] to integrate your existing Playwright test suite with the Microsoft Playwright Testing service. + +This guide explains the different options available to you in the Azure.Developer.MicrosoftPlaywrightTesting.NUnit package and how to use them. + +### Using .runsettings file + +1. Create a `.runsettings` file in the root directory: + +```xml + + + + + + + + + + + + + + + + + + + + +``` + + > [!NOTE] + > You can also modify the runid by setting the environment variable `PLAYWRIGHT_SERVICE_RUN_ID`. + +2. Run tests using the above `.runsettings` file: + +```dotnetcli +dotnet test --settings .runsettings +``` + +#### Known issue: Minimal support for Azure Identity library credentials + +This issue only impacts the reporting feature. Currently, the service provides minimal support for the following [Azure Credential types.](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes) + +Along with this, we also support passing a Managed Identity ClientId to be used along with `DefaultAzureCredential` and `ManagedIdentityCredential`. + +If you only want to use cloud-hosted browsers along with your tests, you can disable the reporting feature by removing the logger from the runsettings file and then modify the `PlaywrightServiceSetup.cs` file as per the following. + +```C# Snippet:Sample1_CustomisingServiceParameters +using Azure.Core; +using Azure.Developer.MicrosoftPlaywrightTesting.NUnit; +using Azure.Identity; + +namespace PlaywrightTests; + +[SetUpFixture] +public class PlaywrightServiceSetup : PlaywrightServiceNUnit +{ + public static readonly TokenCredential managedIdentityCredential = new ManagedIdentityCredential(); + + public PlaywrightServiceSetup() : base(managedIdentityCredential) {} +} +``` + +## Options + +1. **`Os`**: + - **Description**: This setting allows you to choose the operating system where the browsers running Playwright tests will be hosted. + - **Available Options**: + - `System.Runtime.InteropServices.OSPlatform.Windows` for Windows OS. + - `System.Runtime.InteropServices.OSPlatform.LINUX` for Linux OS. + - **Default Value**: `System.Runtime.InteropServices.OSPlatform.LINUX` + +2. **`RunId`**: + - **Description**: This setting allows you to set a unique ID for every test run to distinguish them in the service portal. + +3. **`ExposeNetwork`**: + - **Description**: This settings exposes network available on the connecting client to the browser being connected to. + +4. **`ServiceAuth`** + - **Description**: This setting allows you to specify the default authentication mechanism to be used for sending requests to the service. + - **Available Options**: + - `ServiceAuthType.EntraId` for Microsoft Entra ID authentication. + - `ServiceAuthType.AccessToken` for MPT Access Token authentication. + - **Default Value**: `ServiceAuthType.EntraId` + +5. **`UseCloudHostedBrowsers`** + - **Description**: This setting allows you to select whether to use cloud-hosted browsers to run your Playwright tests. Reporting features remain available even if you disable this setting. + - **Default Value**: `true` + +6. **`AzureTokenCredentialType`**: + - **Description**: This setting allows you to select the authentication method you want to use with Entra. + - **Available Options**: + - `AzureTokenCredentialType.EnvironmentCredential` + - `AzureTokenCredentialType.WorkloadIdentityCredential` + - `AzureTokenCredentialType.ManagedIdentityCredential` + - `AzureTokenCredentialType.SharedTokenCacheCredential` + - `AzureTokenCredentialType.VisualStudioCredential` + - `AzureTokenCredentialType.VisualStudioCodeCredential` + - `AzureTokenCredentialType.AzureCliCredential` + - `AzureTokenCredentialType.AzurePowerShellCredential` + - `AzureTokenCredentialType.AzureDeveloperCliCredential` + - `AzureTokenCredentialType.InteractiveBrowserCredential` + - `AzureTokenCredentialType.DefaultAzureCredential` + - **Default Value**: `AzureTokenCredentialType.DefaultAzureCredential` + +7. **`ManagedIdentityClientId`** + - **Description**: This setting allows you to specify the managed identity client id to be used for Microsoft Entra Id authentication. + +8. **`EnableGitHubSummary`**: + - **Description**: This setting allows you to configure the Microsoft Playwright Testing service reporter. You can choose whether to include the test run summary in the GitHub summary when running in GitHub Actions. + - **Default Value**: `true` + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample2_SetDefaultAuthenticationMechanism.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample2_SetDefaultAuthenticationMechanism.md new file mode 100644 index 0000000000000..13c3ba68314c6 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples/Sample2_SetDefaultAuthenticationMechanism.md @@ -0,0 +1,57 @@ +# How to authenticate to Microsoft Playwright Testing service using service access token. + +Follow the steps listed in this [README] to integrate your existing Playwright test suite with the Microsoft Playwright Testing service. + +This guide will walk you through the steps to integrate your Playwright project where you are launching browsers from within the tests with the service. + +### Setup Microsoft Playwright Testing + +1. Create a file `PlaywrightServiceSetup.cs` in the root directory with the following + +```C# Snippet:Sample2_SetDefaultAuthenticationMechanism +using Azure.Developer.MicrosoftPlaywrightTesting.NUnit; + +namespace PlaywrightATests; // Remember to change this as per your project namespace + +[SetUpFixture] +public class PlaywrightServiceSetup : PlaywrightServiceNUnit {}; +``` + +2. Create a .runsettings file to modify default authentication mechanism. + +```xml + + + + + + + +``` + +> [!NOTE] +> Make sure your project uses Microsoft.Playwright.NUnit version 1.37 or above. + +### Obtain region endpoint + +1. In the [Playwright portal](https://aka.ms/mpt/portal), copy the command under **Add region endpoint in your set up**. + + ![Set workspace endpoint](https://github.com/microsoft/playwright-testing-service/assets/12104064/d81ca629-2b23-4d34-8b70-67b6f7061a83) + + The endpoint URL corresponds to the workspace region. You might see a different endpoint URL in the Playwright portal, depending on the region you selected when creating the workspace. + +### Set up environment + +Ensure that the `PLAYWRIGHT_SERVICE_URL` that you obtained in previous step is available in your environment. + +### Authenticate the client + +To learn more about options for Microsoft Entra Id authentication, refer to [Azure.Identity credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#credentials). You can also refer to [our samples] on how to configurate different Azure Identity credentials. + +### Run the tests + +Run Playwright tests against browsers managed by the service using the configuration you created above. + +```dotnetcli +dotnet test --settings .runsettings +``` \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.csproj new file mode 100644 index 0000000000000..bd13873735388 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.csproj @@ -0,0 +1,19 @@ + + + Azure, Cloud, Playwright, Playwright Service, Reporting, Playwright Testing + + Package to integrate your Playwright test suite with Microsoft Playwright Testing + service + + 1.0.0-beta.1 + 1.0.0-beta.1 + true + $(RequiredTargetFrameworks) + enable + + + + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/PlaywrightServiceNUnit.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/PlaywrightServiceNUnit.cs new file mode 100644 index 0000000000000..46141565b2e98 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/src/PlaywrightServiceNUnit.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using NUnit.Framework; +using System.Threading.Tasks; +using System.Runtime.InteropServices; +using System.Threading; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.NUnit; + +///

+/// NUnit setup fixture to initialize Playwright Service. +/// +[SetUpFixture] +public class PlaywrightServiceNUnit : PlaywrightService +{ + /// + /// Initializes a new instance of the class. + /// + /// The azure token credential to use for authentication. + public PlaywrightServiceNUnit(TokenCredential? credential = null) + : base(playwrightServiceOptions, credential: credential) + { + } + + /// + /// Creates a new instance of based on the runsettings file. + /// + public static PlaywrightServiceOptions playwrightServiceOptions { get; } = new( + os: GetOsPlatform(TestContext.Parameters.Get(RunSettingKey.Os)), + runId: TestContext.Parameters.Get(RunSettingKey.RunId), + exposeNetwork: TestContext.Parameters.Get(RunSettingKey.ExposeNetwork), + serviceAuth: TestContext.Parameters.Get(RunSettingKey.ServiceAuthType), + useCloudHostedBrowsers: TestContext.Parameters.Get(RunSettingKey.UseCloudHostedBrowsers), + azureTokenCredentialType: TestContext.Parameters.Get(RunSettingKey.AzureTokenCredentialType), + managedIdentityClientId: TestContext.Parameters.Get(RunSettingKey.ManagedIdentityClientId) + ); + + /// + /// Setup the resources utilized by Playwright service. + /// + /// Cancellation token. + /// + [OneTimeSetUp] + public async Task SetupAsync(CancellationToken cancellationToken = default) + { + await InitializeAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Tear down resources utilized by Playwright service. + /// + [OneTimeTearDown] + public void Teardown() + { + Cleanup(); + } + + private static OSPlatform? GetOsPlatform(string? os) + { + if (string.IsNullOrEmpty(os)) + { + return null; + } + else if (os!.Equals("Windows", System.StringComparison.OrdinalIgnoreCase)) + { + return OSPlatform.Windows; + } + else if (os.Equals("Linux", System.StringComparison.OrdinalIgnoreCase)) + { + return OSPlatform.Linux; + } + return null; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.Tests.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.Tests.csproj new file mode 100644 index 0000000000000..876d71881eb32 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/Azure.Developer.MicrosoftPlaywrightTesting.NUnit.Tests.csproj @@ -0,0 +1,23 @@ + + + + enable + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/README.md new file mode 100644 index 0000000000000..ecd5c103e8fe3 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/README.md @@ -0,0 +1,3 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. +See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/samples) for more explanation about how to use this client library. \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample1_CustomisingServiceParameters.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample1_CustomisingServiceParameters.cs new file mode 100644 index 0000000000000..aaaf15ee8fe49 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample1_CustomisingServiceParameters.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#region Snippet:Sample1_CustomisingServiceParameters +using Azure.Core; +using Azure.Developer.MicrosoftPlaywrightTesting.NUnit; +using Azure.Identity; + +namespace PlaywrightTests; + +[SetUpFixture] +#if SNIPPET +public class PlaywrightServiceSetup : PlaywrightServiceNUnit +#else +public class Sample2ServiceSetup : PlaywrightServiceNUnit +#endif +{ + public static readonly TokenCredential managedIdentityCredential = new ManagedIdentityCredential(); + +#if SNIPPET + public PlaywrightServiceSetup() : base(managedIdentityCredential) {} +#else + public Sample2ServiceSetup() : base(managedIdentityCredential) {} +#endif +} +#endregion \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample2_SetDefaultAuthenticationMechanism.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample2_SetDefaultAuthenticationMechanism.cs new file mode 100644 index 0000000000000..6cf327b7d4687 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/tests/samples/Sample2_SetDefaultAuthenticationMechanism.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#region Snippet:Sample2_SetDefaultAuthenticationMechanism +using Azure.Developer.MicrosoftPlaywrightTesting.NUnit; + +namespace PlaywrightATests; // Remember to change this as per your project namespace + +[SetUpFixture] +#if SNIPPET +public class PlaywrightServiceSetup : PlaywrightServiceNUnit {}; +#else +public class Sample2ServiceSetup : PlaywrightServiceNUnit { }; +#endif +#endregion \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.sln b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.sln new file mode 100644 index 0000000000000..127dd846d079e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.MicrosoftPlaywrightTesting.TestLogger", "src\Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.csproj", "{2C1F9880-AD7D-433E-A73E-43F503772CD8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests", "tests\Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests.csproj", "{6C78D318-9B96-43B4-97A7-7B3C8088983C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C1F9880-AD7D-433E-A73E-43F503772CD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C1F9880-AD7D-433E-A73E-43F503772CD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C1F9880-AD7D-433E-A73E-43F503772CD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C1F9880-AD7D-433E-A73E-43F503772CD8}.Release|Any CPU.Build.0 = Release|Any CPU + {6C78D318-9B96-43B4-97A7-7B3C8088983C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C78D318-9B96-43B4-97A7-7B3C8088983C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C78D318-9B96-43B4-97A7-7B3C8088983C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C78D318-9B96-43B4-97A7-7B3C8088983C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C3BE422E-8FFF-4EF8-BA89-186F153965D8} + EndGlobalSection +EndGlobal diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md new file mode 100644 index 0000000000000..1576c72198be6 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2024-09-11) + +### Features Added + +- Added authentication using Microsoft Entra ID for the service. +- Added reporting capabilities for the service. You can now publish the reports and artifacts generated by Playwright OSS to the service. \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Directory.Build.props b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Directory.Build.props new file mode 100644 index 0000000000000..63bd836ad44b7 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/README.md new file mode 100644 index 0000000000000..34bbeced75f66 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/README.md @@ -0,0 +1,66 @@ +# Microsoft Azure Playwright Testing client library for .NET + +Microsoft Playwright Testing is a fully managed service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. The service also enables you to publish test results and related artifacts to the service and view them in the service portal enabling faster and easier troubleshooting. With Microsoft Playwright Testing service, you can release features faster and more confidently. + +## Getting started + +### Install the package + +Install the client library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.Developer.MicrosoftPlaywrightTesting.TestLogger --prerelease +``` + +### Authenticate the client + +To learn more about options for Microsoft Entra Id authentication, refer to [Azure.Identity credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#credentials). You can also refer to [our samples] on how to configurate different Azure Identity credentials. + +### Prerequisites + +- An [Azure subscription](https://azure.microsoft.com/free/dotnet/) +- Your Azure account must be assigned the [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner), [Contributor](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#contributor), or one of the [classic administrator roles](https://learn.microsoft.com/azure/role-based-access-control/rbac-and-directory-admin-roles#classic-subscription-administrator-roles). + +## Useful links +- [Quickstart: Run end-to-end tests at scale](https://aka.ms/mpt/quickstart) +- [Quickstart: Set up continuous end-to-end testing across different browsers and operating systems](https://aka.ms/mpt/ci) +- [Explore features and benefits](https://aka.ms/mpt/about) +- [View Microsoft Playwright Testing service demo](https://youtu.be/GenC1jAeTZE) +- [Documentation](https://aka.ms/mpt/docs) +- [Pricing](https://aka.ms/mpt/pricing) +- [Share feedback](https://aka.ms/mpt/feedback) + +## Key concepts + +Key concepts of the Microsoft Playwright Testing NUnit SDK for .NET can be found [here](https://aka.ms/mpt/what-is-mpt) + +## Examples + +Code samples for using this SDK can be found in the following locations +- [.NET Microsoft Playwright Testing NUnit Library Code Samples](https://aka.ms/mpt/sample) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +- Run tests in a [CI/CD pipeline.](https://aka.ms/mpt/configure-pipeline) + +- Learn how to [manage access](https://aka.ms/mpt/manage-access) to the created workspace. + +- Experiment with different number of workers to [determine the optimal configuration of your test suite](https://aka.ms/mpt/parallelism). + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. For +details, visit [cla.microsoft.com][cla]. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. +For more information see the [Code of Conduct FAQ][coc_faq] or contact +[opencode@microsoft.com][coc_contact] with any additional questions or comments. + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/README.png) \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/api/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.netstandard2.0.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/api/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.netstandard2.0.cs new file mode 100644 index 0000000000000..0880153e7dc93 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/api/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.netstandard2.0.cs @@ -0,0 +1,64 @@ +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger +{ + public partial class ConnectOptions where T : class, new() + { + public ConnectOptions() { } + public T? Options { get { throw null; } set { } } + public string? WsEndpoint { get { throw null; } set { } } + } + public partial class PlaywrightService + { + public PlaywrightService(Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.PlaywrightServiceOptions playwrightServiceOptions, Azure.Core.TokenCredential? credential = null) { } + public PlaywrightService(System.Runtime.InteropServices.OSPlatform? os = default(System.Runtime.InteropServices.OSPlatform?), string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, bool? useCloudHostedBrowsers = default(bool?), Azure.Core.TokenCredential? credential = null) { } + public System.Threading.Timer? RotationTimer { get { throw null; } set { } } + public string ServiceAuth { get { throw null; } set { } } + public static string? ServiceEndpoint { get { throw null; } } + public bool UseCloudHostedBrowsers { get { throw null; } set { } } + public void Cleanup() { } + public System.Threading.Tasks.Task> GetConnectOptionsAsync(System.Runtime.InteropServices.OSPlatform? os = default(System.Runtime.InteropServices.OSPlatform?), string? runId = null, string? exposeNetwork = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) where T : class, new() { throw null; } + public System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PlaywrightServiceOptions + { + public PlaywrightServiceOptions(System.Runtime.InteropServices.OSPlatform? os = default(System.Runtime.InteropServices.OSPlatform?), string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, string? useCloudHostedBrowsers = null, string? azureTokenCredentialType = null, string? managedIdentityClientId = null) { } + } + public partial class RunSettingKey + { + public static readonly string AzureTokenCredentialType; + public static readonly string EnableGitHubSummary; + public static readonly string EnableResultPublish; + public static readonly string ExposeNetwork; + public static readonly string ManagedIdentityClientId; + public static readonly string Os; + public static readonly string RunId; + public static readonly string ServiceAuthType; + public static readonly string UseCloudHostedBrowsers; + public RunSettingKey() { } + } + public partial class ServiceAuthType + { + public static readonly string AccessToken; + public static readonly string EntraId; + public ServiceAuthType() { } + } + public partial class ServiceEnvironmentVariable + { + public static readonly string PlaywrightServiceAccessToken; + public static readonly string PlaywrightServiceExposeNetwork; + public static readonly string PlaywrightServiceOs; + public static readonly string PlaywrightServiceRunId; + public static readonly string PlaywrightServiceUri; + public ServiceEnvironmentVariable() { } + } +} +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client +{ + public partial class TestReportingClientOptions : Azure.Core.ClientOptions + { + public TestReportingClientOptions(Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client.TestReportingClientOptions.ServiceVersion version = Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client.TestReportingClientOptions.ServiceVersion.V2024_05_20_Preview) { } + public enum ServiceVersion + { + V2024_05_20_Preview = 1, + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/AssemblyInfo.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/AssemblyInfo.cs new file mode 100644 index 0000000000000..a50e225747117 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.csproj new file mode 100644 index 0000000000000..547bab277e258 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.csproj @@ -0,0 +1,22 @@ + + + Azure, Cloud, Playwright, Playwright Service, Reporting, Playwright Testing + + Package to integrate your Playwright test suite with Microsoft Playwright Testing + service + + 1.0.0-beta.1 + 1.0.0-beta.1 + true + $(RequiredTargetFrameworks) + enable + true + + + + + + + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/Internal/Argument.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/Internal/Argument.cs new file mode 100644 index 0000000000000..825022ea323ce --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestResultsClient.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestResultsClient.cs new file mode 100644 index 0000000000000..ed2f8c76c3fe1 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestResultsClient.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client +{ + // Data plane generated client. + /// The TestResults service client. + internal partial class ReportingTestResultsClient + { + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ReportingTestResultsClient for mocking. + protected ReportingTestResultsClient() + { + } + + /// Initializes a new instance of ReportingTestResultsClient. + /// server parameter. + /// is null. + public ReportingTestResultsClient(Uri endpoint) : this(endpoint, new TestReportingClientOptions()) + { + } + + /// Initializes a new instance of ReportingTestResultsClient. + /// server parameter. + /// The options for configuring the client. + /// is null. + public ReportingTestResultsClient(Uri endpoint, TestReportingClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new TestReportingClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), Array.Empty(), new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Uploads a batch of test results to the test run + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The content to send as the body of the request. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task UploadBatchTestResultsAsync(string workspaceId, RequestContent content, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestResultsClient.UploadBatchTestResults"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadBatchTestResultsRequest(workspaceId, content, authorization, xCorrelationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Uploads a batch of test results to the test run + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The content to send as the body of the request. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response UploadBatchTestResults(string workspaceId, RequestContent content, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestResultsClient.UploadBatchTestResults"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadBatchTestResultsRequest(workspaceId, content, authorization, xCorrelationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateUploadBatchTestResultsRequest(string workspaceId, RequestContent content, string authorization, string xCorrelationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200400500); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/workspaces/", false); + uri.AppendPath(workspaceId, true); + uri.AppendPath("/test-results/upload-batch", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (authorization != null) + { + request.Headers.Add("Authorization", authorization); + } + if (xCorrelationId != null) + { + request.Headers.Add("x-correlation-id", xCorrelationId); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static ResponseClassifier _responseClassifier200400500; + private static ResponseClassifier ResponseClassifier200400500 => _responseClassifier200400500 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 400, 500 }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestRunsClient.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestRunsClient.cs new file mode 100644 index 0000000000000..4bdb0cee6e0a9 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/ReportingTestRunsClient.cs @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client +{ + // Data plane generated client. + /// The TestRuns service client. + internal partial class ReportingTestRunsClient + { + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ReportingTestRunsClient for mocking. + protected ReportingTestRunsClient() + { + } + + /// Initializes a new instance of ReportingTestRunsClient. + /// server parameter. + /// is null. + public ReportingTestRunsClient(Uri endpoint) : this(endpoint, new TestReportingClientOptions()) + { + } + + /// Initializes a new instance of ReportingTestRunsClient. + /// server parameter. + /// The options for configuring the client. + /// is null. + public ReportingTestRunsClient(Uri endpoint, TestReportingClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new TestReportingClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), Array.Empty(), new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// + /// [Protocol Method] Patch Test Run Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// The content to send as the body of the request. + /// Body Parameter content-type. Allowed values: "application/*+json" | "application/json" | "application/json-patch+json" | "text/json". + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task PatchTestRunInfoAsync(string workspaceId, string testRunId, RequestContent content, ContentType contentType, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.PatchTestRunInfoAsync"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchTestRunInfoAsyncRequest(workspaceId, testRunId, content, contentType, authorization, xCorrelationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Patch Test Run Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// The content to send as the body of the request. + /// Body Parameter content-type. Allowed values: "application/*+json" | "application/json" | "application/json-patch+json" | "text/json". + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response PatchTestRunInfo(string workspaceId, string testRunId, RequestContent content, ContentType contentType, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.PatchTestRunInfoAsync"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchTestRunInfoAsyncRequest(workspaceId, testRunId, content, contentType, authorization, xCorrelationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Test Run Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTestRunAsync(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.GetTestRunAsync"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunAsyncRequest(workspaceId, testRunId, authorization, xCorrelationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Test Run Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTestRun(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.GetTestRunAsync"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunAsyncRequest(workspaceId, testRunId, authorization, xCorrelationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Patch Test Run Shard Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// The to use. + /// The content to send as the body of the request. + /// Body Parameter content-type. Allowed values: "application/*+json" | "application/json" | "application/json-patch+json" | "text/json". + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task PatchTestRunShardInfoAsync(string workspaceId, string testRunId, string shardId, RequestContent content, ContentType contentType, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNullOrEmpty(shardId, nameof(shardId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.PatchTestRunShardInfoAsync"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchTestRunShardInfoAsyncRequest(workspaceId, testRunId, shardId, content, contentType, authorization, xCorrelationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Patch Test Run Shard Info + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// The to use. + /// The content to send as the body of the request. + /// Body Parameter content-type. Allowed values: "application/*+json" | "application/json" | "application/json-patch+json" | "text/json". + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response PatchTestRunShardInfo(string workspaceId, string testRunId, string shardId, RequestContent content, ContentType contentType, string authorization = null, string xCorrelationId = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNullOrEmpty(shardId, nameof(shardId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.PatchTestRunShardInfoAsync"); + scope.Start(); + try + { + using HttpMessage message = CreatePatchTestRunShardInfoAsyncRequest(workspaceId, testRunId, shardId, content, contentType, authorization, xCorrelationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Test Run Results Uri + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTestRunResultsUriAsync(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.GetTestRunResultsUriAsync"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunResultsUriAsyncRequest(workspaceId, testRunId, authorization, xCorrelationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Test Run Results Uri + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The to use. + /// The to use. + /// access token. + /// Correlation-id used for tracing and debugging. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTestRunResultsUri(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(workspaceId, nameof(workspaceId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("ReportingTestRunsClient.GetTestRunResultsUriAsync"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunResultsUriAsyncRequest(workspaceId, testRunId, authorization, xCorrelationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreatePatchTestRunInfoAsyncRequest(string workspaceId, string testRunId, RequestContent content, ContentType contentType, string authorization, string xCorrelationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200400401500); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/workspaces/", false); + uri.AppendPath(workspaceId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (authorization != null) + { + request.Headers.Add("Authorization", authorization); + } + if (xCorrelationId != null) + { + request.Headers.Add("x-correlation-id", xCorrelationId); + } + request.Headers.Add("Content-Type", contentType.ToString()); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTestRunAsyncRequest(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200400401500); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/workspaces/", false); + uri.AppendPath(workspaceId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (authorization != null) + { + request.Headers.Add("Authorization", authorization); + } + if (xCorrelationId != null) + { + request.Headers.Add("x-correlation-id", xCorrelationId); + } + return message; + } + + internal HttpMessage CreatePatchTestRunShardInfoAsyncRequest(string workspaceId, string testRunId, string shardId, RequestContent content, ContentType contentType, string authorization, string xCorrelationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200400401500); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/workspaces/", false); + uri.AppendPath(workspaceId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendPath("/shards/", false); + uri.AppendPath(shardId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (authorization != null) + { + request.Headers.Add("Authorization", authorization); + } + if (xCorrelationId != null) + { + request.Headers.Add("x-correlation-id", xCorrelationId); + } + request.Headers.Add("Content-Type", contentType.ToString()); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTestRunResultsUriAsyncRequest(string workspaceId, string testRunId, string authorization, string xCorrelationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200400401500); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/workspaces/", false); + uri.AppendPath(workspaceId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendPath("/resulturi", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (authorization != null) + { + request.Headers.Add("Authorization", authorization); + } + if (xCorrelationId != null) + { + request.Headers.Add("x-correlation-id", xCorrelationId); + } + return message; + } + + private static ResponseClassifier _responseClassifier200400401500; + private static ResponseClassifier ResponseClassifier200400401500 => _responseClassifier200400401500 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 400, 401, 500 }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/TestReportingClientOptions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/TestReportingClientOptions.cs new file mode 100644 index 0000000000000..cf4492767fe75 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Client/TestReportingClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client +{ + /// Client options for TestReporting library clients. + public partial class TestReportingClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_05_20_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-05-20-preview". + V2024_05_20_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of TestReportingClientOptions. + public TestReportingClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_05_20_Preview => "2024-05-20-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/ConnectOptions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/ConnectOptions.cs new file mode 100644 index 0000000000000..7b0b6e1fc17aa --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/ConnectOptions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +/// +/// Represents the connect options for a generic type. +/// +/// The type parameter. +public class ConnectOptions where T : class, new() +{ + /// + /// A browser websocket endpoint to connect to. + /// + public string? WsEndpoint { get; set; } + /// + /// Connect options for the service. + /// + public T? Options { get; set; } +} + +internal class BrowserConnectOptions +{ + public string? ExposeNetwork { get; set; } + public IEnumerable>? Headers { get; set; } + public float? SlowMo { get; set; } + public float? Timeout { get; set; } +} + +internal static class BrowserConnectOptionsConverter +{ + public static T Convert(object source) where T : class, new() + { + var target = new T(); + System.Type sourceType = source.GetType(); + System.Type targetType = typeof(T); + + foreach (System.Reflection.PropertyInfo? sourceProperty in sourceType.GetProperties()) + { + System.Reflection.PropertyInfo targetProperty = targetType.GetProperty(sourceProperty.Name); + if (targetProperty != null && targetProperty.CanWrite) + { + targetProperty.SetValue(target, sourceProperty.GetValue(source)); + } + } + + return target; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Constants.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Constants.cs new file mode 100644 index 0000000000000..4b1f0b43a2bb5 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Constants.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +/// +/// Contains environment variable names used by the Playwright service. +/// +public class ServiceEnvironmentVariable +{ + /// + /// The environment variable for the Playwright service access token. + /// + public static readonly string PlaywrightServiceAccessToken = "PLAYWRIGHT_SERVICE_ACCESS_TOKEN"; + + /// + /// The environment variable for the Playwright service URL. + /// + public static readonly string PlaywrightServiceUri = "PLAYWRIGHT_SERVICE_URL"; + + /// + /// The environment variable for exposing the Playwright service network. + /// + public static readonly string PlaywrightServiceExposeNetwork = "PLAYWRIGHT_SERVICE_EXPOSE_NETWORK"; + + /// + /// The environment variable for the Playwright service operating system. + /// + public static readonly string PlaywrightServiceOs = "PLAYWRIGHT_SERVICE_OS"; + + /// + /// The environment variable for the Playwright service run ID. + /// + public static readonly string PlaywrightServiceRunId = "PLAYWRIGHT_SERVICE_RUN_ID"; +}; + +/// +/// Contains constants for supported operating systems on Microsoft Playwright Testing. +/// +internal class ServiceOs +{ + /// + /// Linux operating system. + /// + public static readonly string Linux = "linux"; + + /// + /// Windows operating system. + /// + public static readonly string Windows = "windows"; +}; + +/// +/// Contains constants for authentication methods. +/// +public class ServiceAuthType +{ + /// + /// Entra ID authentication method. + /// + public static readonly string EntraId = "EntraId"; + + /// + /// Access token authentication method. + /// + public static readonly string AccessToken = "AccessToken"; +}; + +/// +/// Contains constants for Azure token credential types. +/// +internal class AzureTokenCredentialType +{ + /// + /// Environment Credential. + /// + public static readonly string EnvironmentCredential = "EnvironmentCredential"; + + /// + /// Workload Identity Credential. + /// + public static readonly string WorkloadIdentityCredential = "WorkloadIdentityCredential"; + + /// + /// Managed Identity Credential. + /// + public static readonly string ManagedIdentityCredential = "ManagedIdentityCredential"; + + /// + /// Shared Token Cache Credential. + /// + public static readonly string SharedTokenCacheCredential = "SharedTokenCacheCredential"; + + /// + /// Visual Studio Credential. + /// + public static readonly string VisualStudioCredential = "VisualStudioCredential"; + + /// + /// Visual Studio Code Credential. + /// + public static readonly string VisualStudioCodeCredential = "VisualStudioCodeCredential"; + + /// + /// Azure CLI Credential. + /// + public static readonly string AzureCliCredential = "AzureCliCredential"; + + /// + /// Azure PowerShell Credential. + /// + public static readonly string AzurePowerShellCredential = "AzurePowerShellCredential"; + + /// + /// Azure Developer CLI Credential. + /// + public static readonly string AzureDeveloperCliCredential = "AzureDeveloperCliCredential"; + + /// + /// Interactive Browser Credential. + /// + public static readonly string InteractiveBrowserCredential = "InteractiveBrowserCredential"; + + /// + /// Default Azure Credential. + /// + public static readonly string DefaultAzureCredential = "DefaultAzureCredential"; +} + +/// +/// Contains constants for run setting keys. +/// +public class RunSettingKey +{ + /// + /// The operating system setting key. + /// + public static readonly string Os = "Os"; + + /// + /// The run ID setting key. + /// + public static readonly string RunId = "RunId"; + + /// + /// The expose network setting key. + /// + public static readonly string ExposeNetwork = "ExposeNetwork"; + + /// + /// The default authentication setting key. + /// + public static readonly string ServiceAuthType = "ServiceAuthType"; + + /// + /// The use cloud-hosted browsers setting key. + /// + public static readonly string UseCloudHostedBrowsers = "UseCloudHostedBrowsers"; + + /// + /// The Azure token credential type setting key. + /// + public static readonly string AzureTokenCredentialType = "AzureTokenCredentialType"; + + /// + /// The managed identity client ID setting key. + /// + public static readonly string ManagedIdentityClientId = "ManagedIdentityClientId"; + + /// + /// Enable GitHub summary setting key. + /// + public static readonly string EnableGitHubSummary = "EnableGitHubSummary"; + + /// + /// Enable Result publish. + /// + public static readonly string EnableResultPublish = "EnableResultPublish"; +} + +internal class Constants +{ + // Default constants + internal static readonly string s_default_os = ServiceOs.Linux; + internal static readonly string s_default_expose_network = ""; + + // Entra id access token constants + internal static readonly int s_entra_access_token_lifetime_left_threshold_in_minutes_for_rotation = 15; + internal static readonly string[] s_entra_access_token_scopes = new string[] { "https://management.core.windows.net/.default" }; + internal static readonly int s_entra_access_token_rotation_interval_period_in_minutes = 4; + + // Service constants + internal static readonly string s_api_version = "2023-10-01-preview"; + + // Error messages + internal static readonly string s_no_service_endpoint_error_message = "Please set PLAYWRIGHT_SERVICE_URL in your environment variables."; + internal static readonly string s_service_endpoint_removed_since_scalable_execution_disabled_error_message = "GetConnectOptionsAsync() method cannot be used when disableScalableExecution is set to true in the setup file."; + internal static readonly string s_no_auth_error = "Could not authenticate with the service. Please refer to https://aka.ms/mpt/authentication for more information."; + internal static readonly string s_invalid_mpt_pat_error = "The Access Token provided in the environment variable is invalid."; + internal static readonly string s_expired_mpt_pat_error = "The Access Token you are using is expired. Create a new token."; + internal static readonly string s_invalid_os_error = "Invalid operating system, supported values are 'linux' and 'windows'."; + + internal static readonly string s_playwright_service_disable_scalable_execution_environment_variable = "PLAYWRIGHT_SERVICE_DISABLE_SCALABLE_EXECUTION"; + internal static readonly string s_playwright_service_reporting_url_environment_variable = "PLAYWRIGHT_SERVICE_REPORTING_URL"; + internal static readonly string s_playwright_service_workspace_id_environment_variable = "PLAYWRIGHT_SERVICE_WORKSPACE_ID"; +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/EntraLifecycle.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/EntraLifecycle.cs new file mode 100644 index 0000000000000..a1c669902065d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/EntraLifecycle.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Microsoft.IdentityModel.JsonWebTokens; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +internal class EntraLifecycle +{ + internal string? _entraIdAccessToken; + internal long? _entraIdAccessTokenExpiry; + private readonly TokenCredential _tokenCredential; + private readonly JsonWebTokenHandler _jsonWebTokenHandler; + + public EntraLifecycle(TokenCredential? tokenCredential = null, JsonWebTokenHandler? jsonWebTokenHandler = null) + { + _tokenCredential = tokenCredential ?? new DefaultAzureCredential(); + _jsonWebTokenHandler = jsonWebTokenHandler ?? new JsonWebTokenHandler(); + SetEntraIdAccessTokenFromEnvironment(); + } + + internal async Task FetchEntraIdAccessTokenAsync(CancellationToken cancellationToken = default) + { + try + { + var tokenRequestContext = new TokenRequestContext(Constants.s_entra_access_token_scopes); + AccessToken accessToken = await _tokenCredential.GetTokenAsync(tokenRequestContext, cancellationToken).ConfigureAwait(false); + _entraIdAccessToken = accessToken.Token; + _entraIdAccessTokenExpiry = accessToken.ExpiresOn.ToUnixTimeSeconds(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, _entraIdAccessToken); + return true; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex); + return false; + } + } + + internal bool DoesEntraIdAccessTokenRequireRotation() + { + if (string.IsNullOrEmpty(_entraIdAccessToken)) + { + return true; + } + var lifetimeLeft = _entraIdAccessTokenExpiry - DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + return lifetimeLeft < Constants.s_entra_access_token_lifetime_left_threshold_in_minutes_for_rotation * 60; + } + + private void SetEntraIdAccessTokenFromEnvironment() + { + try + { + var token = Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken); + JsonWebToken jsonWebToken = _jsonWebTokenHandler.ReadJsonWebToken(token); + jsonWebToken.TryGetClaim( + "aid", + out System.Security.Claims.Claim? aidClaim + ); + jsonWebToken.TryGetClaim( + "accountId", + out System.Security.Claims.Claim? accountIdClaim + ); + if (aidClaim != null || accountIdClaim != null) + return; // MPT Token + var expiry = (long)(jsonWebToken.ValidTo - new DateTime(1970, 1, 1)).TotalSeconds; + _entraIdAccessToken = token; + _entraIdAccessTokenExpiry = expiry; + } + catch (Exception) + { + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/CIInfo.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/CIInfo.cs new file mode 100644 index 0000000000000..e44bdae81bafd --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/CIInfo.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; + +internal class CIInfo +{ + internal string? Provider { get; set; } + internal string? Repo { get; set; } + internal string? Branch { get; set; } + internal string? Author { get; set; } + internal string? CommitId { get; set; } + internal string? RevisionUrl { get; set; } + internal string? RunId { get; set; } + internal int? RunAttempt { get; set; } + internal string? JobId { get; set; } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/MPTResult.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/MPTResult.cs new file mode 100644 index 0000000000000..50006b0d55dc8 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/MPTResult.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; + +internal class RawTestStep +{ + internal string? Title { get; set; } + internal string? Category { get; set; } + internal string? StartTime { get; set; } + internal int Duration { get; set; } + internal string? Error { get; set; } + internal List Steps { get; set; } = new List(); + internal Location? Location { get; set; } + internal string? Snippet { get; set; } + internal int Count { get; set; } +} + +internal class Location +{ + internal int LineNumber { get; set; } +} + +internal class MPTError +{ + public string? message { get; set; } +} +internal class RawTestResult +{ + [JsonPropertyName("steps")] + public List Steps { get; set; } = new List(); + [JsonPropertyName("errors")] + public string errors { get; set; } = "[]"; + [JsonPropertyName("stdErr")] + public string stdErr { get; set; } = "[]"; + [JsonPropertyName("stdOut")] + public string stdOut { get; set; } = "[]"; +} + +internal class TokenDetails +{ + internal string? aid { get; set; } + internal string? oid { get; set; } + internal string? id { get; set; } + internal string? userName { get; set; } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/TestReporting.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/TestReporting.cs new file mode 100644 index 0000000000000..08cff08b222fa --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Model/TestReporting.cs @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; + +internal enum AccessLevel +{ + Read = 0, + Write = 1, + ReadWrite = 2, + ReadAddCreateWrite = 3, +} + +internal partial class CIConfig +{ + [JsonPropertyName("ciProviderName")] public string CiProviderName { get; set; } = ""; + + [JsonPropertyName("branch")] public string Branch { get; set; } = ""; + + [JsonPropertyName("author")] public string Author { get; set; } = ""; + + [JsonPropertyName("commitId")] public string CommitId { get; set; } = ""; + + [JsonPropertyName("revisionUrl")] public string RevisionUrl { get; set; } = ""; +} + +internal partial class ClientConfig +{ + [JsonPropertyName("retries")] + public int Retries { get; set; } + + [JsonPropertyName("repeatEach")] + public int RepeatEach { get; set; } + + [JsonPropertyName("workers")] + public int Workers { get; set; } + + [JsonPropertyName("pwVersion")] public string PwVersion { get; set; } = ""; + + [JsonPropertyName("testFramework")] + public TestFramework? TestFramework { get; set; } + + [JsonPropertyName("shards")] + public Shard? Shards { get; set; } + + [JsonPropertyName("timeout")] + public int Timeout { get; set; } + + [JsonPropertyName("testType")] public string TestType { get; set; } = ""; + + [JsonPropertyName("testSdkLanguage")] public string TestSdkLanguage { get; set; } = ""; + + [JsonPropertyName("reporterPackageVersion")] public string ReporterPackageVersion { get; set; } = ""; +} + +internal partial class PreviousRetrySummary +{ + [JsonPropertyName("testExecutionId")] public string TestExecutionId { get; set; } = ""; + + [JsonPropertyName("retry")] + public int Retry { get; set; } + + [JsonPropertyName("status")] public string Status { get; set; } = ""; + + [JsonPropertyName("duration")] public long Duration { get; set; } + + [JsonPropertyName("startTime")] public string StartTime { get; set; } = ""; + + [JsonPropertyName("attachmentsMetadata")] public string AttachmentsMetadata { get; set; } = ""; + + [JsonPropertyName("artifactsPath")] + public ICollection ArtifactsPath { get; set; } = new List(); +} + +internal partial class Shard +{ + [JsonPropertyName("total")] + public int Total { get; set; } + + [JsonPropertyName("current")] + public int Current { get; set; } +} + +internal partial class TestFramework +{ + [JsonPropertyName("name")] public string Name { get; set; } = ""; + + [JsonPropertyName("version")] public string Version { get; set; } = ""; + + [JsonPropertyName("runnerName")] public string RunnerName { get; set; } = ""; +} + +internal partial class TestResults +{ + [JsonPropertyName("testExecutionId")] public string TestExecutionId { get; set; } = ""; + + [JsonPropertyName("testId")] public string TestId { get; set; } = ""; + + [JsonPropertyName("testCombinationId")] public string TestCombinationId { get; set; } = ""; + + [JsonPropertyName("runId")] public string RunId { get; set; } = ""; + + [JsonPropertyName("accountId")] public string AccountId { get; set; } = ""; + + [JsonPropertyName("suiteId")] public string SuiteId { get; set; } = ""; + + [JsonPropertyName("testTitle")] public string TestTitle { get; set; } = ""; + + [JsonPropertyName("suiteTitle")] public string SuiteTitle { get; set; } = ""; + + [JsonPropertyName("fileName")] public string FileName { get; set; } = ""; + + [JsonPropertyName("lineNumber")] + public int LineNumber { get; set; } + + [JsonPropertyName("retry")] + public int Retry { get; set; } + + [JsonPropertyName("status")] public string Status { get; set; } = ""; + + [JsonPropertyName("webTestConfig")] + public WebTestConfig? WebTestConfig { get; set; } + + [JsonPropertyName("ciConfig")] + public CIConfig? CiConfig { get; set; } + + [JsonPropertyName("resultsSummary")] + public TestResultsSummary? ResultsSummary { get; set; } + + [JsonPropertyName("previousRetries")] + public ICollection PreviousRetries { get; set; } = new List(); + + [JsonPropertyName("tags")] + public ICollection Tags { get; set; } = new List(); + + [JsonPropertyName("annotations")] + public ICollection Annotations { get; set; } = new List(); + + [JsonPropertyName("artifactsPath")] + public ICollection ArtifactsPath { get; set; } = new List(); +} + +internal partial class TestResultsSummary +{ + [JsonPropertyName("status")] public string Status { get; set; } = ""; + + [JsonPropertyName("duration")] public long Duration { get; set; } + + [JsonPropertyName("startTime")] public string StartTime { get; set; } = ""; + + [JsonPropertyName("attachmentsMetadata")] public string AttachmentsMetadata { get; set; } = ""; +} + +internal partial class TestResultsUri +{ + [JsonPropertyName("uri")] public string Uri { get; set; } = ""; + + [JsonPropertyName("createdAt")] public string CreatedAt { get; set; } = ""; + + [JsonPropertyName("expiresAt")] public string ExpiresAt { get; set; } = ""; + + [JsonPropertyName("accessLevel")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public AccessLevel? AccessLevel { get; set; } +} + +internal partial class TestRunDtoV2 +{ + [JsonPropertyName("testRunId")] + public string TestRunId { get; set; } = ""; + + [JsonPropertyName("displayName")] + public string DisplayName { get; set; } = ""; + + [JsonPropertyName("startTime")] + public string StartTime { get; set; } = ""; + + [JsonPropertyName("creatorId")] + public string CreatorId { get; set; } = ""; + + [JsonPropertyName("creatorName")] + public string CreatorName { get; set; } = ""; + + [JsonPropertyName("summary")] + public TestRunSummary? Summary { get; set; } + + [JsonPropertyName("resultsSummary")] + public TestRunResultsSummary? ResultsSummary { get; set; } + + [JsonPropertyName("ciConfig")] + public CIConfig? CiConfig { get; set; } + + [JsonPropertyName("testRunConfig")] + public ClientConfig? TestRunConfig { get; set; } + + [JsonPropertyName("testResultsUri")] + public TestResultsUri? TestResultsUri { get; set; } + + [JsonPropertyName("cloudRunEnabled")] public string CloudRunEnabled { get; set; } = ""; + + [JsonPropertyName("cloudReportingEnabled")] public string CloudReportingEnabled { get; set; } = ""; +} + +internal partial class TestRunResultsSummary +{ + [JsonPropertyName("numTotalTests")] + public long NumTotalTests { get; set; } + + [JsonPropertyName("numPassedTests")] + public long NumPassedTests { get; set; } + + [JsonPropertyName("numFailedTests")] + public long NumFailedTests { get; set; } + + [JsonPropertyName("numSkippedTests")] + public long NumSkippedTests { get; set; } + + [JsonPropertyName("numFlakyTests")] + public long NumFlakyTests { get; set; } + + [JsonPropertyName("status")] + public string Status { get; set; } = ""; +} + +internal partial class TestRunShardDto +{ + [JsonPropertyName("uploadCompleted")] public string UploadCompleted { get; set; } = ""; + + [JsonPropertyName("summary")] + public TestRunShardSummary? Summary { get; set; } + + [JsonPropertyName("testRunConfig")] + public ClientConfig? TestRunConfig { get; set; } + + [JsonPropertyName("resultsSummary")] + public TestRunResultsSummary? ResultsSummary { get; set; } +} + +internal partial class TestRunShardSummary +{ + [JsonPropertyName("status")] public string Status { get; set; } = ""; + + [JsonPropertyName("startTime")] public string StartTime { get; set; } = ""; + + [JsonPropertyName("endTime")] public string EndTime { get; set; } = ""; + + [JsonPropertyName("errorMessages")] + public ICollection ErrorMessages { get; set; } = new List(); + + [JsonPropertyName("uploadMetadata")] + public UploadMetadata? UploadMetadata { get; set; } + + [JsonPropertyName("totalTime")] public long TotalTime { get; set; } +} + +internal partial class TestRunSummary +{ + [JsonPropertyName("status")] public string Status { get; set; } = ""; + + [JsonPropertyName("startTime")] public string StartTime { get; set; } = ""; + + [JsonPropertyName("endTime")] public string EndTime { get; set; } = ""; + + [JsonPropertyName("billableTime")] public long BillableTime { get; set; } + + [JsonPropertyName("totalTime")] public long TotalTime { get; set; } + + [JsonPropertyName("numBrowserSessions")] public long NumBrowserSessions { get; set; } + + [JsonPropertyName("jobs")] + public ICollection Jobs { get; set; } = new List(); + + [JsonPropertyName("projects")] + public ICollection Projects { get; set; } = new List(); + + [JsonPropertyName("tags")] + public ICollection Tags { get; set; } = new List(); + + [JsonPropertyName("errorMessages")] + public ICollection ErrorMessages { get; set; } = new List(); + + [JsonPropertyName("uploadMetadata")] + public UploadMetadata? UploadMetadata { get; set; } +} + +internal partial class UploadMetadata +{ + [JsonPropertyName("numTestResults")] public long NumTestResults { get; set; } + + [JsonPropertyName("numTotalAttachments")] public long NumTotalAttachments { get; set; } + + [JsonPropertyName("sizeTotalAttachments")] public long SizeTotalAttachments { get; set; } +} + +internal partial class UploadTestResultsRequest +{ + [JsonPropertyName("value")] + public ICollection Value { get; set; } = new List(); +} + +internal partial class WebTestConfig +{ + [JsonPropertyName("jobName")] public string JobName { get; set; } = ""; + + [JsonPropertyName("projectName")] public string ProjectName { get; set; } = ""; + + [JsonPropertyName("browserName")] public string BrowserName { get; set; } = ""; + + [JsonPropertyName("os")] public string Os { get; set; } = ""; +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightReporter.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightReporter.cs new file mode 100644 index 0000000000000..bccfa06325172 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightReporter.cs @@ -0,0 +1,760 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Storage.Blobs; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Client; +using Microsoft.IdentityModel.JsonWebTokens; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.IO; +using System.Text.Json; +using PlaywrightConstants = Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility.Constants; +using Azure.Core; +using Azure.Core.Serialization; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +[FriendlyName("ms-playwright-service")] +[ExtensionUri("logger://Microsoft/Playwright/ServiceLogger/v1")] +internal class PlaywrightReporter : ITestLoggerWithParameters +{ + private Dictionary? _parametersDictionary; + + private bool IsInitialized { get; set; } + + private HttpClient? _httpClient; + + private ReportingTestResultsClient? _reportingTestResultsClient; + private ReportingTestRunsClient? _reportingTestRunsClient; + + private static readonly JsonWebTokenHandler s_tokenHandler = new(); + + private readonly LogLevel _logLevel = LogLevel.Debug; + + internal static string EnableConsoleLog { get => Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_DEBUG) ?? "false"; set { } } + + internal string? PortalUrl { get; set; } + + internal static string? BaseUrl { get => Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_REPORTING_URL); private set { } } + + internal static string AccessToken { get => Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_ACCESS_TOKEN) ?? ""; set { } } + + internal string? WorkspaceId { get; set; } + + internal TokenDetails? TokenDetails { get; set; } + + internal CIInfo? CIInfo { get; set; } + + internal string? RunId { get; set; } + + internal DateTime TestRunStartTime { get; private set; } + + internal int TotalTestCount { get; private set; } + + internal int PassedTestCount { get; private set; } + + internal int FailedTestCount { get; private set; } + + internal int SkippedTestCount { get; private set; } + + internal TestRunDtoV2? TestRun { get; set; } + + internal TestRunShardDto? TestRunShard { get; set; } + + internal bool EnableGithubSummary { get; set; } = true; + internal bool EnableResultPublish { get; set; } = true; + + internal List TestResults = new(); + + internal ConcurrentDictionary RawTestResultsMap = new(); + + internal PlaywrightService? playwrightService; + private List informationalMessages = new(); + private List processedErrorMessageKeys = new(); + + public void Initialize(TestLoggerEvents events, Dictionary parameters) + { + ValidateArg.NotNull(events, nameof(events)); + _parametersDictionary = parameters; + Initialize(events, _parametersDictionary[DefaultLoggerParameterNames.TestRunDirectory]!); + } + + public void Initialize(TestLoggerEvents events, string testResultsDirPath) + { + ValidateArg.NotNull(events, nameof(events)); + ValidateArg.NotNullOrEmpty(testResultsDirPath, nameof(testResultsDirPath)); + + // Register for the events. + events.TestRunMessage += TestMessageHandler; + events.TestResult += TestResultHandler; + events.TestRunComplete += TestRunCompleteHandler; + events.TestRunStart += TestRunStartHandler; + } + + #region Event Handlers + + internal void TestRunStartHandler(object? sender, TestRunStartEventArgs e) + { + InitializePlaywrightReporter(e.TestRunCriteria.TestRunSettings!); + LogMessage("Test Run start Handler"); + if (!EnableResultPublish) + { + return; + } + if (!IsInitialized || _reportingTestResultsClient == null || _reportingTestRunsClient == null) + { + LogErrorMessage("Test Run setup issue exiting handler"); + return; + } + + var startTime = TestRunStartTime.ToString("yyyy-MM-ddTHH:mm:ssZ"); + LogMessage("Test Run start time: " + startTime); + var corelationId = Guid.NewGuid().ToString(); + var gitBasedRunName = ReporterUtils.GetRunName(CiInfoProvider.GetCIInfo()); + var runName = string.IsNullOrEmpty(gitBasedRunName) ? Guid.NewGuid().ToString() : gitBasedRunName; + var run = new TestRunDtoV2 + { + TestRunId = RunId!, + DisplayName = runName, + StartTime = startTime, + CreatorId = TokenDetails!.oid ?? "", + CreatorName = TokenDetails.userName ?? "", + //CloudRunEnabled = "false", + CloudReportingEnabled = "true", + Summary = new TestRunSummary + { + Status = "RUNNING", + StartTime = startTime, + //Projects = ["playwright-dotnet"], + //Tags = ["Nunit", "dotnet"], + //Jobs = ["playwright-dotnet"], + }, + CiConfig = new CIConfig // TODO fetch dynamically + { + Branch = CIInfo!.Branch ?? "", + Author = CIInfo.Author ?? "", + CommitId = CIInfo.CommitId ?? "", + RevisionUrl = CIInfo.RevisionUrl ?? "" + }, + TestRunConfig = new ClientConfig // TODO fetch some of these dynamically + { + Workers = 1, + PwVersion = "1.40", + Timeout = 60000, + TestType = "WebTest", + TestSdkLanguage = "Dotnet", + TestFramework = new TestFramework() { Name = "VSTest", RunnerName = "Nunit/MSTest", Version = "3.1" }, // TODO fetch runner name MSTest/Nunit + ReporterPackageVersion = "0.0.1-dotnet", + Shards = new Shard() { Current = 0, Total = 1 } + } + }; + var shard = new TestRunShardDto + { + UploadCompleted = "false", + Summary = new TestRunShardSummary + { + Status = "RUNNING", + StartTime = startTime, + }, + TestRunConfig = new ClientConfig // TODO fetch some of these dynamically + { + Workers = 1, + PwVersion = "1.40", + Timeout = 60000, + TestType = "Functional", + TestSdkLanguage = "dotnet", + TestFramework = new TestFramework() { Name = "VSTest", RunnerName = "Nunit", Version = "3.1" }, + ReporterPackageVersion = "0.0.1-dotnet", + Shards = new Shard() { Current = 0, Total = 1 }, + } + }; + var token = "Bearer " + AccessToken; + TestRunDtoV2? response = null; + try + { + Response apiResponse = _reportingTestRunsClient.PatchTestRunInfo(WorkspaceId, RunId, RequestContent.Create(run), "application/json", token, corelationId); + if (apiResponse.Content != null) + { + response = apiResponse.Content!.ToObject(new JsonObjectSerializer()); + } + } + catch (Exception ex) + { + Logger.Log(true, LogLevel.Error, ex.ToString()); + throw; + } + if (response != null) + { + TestRun = response; + + // Start shard + corelationId = Guid.NewGuid().ToString(); + TestRunShardDto? response1 = null; + try + { + Response apiResponse = _reportingTestRunsClient.PatchTestRunShardInfo(WorkspaceId, RunId, "1", RequestContent.Create(shard), "application/json", token, corelationId); + if (apiResponse.Content != null) + { + response1 = apiResponse.Content!.ToObject(new JsonObjectSerializer()); + } + } + catch (Exception ex) + { + Logger.Log(true, LogLevel.Error, ex.ToString()); + throw; + } + if (response1 != null) + { + TestRunShard = shard; // due to wrong response type TODO + } + else + { + Logger.Log(true, LogLevel.Error, "Run shard creation Failed"); + } + } + else + { + Logger.Log(true, LogLevel.Error, "Run creation Failed"); + } + LogMessage("Test Run start Handler completed"); + } + + internal void TestMessageHandler(object? sender, TestRunMessageEventArgs e) + { + LogMessage("Test Message Handler"); + ValidateArg.NotNull(sender, nameof(sender)); + ValidateArg.NotNull(e, nameof(e)); + LogMessage(e.Message); + } + + internal void TestResultHandler(object? sender, TestResultEventArgs e) + { + LogMessage("Test Result Handler"); + TestResults? testResult = GetTestCaseResultData(e.Result); + if (!EnableResultPublish) + { + return; + } + if (!IsInitialized || _reportingTestResultsClient == null || _reportingTestRunsClient == null) + { + LogErrorMessage("Test Run setup issue exiting handler"); + return; + } + // Set various counts (passed tests, failed tests, total tests) + if (testResult != null) + { + TotalTestCount++; + if (testResult.Status == "failed") + { + FailedTestCount++; + } + else if (testResult.Status == "passed") + { + PassedTestCount++; + } + else if (testResult.Status == "skipped") + { + SkippedTestCount++; + } + } + if (testResult != null) + { + TestResults.Add(testResult); + } + } + + internal void TestRunCompleteHandler(object? sender, TestRunCompleteEventArgs e) + { + LogMessage("Test Run End Handler"); + if (!EnableResultPublish) + { + UpdateTestRun(e); // will not publish results, but will print informational messages + return; + } + if (!IsInitialized || _reportingTestResultsClient == null || _reportingTestRunsClient == null || TestRun == null) + { + LogErrorMessage("Test Run setup issue exiting handler"); + EnableResultPublish = false; + UpdateTestRun(e); // will not publish results, but will print informational messages + return; + } + // Upload TestResults + var corelationId = Guid.NewGuid().ToString(); + var token = "Bearer " + AccessToken; + + var body = new UploadTestResultsRequest() { Value = TestResults }; + try + { + _reportingTestResultsClient.UploadBatchTestResults(WorkspaceId, RequestContent.Create(JsonSerializer.Serialize(body)), token, corelationId, null); + LogMessage("Test Result Uploaded"); + } + catch (Exception ex) + { + LogErrorMessage(ex.Message); + } + + corelationId = Guid.NewGuid().ToString(); + TestResultsUri? sasUri = null; + Response response = _reportingTestRunsClient.GetTestRunResultsUri(WorkspaceId, RunId, token, corelationId, null); + var serializer = new JsonObjectSerializer(); + if (response.Content != null) + { + sasUri = response.Content.ToObject(serializer); + } + if (sasUri != null && !string.IsNullOrEmpty(sasUri.Uri)) + { + LogMessage("Test Run Uri: " + sasUri.ToString()); + foreach (TestResults testResult in TestResults) + { + if (RawTestResultsMap.TryGetValue(testResult.TestExecutionId!, out RawTestResult? rawResult) && rawResult != null) + { + // Upload rawResult to blob storage using sasUri + var rawTestResultJson = JsonSerializer.Serialize(rawResult); + var filePath = $"{testResult.TestExecutionId}/rawTestResult.json"; + UploadBuffer(sasUri.Uri!, rawTestResultJson, filePath); + } + else + { + LogMessage("Couldnt find rawResult for Id: " + testResult.TestExecutionId); + } + } + } + else + { + LogMessage("MPT API error: failed to upload artifacts"); + } + LogMessage("Test Results uploaded"); + // Update TestRun with CLIENT_COMPLETE + if (UpdateTestRun(e) == false) + { + LogErrorMessage("Test Run setup issue, Failed to update TestRun"); + } + } + #endregion + + private bool UpdateTestRun(TestRunCompleteEventArgs e) + { + if (EnableResultPublish) + { + if (!IsInitialized || _reportingTestResultsClient == null || _reportingTestRunsClient == null || TestRun == null || TestRunShard == null) + { + // no-op + } + else + { + DateTime testRunStartedOn = DateTime.MinValue; + DateTime testRunEndedOn = DateTime.UtcNow; + long durationInMs = 0; + + var result = FailedTestCount > 0 ? "failed" : "passed"; + + if (e.ElapsedTimeInRunningTests != null) + { + testRunEndedOn = TestRunStartTime.Add(e.ElapsedTimeInRunningTests); + durationInMs = (long)e.ElapsedTimeInRunningTests.TotalMilliseconds; + } + + // Update Shard End + if (TestRunShard.Summary == null) + TestRunShard.Summary = new TestRunShardSummary(); + TestRunShard.Summary.Status = "CLIENT_COMPLETE"; + TestRunShard.Summary.StartTime = TestRunStartTime.ToString("yyyy-MM-ddTHH:mm:ssZ"); + TestRunShard.Summary.EndTime = testRunEndedOn.ToString("yyyy-MM-ddTHH:mm:ssZ"); + TestRunShard.Summary.TotalTime = durationInMs; + TestRunShard.Summary.UploadMetadata = new UploadMetadata() { NumTestResults = TotalTestCount, NumTotalAttachments = 0, SizeTotalAttachments = 0 }; + LogMessage("duration:" + durationInMs); + LogMessage("StartTime:" + TestRunShard.Summary.StartTime); + LogMessage("EndTime:" + TestRunShard.Summary.EndTime); + TestRunShard.ResultsSummary = new TestRunResultsSummary + { + NumTotalTests = TotalTestCount, + NumPassedTests = PassedTestCount, + NumFailedTests = FailedTestCount, + NumSkippedTests = SkippedTestCount, + NumFlakyTests = 0, // TODO: Implement flaky tests + Status = result + }; + TestRunShard.UploadCompleted = "true"; + var token = "Bearer " + AccessToken; + var corelationId = Guid.NewGuid().ToString(); + try + { + _reportingTestRunsClient.PatchTestRunShardInfo(WorkspaceId, RunId, "1", RequestContent.Create(TestRunShard), "application/json", token, corelationId); + } + catch (Exception ex) + { + LogErrorMessage("Test Run shard failed: " + ex.ToString()); + throw; + } + + LogMessage("TestRun Shard updated"); + playwrightService?.Cleanup(); + Console.WriteLine("Visit MPT Portal for Debugging: " + Uri.EscapeUriString(PortalUrl!)); + if (EnableGithubSummary) + GenerateMarkdownSummary(); + } + } + if (informationalMessages.Count > 0) + Console.WriteLine(); + int index = 1; + foreach (string message in informationalMessages) + { + Console.WriteLine($"{index}) {message}"); + } + return true; + } + + private TestResults GetTestCaseResultData(TestResult testResultSource) + { + if (testResultSource == null) + return new TestResults(); + + LogMessage(testResultSource.TestCase.DisplayName); + TestResults testCaseResultData = new() + { + ArtifactsPath = new List(), + + AccountId = WorkspaceId!, + RunId = RunId!, + TestExecutionId = GetExecutionId(testResultSource).ToString() + }; + testCaseResultData.TestCombinationId = testCaseResultData.TestExecutionId; // TODO check + testCaseResultData.TestId = testResultSource.TestCase.Id.ToString(); + testCaseResultData.TestTitle = testResultSource.TestCase.DisplayName; + var className = FetchTestClassName(testResultSource.TestCase.FullyQualifiedName); + testCaseResultData.SuiteTitle = className; + testCaseResultData.SuiteId = className; + testCaseResultData.FileName = FetchFileName(testResultSource.TestCase.Source); + testCaseResultData.LineNumber = testResultSource.TestCase.LineNumber; + testCaseResultData.Retry = 0; // TODO Retry and PreviousRetries + testCaseResultData.WebTestConfig = new WebTestConfig + { + JobName = CIInfo!.JobId ?? "", + //ProjectName = "playwright-dotnet", // TODO no project concept NA?? + //BrowserName = "chromium", // TODO check if possible to get from test + Os = GetCurrentOS(), + }; + //testCaseResultData.Annotations = ["windows"]; // TODO MSTest/Nunit annotation ?? + //testCaseResultData.Tags = ["windows"]; // TODO NA ?? + + TimeSpan duration = testResultSource.Duration; + testCaseResultData.ResultsSummary = new TestResultsSummary + { + Duration = (long)duration.TotalMilliseconds, // TODO fallback get from End-Start + StartTime = testResultSource.StartTime.UtcDateTime.ToString(), + Status = "inconclusive" + }; + TestOutcome outcome = testResultSource.Outcome; + switch (outcome) + { + case TestOutcome.Passed: + testCaseResultData.ResultsSummary.Status = "passed"; + testCaseResultData.Status = "passed"; + break; + case TestOutcome.Failed: + testCaseResultData.ResultsSummary.Status = "failed"; + testCaseResultData.Status = "failed"; + break; + case TestOutcome.Skipped: + testCaseResultData.ResultsSummary.Status = "skipped"; + testCaseResultData.Status = "skipped"; + break; + default: + testCaseResultData.ResultsSummary.Status = "inconclusive"; + testCaseResultData.Status = "inconclusive"; + break; + } + // errorMessage, Stacktrace + RawTestResult rawResult = GetRawResultObject(testResultSource); + RawTestResultsMap.TryAdd(testCaseResultData.TestExecutionId, rawResult); + + if (!string.IsNullOrEmpty(testResultSource.ErrorMessage)) + { + ProcessTestResultMessage(testResultSource.ErrorMessage); + // TODO send it in blob + } + if (!string.IsNullOrEmpty(testResultSource.ErrorStackTrace)) + { + ProcessTestResultMessage(testResultSource.ErrorStackTrace); + // TODO send it in blob + } + + // TODO ArtifactsPaths + return testCaseResultData; + } + + private void ProcessTestResultMessage(string? message) + { + if (string.IsNullOrEmpty(message)) + { + return; + } + foreach (TestResultError testResultErrorObj in TestResultErrorConstants.ErrorConstants) + { + if (processedErrorMessageKeys.Contains(testResultErrorObj.Key!)) + continue; + if (testResultErrorObj.Pattern.IsMatch(message)) + { + AddInformationalMessage(testResultErrorObj.Message!); + processedErrorMessageKeys.Add(testResultErrorObj.Key!); + } + } + } + + private TokenDetails ParseWorkspaceIdFromAccessToken(string accessToken) + { + TokenDetails tokenDetails = new(); + if (accessToken == null) + { + if (string.IsNullOrEmpty(accessToken)) + { + throw new ArgumentNullException("AccessToken is null or empty"); + } + } + try + { + JsonWebToken inputToken = (JsonWebToken)s_tokenHandler.ReadToken(accessToken); + var aid = inputToken.Claims.FirstOrDefault(c => c.Type == "aid")?.Value ?? string.Empty; + + if (!string.IsNullOrEmpty(aid)) // Custom Token + { + LogMessage("Custom Token parsing"); + tokenDetails.aid = aid; + tokenDetails.oid = inputToken.Claims.FirstOrDefault(c => c.Type == "oid")?.Value ?? string.Empty; + tokenDetails.id = inputToken.Claims.FirstOrDefault(c => c.Type == "id")?.Value ?? string.Empty; + tokenDetails.userName = inputToken.Claims.FirstOrDefault(c => c.Type == "name")?.Value ?? string.Empty; + } + else // Entra Token + { + LogMessage("Entra Token parsing"); + tokenDetails.aid = Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_WORKSPACE_ID) ?? string.Empty; + tokenDetails.oid = inputToken.Claims.FirstOrDefault(c => c.Type == "oid")?.Value ?? string.Empty; + tokenDetails.id = string.Empty; + tokenDetails.userName = inputToken.Claims.FirstOrDefault(c => c.Type == "name")?.Value ?? string.Empty; + // TODO add back suport for old claims https://devdiv.visualstudio.com/OnlineServices/_git/PlaywrightService?path=/src/Common/Authorization/JwtSecurityTokenValidator.cs&version=GBmain&line=200&lineEnd=200&lineStartColumn=30&lineEndColumn=52&lineStyle=plain&_a=contents + } + + return tokenDetails; + } + catch (Exception ex) + { + LogErrorMessage(ex.Message); + throw; + } + } + + private static Guid GetExecutionId(TestResult testResult) + { + TestProperty? executionIdProperty = testResult.Properties.FirstOrDefault( + property => property.Id.Equals(PlaywrightConstants.ExecutionIdPropertyIdentifier)); + + Guid executionId = Guid.Empty; + if (executionIdProperty != null) + executionId = testResult.GetPropertyValue(executionIdProperty, Guid.Empty); + + return executionId.Equals(Guid.Empty) ? Guid.NewGuid() : executionId; + } + + private static RawTestResult GetRawResultObject(TestResult testResultSource) + { + List errors = new();//[testResultSource.ErrorMessage]; + if (testResultSource.ErrorMessage != null) + errors.Add(new MPTError() { message = testResultSource.ErrorMessage }); + var rawTestResult = new RawTestResult + { + errors = JsonSerializer.Serialize(errors), + stdErr = testResultSource?.ErrorStackTrace ?? string.Empty + }; + return rawTestResult; + } + + private static string GetCloudFilePath(string uri, string fileRelativePath) + { + // Assuming Constants.SAS_URI_SEPARATOR is a static property or field in a class named Constants + // that holds the character used to split the URI and the SAS token. + string[] parts = uri.Split(new string[] { PlaywrightConstants.SASUriSeparator }, StringSplitOptions.None); + string containerUri = parts[0]; + string sasToken = parts.Length > 1 ? parts[1] : string.Empty; + + return $"{containerUri}/{fileRelativePath}?{sasToken}"; + } + + private void UploadBuffer(string uri, string buffer, string fileRelativePath) + { + string cloudFilePath = GetCloudFilePath(uri, fileRelativePath); + LogMessage(cloudFilePath); + LogMessage(buffer); + BlobClient blobClient = new(new Uri(cloudFilePath)); + byte[] bufferBytes = Encoding.UTF8.GetBytes(buffer); + blobClient.Upload(new BinaryData(bufferBytes), overwrite: true); + LogMessage($"Uploaded buffer to {fileRelativePath}"); + } + + private static string FetchTestClassName(string fullyQualifiedName) + { + string[] parts = fullyQualifiedName.Split('.'); + return string.Join(".", parts.Take(parts.Length - 1)); + } + + private static string FetchFileName(string fullFilePath) + { + char[] delimiters = { '\\', '/' }; + string[] parts = fullFilePath.Split(delimiters); + return parts.Last(); + } + + private static string GetCurrentOS() + { + PlatformID platform = Environment.OSVersion.Platform; + if (platform == PlatformID.Unix) + return "Linux"; + else if (platform == PlatformID.MacOSX) + return "MacOS"; + else + return "Windows"; + } + + private void LogMessage(string message) + { + bool enable = bool.TryParse(EnableConsoleLog, out enable) == true && enable; + Logger.Log(enable, _logLevel, message); + } + + private static void LogErrorMessage(string message) + { + Logger.Log(true, LogLevel.Error, message); + } + + private void InitializePlaywrightReporter(string xmlSettings) + { + if (IsInitialized) + { + return; + } + + Dictionary runParameters = XmlRunSettingsUtilities.GetTestRunParameters(xmlSettings); + runParameters.TryGetValue(RunSettingKey.RunId, out var runId); + // If run id is not provided and not set via env, try fetching it from CI info. + CIInfo = CiInfoProvider.GetCIInfo(); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_RUN_ID))) + { + if (string.IsNullOrEmpty(runId?.ToString())) + Environment.SetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_RUN_ID, ReporterUtils.GetRunId(CIInfo)); + else + Environment.SetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_RUN_ID, runId!.ToString()); + } + else + { + PlaywrightService.GetDefaultRunId(); // will not set run id if already present in the environment variable + } + + runParameters.TryGetValue(RunSettingKey.ServiceAuthType, out var serviceAuth); + runParameters.TryGetValue(RunSettingKey.AzureTokenCredentialType, out var azureTokenCredential); + runParameters.TryGetValue(RunSettingKey.ManagedIdentityClientId, out var managedIdentityClientId); + runParameters.TryGetValue(RunSettingKey.EnableGitHubSummary, out var enableGithubSummary); + runParameters.TryGetValue(RunSettingKey.EnableResultPublish, out var enableResultPublish); + string? enableGithubSummaryString = enableGithubSummary?.ToString(); + string? enableResultPublishString = enableResultPublish?.ToString(); + + EnableGithubSummary = string.IsNullOrEmpty(enableGithubSummaryString) || bool.Parse(enableGithubSummaryString!); + EnableResultPublish = string.IsNullOrEmpty(enableResultPublishString) || bool.Parse(enableResultPublishString!); + + PlaywrightServiceOptions? playwrightServiceSettings = null; + try + { + playwrightServiceSettings = new(runId: runId?.ToString(), serviceAuth: serviceAuth?.ToString(), azureTokenCredentialType: azureTokenCredential?.ToString(), managedIdentityClientId: managedIdentityClientId?.ToString()); + } + catch (Exception ex) + { + Console.Error.WriteLine("Failed to initialize PlaywrightServiceSettings: " + ex.Message); + Environment.Exit(1); + } + + // setup entra rotation handlers + playwrightService = new PlaywrightService(null, playwrightServiceSettings!.RunId, null, playwrightServiceSettings.ServiceAuth, null, playwrightServiceSettings.AzureTokenCredential); +#pragma warning disable AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extension method instead. + playwrightService.InitializeAsync().GetAwaiter().GetResult(); +#pragma warning restore AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extension method instead. + + RunId = Environment.GetEnvironmentVariable(PlaywrightConstants.PLAYWRIGHT_SERVICE_RUN_ID); + + try + { + ValidateArg.NotNullOrEmpty(BaseUrl, "Playwright Service URL"); + ValidateArg.NotNullOrEmpty(AccessToken, "Playwright Service Access Token"); + } + catch (Exception ex) + { + Console.Error.WriteLine("Missing values : " + ex.Message); + Environment.Exit(1); + } + + TotalTestCount = 0; + PassedTestCount = 0; + FailedTestCount = 0; + SkippedTestCount = 0; + + TestRunStartTime = DateTime.UtcNow; + TokenDetails = ParseWorkspaceIdFromAccessToken(AccessToken); + WorkspaceId = TokenDetails.aid; + LogMessage("RunId: " + RunId); + LogMessage("BaseUrl: " + BaseUrl); + LogMessage("Workspace Id: " + WorkspaceId); + + PortalUrl = PlaywrightConstants.PortalBaseUrl + WorkspaceId + PlaywrightConstants.ReportingRoute + RunId; + + _httpClient = new HttpClient(); + var baseUri = new Uri(BaseUrl!); + _reportingTestRunsClient = new ReportingTestRunsClient(baseUri); + _reportingTestResultsClient = new ReportingTestResultsClient(baseUri); + + IsInitialized = true; + + LogMessage("Playwright Service Reporter Intialized"); + } + + internal void GenerateMarkdownSummary() + { + if (CiInfoProvider.GetCIProvider() == PlaywrightConstants.GITHUB_ACTIONS) + { + string markdownContent = @$" +#### Results: + +![pass](https://img.shields.io/badge/status-passed-brightgreen) **Passed:** {TestRunShard!.ResultsSummary!.NumPassedTests} + +![fail](https://img.shields.io/badge/status-failed-red) **Failed:** {TestRunShard.ResultsSummary.NumFailedTests} + +![flaky](https://img.shields.io/badge/status-flaky-yellow) **Flaky:** {"0"} + +![skipped](https://img.shields.io/badge/status-skipped-lightgrey) **Skipped:** {TestRunShard.ResultsSummary.NumSkippedTests} + +#### For more details, visit the [service dashboard]({Uri.EscapeUriString(PortalUrl!)}). +"; + + string filePath = Environment.GetEnvironmentVariable("GITHUB_STEP_SUMMARY"); + try + { + File.WriteAllText(filePath, markdownContent); + } + catch (Exception ex) + { + LogErrorMessage($"Error writing Markdown summary: {ex}"); + } + } + } + + private void AddInformationalMessage(string message) + { + informationalMessages.Add(message); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightService.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightService.cs new file mode 100644 index 0000000000000..66e8c38668802 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightService.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility; +using Microsoft.IdentityModel.JsonWebTokens; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +/// +/// Sets up and manages the Playwright service. +/// +public class PlaywrightService +{ + /// + /// Gets or sets the default authentication mechanism. + /// + public string ServiceAuth { get; set; } = ServiceAuthType.EntraId; + /// + /// Gets or sets a flag indicating whether to use cloud-hosted browsers. + /// + public bool UseCloudHostedBrowsers { get; set; } = true; + /// + /// Gets or sets the rotation timer for the Playwright service. + /// + public Timer? RotationTimer { get; set; } + /// + /// Gets the service endpoint for the Playwright service. + /// + public static string? ServiceEndpoint => Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri); + + private readonly EntraLifecycle? _entraLifecycle; + private readonly JsonWebTokenHandler? _jsonWebTokenHandler; + + /// + /// Initializes a new instance of the class. + /// + /// + /// + public PlaywrightService(PlaywrightServiceOptions playwrightServiceOptions, TokenCredential? credential = null) : this( + os: playwrightServiceOptions.Os, + runId: playwrightServiceOptions.RunId, + exposeNetwork: playwrightServiceOptions.ExposeNetwork, + serviceAuth: playwrightServiceOptions.ServiceAuth, + useCloudHostedBrowsers: playwrightServiceOptions.UseCloudHostedBrowsers, + credential: credential ?? playwrightServiceOptions.AzureTokenCredential + ) + { + // No-op + } + + /// + /// Initializes a new instance of the class. + /// + /// The operating system. + /// The run ID. + /// The network exposure. + /// The service authentication mechanism. + /// Whether to use cloud-hosted browsers. + /// The token credential. + public PlaywrightService(OSPlatform? os = null, string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, bool? useCloudHostedBrowsers = null, TokenCredential? credential = null) + { + if (string.IsNullOrEmpty(ServiceEndpoint)) + return; + _entraLifecycle = new EntraLifecycle(tokenCredential: credential); + _jsonWebTokenHandler = new JsonWebTokenHandler(); + InitializePlaywrightServiceEnvironmentVariables(getServiceCompatibleOs(os), runId, exposeNetwork, serviceAuth, useCloudHostedBrowsers); + } + + internal PlaywrightService(OSPlatform? os = null, string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, bool? useCloudHostedBrowsers = null, EntraLifecycle? entraLifecycle = null, JsonWebTokenHandler? jsonWebTokenHandler = null, TokenCredential? credential = null) + { + if (string.IsNullOrEmpty(ServiceEndpoint)) + return; + _entraLifecycle = entraLifecycle ?? new EntraLifecycle(credential); + _jsonWebTokenHandler = jsonWebTokenHandler ?? new JsonWebTokenHandler(); + InitializePlaywrightServiceEnvironmentVariables(getServiceCompatibleOs(os), runId, exposeNetwork, serviceAuth, useCloudHostedBrowsers); + } + + /// + /// Gets the connect options for connecting to Playwright Service's cloud hosted browsers. + /// + /// The type of the connect options. + /// The operating system. + /// The run ID. + /// The network exposure. + /// Cancellation token. + /// The connect options. + public async Task> GetConnectOptionsAsync(OSPlatform? os = null, string? runId = null, string? exposeNetwork = null, CancellationToken cancellationToken = default) where T : class, new() + { + if (Environment.GetEnvironmentVariable(Constants.s_playwright_service_disable_scalable_execution_environment_variable) == "true") + throw new Exception(Constants.s_service_endpoint_removed_since_scalable_execution_disabled_error_message); + if (string.IsNullOrEmpty(ServiceEndpoint)) + throw new Exception(Constants.s_no_service_endpoint_error_message); + string _serviceOs = Uri.EscapeDataString(getServiceCompatibleOs(os) ?? Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs) ?? Constants.s_default_os); + string _runId = Uri.EscapeDataString(runId ?? Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId) ?? GetDefaultRunId()); + string _exposeNetwork = exposeNetwork ?? Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork) ?? Constants.s_default_expose_network; + + string wsEndpoint = $"{ServiceEndpoint}?os={_serviceOs}&runId={_runId}&api-version={Constants.s_api_version}"; + + // fetch Entra id access token if required + // 1. Entra id access token has been fetched once via global functions + // 2. Not close to expiry + if (!string.IsNullOrEmpty(_entraLifecycle!._entraIdAccessToken) && _entraLifecycle!.DoesEntraIdAccessTokenRequireRotation()) + { + _ = await _entraLifecycle.FetchEntraIdAccessTokenAsync(cancellationToken).ConfigureAwait(false); + } + if (string.IsNullOrEmpty(GetAuthToken())) + { + throw new Exception(Constants.s_no_auth_error); + } + + var browserConnectOptions = new BrowserConnectOptions + { + Timeout = 3 * 60 * 1000, + ExposeNetwork = _exposeNetwork, + Headers = new Dictionary + { + ["Authorization"] = $"Bearer {GetAuthToken()}" + } + }; + return new ConnectOptions + { + WsEndpoint = wsEndpoint, + Options = BrowserConnectOptionsConverter.Convert(browserConnectOptions) + }; + } + + /// + /// Initialises the resources used to setup entra id authentication. + /// + public async Task InitializeAsync(CancellationToken cancellationToken = default) + { + if (string.IsNullOrEmpty(ServiceEndpoint)) + return; + if (!UseCloudHostedBrowsers) + { + // Since playwright-dotnet checks PLAYWRIGHT_SERVICE_ACCESS_TOKEN and PLAYWRIGHT_SERVICE_URL to be set, remove PLAYWRIGHT_SERVICE_URL so that tests are run locally. + // If customers use GetConnectOptionsAsync, after setting disableScalableExecution, an error will be thrown. + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, null); + } + // If default auth mechanism is Access token and token is available in the environment variable, no need to setup rotation handler + if (ServiceAuth == ServiceAuthType.AccessToken && !string.IsNullOrEmpty(GetAuthToken())) + { + ValidateMptPAT(); + return; + } + var operationStatus = await _entraLifecycle!.FetchEntraIdAccessTokenAsync(cancellationToken).ConfigureAwait(false); + if (!operationStatus) + { + if (!string.IsNullOrEmpty(GetAuthToken())) + { + ValidateMptPAT(); // throws exception if token is invalid + } + return; // no need to setup rotation handler. If token is not available, it will fallback to local browser launch + } + + RotationTimer = new Timer(RotationHandlerAsync, null, TimeSpan.FromMinutes(Constants.s_entra_access_token_rotation_interval_period_in_minutes), TimeSpan.FromMinutes(Constants.s_entra_access_token_rotation_interval_period_in_minutes)); + } + + /// + /// Cleans up the resources used to setup entra id authentication. + /// + public void Cleanup() + { + RotationTimer?.Dispose(); + } + + internal async void RotationHandlerAsync(object? _) + { + if (_entraLifecycle!.DoesEntraIdAccessTokenRequireRotation()) + { + await _entraLifecycle.FetchEntraIdAccessTokenAsync().ConfigureAwait(false); + } + } + + private void InitializePlaywrightServiceEnvironmentVariables(string? os = null, string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, bool? useCloudHostedBrowsers = null) + { + if (!string.IsNullOrEmpty(serviceAuth)) + { + ServiceAuth = serviceAuth!; + } + if (useCloudHostedBrowsers != null) + { + UseCloudHostedBrowsers = (bool)useCloudHostedBrowsers; + if (!UseCloudHostedBrowsers) + Environment.SetEnvironmentVariable(Constants.s_playwright_service_disable_scalable_execution_environment_variable, "true"); + } + if (!string.IsNullOrEmpty(os)) + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs, os); + } + else + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs, Constants.s_default_os); + } + if (!string.IsNullOrEmpty(runId)) + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, runId); + } + else + { + GetDefaultRunId(); + } + if (!string.IsNullOrEmpty(exposeNetwork)) + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork, exposeNetwork); + } + else + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork, Constants.s_default_expose_network); + } + SetReportingUrlAndWorkspaceId(); + } + + internal static string GetDefaultRunId() + { + var runIdFromEnvironmentVariable = Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId); + if (!string.IsNullOrEmpty(runIdFromEnvironmentVariable)) + return runIdFromEnvironmentVariable!; + CIInfo ciInfo = CiInfoProvider.GetCIInfo(); + var runId = ReporterUtils.GetRunId(ciInfo); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, runId); + return runId; + } + + internal static void SetReportingUrlAndWorkspaceId() + { + Match match = Regex.Match(ServiceEndpoint, @"wss://(?[\w-]+)\.api\.(?playwright(?:-test|-int)?\.io|playwright\.microsoft\.com)/accounts/(?[\w-]+)/"); + if (!match.Success) + return; + var region = match.Groups["region"].Value; + var domain = match.Groups["domain"].Value; + var workspaceId = match.Groups["workspaceId"].Value; + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable))) + Environment.SetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable, $"https://{region}.reporting.api.{domain}"); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable))) + Environment.SetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable, $"{workspaceId}"); + } + + private static string? GetAuthToken() + { + return Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken); + } + + private void ValidateMptPAT() + { + try + { + string authToken = GetAuthToken()!; + JsonWebToken jsonWebToken = _jsonWebTokenHandler!.ReadJsonWebToken(authToken) ?? throw new Exception(Constants.s_invalid_mpt_pat_error); + var expiry = (long)(jsonWebToken.ValidTo - new DateTime(1970, 1, 1)).TotalSeconds; + if (expiry <= DateTimeOffset.UtcNow.ToUnixTimeSeconds()) + throw new Exception(Constants.s_expired_mpt_pat_error); + } + catch (Exception) + { + throw new Exception(Constants.s_invalid_mpt_pat_error); + } + } + + private string? getServiceCompatibleOs(OSPlatform? oSPlatform) + { + if (oSPlatform == null) + return null; + if (oSPlatform.Equals(OSPlatform.Linux)) + return ServiceOs.Linux; + if (oSPlatform.Equals(OSPlatform.Windows)) + return ServiceOs.Windows; + throw new ArgumentException(Constants.s_invalid_os_error); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightServiceOptions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightServiceOptions.cs new file mode 100644 index 0000000000000..cda80ce6fc29f --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightServiceOptions.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.InteropServices; +using Azure.Core; +using Azure.Identity; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger; + +/// +/// Options for the Playwright service. +/// +public class PlaywrightServiceOptions +{ + internal OSPlatform? Os { get; set; } + internal string? RunId { get; set; } + internal string? ExposeNetwork { get; set; } + internal string ServiceAuth { get; set; } + internal bool UseCloudHostedBrowsers { get; set; } + internal TokenCredential AzureTokenCredential { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// The operating system. + /// The run ID. + /// The network exposure. + /// The default authentication mechanism. + /// Whether to use cloud-hosted browsers. + /// The Azure token credential type. + /// The managed identity client ID. + public PlaywrightServiceOptions(OSPlatform? os = null, string? runId = null, string? exposeNetwork = null, string? serviceAuth = null, string? useCloudHostedBrowsers = null, string? azureTokenCredentialType = null, string? managedIdentityClientId = null) + { + Os = os; + RunId = runId; + ExposeNetwork = exposeNetwork; + ServiceAuth = serviceAuth ?? ServiceAuthType.EntraId; + UseCloudHostedBrowsers = string.IsNullOrEmpty(useCloudHostedBrowsers) || bool.Parse(useCloudHostedBrowsers!); + AzureTokenCredential = GetTokenCredential(azureTokenCredentialType, managedIdentityClientId); + Validate(); + } + + private void Validate() + { + if (Os != null && Os != OSPlatform.Linux && Os != OSPlatform.Windows) + { + throw new System.Exception($"Invalid value for {nameof(Os)}: {Os}. Supported values are {ServiceOs.Linux} and {ServiceOs.Windows}"); + } + if (!string.IsNullOrEmpty(ServiceAuth) && ServiceAuth != ServiceAuthType.EntraId && ServiceAuth != ServiceAuthType.AccessToken) + { + throw new System.Exception($"Invalid value for {nameof(ServiceAuth)}: {ServiceAuth}. Supported values are {ServiceAuthType.EntraId} and {ServiceAuthType.AccessToken}"); + } + } + + private static TokenCredential GetTokenCredential(string? azureTokenCredentialType, string? managedIdentityClientId) + { + if (string.IsNullOrEmpty(azureTokenCredentialType) && string.IsNullOrEmpty(managedIdentityClientId)) + return new DefaultAzureCredential(); + if (azureTokenCredentialType == AzureTokenCredentialType.ManagedIdentityCredential) + { + return new ManagedIdentityCredential(managedIdentityClientId); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.WorkloadIdentityCredential) + { + return new WorkloadIdentityCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.EnvironmentCredential) + { + return new EnvironmentCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.AzureCliCredential) + { + return new AzureCliCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.AzurePowerShellCredential) + { + return new AzurePowerShellCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.AzureDeveloperCliCredential) + { + return new AzureDeveloperCliCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.SharedTokenCacheCredential) + { + return new SharedTokenCacheCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.VisualStudioCredential) + { + return new VisualStudioCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.VisualStudioCodeCredential) + { + return new VisualStudioCodeCredential(); + } + else if (azureTokenCredentialType == AzureTokenCredentialType.InteractiveBrowserCredential) + { + return new InteractiveBrowserCredential(); + } + else + { + return new DefaultAzureCredential(new DefaultAzureCredentialOptions + { + ManagedIdentityClientId = managedIdentityClientId + }); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/CiInfoProvider.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/CiInfoProvider.cs new file mode 100644 index 0000000000000..97e332b625056 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/CiInfoProvider.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; +using System; +using PlaywrightConstants = Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility.Constants; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility; + +internal class CiInfoProvider +{ + private static bool IsGitHubActions() + { + return Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true"; + } + + private static bool IsAzureDevOps() + { + return Environment.GetEnvironmentVariable("AZURE_HTTP_USER_AGENT") != null && + Environment.GetEnvironmentVariable("TF_BUILD") != null; + } + + internal static string GetCIProvider() + { + if (IsGitHubActions()) + return PlaywrightConstants.GITHUB_ACTIONS; + else if (IsAzureDevOps()) + return PlaywrightConstants.AZURE_DEVOPS; + else + return PlaywrightConstants.DEFAULT; + } + + internal static CIInfo GetCIInfo() + { + string ciProvider = GetCIProvider(); + if (ciProvider == PlaywrightConstants.GITHUB_ACTIONS) + { + // Logic to get GitHub Actions CIInfo + return new CIInfo + { + Provider = PlaywrightConstants.GITHUB_ACTIONS, + Repo = Environment.GetEnvironmentVariable("GITHUB_REPOSITORY_ID"), + Branch = GetGHBranchName(), + Author = Environment.GetEnvironmentVariable("GITHUB_ACTOR"), + CommitId = Environment.GetEnvironmentVariable("GITHUB_SHA"), + RevisionUrl = Environment.GetEnvironmentVariable("GITHUB_SERVER_URL") != null + ? $"{Environment.GetEnvironmentVariable("GITHUB_SERVER_URL")}/{Environment.GetEnvironmentVariable("GITHUB_REPOSITORY")}/commit/{Environment.GetEnvironmentVariable("GITHUB_SHA")}" + : null, + RunId = Environment.GetEnvironmentVariable("GITHUB_RUN_ID"), + RunAttempt = Environment.GetEnvironmentVariable("GITHUB_RUN_ATTEMPT") != null + ? int.Parse(Environment.GetEnvironmentVariable("GITHUB_RUN_ATTEMPT")!) + : null, + JobId = Environment.GetEnvironmentVariable("GITHUB_JOB") + }; + } + else if (ciProvider == PlaywrightConstants.AZURE_DEVOPS) + { + // Logic to get Azure DevOps CIInfo + return new CIInfo + { + Provider = PlaywrightConstants.AZURE_DEVOPS, + Repo = Environment.GetEnvironmentVariable("BUILD_REPOSITORY_ID"), + Branch = Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"), + Author = Environment.GetEnvironmentVariable("BUILD_REQUESTEDFOR"), + CommitId = Environment.GetEnvironmentVariable("BUILD_SOURCEVERSION"), + RevisionUrl = Environment.GetEnvironmentVariable("SYSTEM_TEAMFOUNDATIONCOLLECTIONURI") != null + ? $"{Environment.GetEnvironmentVariable("SYSTEM_TEAMFOUNDATIONCOLLECTIONURI")}{Environment.GetEnvironmentVariable("SYSTEM_TEAMPROJECT")}/_git/{Environment.GetEnvironmentVariable("BUILD_REPOSITORY_NAME")}/commit/{Environment.GetEnvironmentVariable("BUILD_SOURCEVERSION")}" + : null, + RunId = GetADORunId(), + RunAttempt = Environment.GetEnvironmentVariable("RELEASE_ATTEMPTNUMBER") != null + ? int.Parse(Environment.GetEnvironmentVariable("RELEASE_ATTEMPTNUMBER")!) + : int.Parse(Environment.GetEnvironmentVariable("SYSTEM_JOBATTEMPT")!), + JobId = Environment.GetEnvironmentVariable("RELEASE_DEPLOYMENTID") ?? Environment.GetEnvironmentVariable("SYSTEM_JOBID") + }; + } + else + { + // Handle unsupported CI provider + return new CIInfo + { + Provider = PlaywrightConstants.DEFAULT, + Repo = Environment.GetEnvironmentVariable("REPO"), + Branch = Environment.GetEnvironmentVariable("BRANCH"), + Author = Environment.GetEnvironmentVariable("AUTHOR"), + CommitId = Environment.GetEnvironmentVariable("COMMIT_ID"), + RevisionUrl = Environment.GetEnvironmentVariable("REVISION_URL"), + RunId = Environment.GetEnvironmentVariable("RUN_ID"), + RunAttempt = Environment.GetEnvironmentVariable("RUN_ATTEMPT") != null + ? int.Parse(Environment.GetEnvironmentVariable("RUN_ATTEMPT")!) + : null, + JobId = Environment.GetEnvironmentVariable("JOB_ID") + }; + } + } + + private static string GetADORunId() + { + if (Environment.GetEnvironmentVariable("RELEASE_DEFINITIONID") != null && Environment.GetEnvironmentVariable("RELEASE_DEPLOYMENTID") != null) + return $"{Environment.GetEnvironmentVariable("RELEASE_DEFINITIONID")}-{Environment.GetEnvironmentVariable("RELEASE_DEPLOYMENTID")}"; + else + return $"{Environment.GetEnvironmentVariable("SYSTEM_DEFINITIONID")}-{Environment.GetEnvironmentVariable("SYSTEM_JOBID")}"; + } + + private static string GetGHBranchName() + { + if (Environment.GetEnvironmentVariable("GITHUB_EVENT_NAME") == "pull_request" || + Environment.GetEnvironmentVariable("GITHUB_EVENT_NAME") == "pull_request_target") + return Environment.GetEnvironmentVariable("GITHUB_HEAD_REF")!; + else + return Environment.GetEnvironmentVariable("GITHUB_REF_NAME")!; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Constants.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Constants.cs new file mode 100644 index 0000000000000..e04af7928a216 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Constants.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility; + +internal static class Constants +{ + /// + /// Property Id storing the ExecutionId. + /// + internal const string ExecutionIdPropertyIdentifier = "ExecutionId"; + + /// + /// Property Id storing the ParentExecutionId. + /// + internal const string ParentExecutionIdPropertyIdentifier = "ParentExecId"; + + /// + /// Property If storing the TestType. + /// + internal const string TestTypePropertyIdentifier = "TestType"; + + internal const string SASUriSeparator = "?"; + + internal const string PortalBaseUrl = "https://playwright.microsoft.com/workspaces/"; + + internal const string ReportingRoute = "/runs/"; + + internal const string ReportingAPIVersion_2024_04_30_preview = "2024-04-30-preview"; + + internal const string ReportingAPIVersion_2024_05_20_preview = "2024-05-20-preview"; + + internal const string PLAYWRIGHT_SERVICE_REPORTING_URL = "PLAYWRIGHT_SERVICE_REPORTING_URL"; + + internal const string PLAYWRIGHT_SERVICE_WORKSPACE_ID = "PLAYWRIGHT_SERVICE_WORKSPACE_ID"; + + internal const string PLAYWRIGHT_SERVICE_ACCESS_TOKEN = "PLAYWRIGHT_SERVICE_ACCESS_TOKEN"; + + internal const string PLAYWRIGHT_SERVICE_DEBUG = "PLAYWRIGHT_SERVICE_DEBUG"; + + internal const string PLAYWRIGHT_SERVICE_RUN_ID = "PLAYWRIGHT_SERVICE_RUN_ID"; + + internal const string GITHUB_ACTIONS = "GitHub Actions"; + internal const string AZURE_DEVOPS = "Azure DevOps"; + internal const string DEFAULT = "Default"; +} + +internal enum TestErrorType +{ + Scalable +} + +internal class TestResultError +{ + internal string? Key { get; set; } = string.Empty; + internal string? Message { get; set; } = string.Empty; + internal Regex Pattern { get; set; } = new Regex(string.Empty); + internal TestErrorType Type { get; set; } +} + +internal static class TestResultErrorConstants +{ + public static List ErrorConstants = new() + { + new TestResultError + { + Key = "Unauthorized_Scalable", + Message = "The authentication token provided is invalid. Please check the token and try again.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*401 Unauthorized)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "NoPermissionOnWorkspace_Scalable", + Message = @"You do not have the required permissions to run tests. This could be because: + + a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator. + b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal and login using the command 'az login --tenant '.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*403 Forbidden)(?=[\s\S]*CheckAccess API call with non successful response)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "InvalidWorkspace_Scalable", + Message = "The specified workspace does not exist. Please verify your workspace settings.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*403 Forbidden)(?=.*InvalidAccountOrSubscriptionState)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "AccessKeyBasedAuthNotSupported_Scalable", + Message = "Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*403 Forbidden)(?=.*AccessKeyBasedAuthNotSupported)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "ServiceUnavailable_Scalable", + Message = "The service is currently unavailable. Please check the service status and try again.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*503 Service Unavailable)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "GatewayTimeout_Scalable", + Message = "The request to the service timed out. Please try again later.", + Pattern = new Regex(@"(?=.*Microsoft\.Playwright\.PlaywrightException)(?=.*504 Gateway Timeout)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "QuotaLimitError_Scalable", + Message = "It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded.", + Pattern = new Regex(@"(Timeout .* exceeded)(?=[\s\S]*ws connecting)", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + }, + new TestResultError + { + Key = "BrowserConnectionError_Scalable", + Message = "The service is currently unavailable. Please try again after some time.", + Pattern = new Regex(@"Target page, context or browser has been closed", RegexOptions.IgnoreCase), + Type = TestErrorType.Scalable + } + }; +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Logger.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Logger.cs new file mode 100644 index 0000000000000..e01a38ca03960 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/Logger.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility; + +internal enum LogLevel +{ + Debug, + Info, + Warning, + Error +} + +internal static class Logger +{ + public static void Log(bool enableConsoleLog, LogLevel level, string message) + { + if (enableConsoleLog) + { + Console.WriteLine($"{DateTime.Now} [{level}]: {message}"); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/ReporterUtils.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/ReporterUtils.cs new file mode 100644 index 0000000000000..c25c8d466eb9d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Utility/ReporterUtils.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Model; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Utility +{ + internal class ReporterUtils + { + internal static string GetRunId(CIInfo cIInfo) + { + if (cIInfo.Provider == Constants.DEFAULT) + { + return Guid.NewGuid().ToString(); + } + var concatString = $"{cIInfo.Provider}-{cIInfo.Repo}-{cIInfo.RunId}-{cIInfo.RunAttempt}"; + return CalculateSha1Hash(concatString); + } + + internal static string CalculateSha1Hash(string input) + { + using (var sha1 = SHA1.Create()) + { + var hash = sha1.ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)); + return BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); + } + } + + internal static string GetRunName(CIInfo ciInfo) + { + string GIT_VERSION_COMMAND = "git --version"; + string GIT_REV_PARSE = "git rev-parse --is-inside-work-tree"; + string GIT_COMMIT_MESSAGE_COMMAND = "git log -1 --pretty=%B"; + + if (ciInfo.Provider == Constants.GITHUB_ACTIONS && + Environment.GetEnvironmentVariable("GITHUB_EVENT_NAME") == "pull_request") + { + var prNumber = Environment.GetEnvironmentVariable("GITHUB_REF_NAME")?.Split('/')[0]; + var repo = Environment.GetEnvironmentVariable("GITHUB_REPOSITORY"); + var prLink = $"{repo}/pull/{prNumber}"; + return $"PR# {prNumber} on Repo: {repo} ({prLink})"; + } + + try + { + string gitVersion = RunCommandAsync(GIT_VERSION_COMMAND).EnsureCompleted(); + if (string.IsNullOrEmpty(gitVersion)) + { + throw new Exception("Git is not installed on the machine"); + } + + string isInsideWorkTree = RunCommandAsync(GIT_REV_PARSE).EnsureCompleted(); + if (isInsideWorkTree.Trim() != "true") + { + throw new Exception("Not inside a git repository"); + } + + string gitCommitMessage = RunCommandAsync(GIT_COMMIT_MESSAGE_COMMAND).EnsureCompleted(); + return gitCommitMessage; + } + catch (Exception) + { + return string.Empty; + } + } + + internal static async Task RunCommandAsync(string command, bool async = false) + { + var processInfo = new ProcessStartInfo("cmd", $"/c {command}") + { + RedirectStandardOutput = true, + UseShellExecute = false, + CreateNoWindow = true + }; + + using (var process = new Process { StartInfo = processInfo }) + { + process.Start(); + string result; + if (async) + { + result = await process.StandardOutput.ReadToEndAsync().ConfigureAwait(false); + } + else + { + result = process.StandardOutput.ReadToEnd(); + } + process.WaitForExit(); + return result; + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests.csproj new file mode 100644 index 0000000000000..60229ecd863c2 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests.csproj @@ -0,0 +1,23 @@ + + + + enable + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/EntraLifecycleTests.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/EntraLifecycleTests.cs new file mode 100644 index 0000000000000..62930afb0fff2 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/EntraLifecycleTests.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Microsoft.IdentityModel.JsonWebTokens; +using Microsoft.IdentityModel.Tokens; +using Moq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +[TestFixture] +public class EntraLifecycleTests +{ + private static string GetToken(Dictionary claims, DateTime? expires = null) + { + var tokenHandler = new JsonWebTokenHandler(); + var token = tokenHandler.CreateToken(new SecurityTokenDescriptor + { + Claims = claims, + Expires = expires ?? DateTime.UtcNow.AddMinutes(10), + }); + return token!; + } + + [TearDown] + public void TearDown() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + } + + [Test] + public void Constructor_WhenAccessTokenEnvironmentIsNotSet_DoesNotInitializeEntraToken() + { + EntraLifecycle entraLifecycle = new(); + Assert.That(entraLifecycle._entraIdAccessToken, Is.Null); + } + + [Test] + public void Constructor_WhenAccessTokenEnvironmentIsSetButTokenIsNotValid_DoesNotInitializeEntraToken() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + EntraLifecycle entraLifecycle = new(); + Assert.That(entraLifecycle._entraIdAccessToken, Is.Null); + } + + [Test] + public void Constructor_WhenAccessTokenEnvironmentIsSetAndTokenIsMPTCustomToken_DoesNotInitializeEntraToken() + { + var token = GetToken(new Dictionary + { + {"aid", "account-id-guid"}, + }); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + EntraLifecycle entraLifecycle = new(); + Assert.That(entraLifecycle._entraIdAccessToken, Is.Null); + } + + [Test] + public void Constructor_WhenAccessTokenEnvironmentIsSetAndTokenIsMPTCustomTokenWithAccountIdClaim_DoesNotInitializeEntraToken() + { + var token = GetToken(new Dictionary + { + {"accountId", "account-id-guid"}, + }); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + EntraLifecycle entraLifecycle = new(); + Assert.That(entraLifecycle._entraIdAccessToken, Is.Null); + } + + [Test] + public void Constructor_WhenJWTValidationThrowsException_DoesNotInitializeEntraToken() + { + var token = GetToken(new Dictionary()); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var jsonWebTokenHandlerMock = new Mock(); + jsonWebTokenHandlerMock + .Setup(x => x.ReadJsonWebToken(token)) + .Throws(new Exception()); + EntraLifecycle entraLifecycle = new(jsonWebTokenHandler: jsonWebTokenHandlerMock.Object); + Assert.That(entraLifecycle._entraIdAccessToken, Is.Null); + } + + [Test] + public void Constructor_WhenAccessTokenEnvironmentIsSetAndValid_InitializeEntraToken() + { + DateTime expiry = DateTime.UtcNow.AddMinutes(10); + var token = GetToken(new Dictionary(), expiry); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + EntraLifecycle entraLifecycle = new(); + Assert.Multiple(() => + { + Assert.That(entraLifecycle._entraIdAccessToken, Is.EqualTo(token)); + Assert.That(entraLifecycle._entraIdAccessTokenExpiry, Is.EqualTo((long)(expiry - new DateTime(1970, 1, 1)).TotalSeconds)); + }); + } + + [Test] + public async Task FetchEntraIdAccessTokenAsync_WhenTokenIsFetched_SetsEnvironmentVariable() + { + var defaultAzureCredentialMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + EntraLifecycle entraLifecycle = new(defaultAzureCredentialMock.Object); + await entraLifecycle.FetchEntraIdAccessTokenAsync(); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken), Is.EqualTo(token)); + + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + } + + [Test] + public async Task FetchEntraIdAccessTokenAsync_WhenTokenIsFetched_SetsTokenAndExpiry() + { + var defaultAzureCredentialMock = new Mock(); + var token = "valid_token"; + DateTimeOffset expiry = DateTimeOffset.UtcNow.AddMinutes(10); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, expiry)); + EntraLifecycle entraLifecycle = new(defaultAzureCredentialMock.Object); + await entraLifecycle.FetchEntraIdAccessTokenAsync(); + Assert.That(entraLifecycle._entraIdAccessToken, Is.EqualTo(token)); + Assert.That(entraLifecycle._entraIdAccessTokenExpiry, Is.EqualTo((int)expiry.ToUnixTimeSeconds())); + + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + } + + [Test] + public async Task FetchEntraIdAccessTokenAsync_WhenTokenIsFetched_ReturnsTrue() + { + var defaultAzureCredentialMock = new Mock(); + var token = "valid_token"; + DateTimeOffset expiry = DateTimeOffset.UtcNow.AddMinutes(10); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, expiry)); + EntraLifecycle entraLifecycle = new(defaultAzureCredentialMock.Object); + Assert.That(await entraLifecycle.FetchEntraIdAccessTokenAsync(), Is.True); + + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + } + + [Test] + public async Task FetchEntraIdAccessTokenAsync_WhenThrowsError_ReturnsFalse() + { + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception("sample exception")); + EntraLifecycle entraLifecycle = new(defaultAzureCredentialMock.Object); + Assert.That(await entraLifecycle.FetchEntraIdAccessTokenAsync(), Is.False); + } + + [Test] + public void DoesEntraIdAccessTokenRequireRotation_WhenEntraIdAccessTokenIsEmpty_ReturnsTrue() + { + EntraLifecycle entraLifecycle = new() + { + _entraIdAccessToken = "" + }; + Assert.That(entraLifecycle.DoesEntraIdAccessTokenRequireRotation(), Is.True); + } + + [Test] + public void DoesEntraIdAccessTokenRequireRotation_WhenEntraIdAccessTokenIsNull_ReturnsTrue() + { + EntraLifecycle entraLifecycle = new() + { + _entraIdAccessToken = null + }; + Assert.That(entraLifecycle.DoesEntraIdAccessTokenRequireRotation(), Is.True); + } + + [Test] + public void DoesEntraIdAccessTokenRequireRotation_WhenTokenIsNotAboutToExpire_ReturnsFalse() + { + EntraLifecycle entraLifecycle = new() + { + _entraIdAccessToken = "valid_token", + _entraIdAccessTokenExpiry = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 1000 // more than threshold of 10 mins + }; + Assert.That(entraLifecycle.DoesEntraIdAccessTokenRequireRotation(), Is.False); + } + + [Test] + public void DoesEntraIdAccessTokenRequireRotation_WhenTokenIsAboutToExpire_ReturnsTrue() + { + EntraLifecycle entraLifecycle = new() + { + _entraIdAccessToken = "valid_token", + _entraIdAccessTokenExpiry = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 400 // less than threshold of 10 mins + }; + Assert.That(entraLifecycle.DoesEntraIdAccessTokenRequireRotation(), Is.True); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceClientTests.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceClientTests.cs new file mode 100644 index 0000000000000..a1896981a53c7 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceClientTests.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +public class PlaywrightServiceClientTests : RecordedTestBase +{ + private PlaywrightService? _playwrightService; + private static string Access_Token => Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken)!; + + public PlaywrightServiceClientTests(bool isAsync) : base(isAsync, RecordedTestMode.Live) { } + + [SetUp] + public async Task Setup() + { + var workspaceId = TestUtils.GetWorkspaceIdFromDashboardEndpoint(TestEnvironment.DashboardEndpoint); + var region = TestEnvironment.Region; + var serviceApiEndpoint = TestUtils.GetPlaywrightServiceAPIEndpoint(workspaceId, region); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, serviceApiEndpoint); + _playwrightService = new PlaywrightService(new PlaywrightServiceOptions(), credential: TestEnvironment.Credential); + await _playwrightService.InitializeAsync(); + } + + [TearDown] + public void Teardown() + { + _playwrightService?.Cleanup(); + } + + [Test] + [Category("Live")] + public async Task TestPlaywrightServiceConnection() + { + var workspaceId = TestUtils.GetWorkspaceIdFromDashboardEndpoint(TestEnvironment.DashboardEndpoint); + var region = TestEnvironment.Region; + var serviceApiEndpoint = TestUtils.GetPlaywrightServiceAPIEndpoint(workspaceId, region); + var client = new HttpClient(new HttpClientHandler + { + AllowAutoRedirect = false + }); + var request = new HttpRequestMessage(HttpMethod.Get, serviceApiEndpoint); + request.Headers.Add("Authorization", $"Bearer {Access_Token}"); + request.RequestUri = new Uri($"{request.RequestUri}?cap={{}}"); + HttpResponseMessage response = await client.SendAsync(request); + response.Headers.TryGetValues("Location", out System.Collections.Generic.IEnumerable? location); + Assert.AreEqual(302, (int)response.StatusCode); + Assert.IsTrue(location!.Any(url => url.Contains("browser.playwright.microsoft.com"))); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceOptionsTest.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceOptionsTest.cs new file mode 100644 index 0000000000000..be5afa3adc514 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceOptionsTest.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Identity; +using System; +using System.Runtime.InteropServices; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class PlaywrightServiceOptionsTest +{ + [Test] + public void Constructor_ShouldInitializeProperties() + { + var os = OSPlatform.Linux; + var runId = "test-run-id"; + var exposeNetwork = "true"; + var serviceAuth = ServiceAuthType.EntraId; + var useCloudHostedBrowsers = "true"; + var azureTokenCredentialType = AzureTokenCredentialType.ManagedIdentityCredential; + var managedIdentityClientId = "test-client-id"; + + var settings = new PlaywrightServiceOptions( + os, runId, exposeNetwork, serviceAuth, useCloudHostedBrowsers, azureTokenCredentialType, managedIdentityClientId); + + Assert.Multiple(() => + { + Assert.That(settings.Os, Is.EqualTo(os)); + Assert.That(settings.RunId, Is.EqualTo(runId)); + Assert.That(settings.ExposeNetwork, Is.EqualTo(exposeNetwork)); + Assert.That(settings.ServiceAuth, Is.EqualTo(serviceAuth)); + Assert.That(settings.UseCloudHostedBrowsers, Is.True); + Assert.That(settings.AzureTokenCredential, Is.InstanceOf()); + }); + } + + [Test] + public void Constructor_ShouldUseDefaultValues() + { + var settings = new PlaywrightServiceOptions(); + Assert.Multiple(() => + { + Assert.That(settings.Os, Is.Null); + Assert.That(settings.RunId, Is.Null); + Assert.That(settings.ExposeNetwork, Is.Null); + Assert.That(settings.ServiceAuth, Is.EqualTo(ServiceAuthType.EntraId)); + Assert.That(settings.UseCloudHostedBrowsers, Is.True); + Assert.That(settings.AzureTokenCredential, Is.InstanceOf()); + }); + } + + [Test] + public void Validate_ShouldThrowExceptionForInvalidOs() + { + Exception? ex = Assert.Throws(() => new PlaywrightServiceOptions(os: OSPlatform.Create("invalid"))); + Assert.That(ex!.Message, Does.Contain("Invalid value for Os")); + } + + [Test] + public void Validate_ShouldThrowExceptionForInvalidDefaultAuth() + { + var invalidAuth = "InvalidAuth"; + Exception? ex = Assert.Throws(() => new PlaywrightServiceOptions(serviceAuth: invalidAuth)); + Assert.That(ex!.Message, Does.Contain("Invalid value for ServiceAuth")); + } + + [TestCase("ManagedIdentityCredential", typeof(ManagedIdentityCredential))] + [TestCase("WorkloadIdentityCredential", typeof(WorkloadIdentityCredential))] + [TestCase("EnvironmentCredential", typeof(EnvironmentCredential))] + [TestCase("AzureCliCredential", typeof(AzureCliCredential))] + [TestCase("AzurePowerShellCredential", typeof(AzurePowerShellCredential))] + [TestCase("AzureDeveloperCliCredential", typeof(AzureDeveloperCliCredential))] + [TestCase("InteractiveBrowserCredential", typeof(InteractiveBrowserCredential))] + [TestCase("SharedTokenCacheCredential", typeof(SharedTokenCacheCredential))] + [TestCase("VisualStudioCredential", typeof(VisualStudioCredential))] + [TestCase("VisualStudioCodeCredential", typeof(VisualStudioCodeCredential))] + [TestCase("DefaultAzureCredential", typeof(DefaultAzureCredential))] + [TestCase("", typeof(DefaultAzureCredential))] + [TestCase(null, typeof(DefaultAzureCredential))] + public void GetTokenCredential_ShouldReturnCorrectCredential(string? credentialType, Type expectedType) + { + var settings = new PlaywrightServiceOptions(azureTokenCredentialType: credentialType); + Assert.That(settings.AzureTokenCredential, Is.InstanceOf(expectedType)); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTestEnvironment.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTestEnvironment.cs new file mode 100644 index 0000000000000..dbd0ca3ff17bd --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTestEnvironment.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +public class PlaywrightServiceTestEnvironment : TestEnvironment +{ + public string Region => GetRecordedVariable("PLAYWRIGHTTESTING_LOCATION"); + public string DashboardEndpoint => GetRecordedVariable("DASHBOARD_ENDPOINT"); +}; diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTests.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTests.cs new file mode 100644 index 0000000000000..8e1ab574e9804 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/PlaywrightServiceTests.cs @@ -0,0 +1,662 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Microsoft.IdentityModel.JsonWebTokens; +using Microsoft.IdentityModel.Tokens; +using Moq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class PlaywrightServiceTests +{ + private static string GetToken(Dictionary claims, DateTime? expires = null) + { + var tokenHandler = new JsonWebTokenHandler(); + var token = tokenHandler.CreateToken(new SecurityTokenDescriptor + { + Claims = claims, + Expires = expires ?? DateTime.UtcNow.AddMinutes(10), + }); + return token!; + } + + [SetUp] + public void Setup() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, "https://playwright.microsoft.com"); + } + [TearDown] + public void TearDown() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, null); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs, null); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, null); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork, null); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_disable_scalable_execution_environment_variable, null); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable, null); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable, null); + } + + [Test] + public void Constructor_NoConstructorParams_SetsEntraAuthMechanismAsDefault() + { + PlaywrightService service = new(entraLifecycle: null); + Assert.That(service.ServiceAuth, Is.EqualTo(ServiceAuthType.EntraId)); + } + + [Test] + public void Constructor_NoServiceParams_SetsDefaultValues() + { + var playwrightService = new PlaywrightService(entraLifecycle: null); + Assert.Multiple(() => + { + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs), Is.EqualTo(Constants.s_default_os)); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork), Is.EqualTo(Constants.s_default_expose_network)); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId), Is.Not.Null); + Assert.That(playwrightService.ServiceAuth, Is.EqualTo(ServiceAuthType.EntraId)); + Assert.That(playwrightService.UseCloudHostedBrowsers, Is.True); + }); + } + + [Test] + public void Constructor_PassServiceOS_SetsServiceOS() + { + _ = new PlaywrightService(os: OSPlatform.Windows, entraLifecycle: null); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs), Is.EqualTo(ServiceOs.Windows)); + } + + [Test] + public void Constructor_PassExposeNetwork_SetsExposeNetwork() + { + _ = new PlaywrightService(exposeNetwork: "new-expose", entraLifecycle: null); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork), Is.EqualTo("new-expose")); + } + + [Test] + public void Constructor_PassRunId_SetsRunId() + { + _ = new PlaywrightService(runId: "new-run-id", entraLifecycle: null); + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId), Is.EqualTo("new-run-id")); + } + + [Test] + public void Constructor_PassDefaultAuthMechanism_SetsDefaultAuthMechanism() + { + var playwrightService = new PlaywrightService(entraLifecycle: null, serviceAuth: ServiceAuthType.AccessToken); + Assert.That(playwrightService.ServiceAuth, Is.EqualTo(ServiceAuthType.AccessToken)); + } + + [Test] + public void Constructor_PassUseCloudHostedBrowsersAsFalse_SetsDisableScalableExecutionAndEnvVariable() + { + var playwrightService = new PlaywrightService(entraLifecycle: null, useCloudHostedBrowsers: false); + Assert.Multiple(() => + { + Assert.That(playwrightService.UseCloudHostedBrowsers, Is.False); + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_disable_scalable_execution_environment_variable), Is.EqualTo("true")); + }); + } + + [Test] + public void Constructor_PassUseCloudHostedBrowsersAsTrue_SetsDisableScalableExecutionButNotEnvVariable() + { + var playwrightService = new PlaywrightService(entraLifecycle: null, useCloudHostedBrowsers: true); + Assert.Multiple(() => + { + Assert.That(playwrightService.UseCloudHostedBrowsers, Is.True); + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_disable_scalable_execution_environment_variable), Is.Null); + }); + } + + [Test] + public void Initialize_WhenServiceEnpointIsNotSet_NoOP() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, null); + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Never); + } + + [Test] + public void Initialize_WhenDefaultAuthIsEntraIdAccessTokenAndAccessTokenEnvironmentVariableIsSet_FetchesEntraIdAccessToken() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "access_token"); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + + service.RotationTimer!.Dispose(); + + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri), Is.Not.Null); + } + + [Test] + public void Initialize_WhenDefaultAuthIsEntraIdAccessTokenAndAccessTokenEnvironmentVariableIsSetAndCredentialsArePassed_FetchesEntraIdAccessTokenUsedPassedCredentials() + { + var tokenCredential = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + tokenCredential + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "access_token"); + PlaywrightService service = new(new PlaywrightServiceOptions(), credential: tokenCredential.Object); + service.InitializeAsync().Wait(); + tokenCredential.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + + service.RotationTimer!.Dispose(); + + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri), Is.Not.Null); + } + + [Test] + public void Initialize_WhenDefaultAuthIsEntraIdAccessTokenAndAccessTokenEnvironmentVariableIsSetButScalableExecutionIsDisabled_DeletesServiceUrlEnvVariable() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "access_token"); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, useCloudHostedBrowsers: false); + + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri), Is.Not.Null); + + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + + service.RotationTimer!.Dispose(); + + Assert.That(Environment.GetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri), Is.Null); + } + + [Test] + public void Initialize_WhenDefaultAuthIsEntraIdAccessTokenAndAccessTokenEnvironmentVariableIsNotSet_FetchesEntraIdAccessToken() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + + service.RotationTimer!.Dispose(); + } + + [Test] + public void Initialize_WhenFetchesEntraIdAccessToken_SetsUpRotationHandler() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(10))); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + Assert.That(service.RotationTimer, Is.Not.Null); + + service.RotationTimer!.Dispose(); + } + + [Test] + public void Initialize_WhenFailsToFetchEntraIdAccessToken_DoesNotSetUpRotationHandler() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + service.InitializeAsync().Wait(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + Assert.That(service.RotationTimer, Is.Null); + } + + [Test] + public void Initialize_WhenEntraIdAccessTokenFailsAndMptPatIsSet_DoesNotSetUpRotationHandler() + { + var token = GetToken(new Dictionary + { + {"aid", "account-id-guid"}, + }); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: new JsonWebTokenHandler()); + service.InitializeAsync().Wait(); + Assert.That(service.RotationTimer, Is.Null); + } + + [Test] + public void Initialize_WhenEntraIdAccessTokenFailsAndMptPatIsNotSet_DoesNotSetUpRotationHandler() + { + var token = GetToken(new Dictionary + { + {"aid", "account-id-guid"}, + }); + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: new JsonWebTokenHandler()); + service.InitializeAsync().Wait(); + Assert.That(service.RotationTimer, Is.Null); + } + + [Test] + public void Initialize_WhenEntraIdAccessTokenFailsAndMptPatIsNotValid_ThrowsError() + { + var token = "sample token"; + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: new JsonWebTokenHandler()); + Assert.That(() => service.InitializeAsync().Wait(), Throws.Exception); + } + + [Test] + public void Initialize_WhenEntraIdAccessTokenFailsAndMptPatTokenParsingReturnsNull_ThrowsError() + { + var token = "sample token"; + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var jsonWebTokenHandlerMock = new Mock(); +#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. + jsonWebTokenHandlerMock + .Setup(x => x.ReadJsonWebToken(It.IsAny())) + .Returns(value: null); +#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: jsonWebTokenHandlerMock.Object); + Assert.That(() => service.InitializeAsync().Wait(), Throws.Exception); + } + + [Test] + public void Initialize_WhenEntraIdAccessTokenFailsAndMptPatIsExpired_ThrowsError() + { + var token = GetToken(new Dictionary + { + {"aid", "account-id-guid"}, + }, DateTime.UtcNow.AddMinutes(-1)); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ThrowsAsync(new Exception()); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: new JsonWebTokenHandler()); + + Assert.That(() => service.InitializeAsync().Wait(), Throws.Exception); + } + + [Test] + public void Initialize_WhenDefaultAuthIsMptPATAndPATIsSet_DoesNotSetUpRotationHandler() + { + var token = GetToken(new Dictionary + { + {"aid", "account-id-guid"}, + }); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, token); + var defaultAzureCredentialMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, new JsonWebTokenHandler()); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object, jsonWebTokenHandler: new JsonWebTokenHandler(), serviceAuth: ServiceAuthType.AccessToken); + service.InitializeAsync().Wait(); + Assert.That(service.RotationTimer, Is.Null); + } + + [Test] + public void RotationHandler_WhenEntraIdAccessTokenRequiresRotation_FetchesEntraIdAccessToken() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var token = "valid_token"; + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken(token, DateTimeOffset.UtcNow.AddMinutes(5))); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + + service.RotationHandlerAsync(null); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + } + + [Test] + public void RotationHandler_WhenEntraIdAccessTokenDoesNotRequireRotation_NoOp() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + + service.RotationHandlerAsync(null); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Never); + } + + [Test] + public void GetConnectOptionsAsync_WhenServiceEndpointIsNotSet_ThrowsException() + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, null); + PlaywrightService service = new(entraLifecycle: null); + Exception? ex = Assert.ThrowsAsync(() => service.GetConnectOptionsAsync()); + Assert.That(ex!.Message, Is.EqualTo(Constants.s_no_service_endpoint_error_message)); + } + + [Test] + public void GetConnectOptionsAsync_WhenUseCloudHostedBrowsersEnvironmentIsFalse_ThrowsException() + { + PlaywrightService service = new(entraLifecycle: null, useCloudHostedBrowsers: false); + Exception? ex = Assert.ThrowsAsync(() => service.GetConnectOptionsAsync()); + Assert.Multiple(() => + { + Assert.That(service.UseCloudHostedBrowsers, Is.False); + Assert.That(ex!.Message, Is.EqualTo(Constants.s_service_endpoint_removed_since_scalable_execution_disabled_error_message)); + }); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenServiceEndpointIsSet_ReturnsConnectOptions() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + var runId = "run-id"; + + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + ConnectOptions connectOptions = await service.GetConnectOptionsAsync(runId: runId); + var authorizationHeader = connectOptions.Options!.Headers!.Where(x => x.Key == "Authorization").FirstOrDefault().Value!; + Assert.Multiple(() => + { + Assert.That(connectOptions.WsEndpoint, Is.EqualTo($"https://playwright.microsoft.com?os={Constants.s_default_os}&runId={runId}&api-version={Constants.s_api_version}")); + Assert.That(connectOptions.Options!.Timeout, Is.EqualTo(3 * 60 * 1000)); + Assert.That(connectOptions.Options!.ExposeNetwork, Is.EqualTo(Constants.s_default_expose_network)); + Assert.That(authorizationHeader, Is.EqualTo("Bearer valid_token")); + }); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenTokenRequiresRotation_RotatesEntraToken() + { + var defaultAzureCredentialMock = new Mock(); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken("valid_token", DateTimeOffset.UtcNow.AddMinutes(5))); + var jsonWebTokenHandlerMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(-1).ToUnixTimeSeconds(); + + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + _ = await service.GetConnectOptionsAsync(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Once); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenTokenDoesNotRequireRotation_DoesNotRotateEntraToken() + { + var defaultAzureCredentialMock = new Mock(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + defaultAzureCredentialMock + .Setup(x => x.GetTokenAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AccessToken("valid_token", DateTimeOffset.UtcNow.AddMinutes(5))); + var jsonWebTokenHandlerMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + + PlaywrightService service = new(entraLifecycle: entraLifecycleMock.Object); + _ = await service.GetConnectOptionsAsync(); + defaultAzureCredentialMock.Verify(x => x.GetTokenAsync(It.IsAny(), It.IsAny()), Times.Never); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenDefaultParametersAreProvided_SetsServiceParameters() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object + ._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object + ._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + var runId = "run-id"; + + var service = new PlaywrightService(entraLifecycle: entraLifecycleMock.Object); + ConnectOptions connectOptions = await service.GetConnectOptionsAsync(runId: runId, os: OSPlatform.Windows, exposeNetwork: "localhost"); + + Assert.Multiple(() => + { + Assert.That(connectOptions.WsEndpoint, Is.EqualTo($"https://playwright.microsoft.com?os={ServiceOs.Windows}&runId={runId}&api-version={Constants.s_api_version}")); + Assert.That(connectOptions.Options!.ExposeNetwork, Is.EqualTo("localhost")); + }); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenDefaultParametersAreNotProvided_SetsDefaultServiceParameters() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object + ._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object + ._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + var runId = "run-id"; + + var service = new PlaywrightService(entraLifecycle: entraLifecycleMock.Object); + ConnectOptions connectOptions = await service.GetConnectOptionsAsync(runId: runId); + + Assert.Multiple(() => + { + Assert.That(connectOptions.WsEndpoint, Is.EqualTo($"https://playwright.microsoft.com?os={Constants.s_default_os}&runId={runId}&api-version={Constants.s_api_version}")); + Assert.That(connectOptions.Options!.ExposeNetwork, Is.EqualTo(Constants.s_default_expose_network)); + }); + } + + [Test] + public async Task GetConnectOptionsAsync_WhenServiceParametersAreSetViaEnvironment_SetsServiceParameters() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, "valid_token"); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + entraLifecycleMock.Object + ._entraIdAccessToken = "valid_token"; + entraLifecycleMock.Object + ._entraIdAccessTokenExpiry = (int)DateTimeOffset.UtcNow.AddMinutes(22).ToUnixTimeSeconds(); + var runId = "run-id"; + var service = new PlaywrightService(entraLifecycle: entraLifecycleMock.Object); + + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceOs, ServiceOs.Windows); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceExposeNetwork, "localhost"); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, runId); + + ConnectOptions connectOptions = await service.GetConnectOptionsAsync(); + Assert.Multiple(() => + { + Assert.That(connectOptions.WsEndpoint, Is.EqualTo($"https://playwright.microsoft.com?os={ServiceOs.Windows}&runId={runId}&api-version={Constants.s_api_version}")); + Assert.That(connectOptions.Options!.ExposeNetwork, Is.EqualTo("localhost")); + }); + } + + [Test] + public void GetConnectOptionsAsync_WhenNoAuthTokenIsSet_ThrowsException() + { + var defaultAzureCredentialMock = new Mock(); + var jsonWebTokenHandlerMock = new Mock(); + var entraLifecycleMock = new Mock(defaultAzureCredentialMock.Object, jsonWebTokenHandlerMock.Object); + var service = new PlaywrightService(entraLifecycle: entraLifecycleMock.Object); + + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceAccessToken, null); + + Exception? ex = Assert.ThrowsAsync(() => service.GetConnectOptionsAsync()); + Assert.That(ex!.Message, Is.EqualTo(Constants.s_no_auth_error)); + } + + [Test] + public void GetDefaultRunId_RunIdSetViaEnvironmentVariable_ReturnsRunId() + { + var runId = "run-id"; + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, runId); + Assert.Multiple(() => + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, null); + Assert.That(PlaywrightService.GetDefaultRunId(), Is.Not.Null); + }); + } + + [Test] + public void GetDefaultRunId_RunIdNotSetViaEnvironmentVariable_ReturnsRandomRunId() + { + Assert.Multiple(() => + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceRunId, null); + Assert.That(PlaywrightService.GetDefaultRunId(), Is.Not.Null); + }); + } + + [Test] + public void SetReportingUrlAndWorkspaceId_WhenServiceEndpointIsSet_SetsReportingUrlAndWorkspaceId() + { + var testRubricCombinations = new List>() + { + new() + { + { "url", "wss://eastus.api.playwright.microsoft.com/accounts/eastus_bd830e63-6120-40cb-8cd7-f0739502d888/browsers" }, + { "workspaceId", "eastus_bd830e63-6120-40cb-8cd7-f0739502d888" }, + { "region", "eastus" }, + { "domain", "playwright.microsoft.com" } + }, + new() + { + { "url", "wss://eastus.api.playwright.microsoft.com/accounts/77a38aac-4577-43a9-ac72-5720e5459c5a/browsers" }, + { "workspaceId", "77a38aac-4577-43a9-ac72-5720e5459c5a" }, + { "region", "eastus" }, + { "domain", "playwright.microsoft.com" } + }, + new() + { + { "url", "wss://westus3.api.playwright.microsoft.com/accounts/ad3cf59a-43e1-4dbe-af22-49bfe72b4178/browsers" }, + { "workspaceId", "ad3cf59a-43e1-4dbe-af22-49bfe72b4178" }, + { "region", "westus3" }, + { "domain", "playwright.microsoft.com" } + }, + new() + { + { "url", "wss://westus3.api.playwright-int.io/accounts/3c9ae1d4-e856-4ce0-8b56-1f4488676dff/browsers" }, + { "workspaceId", "3c9ae1d4-e856-4ce0-8b56-1f4488676dff" }, + { "region", "westus3" }, + { "domain", "playwright-int.io" } + }, + new() + { + { "url", "wss://eastasia.api.playwright-test.io/accounts/29abee44-a5f4-477e-9ff1-6c6786d09c7c/browsers" }, + { "workspaceId", "29abee44-a5f4-477e-9ff1-6c6786d09c7c" }, + { "region", "eastasia" }, + { "domain", "playwright-test.io" } + } + }; + + foreach (Dictionary testRubric in testRubricCombinations) + { + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, $"{testRubric["url"]}"); + var service = new PlaywrightService(entraLifecycle: null); + Assert.Multiple(() => + { + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable), Is.EqualTo($"https://{testRubric["region"]}.reporting.api.{testRubric["domain"]}")); + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable), Is.EqualTo(testRubric["workspaceId"])); + }); + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, null); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable, null); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable, null); + } + } + + [Test] + public void SetReportingUrlAndWorkspaceId_WhenReportingServiceEndpointIsSet_OnlySetsWorkspaceId() + { + var testRubric = new Dictionary + { + { "url", "wss://eastus.api.playwright.microsoft.com/accounts/eastus_bd830e63-6120-40cb-8cd7-f0739502d888/browsers" }, + { "workspaceId", "eastus_bd830e63-6120-40cb-8cd7-f0739502d888" }, + { "region", "eastus" }, + { "domain", "playwright.microsoft.com" } + }; + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, $"{testRubric["url"]}"); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable, "https://playwright.microsoft.com"); + var service = new PlaywrightService(entraLifecycle: null); + Assert.Multiple(() => + { + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable), Is.EqualTo("https://playwright.microsoft.com")); + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable), Is.EqualTo(testRubric["workspaceId"])); + }); + } + + [Test] + public void SetReportingUrlAndWorkspaceId_WhenReportingServiceEndpointAndWorkspaceIdIsSet_NoOp() + { + var testRubric = new Dictionary + { + { "url", "wss://eastus.api.playwright.microsoft.com/accounts/eastus_bd830e63-6120-40cb-8cd7-f0739502d888/browsers" }, + { "workspaceId", "eastus_bd830e63-6120-40cb-8cd7-f0739502d888" }, + { "region", "eastus" }, + { "domain", "playwright.microsoft.com" } + }; + Environment.SetEnvironmentVariable(ServiceEnvironmentVariable.PlaywrightServiceUri, $"{testRubric["url"]}"); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable, "https://playwright.microsoft.com"); + Environment.SetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable, "sample-id"); + var service = new PlaywrightService(entraLifecycle: null); + Assert.Multiple(() => + { + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_reporting_url_environment_variable), Is.EqualTo("https://playwright.microsoft.com")); + Assert.That(Environment.GetEnvironmentVariable(Constants.s_playwright_service_workspace_id_environment_variable), Is.EqualTo("sample-id")); + }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/TestUtils.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/TestUtils.cs new file mode 100644 index 0000000000000..52308c93a16cc --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/TestUtils.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.TestLogger.Tests; + +public class TestUtils +{ + public static string GetPlaywrightServiceAPIEndpoint(string workspaceId, string region) + { + return $"https://{region}.api.playwright.microsoft.com/accounts/{workspaceId}/browsers"; + } + + public static string GetWorkspaceIdFromDashboardEndpoint(string dashboardEndpoint) + { + var parts = dashboardEndpoint.Split('/'); + return parts.Last(); + } +} diff --git a/sdk/playwrighttesting/ci.yml b/sdk/playwrighttesting/ci.yml new file mode 100644 index 0000000000000..c36cc48c299de --- /dev/null +++ b/sdk/playwrighttesting/ci.yml @@ -0,0 +1,41 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ + exclude: + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ + exclude: + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: playwrighttesting + BuildSnippets: false + ArtifactName: packages + Artifacts: + - name: Azure.Developer.MicrosoftPlaywrightTesting.NUnit + safeName: AzureDeveloperMicrosoftPlaywrightTestingNUnit + - name: Azure.Developer.MicrosoftPlaywrightTesting.TestLogger + safeName: AzureDeveloperMicrosoftPlaywrightTesting.TestLogger + + + diff --git a/sdk/playwrighttesting/test-resources.json b/sdk/playwrighttesting/test-resources.json new file mode 100644 index 0000000000000..a1d088553b8da --- /dev/null +++ b/sdk/playwrighttesting/test-resources.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + } + }, + "resources": [ + { + "apiVersion": "2024-02-01-preview", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "type": "Microsoft.AzurePlaywrightService/accounts" + } + ], + "outputs": { + "DASHBOARD_ENDPOINT": { + "type": "string", + "value": "[reference(resourceId('Microsoft.AzurePlaywrightService/accounts', parameters('baseName'))).dashboardUri]" + } + } +} \ No newline at end of file diff --git a/sdk/playwrighttesting/tests.yml b/sdk/playwrighttesting/tests.yml new file mode 100644 index 0000000000000..2a730f27c3ea7 --- /dev/null +++ b/sdk/playwrighttesting/tests.yml @@ -0,0 +1,8 @@ +trigger: none + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: playwrighttesting + SupportedClouds: 'Public' + Location: 'westus3' \ No newline at end of file From 984ecd13958461598de9f98fcc6df3099677e825 Mon Sep 17 00:00:00 2001 From: Sean McCullough <44180881+seanmcc-msft@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:51:46 -0500 Subject: [PATCH 34/43] STG 96 beta changelogs (#46451) * STG 96 beta changelogs * PR comments --- sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Common/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md | 2 +- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index 64c9a4b2a297d..0455e2a2a46a2 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.20.0-beta.1 (Unreleased) +## 12.20.0-beta.1 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index 6fccde404a9b0..8f5f37076a8ed 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.0.0-preview.50 (Unreleased) +## 12.0.0-preview.50 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 2450bdef7e6cc..869dcec9ce7c3 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.23.0-beta.1 (Unreleased) +## 12.23.0-beta.1 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index aad2683bdfb5b..96585378eb5ba 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.22.0-beta.1 (Unreleased) +## 12.22.0-beta.1 (2024-10-08) ### Features Added - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index 33308a624cadd..ceacfe2622020 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.21.0-beta.1 (Unreleased) +## 12.21.0-beta.1 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 554b55af32ad5..74759a40cf07c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.21.0-beta.1 (Unreleased) +## 12.21.0-beta.1 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index dc6bb8705a693..2674322136ca7 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.21.0-beta.1 (Unreleased) +## 12.21.0-beta.1 (2024-10-08) ### Features Added - Added support for service version 2025-01-05. From e1469a2a969a4dd3e180053bf7a8ca37d2609852 Mon Sep 17 00:00:00 2001 From: wps0 <53907986+wps0@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:12:12 +0200 Subject: [PATCH 35/43] Azure.Monitor.Query: invalid date string format in MetricsClient (#45998) --- sdk/monitor/Azure.Monitor.Query/CHANGELOG.md | 1 + sdk/monitor/Azure.Monitor.Query/assets.json | 2 +- .../Azure.Monitor.Query/src/MetricsClient.cs | 4 +- .../src/MetricsClientExtensions.cs | 16 ++ .../src/MetricsQueryResourcesOptions.cs | 3 +- .../Azure.Monitor.Query/src/QueryTimeRange.cs | 18 +- .../tests/LogsQueryClientLiveTests.cs | 2 +- .../tests/MetricsClientLiveTests.cs | 177 ++++++++++++++++++ .../tests/MetricsQueryClientLiveTests.cs | 56 ------ sdk/monitor/test-resources.bicep | 28 ++- 10 files changed, 227 insertions(+), 80 deletions(-) create mode 100644 sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index 463fdcc858018..206c4a044a126 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fix bug in 'MetricsClient' QueryResourceAsync method where the 'QueryTimeRange' parameter was incorrectly set ### Other Changes diff --git a/sdk/monitor/Azure.Monitor.Query/assets.json b/sdk/monitor/Azure.Monitor.Query/assets.json index 49e865294c1b1..5f9a259c23f09 100644 --- a/sdk/monitor/Azure.Monitor.Query/assets.json +++ b/sdk/monitor/Azure.Monitor.Query/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/monitor/Azure.Monitor.Query", - "Tag": "net/monitor/Azure.Monitor.Query_2eaa6ed059" + "Tag": "net/monitor/Azure.Monitor.Query_26f5d5d32f" } diff --git a/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs b/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs index f2ee8d61861e1..21d346f9926d1 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs @@ -150,8 +150,8 @@ private async Task> ExecuteBatchAsync(IEnu { if (options.TimeRange != null) { - startTime = options.TimeRange.Value.Start.ToString(); - endTime = options.TimeRange.Value.End.ToString(); + startTime = options.TimeRange.Value.Start.ToIsoString(); + endTime = options.TimeRange.Value.End.ToIsoString(); } aggregations = MetricsClientExtensions.CommaJoin(options.Aggregations); top = options.Size; diff --git a/sdk/monitor/Azure.Monitor.Query/src/MetricsClientExtensions.cs b/sdk/monitor/Azure.Monitor.Query/src/MetricsClientExtensions.cs index 8fccf3d2448b4..036cde72ee82e 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/MetricsClientExtensions.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/MetricsClientExtensions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using Azure.Monitor.Query.Models; @@ -51,5 +52,20 @@ internal static IList CommaSplit(string value) => new List() : // TODO: #10600 - Verify we don't need to worry about escaping new List(value.Split(',')); + + internal static string ToIsoString(this DateTimeOffset value) + { + if (value.Offset == TimeSpan.Zero) + { + // Some Azure service required 0-offset dates to be formatted without the + // -00:00 part + const string roundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + return value.ToString(roundtripZFormat, CultureInfo.InvariantCulture); + } + + return value.ToString("O", CultureInfo.InvariantCulture); + } + + internal static string ToIsoString(this DateTimeOffset? value) => value?.ToIsoString(); } } diff --git a/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs b/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs index a55d310390c62..9c52dff5845f2 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs @@ -14,9 +14,10 @@ namespace Azure.Monitor.Query public class MetricsQueryResourcesOptions { /// - /// Gets or sets the timespan over which the metric will be queried. + /// Gets or sets the timespan over which the metric will be queried. If only the starttime is set, the endtime default becomes the current time. When the endtime is specified, the starttime is necessary as well. Duration is disregarded. /// [CodeGenMember("TimeSpan")] + // TODO: https://github.com/Azure/azure-sdk-for-net/issues/46454 public QueryTimeRange? TimeRange { get; set; } /// diff --git a/sdk/monitor/Azure.Monitor.Query/src/QueryTimeRange.cs b/sdk/monitor/Azure.Monitor.Query/src/QueryTimeRange.cs index b343b02c697d7..a5b2ee3cd7f04 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/QueryTimeRange.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/QueryTimeRange.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.Globalization; using System.Xml; using Azure.Core; @@ -105,21 +104,8 @@ public override string ToString() internal string ToIsoString() { - string ToString(DateTimeOffset value) - { - if (value.Offset == TimeSpan.Zero) - { - // Some Azure service required 0-offset dates to be formatted without the - // -00:00 part - const string roundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - return value.ToString(roundtripZFormat, CultureInfo.InvariantCulture); - } - - return value.ToString("O", CultureInfo.InvariantCulture); - } - - var startTime = Start != null ? ToString(Start.Value) : null; - var endTime = End != null ? ToString(End.Value) : null; + var startTime = Start.ToIsoString(); + var endTime = End.ToIsoString(); var duration = XmlConvert.ToString(Duration); switch (startTime, endTime, duration) diff --git a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientLiveTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientLiveTests.cs index 8d4ee53fae1cc..924268e841e34 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientLiveTests.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientLiveTests.cs @@ -707,7 +707,7 @@ public async Task CanSetServiceTimeout() // or a partial failure 200 response if (exception.Status == 200) { - StringAssert.Contains("Query cancelled by the user's request", exception.Message); + StringAssert.Contains("PartialError", exception.Message); } else { diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs new file mode 100644 index 0000000000000..41d8d8023450c --- /dev/null +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.Monitor.Query.Models; +using NUnit.Framework; + +namespace Azure.Monitor.Query.Tests +{ + public class MetricsClientLiveTests : RecordedTestBase + { + private MetricsTestData _testData; + + public MetricsClientLiveTests(bool isAsync) : base(isAsync) + { + } + + private MetricsClient CreateMetricsClient() + { + return InstrumentClient(new MetricsClient( + new Uri(TestEnvironment.ConstructMetricsClientUri()), + TestEnvironment.Credential, + InstrumentClientOptions(new MetricsClientOptions() + { + Audience = TestEnvironment.GetMetricsClientAudience() + }) + )); + } + + [SetUp] + public void SetUp() + { + _testData = new MetricsTestData(TestEnvironment, Recording.UtcNow); + } + + [RecordedTest] + public async Task MetricsQueryResourcesAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts").ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + for (int i = 0; i < metricsQueryResults.Values.Count; i++) + { + foreach (MetricResult value in metricsQueryResults.Values[i].Metrics) + { + for (int j = 0; j < value.TimeSeries.Count; j++) + { + Assert.GreaterOrEqual(value.TimeSeries[j].Values[i].Total, 0); + } + } + } + } + + [RecordedTest] + public async Task MetricsQueryResourcesWithStartEndTimeRangeAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + var timeRange = new QueryTimeRange( + start: Recording.UtcNow.Subtract(TimeSpan.FromHours(4)), + end: Recording.UtcNow + ); + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { TimeRange = timeRange} ).ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + } + + [RecordedTest] + public async Task MetricsQueryResourcesWithStartDurationTimeRangeAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + var timeRange = new QueryTimeRange( + start: Recording.UtcNow.Subtract(TimeSpan.FromHours(4)), + duration: TimeSpan.FromHours(4) + ); + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { TimeRange = timeRange }).ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + } + + [RecordedTest] + [SyncOnly] + public void MetricsQueryResourcesWithEndDurationTimeRange() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + var timeRange = new QueryTimeRange( + end: Recording.UtcNow, + duration: TimeSpan.FromHours(4) + ); + + Assert.Throws(() => + client.QueryResources( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { TimeRange = timeRange })); + } + + [RecordedTest] + public async Task MetricsQueryResourcesWithDurationTimeRangeAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + var timeRange = new QueryTimeRange( + duration: TimeSpan.FromHours(4) + ); + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { TimeRange = timeRange }).ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + } + + [Test] + [SyncOnly] + public void MetricsQueryResourcesInvalid() + { + MetricsClient client = CreateMetricsClient(); + + Assert.Throws(() => + client.QueryResources( + resourceIds: new List(), + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts")); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientLiveTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientLiveTests.cs index 6583b0916c7c6..e9b916b972fc6 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientLiveTests.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientLiveTests.cs @@ -4,13 +4,10 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Security.AccessControl; using System.Threading.Tasks; -using Azure.Core; using Azure.Core.TestFramework; using Azure.Monitor.Query.Models; using NUnit.Framework; -using NUnit.Framework.Internal.Commands; namespace Azure.Monitor.Query.Tests { @@ -34,18 +31,6 @@ private MetricsQueryClient CreateClient() )); } - private MetricsClient CreateMetricsClient() - { - return InstrumentClient(new MetricsClient( - new Uri(TestEnvironment.ConstructMetricsClientUri()), - TestEnvironment.Credential, - InstrumentClientOptions(new MetricsClientOptions() - { - Audience = TestEnvironment.GetMetricsClientAudience() - }) - )); - } - [SetUp] public void SetUp() { @@ -327,46 +312,5 @@ public async Task CanGetMetricByNameInvalid() Assert.Throws(() => { results.Value.GetMetricByName("Guinness"); }); } - - [RecordedTest] - public async Task MetricsQueryResourcesAsync() - { - MetricsClient client = CreateMetricsClient(); - - var resourceId = TestEnvironment.StorageAccountId; - - Response metricsResultsResponse = await client.QueryResourcesAsync( - resourceIds: new List { new ResourceIdentifier(resourceId) }, - metricNames: new List { "Ingress" }, - metricNamespace: "Microsoft.Storage/storageAccounts").ConfigureAwait(false); - - MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; - Assert.AreEqual(1, metricsQueryResults.Values.Count); - Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); - Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); - for (int i = 0; i < metricsQueryResults.Values.Count; i++) - { - foreach (MetricResult value in metricsQueryResults.Values[i].Metrics) - { - for (int j = 0; j < value.TimeSeries.Count; j++) - { - Assert.GreaterOrEqual(value.TimeSeries[j].Values[i].Total, 0); - } - } - } - } - - [Test] - [SyncOnly] - public void MetricsQueryResourcesInvalid() - { - MetricsClient client = CreateMetricsClient(); - - Assert.Throws(() => - client.QueryResources( - resourceIds: new List(), - metricNames: new List { "Ingress" }, - metricNamespace: "Microsoft.Storage/storageAccounts")); - } } } diff --git a/sdk/monitor/test-resources.bicep b/sdk/monitor/test-resources.bicep index e9c6f163fd1bc..7138a94aedfbb 100644 --- a/sdk/monitor/test-resources.bicep +++ b/sdk/monitor/test-resources.bicep @@ -5,9 +5,6 @@ param location string = resourceGroup().location @description('The client OID to grant access to test resources.') param testApplicationOid string -@description('Random string to generate storage account name.') -param utc string = utcNow() - @description('The base resource name.') param baseName string = resourceGroup().name @@ -276,11 +273,36 @@ resource dataCollectionEndpoint2 'Microsoft.Insights/dataCollectionEndpoints@202 } } +//STORAGE ACCOUNT FOR METRICSCLIENT +@description('The base resource name.') +param storageAccountName string = uniqueString(baseName, 'storage') +@description('The base resource name.') +param storageAccountsku string = 'Standard_LRS' +resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = { + name: storageAccountName + location: location + sku: { + name: storageAccountsku + } + kind: 'StorageV2' + tags: { + ObjectName: storageAccountName + } + properties: {} +} + // OUTPUT VALUES USED BY TEST ENVIRONMENT output LOGS_ENDPOINT string = 'https://api.loganalytics.io' output CONNECTION_STRING string = ApplicationInsightsResource1.properties.ConnectionString output WORKSPACE_ID string = LogAnalyticsWorkspace1.properties.customerId +output WORKSPACE_PRIMARY_RESOURCE_ID string = LogAnalyticsWorkspace1.id output SECONDARY_CONNECTION_STRING string = ApplicationInsightsResource2.properties.ConnectionString output SECONDARY_WORKSPACE_ID string = LogAnalyticsWorkspace2.properties.customerId +output WORKSPACE_SECONDARY_RESOURCE_ID string = LogAnalyticsWorkspace2.id + +output STORAGE_NAME string = storageAccount.name +output STORAGE_ID string = storageAccount.id +output METRICS_RESOURCE_ID string = LogAnalyticsWorkspace1.id +output METRICS_RESOURCE_NAMESPACE string = 'Microsoft.OperationalInsights/workspaces' From bdef6a681fff2f7334c18d4a15537b640ee09a53 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:59:29 -0700 Subject: [PATCH 36/43] Persist oidc env vars in deploy template (#46477) Co-authored-by: Ben Broderick Phillips --- .../TestResources/deploy-test-resources.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index a0fcc2e3178eb..6cd2a441e22a3 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -8,6 +8,7 @@ parameters: ServiceConnection: not-specified ResourceType: test UseFederatedAuth: false + PersistOidcToken: false # SubscriptionConfiguration will be splatted into the parameters of the test # resources script. It should be JSON in the form: @@ -41,12 +42,27 @@ steps: - template: /eng/common/TestResources/setup-environments.yml + - ${{ if parameters.PersistOidcToken }}: + - task: AzureCLI@2 + displayName: Set OIDC token + env: + ARM_OIDC_TOKEN: $(ARM_OIDC_TOKEN) + inputs: + azureSubscription: ${{ parameters.ServiceConnection }} + addSpnToEnvironment: true + scriptLocation: inlineScript + scriptType: pscore + inlineScript: | + Write-Host "##vso[task.setvariable variable=ARM_OIDC_TOKEN;issecret=true]$($env:idToken)" + - ${{ if eq('true', parameters.UseFederatedAuth) }}: - task: AzurePowerShell@5 displayName: 🚀 Deploy test resources env: TEMP: $(Agent.TempDirectory) PoolSubnet: $(PoolSubnet) + ${{ if parameters.PersistOidcToken }}: + ARM_OIDC_TOKEN: $(ARM_OIDC_TOKEN) ${{ insert }}: ${{ parameters.EnvVars }} inputs: azureSubscription: ${{ parameters.ServiceConnection }} From f892913097167fae6aa00db4c7abbef544ccdc79 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:30:38 -0700 Subject: [PATCH 37/43] Increment version for storage releases (#46479) * Increment package version after release of Azure.Storage.Common * Increment package version after release of Azure.Storage.Files.Shares * Increment package version after release of Azure.Storage.Blobs * Increment package version after release of Azure.Storage.Queues * Increment package version after release of Azure.Storage.Blobs.Batch * Increment package version after release of Azure.Storage.Files.DataLake * Increment package version after release of Azure.Storage.Blobs.ChangeFeed --- sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Blobs.Batch.csproj | 2 +- .../Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Blobs.ChangeFeed.csproj | 2 +- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 10 ++++++++++ .../Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj | 2 +- sdk/storage/Azure.Storage.Common/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Common.csproj | 2 +- sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Files.DataLake.csproj | 2 +- sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Files.Shares.csproj | 2 +- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Storage.Queues.csproj | 2 +- 14 files changed, 77 insertions(+), 7 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index 0455e2a2a46a2..2f2d8fda04ca8 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.20.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.20.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj index 9a47ac253891e..bf4d911c3150f 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.Batch client library - 12.20.0-beta.1 + 12.20.0-beta.2 12.19.0 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index 8f5f37076a8ed..937d64670a372 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.0.0-preview.51 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.0.0-preview.50 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj index f864439f2faed..c40a1339170f3 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.ChangeFeed client library - 12.0.0-preview.50 + 12.0.0-preview.51 ChangeFeedSDK;$(DefineConstants) Microsoft Azure Change Feed;Microsoft;Azure;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 869dcec9ce7c3..c2071820ccb16 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.23.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.23.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj index 605516dade231..3530fbd9b3164 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj +++ b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs client library - 12.23.0-beta.1 + 12.23.0-beta.2 12.22.1 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index 96585378eb5ba..09c2e22ddc345 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.22.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.22.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index 6e362e14456ec..cc765aa6c4189 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Common client library - 12.22.0-beta.1 + 12.22.0-beta.2 12.21.0 CommonSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index ceacfe2622020..10ab3fa71cd2e 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.21.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.21.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj index 3c551e05c24c2..d6433c9107d33 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.DataLake client library - 12.21.0-beta.1 + 12.21.0-beta.2 12.20.0 DataLakeSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 74759a40cf07c..f50c36c8c5b61 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.21.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.21.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj index 740160b155650..85fbb7d05a0aa 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.Shares client library - 12.21.0-beta.1 + 12.21.0-beta.2 12.20.0 FileSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index 2674322136ca7..aa42071b2ce8c 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 12.21.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 12.21.0-beta.1 (2024-10-08) ### Features Added diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index 4ab91b5fc19c3..de76bf98f1969 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Queues client library - 12.21.0-beta.1 + 12.21.0-beta.2 12.20.0 QueueSDK;$(DefineConstants) From ee9547d6279a2df0682bac6cc30756d3b59888a2 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:39:29 -0700 Subject: [PATCH 38/43] Increment package version after release of Azure.Messaging.ServiceBus (#46480) --- sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md | 10 ++++++++++ .../src/Azure.Messaging.ServiceBus.csproj | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md index 898f85384f2b0..d7c2d171aa613 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 7.19.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 7.18.2 (2024-10-08) ### Other Changes diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj index bb9433abd47ee..eed9d3b07c026 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj @@ -1,9 +1,9 @@ Azure Service Bus is a fully managed enterprise integration message broker. Service Bus can decouple applications and services. Service Bus offers a reliable and secure platform for asynchronous transfer of data and state. This client library allows for both sending and receiving messages using Azure Service Bus. For more information about Service Bus, see https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview - 7.18.2 + 7.19.0-beta.1 - 7.18.1 + 7.18.2 Azure;Service Bus;ServiceBus;.NET;AMQP;$(PackageCommonTags) $(RequiredTargetFrameworks) false From 7c8f16deec3a1150bfa04ec372d3abe5b238dd18 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Tue, 8 Oct 2024 13:53:56 -0700 Subject: [PATCH 39/43] [Event Hubs] Convert tests to use identity auth (#46330) * [Event Hubs] Convert tests to use identity auth The focus of these changes is to convert the Event Hubs live tests to use identity-based authorization by default. Connection strings will continue to have test coverage and appear in "Hello World" samples and in legacy samples for the migration guide. * Test fixes * Fixing more typos * Test debugging * tuning test timing and renabling cancellation check * tuning test timing * Extending test timing slightly * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Update sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> * Regenerating snippets --------- Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> --- .../README.md | 65 +- .../samples/Sample01_HelloWorld.md | 10 +- .../Sample02_EventProcessorConfiguration.md | 202 +++-- .../Sample03_EventProcessorHandlers.md | 158 ++-- .../samples/Sample04_ProcessingEvents.md | 114 ++- ...le05_IdentityAndSharedAccessCredentials.md | 34 +- ...mple06_RequestingStorageServiceVersions.md | 26 +- .../samples/Sample07_BatchProcessing.md | 26 +- .../EventProcessorClientLiveTests.cs | 154 ++-- .../MigrationGuideSnippetsLiveTests.cs | 35 +- .../tests/Snippets/ReadMeSnippetsLiveTests.cs | 98 ++- ...02_EventProcessorConfigurationLiveTests.cs | 311 ++++--- ...ample03_EventProcessorHandlersLiveTests.cs | 228 +++-- .../Sample04_ProcessingEventsLiveTests.cs | 119 ++- ...tityAndSharedAccessCredentialsLiveTests.cs | 14 +- ...questingStorageServiceVersionsLiveTests.cs | 30 +- .../Sample07_BatchProcessingLiveTests.cs | 37 +- .../MigrationGuide.md | 110 ++- .../MigrationGuide_WindowsAzureServiceBus.md | 45 +- .../Azure.Messaging.EventHubs/README.md | 41 +- .../TROUBLESHOOTING.md | 46 +- .../samples/README.md | 62 +- .../samples/Sample01_HelloWorld.md | 14 +- .../samples/Sample02_EventHubsClients.md | 76 +- .../samples/Sample03_EventHubMetadata.md | 29 +- .../samples/Sample04_PublishingEvents.md | 122 ++- .../samples/Sample05_ReadingEvents.md | 109 ++- ...le06_IdentityAndSharedAccessCredentials.md | 20 +- .../Sample07_EarlierLanguageVersions.md | 30 +- .../samples/Sample08_CustomEventProcessor.md | 30 +- .../samples/Sample09_ObservableEventBatch.md | 16 +- .../Sample10_AzureEventSourceListener.md | 42 +- .../samples/Sample11_MockingClientTypes.md | 8 +- .../Connection/EventHubConnectionLiveTests.cs | 79 +- .../EventHubConsumerClientLiveTests.cs | 495 +++++++---- .../Primitives/PartitionReceiverLiveTests.cs | 824 +++++++++++++----- ...EventHubBufferedProducerClientLiveTests.cs | 113 ++- .../EventHubProducerClientLiveTests.cs | 181 ++-- .../Producer/IdempotentPublishingLiveTests.cs | 198 +++-- .../tests/Snippets/ReadMeSnippetsLiveTests.cs | 2 +- .../Snippets/Sample01_HelloWorldLiveTests.cs | 16 +- .../Sample02_EventHubsClientsLiveTests.cs | 75 +- .../Sample03_EventHubMetadataLiveTests.cs | 35 +- .../Sample04_PublishingEventsLiveTests.cs | 135 ++- .../Sample05_ReadingEventsLiveTests.cs | 116 ++- ...mple07_EarlierLanguageVersionsLiveTests.cs | 23 +- .../Sample08_CustomEventProcessorLiveTests.cs | 30 +- .../Sample09_ObservableEventBatchLiveTests.cs | 23 +- .../Sample10_AzureEventSourceListenerTests.cs | 50 +- .../tests/Snippets/SamplesCommonTests.cs | 8 +- 50 files changed, 3247 insertions(+), 1617 deletions(-) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md index 6e8a98dfd82ce..249e00b104542 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md @@ -120,10 +120,12 @@ var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubs In order to use the `EventProcessorClient`, handlers for event processing and errors must be provided. These handlers are considered self-contained and developers are responsible for ensuring that exceptions within the handler code are accounted for. ```C# Snippet:EventHubs_Processor_ReadMe_ConfigureHandlers -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -157,8 +159,23 @@ async Task processErrorHandler(ProcessErrorEventArgs eventArgs) } } -var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); -var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubsConnectionString, eventHubName); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + +var processor = new EventProcessorClient +( + storageClient, + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential +); processor.ProcessEventAsync += processEventHandler; processor.ProcessErrorAsync += processErrorHandler; @@ -172,18 +189,35 @@ The `EventProcessorClient` will perform its processing in the background once it var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(TimeSpan.FromSeconds(45)); -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; Task processEventHandler(ProcessEventArgs eventArgs) => Task.CompletedTask; Task processErrorHandler(ProcessErrorEventArgs eventArgs) => Task.CompletedTask; -var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); -var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubsConnectionString, eventHubName); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + +var processor = new EventProcessorClient +( + storageClient, + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential +); processor.ProcessEventAsync += processEventHandler; processor.ProcessErrorAsync += processErrorHandler; @@ -225,13 +259,22 @@ To make use of an Active Directory principal with Azure Storage blob containers, ```C# Snippet:EventHubs_Processor_ReadMe_CreateWithIdentity var credential = new DefaultAzureCredential(); -var blobStorageUrl ="<< FULLY-QUALIFIED CONTAINER URL (like https://myaccount.blob.core.windows.net/mycontainer) >>"; -var fullyQualifiedNamespace = "<< FULLY-QUALIFIED EVENT HUBS NAMESPACE (like something.servicebus.windows.net) >>"; +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; +var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; + +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; -var storageClient = new BlobContainerClient(new Uri(blobStorageUrl), credential); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient ( diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md index e4333c783818d..d53cb5b428352 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md @@ -12,13 +12,13 @@ To begin, please ensure that you're familiar with the items discussed in the [Ge ## Client lifetime -Each of the Event Hubs client types is safe to cache and use for the lifetime of the application, which is best practice when the application publishes or reads events regularly or semi-regularly. The clients are responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. +Each of the Event Hubs client types is safe to cache and use for the lifetime of the application, which is best practice when the application publishes or reads events regularly or semi-regularly. The clients are responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. For the `EventProcessorClient`, calling the `StopProcessingAsync` method when your application is closing will ensure that network resources and other unmanaged objects are cleaned up. Calling either the `CloseAsync` or `DisposeAsync` method on the `EventHubProducerClient` will perform the equivalent clean-up. ## Publish events -To publish events, we will make use of the `EventHubsProducerClient`. Because this is the only area of our sample that will be publishing events, we will close the client once publishing has completed. In the majority of real-world scenarios, closing the producer when the application exits is the preferred pattern. +To publish events, we will make use of the `EventHubsProducerClient`. Because this is the only area of our sample that will be publishing events, we will close the client once publishing has completed. In the majority of real-world scenarios, closing the producer when the application exits is the preferred pattern. So that we have something to process, our example will publish a full batch of events. The `EventHubDataBatch` exists to ensure that a set of events can safely be published without exceeding the size allowed by the Event Hub. The `EventDataBatch` queries the service to understand the maximum size and is responsible for accurately measuring each event as it is added to the batch. When its `TryAdd` method returns `false`, the event is too large to fit into the batch. @@ -74,9 +74,9 @@ finally Now that the events have been published, we'll process them using the `EventProcessorClient`. It's important to note that because events are not removed when reading, you are likely to see events that had been previously published as well as those from the batch that we just sent, if you're using an existing Event Hub. -The `EventProcessorClient` is associated with a specific Event Hub and [consumer group](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it. The default group, named "$Default", is what we'll be using for illustration. +The `EventProcessorClient` is associated with a specific Event Hub and [consumer group](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it. The default group, named "$Default", is what we'll be using for illustration. -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://docs.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. Each `EventProcessorClient` has its own full view of the events each partition of an Event Hub, meaning that events are available to all processors and are not removed from the partition when a processor reads them. This allows for one or more of the different Event Hub clients to read and process events from the partition at different speeds and beginning with different events without interfering with one another. @@ -218,4 +218,4 @@ finally processor.ProcessEventAsync -= processEventHandler; processor.ProcessErrorAsync -= processErrorHandler; } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md index fdb831d8d6d3e..c4c30bb327496 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md @@ -34,13 +34,13 @@ As part of its normal operation, an `EventProcessorClient` needs to enumerate th ## Controlling processor identity -When constructing an `EventProcessorClient`, it is recommended that you set a stable unique identifier for the instance. This can be done by setting the [Identifier](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.identifier?view=azure-dotnet#azure-messaging-eventhubs-eventprocessorclientoptions-identifier) property of [EventProcessorClientOptions](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions) and passing the options to the constructor. +When constructing an `EventProcessorClient`, it is recommended that you set a stable unique identifier for the instance. This can be done by setting the [Identifier](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.identifier?view=azure-dotnet#azure-messaging-eventhubs-eventprocessorclientoptions-identifier) property of [EventProcessorClientOptions](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions) and passing the options to the constructor. A stable identifier allows the processor to recover partition ownership when an application or host instance is restarted. It also aids readability in Azure SDK logs and allows for more easily correlating logs to a specific processor instance. ## Influencing load balancing behavior -To scale event processing, you can run multiple instances of the `EventProcessorClient` and they will coordinate to balance work between them. The responsibility for processing is distributed among each of the active processors configured to read from the same Event Hub and using the same consumer group. To balance work, each active `EventProcessorClient` instance will assume responsibility for processing a set of Event Hub partitions, referred to as "owning" the partitions. The processors collaborate on ownership using storage as a central point of coordination. +To scale event processing, you can run multiple instances of the `EventProcessorClient` and they will coordinate to balance work between them. The responsibility for processing is distributed among each of the active processors configured to read from the same Event Hub and using the same consumer group. To balance work, each active `EventProcessorClient` instance will assume responsibility for processing a set of Event Hub partitions, referred to as "owning" the partitions. The processors collaborate on ownership using storage as a central point of coordination. While an `EventProcessorClient` is running, it will periodically perform a load balancing cycle in which it audits its own health and inspects the current state of collaboration with other processors. As part of that cycle, it will refresh the timestamp on an ownership record for each partition that it owns. These ownership records help to ensure that each `EventProcessorClient` understands how to maintain its fair share of partitions. @@ -48,13 +48,15 @@ There are several configuration options that can be used together to influence t ### Load balancing strategy -This controls the approach that the `EventProcessorClient` will use to make decisions about how aggressively to request partition ownership; this is most impactful during the initial startup or when recovering from a crash. More information on the strategies available can be found in the [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy). +This controls the approach that the `EventProcessorClient` will use to make decisions about how aggressively to request partition ownership; this is most impactful during the initial startup or when recovering from a crash. More information on the strategies available can be found in the [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy). ```C# Snippet:EventHubs_Processor_Sample02_LoadBalancingStrategy -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -63,29 +65,37 @@ var processorOptions = new EventProcessorClientOptions LoadBalancingStrategy = LoadBalancingStrategy.Greedy }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` ### Load balancing intervals -There are two intervals considered during load balancing which can influence its behavior. The `LoadBalancingUpdateInterval` controls how frequently a load balancing cycle is run. During the load balancing cycle, the `EventProcessorClient` will attempt to refresh its ownership record for each partition that it owns. The `PartitionOwnershipExpirationInterval` controls how long an ownership record is considered valid. If the processor does not update an ownership record before this interval elapses, the partition represented by this record is considered unowned and is eligible to be claimed by another processor. +There are two intervals considered during load balancing which can influence its behavior. The `LoadBalancingUpdateInterval` controls how frequently a load balancing cycle is run. During the load balancing cycle, the `EventProcessorClient` will attempt to refresh its ownership record for each partition that it owns. The `PartitionOwnershipExpirationInterval` controls how long an ownership record is considered valid. If the processor does not update an ownership record before this interval elapses, the partition represented by this record is considered unowned and is eligible to be claimed by another processor. It is recommended that the `PartitionOwnershipExpirationInterval` be at least 3 times greater than the `LoadBalancingUpdateInterval` and very strongly advised that it should be no less than twice as long. When these intervals are too close together, ownership may expire before it is renewed during load balancing which will cause partitions to migrate. ```C# Snippet:EventHubs_Processor_Sample02_LoadBalancingIntervals -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -95,27 +105,35 @@ var processorOptions = new EventProcessorClientOptions PartitionOwnershipExpirationInterval = TimeSpan.FromSeconds(30) }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` -## Using web sockets +## Using web sockets Communication with the Event Hubs service can be configured by adjusting the `EventHubConfigurationOptions` that are exposed by the `ConnectionOptions` member of a client options type. By default, the `EventProcessorClient` communicates using the AMQP protocol over TCP. Some application host environments prefer to restrict raw TCP socket use, especially in many enterprise or VPN scenarios. In these environments, or when a proxy is in use, communication with the Event Hubs service can make use of web sockets by configuring the client's connection settings. ```C# Snippet:EventHubs_Processor_Sample02_TransportFullConnectionOptions -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -127,51 +145,67 @@ var processorOptions = new EventProcessorClientOptions } }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` The connection options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Processor_Sample02_TransportProperty -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` ## Setting a custom proxy -A common scenario for adjusting the connection options is configuring a proxy. Proxy support takes the form of the [IWebProxy](https://docs.microsoft.com/dotnet/api/system.net.iwebproxy?view=netcore-3.1) interface, of which [WebProxy](https://docs.microsoft.com/dotnet/api/system.net.webproxy?view=netcore-3.1) is the most common default implementation. Event Hubs supports a proxy only when using `AmqpWebSockets` as the transport type. +A common scenario for adjusting the connection options is configuring a proxy. Proxy support takes the form of the [IWebProxy](https://learn.microsoft.com/dotnet/api/system.net.iwebproxy?view=netcore-3.1) interface, of which [WebProxy](https://learn.microsoft.com/dotnet/api/system.net.webproxy?view=netcore-3.1) is the most common default implementation. Event Hubs supports a proxy only when using `AmqpWebSockets` as the transport type. ```C# Snippet:EventHubs_Processor_Sample02_ProxyFullConnectionOptions -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -184,25 +218,33 @@ var processorOptions = new EventProcessorClientOptions } }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` The connection options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Processor_Sample02_ProxyProperty -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -210,21 +252,27 @@ var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; processorOptions.ConnectionOptions.Proxy = new WebProxy("https://proxyserver:80", true); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` ## Using the default system proxy -To use the default proxy for your environment, the recommended approach is to make use of [HttpClient.DefaultProxy](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1), which will attempt to detect proxy settings from the ambient environment in a manner consistent with expectations for the target platform. +To use the default proxy for your environment, the recommended approach is to make use of [HttpClient.DefaultProxy](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1), which will attempt to detect proxy settings from the ambient environment in a manner consistent with expectations for the target platform. **Note:** This member was first introduced in .NET Core 3.1 and is not supported for earlier target frameworks. @@ -243,39 +291,49 @@ Connections to the Azure Event Hubs service are made using the fully qualified n However, a custom address is required for proper routing by some environments, such as those using unconventional proxy configurations or certain configurations of an Express Route circuit. To support these scenarios, a custom endpoint address may be specified as part of the connection options. This custom address will take precedence for establishing the connection to the Event Hubs service. ```C# Snippet:EventHubs_Processor_Sample02_ConnectionOptionsCustomEndpoint -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.CustomEndpointAddress = new Uri("amqps://app-gateway.mycompany.com"); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` ## Influencing SSL certificate validation -For some environments using a proxy or custom gateway for routing traffic to Event Hubs, a certificate not trusted by the root certificate authorities may be issued. This can often be a self-signed certificate from the gateway or one issued by a company's internal certificate authority. +For some environments using a proxy or custom gateway for routing traffic to Event Hubs, a certificate not trusted by the root certificate authorities may be issued. This can often be a self-signed certificate from the gateway or one issued by a company's internal certificate authority. -By default, these certificates are not trusted by the Event Hubs client library and the connection will be refused. To enable these scenarios, a [RemoteCertificateValidationCallback](https://docs.microsoft.com/dotnet/api/system.net.security.remotecertificatevalidationcallback) can be registered to provide custom validation logic for remote certificates. This allows an application to override the default trust decision and assert responsibility for accepting or rejecting the certificate. +By default, these certificates are not trusted by the Event Hubs client library and the connection will be refused. To enable these scenarios, a [RemoteCertificateValidationCallback](https://learn.microsoft.com/dotnet/api/system.net.security.remotecertificatevalidationcallback) can be registered to provide custom validation logic for remote certificates. This allows an application to override the default trust decision and assert responsibility for accepting or rejecting the certificate. ```C# Snippet:EventHubs_Processor_Sample02_RemoteCertificateValidationCallback -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -299,15 +357,21 @@ static bool ValidateServerCertificate( var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.CertificateValidationCallback = ValidateServerCertificate; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` @@ -315,13 +379,15 @@ var processor = new EventProcessorClient( The built-in retry policy offers an implementation for an exponential back-off strategy by default, as this provides a good balance between making forward progress and allowing for transient issues that may take some time to resolve. The built-in policy also offers a fixed strategy for those cases where your application requires that you have a deterministic understanding of how long an operation may take. -The values used as thresholds for the different aspects of these strategies can be configured by adjusting the `EventHubsRetryOptions` that are exposed by the `RetryOptions` member of a client options type. +The values used as thresholds for the different aspects of these strategies can be configured by adjusting the `EventHubsRetryOptions` that are exposed by the `RetryOptions` member of a client options type. ```C# Snippet:EventHubs_Processor_Sample02_RetryWithFullOptions -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -336,25 +402,33 @@ var processorOptions = new EventProcessorClientOptions } }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` The retry options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Processor_Sample02_RetryByProperty -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -362,15 +436,21 @@ var processorOptions = new EventProcessorClientOptions(); processorOptions.RetryOptions.Mode = EventHubsRetryMode.Fixed; processorOptions.RetryOptions.MaximumRetries = 5; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); ``` @@ -423,4 +503,4 @@ var options = new EventHubsRetryOptions { CustomRetryPolicy = new ExampleRetryPolicy() }; -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md index df93787629a56..9e23058e482a3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md @@ -1,6 +1,6 @@ # Event Processor Handlers -Once started, the majority of work performed by the `EventProcessorClient` takes place in the background. Interaction with the host application takes place using .NET [events](https://docs.microsoft.com/dotnet/standard/events/), allowing the processor to surface information and the application to influence processor behavior. Unlike most .NET events, those used by the processor are asynchronous and allow only a single handler to be subscribed. +Once started, the majority of work performed by the `EventProcessorClient` takes place in the background. Interaction with the host application takes place using .NET [events](https://learn.microsoft.com/dotnet/standard/events/), allowing the processor to surface information and the application to influence processor behavior. Unlike most .NET events, those used by the processor are asynchronous and allow only a single handler to be subscribed. This sample details the means to receive information and interact with the `EventProcessorClient` as it is running and demonstrates how to configure the event handlers for some common scenarios. To begin, please ensure that you're familiar with the items discussed in the [Getting started](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples#getting-started) section of the README, and have the prerequisites and connection string information available. @@ -21,31 +21,39 @@ This sample details the means to receive information and interact with the `Even ## Process Event -The processor will invoke the `ProcessEventAsync` handler when an event read from the Event Hubs service is available for processing or, if the [MaximumWaitTime](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClientOptions_MaximumWaitTime) was specified, when that duration has elapsed without an event being available. This handler will be invoked concurrently, limited to one call per partition. The processor will await each invocation to ensure that the events from the same partition are processed one-at-a-time in the order that they were read from the partition. +The processor will invoke the `ProcessEventAsync` handler when an event read from the Event Hubs service is available for processing or, if the [MaximumWaitTime](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClientOptions_MaximumWaitTime) was specified, when that duration has elapsed without an event being available. This handler will be invoked concurrently, limited to one call per partition. The processor will await each invocation to ensure that the events from the same partition are processed one-at-a-time in the order that they were read from the partition. Processing events are covered in more depth for different scenarios in [Sample04_ProcessingEvents](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md). ### Respecting cancellation -The [event arguments](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.processeventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action to process the event and, perhaps, record a checkpoint or to cancel immediately. If the handler chooses not to process the event, the data will not be lost and the event will be replayed when the partition processed in the future, so long as the event is not used to create a checkpoint. +The [event arguments](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.processeventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action to process the event and, perhaps, record a checkpoint or to cancel immediately. If the handler chooses not to process the event, the data will not be lost and the event will be replayed when the partition processed in the future, so long as the event is not used to create a checkpoint. ```C# Snippet:EventHubs_Processor_Sample03_EventHandlerCancellation -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -92,25 +100,33 @@ It is important to note that the error handler is **_NOT_** invoked for failures ### Inspecting error details -The [event arguments](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.processerroreventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action for the error or cancel immediately. The arguments also contain information about the exception that was observed, the operation that the processor was performing at the time, and the partition that the operation was associated with, if any. +The [event arguments](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.processerroreventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action for the error or cancel immediately. The arguments also contain information about the exception that was observed, the operation that the processor was performing at the time, and the partition that the operation was associated with, if any. ```C# Snippet:EventHubs_Processor_Sample03_ErrorHandlerArgs -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processErrorHandler(ProcessErrorEventArgs args) { @@ -154,7 +170,7 @@ finally ### Reacting to processor errors -The exceptions surfaced to your error handler represent a failure within the infrastructure of the processor. The processor is highly resilient; there is generally no action needed by your application to react to occasional errors. +The exceptions surfaced to your error handler represent a failure within the infrastructure of the processor. The processor is highly resilient; there is generally no action needed by your application to react to occasional errors. The processor lacks insight into your application, host environment, and error patterns observed over time. If you're seeing frequent exceptions in your handler or consistent patterns - those often indicate a problem that needs to be addressed. While the processor is likely to recover from that specific instance of the error but, in aggregate, there may need to consider a wider problem. @@ -165,22 +181,30 @@ The error handler (but no other event handler) may safely call `StopProcessingAs This example demonstrates signaling the application to stop processing if the application is out of memory and restarting the processor if it indicates that it has stopped running. ```C# Snippet:EventHubs_Processor_Sample03_ErrorHandlerCancellationRecovery -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); // This token is used to control processing, // if signaled, then processing will be stopped. @@ -281,26 +305,34 @@ When the `EventProcessorClient` begins processing, it will take ownership over a ### Requesting a default starting point for the partition When a partition is initialized, one of the decisions made is where in the partition's event stream to begin processing. If a checkpoint exists for a partition, processing will begin at the next available event after the checkpoint. When no checkpoint is found for a partition, a default location is used. One of the common reasons that you may choose to participate in initialization is to influence where to begin processing when a checkpoint is not found, overriding the default. - -The [event arguments](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.partitioninitializingeventargs?view=azure-dotnet) contain a `DefaultStartingPosition` which can be used to influence where processing begins when a checkpoint is unavailable. The arguments also contain a cancellation token that the `EventProcessorClient` uses to signal the handler that initialization should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action or to cancel immediately, but there typically is no benefit to continuing initialization when the token has been signaled. + +The [event arguments](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.partitioninitializingeventargs?view=azure-dotnet) contain a `DefaultStartingPosition` which can be used to influence where processing begins when a checkpoint is unavailable. The arguments also contain a cancellation token that the `EventProcessorClient` uses to signal the handler that initialization should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action or to cancel immediately, but there typically is no benefit to continuing initialization when the token has been signaled. ```C# Snippet:EventHubs_Processor_Sample03_InitializeHandlerArgs -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task initializeEventHandler(PartitionInitializingEventArgs args) { @@ -350,25 +382,33 @@ The processor will invoke the `PartitionClosingAsync` handler when processing fo ### Inspecting closing details -The [event arguments](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.partitionclosingeventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action for the error to cancel immediately. The arguments also contain information about the reason for closing the partition and the partition being closed. +The [event arguments](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.partitionclosingeventargs?view=azure-dotnet) contain a cancellation token that the `EventProcessorClient` uses to signal the handler that processing should cease as soon as possible. This is most commonly seen when the `EventProcessorClient` is stopping or has encountered an unrecoverable problem. It is up to the handler to decide whether to take action for the error to cancel immediately. The arguments also contain information about the reason for closing the partition and the partition being closed. ```C# Snippet:EventHubs_Processor_Sample03_CloseHandlerArgs -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task closeEventHandler(PartitionClosingEventArgs args) { @@ -425,22 +465,30 @@ The following examples discuss common guidance for handlers used with the `Event It is extremely important that you always guard against exceptions in your handler code; it is strongly recommended to wrap your entire handler in a `try/catch` block and ensure that you do not re-throw exceptions. The processor does not have enough understanding of your handler code to determine the correct action to take in the face of an exception nor to understand whether it is safe to assume that processing has not been corrupted. Any exceptions thrown from your handler will not be caught by the processor and will NOT be redirected to the error handler. This will typically cause processing for the partition to abort, and be restarted, but may also crash your application process. ```C# Snippet:EventHubs_Processor_Sample03_EventHandlerExceptionHandling -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -479,22 +527,30 @@ finally With the notable exception of the `ProcessErrorAsync` handler, the `EventProcessorClient` will await a handler when it is invoked. Because of this, you are unable to safely perform operations on the client, such as calling `StopProcessingAsync` when an exception is observed. Doing so is likely to result in a deadlock. A common technique to work around this limitation for is to signal a cancellation token observed by the application. ```C# Snippet:EventHubs_Processor_Sample03_EventHandlerStopOnException -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); // This token is used to control processing, // if signaled, then processing will be stopped. @@ -568,4 +624,4 @@ finally processor.ProcessEventAsync -= processEventHandler; processor.ProcessErrorAsync -= processErrorHandler; } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md index 3e09dfd8e3fed..17864c4779d23 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md @@ -21,19 +21,19 @@ This sample demonstrates scenarios for processing events read from the Event Hub The `EventProcessorClient` is intended to provide a robust and resilient client for processing events from an Event Hub and is capable of automatically managing the recovery process for transient failures. It will also collaborate with other `EventProcessorClient` instances to dynamically distribute and share processing responsibility as processors are added and removed from the group. -The `EventProcessorClient` is safe to cache and use for the lifetime of the application, which is best practice when the application processes events regularly or semi-regularly. The processor is responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling the `StopProcessingAsync` method when your application is closing will ensure that network resources and other unmanaged objects are cleaned up. +The `EventProcessorClient` is safe to cache and use for the lifetime of the application, which is best practice when the application processes events regularly or semi-regularly. The processor is responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling the `StopProcessingAsync` method when your application is closing will ensure that network resources and other unmanaged objects are cleaned up. ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://docs.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Processing and consumer groups -An `EventProcessorClient` is associated with a specific Event Hub and [consumer group](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." These examples will make use of the default consumer group for illustration. +An `EventProcessorClient` is associated with a specific Event Hub and [consumer group](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." These examples will make use of the default consumer group for illustration. ## Processing and partitions -Every event that is published is sent to one of the [partitions](https://docs.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. When processing events, the `EventProcessorClient` will take ownership over a set of partitions to process, treating each as an independent unit of work. This allows the processor to isolate partitions from one another, helping to ensure that a failure in one partition does not impact processing for another. +Every event that is published is sent to one of the [partitions](https://learn.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. When processing events, the `EventProcessorClient` will take ownership over a set of partitions to process, treating each as an independent unit of work. This allows the processor to isolate partitions from one another, helping to ensure that a failure in one partition does not impact processing for another. ## Checkpointing @@ -43,25 +43,25 @@ When an event processor connects, it will begin reading events at the checkpoint ## Load balancing -If more than one `EventProcessorClient` is configured to process an Event Hub, belongs to the same consumer group, and make use of the same Blob Storage container, those processors will collaborate using Blob storage to share responsibility for processing the partitions of the Event Hub. Each `EventProcessorClient` will claim ownership of partitions until each had an equal share; the processors will ensure that each partition belongs to only a single processor. As processors are added or removed from the group, the partitions will be redistributed to keep the work even. +If more than one `EventProcessorClient` is configured to process an Event Hub, belongs to the same consumer group, and make use of the same Blob Storage container, those processors will collaborate using Blob storage to share responsibility for processing the partitions of the Event Hub. Each `EventProcessorClient` will claim ownership of partitions until each had an equal share; the processors will ensure that each partition belongs to only a single processor. As processors are added or removed from the group, the partitions will be redistributed to keep the work even. -An important call-out is that Event Hubs has an [at-least-once delivery guarantee](https://docs.microsoft.com/azure/event-grid/compare-messaging-services#event-hubs); it is highly recommended to ensure that your processing is resilient to event duplication in whatever way is appropriate for your application scenarios. +An important call-out is that Event Hubs has an [at-least-once delivery guarantee](https://learn.microsoft.com/azure/event-grid/compare-messaging-services#event-hubs); it is highly recommended to ensure that your processing is resilient to event duplication in whatever way is appropriate for your application scenarios. This can be observed when a processor is starting up, as it will attempt to claim ownership of partitions by taking those that do not currently have owners. In the case where a processor isn’t able to reach its fair share by claiming unowned partitions, it will attempt to steal ownership from other processors. During this time, the new owner will begin reading from the last recorded checkpoint. At the same time, the old owner may be dispatching the events that it last read to the handler for processing; it will not understand that ownership has changed until it attempts to read the next set of events from the Event Hubs service. -As a result, you are likely to see some duplicate events being processed when `EventProcessorClients` join or leave the consumer group, which will subside when the processors have reached a stable state with respect to load balancing. The duration of that window will differ depending on the configuration of your processor and your checkpointing strategy. +As a result, you are likely to see some duplicate events being processed when `EventProcessorClients` join or leave the consumer group, which will subside when the processors have reached a stable state with respect to load balancing. The duration of that window will differ depending on the configuration of your processor and your checkpointing strategy. ## Starting and stopping processing -Once it has been configured, the `EventProcessorClient` must be explicitly started by calling its [StartProcessingAsync](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient.startprocessingasync?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClient_StartProcessingAsync_System_Threading_CancellationToken_) method to begin processing. After being started, processing is performed in the background and will continue until the processor has been explicitly stopped by calling its [StopProcessingAsync](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient.stopprocessingasync?view=azure-dotnet) method. While this allows the application code to perform other tasks, it also places the responsibility of ensuring that the process does not terminate during processing if there are no other tasks being performed. +Once it has been configured, the `EventProcessorClient` must be explicitly started by calling its [StartProcessingAsync](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient.startprocessingasync?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClient_StartProcessingAsync_System_Threading_CancellationToken_) method to begin processing. After being started, processing is performed in the background and will continue until the processor has been explicitly stopped by calling its [StopProcessingAsync](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient.stopprocessingasync?view=azure-dotnet) method. While this allows the application code to perform other tasks, it also places the responsibility of ensuring that the process does not terminate during processing if there are no other tasks being performed. + + When stopping, the processor will relinquish ownership of partitions that it was responsible for processing and clean up network resources used for communication with the Event Hubs service. As a result, this method will perform network I/O and may need to wait for partition reads that were active to complete. Due to service calls and network latency, an invocation of this method may take slightly longer than the configured [MaximumWaitTime](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClientOptions_MaximumWaitTime). In the case where the wait time was not configured, stopping may take slightly longer than the [TryTimeout](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsretryoptions.trytimeout?view=azure-dotnet#Azure_Messaging_EventHubs_EventHubsRetryOptions_TryTimeout) of the active retry policy. By default, this is 60 seconds. - When stopping, the processor will relinquish ownership of partitions that it was responsible for processing and clean up network resources used for communication with the Event Hubs service. As a result, this method will perform network I/O and may need to wait for partition reads that were active to complete. Due to service calls and network latency, an invocation of this method may take slightly longer than the configured [MaximumWaitTime](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet#Azure_Messaging_EventHubs_EventProcessorClientOptions_MaximumWaitTime). In the case where the wait time was not configured, stopping may take slightly longer than the [TryTimeout](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsretryoptions.trytimeout?view=azure-dotnet#Azure_Messaging_EventHubs_EventHubsRetryOptions_TryTimeout) of the active retry policy. By default, this is 60 seconds. - For more information on configuring the `TryTimeout`, see: [Configuring the timeout used for Event Hubs service operations](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md#configuring-the-timeout-used-for-event-hubs-service-operations). - + ## Interacting with the processor while running -The act of processing events read from the partition and handling any errors that occur is delegated by the `EventProcessorClient` to code that you provide using the [.NET event pattern](https://docs.microsoft.com/dotnet/csharp/event-pattern). This allows your logic to concentrate on delivering business value while the processor handles the tasks associated with reading events, managing the partitions, and allowing state to be persisted in the form of checkpoints. +The act of processing events read from the partition and handling any errors that occur is delegated by the `EventProcessorClient` to code that you provide using the [.NET event pattern](https://learn.microsoft.com/dotnet/csharp/event-pattern). This allows your logic to concentrate on delivering business value while the processor handles the tasks associated with reading events, managing the partitions, and allowing state to be persisted in the form of checkpoints. An in-depth discussion of the handlers used with the `EventProcessorClient` along with guidance for implementing them can be found in the sample: [Event Processor Handlers](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md). The following examples will assume familiarity with best practices for handler implementation and will often avoid going into detail in the interest of brevity. @@ -70,22 +70,30 @@ An in-depth discussion of the handlers used with the `EventProcessorClient` alon At minimum, the `EventProcessorClient` will make sure that you've registered a handler for processing events and receiving notification about exceptions the processor encounters before it will begin processing events. This example illustrates a common general pattern for processing, without taking checkpointing into consideration. ```C# Snippet:EventHubs_Processor_Sample04_BasicEventProcessing -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -196,25 +204,33 @@ The creation of checkpoints comes at a cost, both in terms of processing perform In either case, it is important to understand that your processing must be tolerant of receiving the same event to be processed more than once; the Event Hubs service, like most messaging platforms, guarantees at-least-once delivery. Even were you to create a checkpoint for each event that you process, it is entirely possible that you would receive that same event again from the service. -This example illustrates checkpointing after 25 events have been processed for a given partition. +This example illustrates checkpointing after 25 events have been processed for a given partition. ```C# Snippet:EventHubs_Processor_Sample04_CheckpointByEventCount -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); const int EventsBeforeCheckpoint = 25; var partitionEventCount = new ConcurrentDictionary(); @@ -305,22 +321,30 @@ When a partition is initialized, one of the decisions made is where in the parti This example will demonstrate choosing to start with the event closest to being on or after the current date and time. ```C# Snippet:EventHubs_Processor_Sample04_InitializePartition -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task initializeEventHandler(PartitionInitializingEventArgs args) { @@ -397,34 +421,42 @@ finally ## Heartbeat while processing events -It is often helpful for an application to understand whether an `EventProcessorClient` instance is still healthy but no events were available for its partitions versus when the processor or its host may have stopped. This can be accomplished by setting a maximum wait time for events to be available to read from the Event Hubs service. +It is often helpful for an application to understand whether an `EventProcessorClient` instance is still healthy but no events were available for its partitions versus when the processor or its host may have stopped. This can be accomplished by setting a maximum wait time for events to be available to read from the Event Hubs service. -When the wait time is set, if no events are read within that interval, the processor will invoke the `ProcessEventAsync` handler and pass a set of arguments that indicates no event was available, using the [MaximumWaitTime](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet) of the `EventProcessorClientOptions`. +When the wait time is set, if no events are read within that interval, the processor will invoke the `ProcessEventAsync` handler and pass a set of arguments that indicates no event was available, using the [MaximumWaitTime](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions.maximumwaittime?view=azure-dotnet) of the `EventProcessorClientOptions`. This example demonstrates emitting a heartbeat to the host application whenever an event is processed or after a maximum of 250 milliseconds passes with no event. ```C# Snippet:EventHubs_Processor_Sample04_ProcessWithHeartbeat -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; -var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); - var processorOptions = new EventProcessorClientOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(250) }; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); async Task processEventHandler(ProcessEventArgs args) @@ -491,4 +523,4 @@ finally processor.ProcessEventAsync -= processEventHandler; processor.ProcessErrorAsync -= Application.ProcessorErrorHandler; } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md index 63b2b692f5fea..2f79adf3c97ed 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md @@ -16,7 +16,7 @@ This sample demonstrates using credentials to authorize clients with the Event H ## Prerequisites -To begin, please ensure that you're familiar with the items discussed in the [Getting started](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples#getting-started) section of the README. You will also need to the fully qualified namespace for the Event Hubs resource that you would like to use. This can be found in the Azure Portal view of the Event Hubs namespace in the "Overview" tab. In the center pane, the "essentials" area will list a "hostname." This is the fully qualified namespace and is likely be similar to: `{your-namespace}.servicebus.windows.net`. +To begin, please ensure that you're familiar with the items discussed in the [Getting started](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples#getting-started) section of the README. You will also need to the fully qualified namespace for the Event Hubs resource that you would like to use. This can be found in the Azure Portal view of the Event Hubs namespace in the "Overview" tab. In the center pane, the "essentials" area will list a "hostname." This is the fully qualified namespace and is likely be similar to: `{your-namespace}.servicebus.windows.net`. If you'd like to use an identity credential for accessing Azure Storage, you will need one of the Blob service endpoint URLs. These can be found in the Azure Portal view of the Azure Storage account in the "Properties" area under the "Settings" tab. Either the primary or secondary endpoint can be used, but you'll need to ensure that "Blob service" appears under the endpoint that you've selected for it to be valid. This endpoint is likely similar to: `{your-account-name}.blob.core.windows.net`. @@ -24,30 +24,30 @@ Depending on the type of authorization that you wish to use, additional setup ma ### Identity authorization -**Azure.Identity** +**Azure.Identity** -The `Azure.Identity` library is recommended for identity-based authentication across the different sources supported by the Azure platform for [role-based access control (RBAC)](https://docs.microsoft.com/azure/role-based-access-control/overview). This includes Azure Active Directory principals and Managed Identities. To allow for the best developer experience, and one that supports promoting applications between environments without code changes, this sample will concentrate on the `DefaultAzureCredential`. Please see the [Azure.Identity README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential) for details on configuring your environment for `DefaultAzureCredential` integration. +The `Azure.Identity` library is recommended for identity-based authentication across the different sources supported by the Azure platform for [role-based access control (RBAC)](https://learn.microsoft.com/azure/role-based-access-control/overview). This includes Azure Active Directory principals and Managed Identities. To allow for the best developer experience, and one that supports promoting applications between environments without code changes, this sample will concentrate on the `DefaultAzureCredential`. Please see the [Azure.Identity README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential) for details on configuring your environment for `DefaultAzureCredential` integration. -**Role Assignments** +**Role Assignments** -Once your environment is configured, you'll need to ensure that the principal that you've chosen has access to your Event Hubs resources in Azure. To do so, they will need to be assigned the appropriate role. For those unfamiliar with role assignments, it is recommended to follow [these steps](https://docs.microsoft.com/azure/event-hubs/authenticate-managed-identity?tabs=latest#to-assign-azure-roles-using-the-azure-portal) in the Azure portal for the most intuitive experience. Roles may also be assigned via the [Azure CLI](https://docs.microsoft.com/cli/azure/role/assignment?view=azure-cli-latest#az_role_assignment_create) or [PowerShell](https://docs.microsoft.com/powershell/module/az.resources/new-azroleassignment), though these require more in-depth knowledge of the Azure platform and may be difficult for developers exploring Azure for the first time. +Once your environment is configured, you'll need to ensure that the principal that you've chosen has access to your Event Hubs resources in Azure. To do so, they will need to be assigned the appropriate role. For those unfamiliar with role assignments, it is recommended to follow [these steps](https://learn.microsoft.com/azure/event-hubs/authenticate-managed-identity?tabs=latest#to-assign-azure-roles-using-the-azure-portal) in the Azure portal for the most intuitive experience. Roles may also be assigned via the [Azure CLI](https://learn.microsoft.com/cli/azure/role/assignment?view=azure-cli-latest#az_role_assignment_create) or [PowerShell](https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignment), though these require more in-depth knowledge of the Azure platform and may be difficult for developers exploring Azure for the first time. -The available role choices for Event Hubs are: +The available role choices for Event Hubs are: -- [Azure Event Hubs Data Owner](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-owner) for full access to read and publish events. -- [Azure Event Hubs Data Receiver](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-receiver) for the ability to read events but not publish them. +- [Azure Event Hubs Data Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-owner) for full access to read and publish events. +- [Azure Event Hubs Data Receiver](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-receiver) for the ability to read events but not publish them. -You will also need to ensure that your principal is assigned the [Storage Blob Data Contributor](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor) role for the Blob Storage container that you're using for checkpoint and ownership data. +You will also need to ensure that your principal is assigned the [Storage Blob Data Contributor](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor) role for the Blob Storage container that you're using for checkpoint and ownership data. ### Event Hubs Shared Access Signature authorization Shared access signatures (SAS) are recommended over shared access keys, when RBAC cannot be used. A shared access signature allows for granular and time-limited access to Event Hubs resources. In order to use SAS-based authorization, a token needs to be generated and the associated Event Hubs resource needs to be configured to authorize its use. -The steps to to generate a SAS token can be found in the article "[Authenticate access to Event Hubs resources using shared access signatures (SAS)](https://docs.microsoft.com/azure/event-hubs/authenticate-shared-access-signature)", with details for some additional languages detailed in the article "[Generate SAS token](https://docs.microsoft.com/rest/api/eventhub/generate-sas-token)". Information about configuring SAS authorization can be found in the article "[Authorizing access to Event Hubs resources using Shared Access Signatures](https://docs.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature)". +The steps to to generate a SAS token can be found in the article "[Authenticate access to Event Hubs resources using shared access signatures (SAS)](https://learn.microsoft.com/azure/event-hubs/authenticate-shared-access-signature)", with details for some additional languages detailed in the article "[Generate SAS token](https://learn.microsoft.com/rest/api/eventhub/generate-sas-token)". Information about configuring SAS authorization can be found in the article "[Authorizing access to Event Hubs resources using Shared Access Signatures](https://learn.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature)". ### Event Hubs Shared Access Key authorization -Shared access keys for Event Hubs authorization are generated when access policies are created for an Event Hubs namespace or one of its Event Hub instances. Since these keys are most often used in association with a connection string, the article "[Get an Event Hubs connection string](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string#get-connection-string-from-the-portal)" is the best source of information on generating and accessing them. +Shared access keys for Event Hubs authorization are generated when access policies are created for an Event Hubs namespace or one of its Event Hub instances. Since these keys are most often used in association with a connection string, the article "[Get an Event Hubs connection string](https://learn.microsoft.com/azure/event-hubs/event-hubs-get-connection-string#get-connection-string-from-the-portal)" is the best source of information on generating and accessing them. In step 6 of the article, the policy that you select will be the name of your shared access key when used for credential authorization. In step 7, you'll want to copy the "Primary key" rather than connection string. @@ -55,22 +55,24 @@ In step 6 of the article, the policy that you select will be the name of your sh The `EventProcessorClient` is intended to provide a robust and resilient client for processing events from an Event Hub and is capable of automatically managing the recovery process for transient failures. It will also collaborate with other `EventProcessorClient` instances to dynamically distribute and share processing responsibility as processors are added and removed from the group. -The `EventProcessorClient` is safe to cache and use for the lifetime of the application, which is best practice when the application processes events regularly or semi-regularly. The processor is responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling the `StopProcessingAsync` method when your application is closing will ensure that network resources and other unmanaged objects are cleaned up. +The `EventProcessorClient` is safe to cache and use for the lifetime of the application, which is best practice when the application processes events regularly or semi-regularly. The processor is responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling the `StopProcessingAsync` method when your application is closing will ensure that network resources and other unmanaged objects are cleaned up. ## Processing events with identity-based authorization ```C# Snippet:EventHubs_Processor_Sample05_DefaultAzureCredential var credential = new DefaultAzureCredential(); -var storageEndpoint = "<< STORAGE ENDPOINT (likely similar to {your-account}.blob.core.windows.net) >>"; +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; -var blobUriBuilder = new BlobUriBuilder(new Uri(storageEndpoint)); -blobUriBuilder.BlobContainerName = blobContainerName; +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; var storageClient = new BlobContainerClient( blobUriBuilder.ToUri(), @@ -347,4 +349,4 @@ finally processor.ProcessEventAsync -= Application.ProcessorEventHandler; processor.ProcessErrorAsync -= Application.ProcessorErrorHandler; } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md index b1cd782660c4d..065e1f67e8ea6 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md @@ -1,6 +1,6 @@ # Requesting Azure Storage Service Versions -This sample demonstrates configuring the Blob Storage client to use a specific version of the service, rather than the default. This is useful when the Azure environment that you are targeting supports a different version of Blob Storage service than is available in the Azure public cloud. For example, if you are running Event Hubs on an Azure Stack Hub version 2002, the highest available version for the Storage service is version 2017-11-09. In this case, you will need to use the following code to change the Blob Storage service API version to 2017-11-09. For more information on the Azure Storage service versions supported on Azure Stack Hub, please refer to the [Azure Stack documentation](https://docs.microsoft.com/azure-stack/user/azure-stack-acs-differences). +This sample demonstrates configuring the Blob Storage client to use a specific version of the service, rather than the default. This is useful when the Azure environment that you are targeting supports a different version of Blob Storage service than is available in the Azure public cloud. For example, if you are running Event Hubs on an Azure Stack Hub version 2002, the highest available version for the Storage service is version 2017-11-09. In this case, you will need to use the following code to change the Blob Storage service API version to 2017-11-09. For more information on the Azure Storage service versions supported on Azure Stack Hub, please refer to the [Azure Stack documentation](https://learn.microsoft.com/azure-stack/user/azure-stack-acs-differences). To begin, please ensure that you're familiar with the items discussed in the [Event Processor Handlers](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md) sample. You'll also need to have the prerequisites and connection string information available, as discussed in the [Getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples#getting-started) section of the README. @@ -10,7 +10,7 @@ To begin, please ensure that you're familiar with the items discussed in the [Ev ## Configuring the Blob Storage client - This sample demonstrates using an [Azure.Core](https://docs.microsoft.com/dotnet/api/overview/azure/core-readme) pipeline policy to request the Blob Storage client request use of a specific service version. + This sample demonstrates using an [Azure.Core](https://learn.microsoft.com/dotnet/api/overview/azure/core-readme) pipeline policy to request the Blob Storage client request use of a specific service version. ```C# Snippet:EventHubs_Processor_Sample06_StorageVersionPolicy /// @@ -50,10 +50,12 @@ private class StorageApiVersionPolicy : HttpPipelineSynchronousPolicy ``` ```C# Snippet:EventHubs_Processor_Sample06_ChooseStorageVersion -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; @@ -63,16 +65,22 @@ storageClientOptions.AddPolicy( new StorageApiVersionPolicy(), HttpPipelinePosition.PerCall); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName, + blobUriBuilder.ToUri(), + credential, storageClientOptions); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -125,4 +133,4 @@ finally processor.ProcessEventAsync -= Application.ProcessorEventHandler; processor.ProcessErrorAsync -= Application.ProcessorErrorHandler; } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md index febb3126fa087..a94329be52822 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md @@ -24,15 +24,17 @@ public class SimpleBatchProcessor : PluggableCheckpointStoreEventProcessor(); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250), LoadBalancingStrategy = loadBalancingStrategy }; - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); processor.ProcessErrorAsync += CreateAssertingErrorHandler(); processor.ProcessEventAsync += CreateEventTrackingHandler(sentCount, processedEvents, completionSource, cancellationSource.Token); @@ -92,7 +91,7 @@ public async Task EventsCanBeReadByOneProcessorClient(LoadBalancingStrategy load /// /// [Test] - public async Task EventsCanBeReadByOneProcessorClientUsingAnIdentityCredential() + public async Task EventsCanBeReadByOneProcessorClientUsingTheConnectionString() { // Setup the environment. @@ -105,7 +104,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingAnIdentityCredential() // Send a set of events. var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -114,7 +113,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingAnIdentityCredential() var processedEvents = new ConcurrentDictionary(); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) }; - var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); + var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); processor.ProcessErrorAsync += CreateAssertingErrorHandler(); processor.ProcessEventAsync += CreateEventTrackingHandler(sentCount, processedEvents, completionSource, cancellationSource.Token); @@ -147,7 +146,6 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSharedKeyCredential // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(2); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -155,7 +153,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSharedKeyCredential // Send a set of events. var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -197,7 +195,6 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSasCredential() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(2); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -205,7 +202,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSasCredential() // Send a set of events. var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -247,7 +244,6 @@ public async Task EventsCanBeReadByMultipleProcessorClients() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(4); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -255,7 +251,7 @@ public async Task EventsCanBeReadByMultipleProcessorClients() // Send a set of events. var sourceEvents = EventGenerator.CreateEvents(500).ToList(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -271,8 +267,8 @@ public async Task EventsCanBeReadByMultipleProcessorClients() var processors = new[] { - CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options), - CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options) + CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options), + CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options) }; foreach (var processor in processors) @@ -314,14 +310,16 @@ public async Task ProcessorClientCreatesOwnership() var partitionIds = new HashSet(); await using EventHubScope scope = await EventHubScope.CreateAsync(partitionCount); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); // Discover the partitions. - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { foreach (var partitionId in (await producer.GetPartitionIdsAsync())) { @@ -332,7 +330,7 @@ public async Task ProcessorClientCreatesOwnership() // Send a set of events. var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -379,7 +377,6 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(1); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -388,7 +385,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() var sourceEvents = EventGenerator.CreateEvents(25).ToList(); var lastSourceEvent = sourceEvents.Last(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -396,7 +393,11 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() var startingOffset = 0L; - await using (var consumer = new EventHubConsumerClient(scope.ConsumerGroups.First(), connectionString)) + await using (var consumer = new EventHubConsumerClient( + scope.ConsumerGroups.First(), + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { await foreach (var partitionEvent in consumer.ReadEventsAsync(new ReadEventOptions { MaximumWaitTime = null }, cancellationSource.Token)) { @@ -412,7 +413,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() // Send the second set of events to be read by the processor. sourceEvents = EventGenerator.CreateEvents(20).ToList(); - sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -421,7 +422,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() var processedEvents = new ConcurrentDictionary(); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) }; - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); processor.PartitionInitializingAsync += args => { @@ -460,7 +461,6 @@ public async Task ProcessorClientBeginsWithTheNextEventAfterCheckpointing() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(1); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -473,7 +473,7 @@ public async Task ProcessorClientBeginsWithTheNextEventAfterCheckpointing() var afterCheckpointEvents = EventGenerator.CreateEvents(segmentEventCount).ToList(); var sourceEvents = Enumerable.Concat(beforeCheckpointEvents, afterCheckpointEvents).ToList(); var checkpointEvent = beforeCheckpointEvents.Last(); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -493,7 +493,7 @@ public async Task ProcessorClientBeginsWithTheNextEventAfterCheckpointing() var beforeCheckpointProcessHandler = CreateEventTrackingHandler(segmentEventCount, processedEvents, completionSource, cancellationSource.Token, processedEventCallback); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) }; var checkpointStore = new InMemoryCheckpointStore(_ => { }); - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, checkpointStore, options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, checkpointStore, options); processor.ProcessErrorAsync += CreateAssertingErrorHandler(); processor.ProcessEventAsync += beforeCheckpointProcessHandler; @@ -590,7 +590,13 @@ public async Task ProcessorClientDetectsAnInvalidEventHubName(bool async) // Create the processor and attempt to start. - var processor = new EventProcessorClient(Mock.Of(), EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, "fake"); + var processor = new EventProcessorClient( + Mock.Of(), + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + "fake", + EventHubsTestEnvironment.Instance.Credential); + processor.ProcessErrorAsync += _ => Task.CompletedTask; processor.ProcessEventAsync += _ => Task.CompletedTask; @@ -627,8 +633,23 @@ public async Task ProcessorClientDetectsAnInvalidConsumerGroup(bool async) // Create the processor and attempt to start. - var containerClient = new BlobContainerClient(StorageTestEnvironment.Instance.StorageConnectionString, storageScope.ContainerName); - var processor = new EventProcessorClient(containerClient, "fake", EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + var blobUri = new Uri($"https://{ StorageTestEnvironment.Instance.StorageAccountName }.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"); + + var blobUriBuilder = new BlobUriBuilder(blobUri) + { + BlobContainerName = storageScope.ContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + EventHubsTestEnvironment.Instance.Credential); + + var processor = new EventProcessorClient( + storageClient, + "fake", + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); processor.ProcessErrorAsync += _ => Task.CompletedTask; processor.ProcessEventAsync += _ => Task.CompletedTask; @@ -647,13 +668,14 @@ public async Task ProcessorClientDetectsAnInvalidConsumerGroup(bool async) } /// - /// Verifies that the can read a set of published events. + /// Verifies that the detects an invalid connection + /// to Storage. /// /// [Test] [TestCase(true)] [TestCase(false)] - public async Task ProcessorClientDetectsAnInvalidStorageConnectionString(bool async) + public async Task ProcessorClientDetectsAnInvalidStorageConnection(bool async) { // Setup the environment. @@ -665,9 +687,24 @@ public async Task ProcessorClientDetectsAnInvalidStorageConnectionString(bool as // Create the processor and attempt to start. - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString.Replace(StorageTestEnvironment.Instance.StorageEndpointSuffix, "fake.com"); - var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); - var processor = new EventProcessorClient(containerClient, eventHubScope.ConsumerGroups[0], EventHubsTestEnvironment.Instance.EventHubsConnectionString, eventHubScope.EventHubName); + var blobUri = new Uri($"https://{ StorageTestEnvironment.Instance.StorageAccountName }.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"); + + var blobUriBuilder = new BlobUriBuilder(blobUri) + { + BlobContainerName = storageScope.ContainerName + }; + + var containerClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + EventHubsTestEnvironment.Instance.Credential); + + var processor = new EventProcessorClient( + containerClient, + eventHubScope.ConsumerGroups[0], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubScope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + processor.ProcessErrorAsync += _ => Task.CompletedTask; processor.ProcessEventAsync += _ => Task.CompletedTask; @@ -702,8 +739,24 @@ public async Task ProcessorClientDetectsAnInvalidStorageContainer(bool async) // Create the processor and attempt to start. - var containerClient = new BlobContainerClient(StorageTestEnvironment.Instance.StorageConnectionString, "fake"); - var processor = new EventProcessorClient(containerClient, eventHubScope.ConsumerGroups[0], EventHubsTestEnvironment.Instance.EventHubsConnectionString, eventHubScope.EventHubName); + var blobUri = new Uri($"https://{ StorageTestEnvironment.Instance.StorageAccountName }.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"); + + var blobUriBuilder = new BlobUriBuilder(blobUri) + { + BlobContainerName = "fake" + }; + + var containerClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + EventHubsTestEnvironment.Instance.Credential); + + var processor = new EventProcessorClient( + containerClient, + eventHubScope.ConsumerGroups[0], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubScope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + processor.ProcessErrorAsync += _ => Task.CompletedTask; processor.ProcessEventAsync += _ => Task.CompletedTask; @@ -733,14 +786,13 @@ public async Task ProcessorClientStopsWithoutWaitingForTimeoutWhenPartitionsAreE // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(4); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); // Send a single event. - var sentCount = await SendEvents(connectionString, EventGenerator.CreateEvents(1), cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, EventGenerator.CreateEvents(1), cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(1), "A single event should have been sent."); // Attempt to read events using the longest possible TryTimeout. @@ -750,7 +802,7 @@ public async Task ProcessorClientStopsWithoutWaitingForTimeoutWhenPartitionsAreE var processedEvents = new ConcurrentDictionary(); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); processor.ProcessErrorAsync += CreateAssertingErrorHandler(); processor.ProcessEventAsync += CreateEventTrackingHandler(sentCount, processedEvents, completionSource, cancellationSource.Token); @@ -792,14 +844,13 @@ public async Task ProcessorClientCanRestartAfterStopping() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(4); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); // Send a single event. - var sentCount = await SendEvents(connectionString, EventGenerator.CreateEvents(1), cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, EventGenerator.CreateEvents(1), cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(1), "A single event should have been sent."); // Attempt to read events using the longest possible TryTimeout. @@ -809,7 +860,7 @@ public async Task ProcessorClientCanRestartAfterStopping() var processedEvents = new ConcurrentDictionary(); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); var activeEventHandler = CreateEventTrackingHandler(sentCount, processedEvents, completionSource, cancellationSource.Token); processor.ProcessEventAsync += activeEventHandler; @@ -833,7 +884,7 @@ public async Task ProcessorClientCanRestartAfterStopping() // Send another single event to prove restart was successful. - sentCount = await SendEvents(connectionString, EventGenerator.CreateEvents(1), cancellationSource.Token); + sentCount = await SendEvents(scope.EventHubName, EventGenerator.CreateEvents(1), cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(1), "A single event should have been sent."); // Reset the event handler so that it uses a completion source that hasn't been signaled.. @@ -870,14 +921,13 @@ public async Task ProcessorClientCeasesProcessingWhenStopping() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(4); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); // Publish some events - var sentCount = await SendEvents(connectionString, EventGenerator.CreateSmallEvents(400), cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, EventGenerator.CreateSmallEvents(400), cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(400), "All generated events should have been published."); // Attempt to read events using the longest possible TryTimeout. @@ -889,7 +939,7 @@ public async Task ProcessorClientCeasesProcessingWhenStopping() var eventsProcessedAfterStop = false; var readCount = 0; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, options: options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, options: options); processor.ProcessEventAsync += args => { @@ -937,7 +987,6 @@ public async Task ProcessorClientCanCheckpointAfterStopping() // Setup the environment. await using EventHubScope scope = await EventHubScope.CreateAsync(1); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -951,7 +1000,7 @@ public async Task ProcessorClientCanCheckpointAfterStopping() var sourceEvents = Enumerable.Concat(beforeCheckpointEvents, afterCheckpointEvents).ToList(); var checkpointEvent = beforeCheckpointEvents.Last(); var checkpointArgs = default(ProcessEventArgs); - var sentCount = await SendEvents(connectionString, sourceEvents, cancellationSource.Token); + var sentCount = await SendEvents(scope.EventHubName, sourceEvents, cancellationSource.Token); Assert.That(sentCount, Is.EqualTo(sourceEvents.Count), "Not all of the source events were sent."); @@ -973,7 +1022,7 @@ public async Task ProcessorClientCanCheckpointAfterStopping() var beforeCheckpointProcessHandler = CreateEventTrackingHandler(segmentEventCount, processedEvents, completionSource, cancellationSource.Token, processedEventCallback); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) }; var checkpointStore = new InMemoryCheckpointStore(_ => { }); - var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, checkpointStore, options); + var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, checkpointStore, options); processor.ProcessErrorAsync += CreateAssertingErrorHandler(); processor.ProcessEventAsync += beforeCheckpointProcessHandler; @@ -1112,19 +1161,22 @@ private EventProcessorClient CreateProcessorWithSharedAccessSignature(string con /// Sends a set of events using a new producer to do so. /// /// - /// The connection string to use when creating the producer. + /// The name of the Event Hub to use when creating the producer. /// The set of events to send. /// The token used to signal a cancellation request. /// /// The count of events that were sent. /// - private async Task SendEvents(string connectionString, + private async Task SendEvents(string eventHubName, IEnumerable sourceEvents, CancellationToken cancellationToken) { var sentCount = 0; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubName, + EventHubsTestEnvironment.Instance.Credential)) { foreach (var batch in (await EventGenerator.BuildBatchesAsync(sourceEvents, producer, default, cancellationToken))) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/MigrationGuideSnippetsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/MigrationGuideSnippetsLiveTests.cs index f62558c7a0b38..7916e042b8cd3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/MigrationGuideSnippetsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/MigrationGuideSnippetsLiveTests.cs @@ -9,6 +9,8 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; @@ -38,19 +40,23 @@ public async Task MigrateCheckpoints() #region Snippet:EventHubs_Migrate_Checkpoints #if SNIPPET + var credential = new DefaultAzureCredential(); + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; var legacyBlobContainerName = "<< NAME OF THE BLOB CONTAINER THAT CONTAINS THE LEGACY DATA>>"; #else + var credential = EventHubsTestEnvironment.Instance.Credential; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake-hub"; var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; var blobContainerName = storageScope.ContainerName; #endif @@ -63,9 +69,10 @@ public async Task MigrateCheckpoints() #if SNIPPET var legacyCheckpoints = await ReadLegacyCheckpoints( - storageConnectionString, + storageAccountEndpoint, legacyBlobContainerName, consumerGroup, + credential, cancellationSource.Token); #else var legacyCheckpoints = ReadFakeLegacyCheckpoints("fake"); @@ -90,7 +97,15 @@ public async Task MigrateCheckpoints() // assumes that the connection string grants the appropriate permissions to create a // container in the storage account. - var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + await storageClient.CreateIfNotExistsAsync(cancellationToken: cancellationSource.Token); // Translate each of the legacy checkpoints, storing the offset and @@ -160,12 +175,20 @@ private IEnumerable ReadFakeLegacyCheckpoints(string fakeCo #region Snippet:EventHubs_Migrate_LegacyCheckpoints private async Task> ReadLegacyCheckpoints( - string connectionString, + string storageAccountEndpoint, string container, string consumerGroup, + TokenCredential credential, CancellationToken cancellationToken) { - var storageClient = new BlobContainerClient(connectionString, container); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = container + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); // If there is no container, no action can be taken. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/ReadMeSnippetsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/ReadMeSnippetsLiveTests.cs index 79b33991df588..cd3fde8c9856f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/ReadMeSnippetsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/ReadMeSnippetsLiveTests.cs @@ -67,18 +67,23 @@ public void ConfigureHandlers() #region Snippet:EventHubs_Processor_ReadMe_ConfigureHandlers #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake-hub"; + var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif async Task processEventHandler(ProcessEventArgs eventArgs) @@ -111,8 +116,23 @@ async Task processErrorHandler(ProcessErrorEventArgs eventArgs) } } - var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); - var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubsConnectionString, eventHubName); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + + var processor = new EventProcessorClient + ( + storageClient, + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential + ); processor.ProcessEventAsync += processEventHandler; processor.ProcessErrorAsync += processErrorHandler; @@ -139,25 +159,45 @@ public async Task ProcessUntilCanceled() cancellationSource.CancelAfter(TimeSpan.FromSeconds(45)); #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; - var consumerGroup = eventHubScope.ConsumerGroups.First(); + var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif Task processEventHandler(ProcessEventArgs eventArgs) => Task.CompletedTask; Task processErrorHandler(ProcessErrorEventArgs eventArgs) => Task.CompletedTask; - var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); - var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubsConnectionString, eventHubName); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + + var processor = new EventProcessorClient + ( + storageClient, + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential + ); processor.ProcessEventAsync += processEventHandler; processor.ProcessErrorAsync += processErrorHandler; @@ -202,20 +242,32 @@ public void CreateWithIdentity() #if SNIPPET var credential = new DefaultAzureCredential(); - var blobStorageUrl ="<< FULLY-QUALIFIED CONTAINER URL (like https://myaccount.blob.core.windows.net/mycontainer) >>"; - var fullyQualifiedNamespace = "<< FULLY-QUALIFIED EVENT HUBS NAMESPACE (like something.servicebus.windows.net) >>"; + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; + var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; + + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else var credential = EventHubsTestEnvironment.Instance.Credential; - var blobStorageUrl = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.{ StorageTestEnvironment.Instance.StorageEndpointSuffix }/{ "fake-container" }"; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var eventHubName = "fake-hub"; + var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif - var storageClient = new BlobContainerClient(new Uri(blobStorageUrl), credential); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient ( diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample02_EventProcessorConfigurationLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample02_EventProcessorConfigurationLiveTests.cs index 5d3d0d6f03cc4..6a3292e873e55 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample02_EventProcessorConfigurationLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample02_EventProcessorConfigurationLiveTests.cs @@ -5,6 +5,7 @@ using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; +using Azure.Identity; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; using NUnit.Framework; @@ -31,18 +32,23 @@ public void ConfigureLoadBalancingStrategy() #region Snippet:EventHubs_Processor_Sample02_LoadBalancingStrategy #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions @@ -50,15 +56,21 @@ public void ConfigureLoadBalancingStrategy() LoadBalancingStrategy = LoadBalancingStrategy.Greedy }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -74,18 +86,23 @@ public void ConfigureLoadBalancingIntervals() #region Snippet:EventHubs_Processor_Sample02_LoadBalancingIntervals #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions @@ -94,15 +111,21 @@ public void ConfigureLoadBalancingIntervals() PartitionOwnershipExpirationInterval = TimeSpan.FromSeconds(30) }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -118,18 +141,23 @@ public void ConfigureTransportWithFullOptions() #region Snippet:EventHubs_Processor_Sample02_TransportFullConnectionOptions #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions @@ -140,15 +168,21 @@ public void ConfigureTransportWithFullOptions() } }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -164,32 +198,43 @@ public void ConfigureTransportByProperty() #region Snippet:EventHubs_Processor_Sample02_TransportProperty #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -205,18 +250,23 @@ public void ConfigureProxyWithFullOptions() #region Snippet:EventHubs_Processor_Sample02_ProxyFullConnectionOptions #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions @@ -228,15 +278,21 @@ public void ConfigureProxyWithFullOptions() } }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -252,33 +308,44 @@ public void ConfigureProxyByProperty() #region Snippet:EventHubs_Processor_Sample02_ProxyProperty #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; processorOptions.ConnectionOptions.Proxy = new WebProxy("https://proxyserver:80", true); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -294,32 +361,43 @@ public void ConfigureCustomEndpointAddress() #region Snippet:EventHubs_Processor_Sample02_ConnectionOptionsCustomEndpoint #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.CustomEndpointAddress = new Uri("amqps://app-gateway.mycompany.com"); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -335,18 +413,23 @@ public void ConfigureRemoteCertificateValidationCallback() #region Snippet:EventHubs_Processor_Sample02_RemoteCertificateValidationCallback #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif static bool ValidateServerCertificate( @@ -369,15 +452,21 @@ static bool ValidateServerCertificate( var processorOptions = new EventProcessorClientOptions(); processorOptions.ConnectionOptions.CertificateValidationCallback = ValidateServerCertificate; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -393,18 +482,23 @@ public void ConfigureRetryWithFullOptions() #region Snippet:EventHubs_Processor_Sample02_RetryWithFullOptions #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions @@ -418,15 +512,21 @@ public void ConfigureRetryWithFullOptions() } }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion @@ -442,33 +542,44 @@ public void ConfigureRetryByProperty() #region Snippet:EventHubs_Processor_Sample02_RetryByProperty #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif var processorOptions = new EventProcessorClientOptions(); processorOptions.RetryOptions.Mode = EventHubsRetryMode.Fixed; processorOptions.RetryOptions.MaximumRetries = 5; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); #endregion diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample03_EventProcessorHandlersLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample03_EventProcessorHandlersLiveTests.cs index d4c74c52e1acb..163821a58f813 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample03_EventProcessorHandlersLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample03_EventProcessorHandlersLiveTests.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; @@ -33,29 +34,40 @@ public void EventHandlerExceptionHandling() #region Snippet:EventHubs_Processor_Sample03_EventHandlerExceptionHandling #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -101,29 +113,40 @@ public void EventHandlerCancellation() #region Snippet:EventHubs_Processor_Sample03_EventHandlerCancellation #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -177,29 +200,40 @@ public async Task EventHandlerStopOnException() #region Snippet:EventHubs_Processor_Sample03_EventHandlerStopOnException #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; - var consumerGroup = eventHubScope.ConsumerGroups.First(); + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); // This token is used to control processing, // if signaled, then processing will be stopped. @@ -290,29 +324,40 @@ public void ErrorHandlerArgs() #region Snippet:EventHubs_Processor_Sample03_ErrorHandlerArgs #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processErrorHandler(ProcessErrorEventArgs args) { @@ -369,29 +414,40 @@ public async Task ErrorHandlerCancellationRecovery() #region Snippet:EventHubs_Processor_Sample03_ErrorHandlerCancellationRecovery #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; - var consumerGroup = eventHubScope.ConsumerGroups.First(); + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); // This token is used to control processing, // if signaled, then processing will be stopped. @@ -500,29 +556,40 @@ public void InitializeHandlerArgs() #region Snippet:EventHubs_Processor_Sample03_InitializeHandlerArgs #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task initializeEventHandler(PartitionInitializingEventArgs args) { @@ -578,29 +645,40 @@ public void CloseHandlerArgs() #region Snippet:EventHubs_Processor_Sample03_CloseHandlerArgs #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = "not-real"; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; - var consumerGroup = "fakeConsumer"; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fake"; + var consumerGroup = "$Default"; + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = "fake"; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task closeEventHandler(PartitionClosingEventArgs args) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample04_ProcessingEventsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample04_ProcessingEventsLiveTests.cs index b736b6d04f9a3..8725db5627df3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample04_ProcessingEventsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample04_ProcessingEventsLiveTests.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; @@ -37,29 +38,40 @@ public async Task BasicEventProcessing() #region Snippet:EventHubs_Processor_Sample04_BasicEventProcessing #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task processEventHandler(ProcessEventArgs args) { @@ -177,29 +189,40 @@ public async Task CheckpointByEventCount() #region Snippet:EventHubs_Processor_Sample04_CheckpointByEventCount #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); const int EventsBeforeCheckpoint = 25; var partitionEventCount = new ConcurrentDictionary(); @@ -298,29 +321,40 @@ public async Task InitializePartition() #region Snippet:EventHubs_Processor_Sample04_InitializePartition #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); Task initializeEventHandler(PartitionInitializingEventArgs args) { @@ -410,34 +444,45 @@ public async Task ProcessWithHeartbeat() #region Snippet:EventHubs_Processor_Sample04_ProcessWithHeartbeat #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); -#endif - var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; +#endif var processorOptions = new EventProcessorClientOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(250) }; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, + fullyQualifiedNamespace, eventHubName, + credential, processorOptions); async Task processEventHandler(ProcessEventArgs args) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample05_IdentityAndSharedAccessCredentialsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample05_IdentityAndSharedAccessCredentialsLiveTests.cs index 8b2697a9d05ed..e10c8cd100cca 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample05_IdentityAndSharedAccessCredentialsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample05_IdentityAndSharedAccessCredentialsLiveTests.cs @@ -39,7 +39,7 @@ public async Task DefaultAzureCredential() #if SNIPPET var credential = new DefaultAzureCredential(); - var storageEndpoint = "<< STORAGE ENDPOINT (likely similar to {your-account}.blob.core.windows.net) >>"; + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; @@ -47,15 +47,19 @@ public async Task DefaultAzureCredential() var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else var credential = EventHubsTestEnvironment.Instance.Credential; - var storageEndpoint = new BlobServiceClient(StorageTestEnvironment.Instance.StorageConnectionString).Uri.ToString(); - var blobContainerName = storageScope.ContainerName; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif - var blobUriBuilder = new BlobUriBuilder(new Uri(storageEndpoint)); - blobUriBuilder.BlobContainerName = blobContainerName; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; var storageClient = new BlobContainerClient( blobUriBuilder.ToUri(), diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample06_RequestingStorageServiceVersionsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample06_RequestingStorageServiceVersionsLiveTests.cs index 2a7b0639ffd14..e6c49f55cda0e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample06_RequestingStorageServiceVersionsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample06_RequestingStorageServiceVersionsLiveTests.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.Identity; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; using NUnit.Framework; @@ -36,18 +37,23 @@ public async Task ProcessEvents() #region Snippet:EventHubs_Processor_Sample06_ChooseStorageVersion #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif var storageClientOptions = new BlobClientOptions(); @@ -56,16 +62,22 @@ public async Task ProcessEvents() new StorageApiVersionPolicy(), HttpPipelinePosition.PerCall); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName, + blobUriBuilder.ToUri(), + credential, storageClientOptions); var processor = new EventProcessorClient( storageClient, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample07_BatchProcessingLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample07_BatchProcessingLiveTests.cs index 3fe28b1eb7d45..417b717aff966 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample07_BatchProcessingLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample07_BatchProcessingLiveTests.cs @@ -6,6 +6,8 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; using Azure.Messaging.EventHubs.Primitives; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; @@ -36,23 +38,33 @@ public async Task ProcessByBatch() #region Snippet:EventHubs_Processor_Sample07_ProcessByBatch_Usage #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; #else - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var blobContainerName = storageScope.ContainerName; - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); + + var storageAccountEndpoint = $"https://{ StorageTestEnvironment.Instance.StorageAccountName }.blob.{ StorageTestEnvironment.Instance.StorageEndpointSuffix}"; + var blobContainerName = storageScope.ContainerName; #endif + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); var checkpointStore = new BlobCheckpointStore(storageClient); var maximumBatchSize = 100; @@ -61,8 +73,9 @@ public async Task ProcessByBatch() checkpointStore, maximumBatchSize, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(TimeSpan.FromSeconds(30)); @@ -103,15 +116,17 @@ public class SimpleBatchProcessor : PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. +- The [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet) provides a base for creating a custom processor for reading and processing events from all partitions of an Event Hub, using the provided checkpoint store for state persistence. It fills a role similar to the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package, with cooperative load balancing and resiliency as its core features. However, `PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. -- The [EventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). +- The [EventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). ### Client constructors @@ -206,10 +206,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with its default configuration. ```C# Snippet:EventHubs_Sample04_AutomaticRouting -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -276,10 +280,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with a partition key specified as an option. ```C# Snippet:EventHubs_Sample04_PartitionKey -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -351,10 +359,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with a partition identifier specified as an option. ```C# Snippet:EventHubs_Sample04_PartitionId -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -387,7 +399,7 @@ finally ### Reading events -In the `Microsoft.Azure.EventHubs` library, reading events can be performed by either the `EventProcessorHost` or the `PartitionReceiver`, depending on whether you would like to read from all partitions of an Event Hub or a single partition. Generally, using the `EventProcessorHost` is the preferred approach for most production scenarios. +In the `Microsoft.Azure.EventHubs` library, reading events can be performed by either the `EventProcessorHost` or the `PartitionReceiver`, depending on whether you would like to read from all partitions of an Event Hub or a single partition. Generally, using the `EventProcessorHost` is the preferred approach for most production scenarios. The `Azure.Messaging.EventHubs` library also provides multiple types for reading events, with the `EventProcessorClient` focused on reading from all partitions, and the `EventHubConsumerClient` and `PartitionReceiver` focused on reading from a single partition. The `EventProcessorClient` is the preferred approach for most production scenarios. For a detailed discussion of common scenarios and options, please see the [Event Processor Client](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) and [Reading Events](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md) samples. @@ -658,17 +670,19 @@ finally } ``` -In the `Azure.Messaging.EventHubs` library, the `EventHubConsumerClient` can be used to read events from a partition in a streaming manner using the asynchronous enumerator pattern. +In the `Azure.Messaging.EventHubs` library, the `EventHubConsumerClient` can be used to read events from a partition in a streaming manner using the asynchronous enumerator pattern. ```C# Snippet:EventHubs_Sample05_ReadPartition -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -703,8 +717,9 @@ finally For those that prefer a batched approach to reading, `Azure.Messaging.EventHubs` also offers a `PartitionReceiver` that follows pull-based semantics. ```C# Snippet:EventHubs_Sample05_ReadPartitionWithReceiver -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; using CancellationTokenSource cancellationSource = new CancellationTokenSource(); @@ -712,7 +727,10 @@ cancellationSource.CancelAfter(TimeSpan.FromSeconds(30)); string firstPartition; -await using (var producer = new EventHubProducerClient(connectionString, eventHubName)) +await using (var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential)) { firstPartition = (await producer.GetPartitionIdsAsync()).First(); } @@ -721,8 +739,9 @@ var receiver = new PartitionReceiver( consumerGroup, firstPartition, EventPosition.Earliest, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -762,7 +781,7 @@ In `Azure.Messaging.EventHubs`, Activity baggage is not currently flowed through ## Migrating EventProcessorHost checkpoints -In `Microsoft.Azure.EventHubs`, the `EventProcessorHost` supported a model of pluggable storage providers for checkpoint data, using Azure Storage Blobs as the default. Using the Azure Storage checkpoint manager, the lease and checkpoint information is stored as a JSON blob appearing within the Azure Storage account provided to the `EventProcessorHost`. More details can be found in the [documentation](https://docs.microsoft.com/azure/event-hubs/event-hubs-event-processor-host#partition-ownership-tracking). +In `Microsoft.Azure.EventHubs`, the `EventProcessorHost` supported a model of pluggable storage providers for checkpoint data, using Azure Storage Blobs as the default. Using the Azure Storage checkpoint manager, the lease and checkpoint information is stored as a JSON blob appearing within the Azure Storage account provided to the `EventProcessorHost`. More details can be found in the [documentation](https://learn.microsoft.com/azure/event-hubs/event-hubs-event-processor-host#partition-ownership-tracking). In `Azure.Messaging.EventHubs`, the `EventProcessorClient` is an opinionated implementation, storing checkpoints in Azure Storage Blobs using the blob metadata to track information. Unfortunately, the `EventProcessorClient` is unable to consume legacy checkpoints due to the differences in format, approach, and the possibility of a custom checkpoint provider having been used. @@ -777,14 +796,16 @@ private class MigrationCheckpoint } ``` -The `Azure.Messaging.EventHubs` checkpoints are expected by the `EventProcessorClient` to exist in a specifically named blob per partition that contains two metadata attributes. Any content of the blob itself is ignored. Casing is significant where both the name of the blob and the metadata attributes are concerned and must be lowercase. +The `Azure.Messaging.EventHubs` checkpoints are expected by the `EventProcessorClient` to exist in a specifically named blob per partition that contains two metadata attributes. Any content of the blob itself is ignored. Casing is significant where both the name of the blob and the metadata attributes are concerned and must be lowercase. ```C# Snippet:EventHubs_Migrate_Checkpoints +var credential = new DefaultAzureCredential(); + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; var legacyBlobContainerName = "<< NAME OF THE BLOB CONTAINER THAT CONTAINS THE LEGACY DATA>>"; @@ -796,9 +817,10 @@ using var cancellationSource = new CancellationTokenSource(); // Note: The ReadLegacyCheckpoints method will be defined in another snippet. var legacyCheckpoints = await ReadLegacyCheckpoints( - storageConnectionString, + storageAccountEndpoint, legacyBlobContainerName, consumerGroup, + credential, cancellationSource.Token); // The member names of MigrationCheckpoint match the names of the checkpoint @@ -820,7 +842,15 @@ var prefix = string.Format( // assumes that the connection string grants the appropriate permissions to create a // container in the storage account. -var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + await storageClient.CreateIfNotExistsAsync(cancellationToken: cancellationSource.Token); // Translate each of the legacy checkpoints, storing the offset and @@ -849,12 +879,20 @@ The following snippet to read and parse legacy checkpoints assumes that the defa ```C# Snippet:EventHubs_Migrate_LegacyCheckpoints private async Task> ReadLegacyCheckpoints( - string connectionString, + string storageAccountEndpoint, string container, string consumerGroup, + TokenCredential credential, CancellationToken cancellationToken) { - var storageClient = new BlobContainerClient(connectionString, container); + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = container + }; + + var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); // If there is no container, no action can be taken. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md b/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md index 6ad936287d768..deae35e89f4f8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md @@ -164,10 +164,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with its default configuration. ```C# Snippet:EventHubs_Sample04_AutomaticRouting -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -227,10 +231,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with a partition key specified as an option. ```C# Snippet:EventHubs_Sample04_PartitionKey -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -299,10 +307,14 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubProducerClient` is used as the publisher for a batch created with a partition identifier specified as an option. ```C# Snippet:EventHubs_Sample04_PartitionId -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -588,14 +600,16 @@ finally In the `Azure.Messaging.EventHubs` library, the `EventHubConsumerClient` can be used to read events from a partition in a streaming manner using the asynchronous enumerator pattern. ```C# Snippet:EventHubs_Sample05_ReadPartition -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -630,8 +644,9 @@ finally For those that prefer a batched approach to reading, `Azure.Messaging.EventHubs` also offers a `PartitionReceiver` that follows pull-based semantics. ```C# Snippet:EventHubs_Sample05_ReadPartitionWithReceiver -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; using CancellationTokenSource cancellationSource = new CancellationTokenSource(); @@ -639,7 +654,10 @@ cancellationSource.CancelAfter(TimeSpan.FromSeconds(30)); string firstPartition; -await using (var producer = new EventHubProducerClient(connectionString, eventHubName)) +await using (var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential)) { firstPartition = (await producer.GetPartitionIdsAsync()).First(); } @@ -648,8 +666,9 @@ var receiver = new PartitionReceiver( consumerGroup, firstPartition, EventPosition.Earliest, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/README.md b/sdk/eventhub/Azure.Messaging.EventHubs/README.md index ff5bd91461f85..8470eb1c1fbc4 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/README.md @@ -26,7 +26,7 @@ The Azure Event Hubs client library allows for publishing and consuming of Azure Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal. - You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). + You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). **Important Note:** In order to build or run the [examples](#examples) and the [samples](#next-steps) without modification, use of C# 11.0 is necessary. You can still run the samples if you decide to tweak them for other language versions. An example of doing so is available in the sample: [Earlier Language Versions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md). To quickly create a basic set of Event Hubs resources in Azure and to receive a connection string for them, you can deploy our sample template by clicking: @@ -66,13 +66,13 @@ For examples of authenticating the Event Hubs clients for an ASP.NET Core applic - An **Event Hub client** is the primary interface for developers interacting with the Event Hubs client library. There are several different Event Hub clients, each dedicated to a specific use of Event Hubs, such as publishing or consuming events. -- An **Event Hub producer** is a type of client that serves as a source of telemetry data, diagnostics information, usage logs, or other log data, as part of an embedded device solution, a mobile device application, a game title running on a console or other device, some client or server based business solution, or a web site. +- An **Event Hub producer** is a type of client that serves as a source of telemetry data, diagnostics information, usage logs, or other log data, as part of an embedded device solution, a mobile device application, a game title running on a console or other device, some client or server based business solution, or a web site. -- An **Event Hub consumer** is a type of client which reads information from the Event Hub and allows processing of it. Processing may involve aggregation, complex computation and filtering. Processing may also involve distribution or storage of the information in a raw or transformed fashion. Event Hub consumers are often robust and high-scale platform infrastructure parts with built-in analytics capabilities, like Azure Stream Analytics, Apache Spark, or Apache Storm. +- An **Event Hub consumer** is a type of client which reads information from the Event Hub and allows processing of it. Processing may involve aggregation, complex computation and filtering. Processing may also involve distribution or storage of the information in a raw or transformed fashion. Event Hub consumers are often robust and high-scale platform infrastructure parts with built-in analytics capabilities, like Azure Stream Analytics, Apache Spark, or Apache Storm. - A **partition** is an ordered sequence of events that is held in an Event Hub. Partitions are a means of data organization associated with the parallelism required by event consumers. Azure Event Hubs provides message streaming through a partitioned consumer pattern in which each consumer only reads a specific subset, or partition, of the message stream. As newer events arrive, they are added to the end of this sequence. The number of partitions is specified at the time an Event Hub is created and cannot be changed. -- A **consumer group** is a view of an entire Event Hub. Consumer groups enable multiple consuming applications to each have a separate view of the event stream, and to read the stream independently at their own pace and from their own position. There can be at most 5 concurrent readers on a partition per consumer group; however it is recommended that there is only one active consumer for a given partition and consumer group pairing. Each active reader receives all of the events from its partition; if there are multiple readers on the same partition, then they will receive duplicate events. +- A **consumer group** is a view of an entire Event Hub. Consumer groups enable multiple consuming applications to each have a separate view of the event stream, and to read the stream independently at their own pace and from their own position. There can be at most 5 concurrent readers on a partition per consumer group; however it is recommended that there is only one active consumer for a given partition and consumer group pairing. Each active reader receives all of the events from its partition; if there are multiple readers on the same partition, then they will receive duplicate events. For more concepts and deeper discussion, see: [Event Hubs Features](https://learn.microsoft.com/azure/event-hubs/event-hubs-features). @@ -82,7 +82,7 @@ Each of the Event Hubs client types is safe to cache and use as a singleton for ### Thread safety -We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. The data model types, such as `EventData` and `EventDataBatch` are not thread-safe. They should not be shared across threads nor used concurrently with client methods. @@ -212,18 +212,35 @@ Since the `EventProcessorClient` has a dependency on Azure Storage blobs for per var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(TimeSpan.FromSeconds(45)); -var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; +var credential = new DefaultAzureCredential(); + +var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; -var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; Task processEventHandler(ProcessEventArgs eventArgs) => Task.CompletedTask; Task processErrorHandler(ProcessErrorEventArgs eventArgs) => Task.CompletedTask; -var storageClient = new BlobContainerClient(storageConnectionString, blobContainerName); -var processor = new EventProcessorClient(storageClient, consumerGroup, eventHubsConnectionString, eventHubName); +var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) +{ + BlobContainerName = blobContainerName +}; + +var storageClient = new BlobContainerClient( + blobUriBuilder.ToUri(), + credential); + +var processor = new EventProcessorClient +( + storageClient, + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential +); processor.ProcessEventAsync += processEventHandler; processor.ProcessErrorAsync += processErrorHandler; @@ -305,7 +322,7 @@ public void ConfigureServices(IServiceCollection services) { builder.AddEventHubProducerClient(Configuration.GetConnectionString("EventHubs")); }); - + services.AddControllers(); } ``` @@ -337,7 +354,7 @@ public void ConfigureServices(IServiceCollection services) // register that instance as the default credential instead. builder.UseCredential(new ManagedIdentityCredential()); }); - + services.AddControllers(); } ``` @@ -360,7 +377,7 @@ The Event Hubs client library is also instrumented for distributed tracing using Beyond the introductory scenarios discussed, the Azure Event Hubs client library offers support for additional scenarios to help take advantage of the full feature set of the Azure Event Hubs service. In order to help explore some of these scenarios, the Event Hubs client library offers a project of samples to serve as an illustration for common scenarios. Please see the samples [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/README.md) for details. -## Contributing +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/TROUBLESHOOTING.md b/sdk/eventhub/Azure.Messaging.EventHubs/TROUBLESHOOTING.md index 3c63e5dfdd251..f651fca83dc73 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/TROUBLESHOOTING.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/TROUBLESHOOTING.md @@ -231,7 +231,7 @@ Generally, it is recommended that an event processor own no more than 3 partitio Further reading: - [Debug ThreadPool Starvation][DebugThreadPoolStarvation] -- [Diagnosing .NET Core ThreadPool Starvation with PerfView (Why my service is not saturating all cores or seems to stall)](https://docs.microsoft.com/archive/blogs/vancem/diagnosing-net-core-threadpool-starvation-with-perfview-why-my-service-is-not-saturating-all-cores-or-seems-to-stall) +- [Diagnosing .NET Core ThreadPool Starvation with PerfView (Why my service is not saturating all cores or seems to stall)](https://learn.microsoft.com/archive/blogs/vancem/diagnosing-net-core-threadpool-starvation-with-perfview-why-my-service-is-not-saturating-all-cores-or-seems-to-stall) - [Diagnosing ThreadPool Exhaustion Issues in .NET Core Apps][DiagnoseThreadPoolExhaustion] _(video)_ #### "Soft Delete" or "Blob versioning" is enabled for a Blob Storage checkpoint store: @@ -453,28 +453,28 @@ For more information on ways to request support, please see: [Support][SUPPORT]. [MigrationGuideT1]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide.md [SUPPORT]: https://github.com/Azure/azure-sdk-for-net/blob/main/SUPPORT.md - -[AuthorizeSAS]: https://docs.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature -[AzureSdkNetLogging]: https://docs.microsoft.com/dotnet/azure/sdk/logging#map-to-aspnet-core-logging -[DebugThreadPoolStarvation]: https://docs.microsoft.com/dotnet/core/diagnostics/debug-threadpool-starvation -[DependencyInjectionAzureFunctions]: https://docs.microsoft.com/azure/azure-functions/functions-dotnet-dependency-injection -[DependencyInjectionAzureSdk]: https://docs.microsoft.com/dotnet/azure/sdk/dependency-injection -[DiagnoseThreadPoolExhaustion]: https://docs.microsoft.com/shows/on-net/diagnosing-thread-pool-exhaustion-issues-in-net-core-apps -[EventHubsException]: https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception -[EventHubsIPAddresses]: https://docs.microsoft.com/azure/event-hubs/troubleshooting-guide#what-ip-addresses-do-i-need-to-allow -[EventHubsMessagingExceptions]: https://docs.microsoft.com/azure/event-hubs/event-hubs-messaging-exceptions -[EventHubsQuotas]: https://docs.microsoft.com/azure/event-hubs/event-hubs-quotas -[EventHubsRetryOptions]: https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsretryoptions -[EventHubsTroubleshooting]: https://docs.microsoft.com/azure/event-hubs/troubleshooting-guide -[GetConnectionString]: https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string -[IoTHubDocs]: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-endpoints -[IoTEventHubEndpoint]: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-read-builtin -[IoTHubSAS]: https://docs.microsoft.com/azure/iot-hub/iot-hub-dev-guide-sas#security-tokens -[RBAC]: https://docs.microsoft.com/azure/event-hubs/authorize-access-azure-active-directory -[SoftDeleteBlobStorage]: https://docs.microsoft.com/azure/storage/blobs/soft-delete-blob-overview -[VersioningBlobStorage]: https://docs.microsoft.com/azure/storage/blobs/versioning-overview -[TroubleshootAuthenticationAuthorization]: https://docs.microsoft.com/azure/event-hubs/troubleshoot-authentication-authorization -[UnauthorizedAccessException]: https://docs.microsoft.com/dotnet/api/system.unauthorizedaccessexception + +[AuthorizeSAS]: https://learn.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature +[AzureSdkNetLogging]: https://learn.microsoft.com/dotnet/azure/sdk/logging#map-to-aspnet-core-logging +[DebugThreadPoolStarvation]: https://learn.microsoft.com/dotnet/core/diagnostics/debug-threadpool-starvation +[DependencyInjectionAzureFunctions]: https://learn.microsoft.com/azure/azure-functions/functions-dotnet-dependency-injection +[DependencyInjectionAzureSdk]: https://learn.microsoft.com/dotnet/azure/sdk/dependency-injection +[DiagnoseThreadPoolExhaustion]: https://learn.microsoft.com/shows/on-net/diagnosing-thread-pool-exhaustion-issues-in-net-core-apps +[EventHubsException]: https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception +[EventHubsIPAddresses]: https://learn.microsoft.com/azure/event-hubs/troubleshooting-guide#what-ip-addresses-do-i-need-to-allow +[EventHubsMessagingExceptions]: https://learn.microsoft.com/azure/event-hubs/event-hubs-messaging-exceptions +[EventHubsQuotas]: https://learn.microsoft.com/azure/event-hubs/event-hubs-quotas +[EventHubsRetryOptions]: https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsretryoptions +[EventHubsTroubleshooting]: https://learn.microsoft.com/azure/event-hubs/troubleshooting-guide +[GetConnectionString]: https://learn.microsoft.com/azure/event-hubs/event-hubs-get-connection-string +[IoTHubDocs]: https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-endpoints +[IoTEventHubEndpoint]: https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-read-builtin +[IoTHubSAS]: https://learn.microsoft.com/azure/iot-hub/iot-hub-dev-guide-sas#security-tokens +[RBAC]: https://learn.microsoft.com/azure/event-hubs/authorize-access-azure-active-directory +[SoftDeleteBlobStorage]: https://learn.microsoft.com/azure/storage/blobs/soft-delete-blob-overview +[VersioningBlobStorage]: https://learn.microsoft.com/azure/storage/blobs/versioning-overview +[TroubleshootAuthenticationAuthorization]: https://learn.microsoft.com/azure/event-hubs/troubleshoot-authentication-authorization +[UnauthorizedAccessException]: https://learn.microsoft.com/dotnet/api/system.unauthorizedaccessexception [AmqpSpec]: https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/README.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/README.md index 971ea3fdcb316..4c6018fcf3966 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/README.md @@ -11,11 +11,11 @@ description: Samples for the Azure.Messaging.EventHubs client library # Azure.Messaging.EventHubs Samples -The Azure Event Hubs client library offers samples in two forms. Common application scenarios are presented as markdown documents, providing a detailed explanation of context while also demonstrating implementation details with snippets of code. More specialized scenarios are presented as stand-alone projects to both illustrate the deeper end-to-end context and allow exploring interactively. +The Azure Event Hubs client library offers samples in two forms. Common application scenarios are presented as markdown documents, providing a detailed explanation of context while also demonstrating implementation details with snippets of code. More specialized scenarios are presented as stand-alone projects to both illustrate the deeper end-to-end context and allow exploring interactively. The markdown-based samples are ordered by increasing complexity, starting with more basic scenarios to help get started quickly. Though each sample is independent, they will assume an understanding of the content discussed in earlier samples. -Each of the application samples are intended to be self-contained and focused on illustrating one specific scenario. The simplest way to begin is to launch the project for debugging in Visual Studio, or your preferred IDE, and provide the Event Hubs connection information in response to the prompts. Each of these sample applications is accompanied by a dedicated README, offering more specific detail about its hosting needs and operation. +Each of the application samples are intended to be self-contained and focused on illustrating one specific scenario. The simplest way to begin is to launch the project for debugging in Visual Studio, or your preferred IDE, and provide the Event Hubs connection information in response to the prompts. Each of these sample applications is accompanied by a dedicated README, offering more specific detail about its hosting needs and operation. ## Getting started @@ -23,13 +23,13 @@ Each of the application samples are intended to be self-contained and focused on - **Azure Subscription:** To use Azure services, including Azure Event Hubs, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- **Event Hubs namespace with an Event Hub:** To interact with Azure Event Hubs, you'll also need to have a namespace and Event Hub available. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [creating an Event Hub using the Azure portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create an Event Hub. +- **Event Hubs namespace with an Event Hub:** To interact with Azure Event Hubs, you'll also need to have a namespace and Event Hub available. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [creating an Event Hub using the Azure portal](https://learn.microsoft.com/azure/event-hubs/event-hubs-create). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create an Event Hub. -- **C# 8.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. +- **C# 8.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal. - You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://docs.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). + You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). To quickly create a basic set of Event Hubs resources in Azure and to receive a connection string for them, you can deploy our sample template by clicking: @@ -45,44 +45,44 @@ dotnet add package Azure.Messaging.EventHubs ### Authenticate the client -For the Event Hubs client library to interact with an Event Hub, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating an Event Hubs namespace. If you aren't familiar with using connection strings with Event Hubs, you may wish to follow the step-by-step guide to [get an Event Hubs connection string](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string). +For the Event Hubs client library to interact with an Event Hub, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating an Event Hubs namespace. If you aren't familiar with using connection strings with Event Hubs, you may wish to follow the step-by-step guide to [get an Event Hubs connection string](https://learn.microsoft.com/azure/event-hubs/event-hubs-get-connection-string). ## Common samples -- [Hello world](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md) - An introduction to Event Hubs, illustrating the basic flow of events through an Event Hub, with the goal of quickly allowing you to view events being published and read from the Event Hubs service. - -- [Event Hubs Clients](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md) - An overview of the Event Hubs clients, detailing the available client types, the scenarios they serve, and demonstrating options for customizing their configuration, such as specifying a proxy. - -- [Event Hubs Metadata](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md) - A discussion of the metadata available for an Event Hub instance and demonstration of how to query and inspect the information. - -- [Publishing Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md) - A deep dive into publishing events using the Event Hubs client library, detailing the different options available and illustrating common scenarios. - -- [Reading Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md) - A deep dive into reading events using the Event Hubs client library, detailing the different options available and illustrating common scenarios. - -- [Identity and Shared Access Credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md) - A discussion of the different types of authorization supported, focusing on identity-based credentials for Azure Active Directory and use the of shared access signatures and keys. - -- [Earlier Language Versions](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md) +- [Hello world](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md) + An introduction to Event Hubs, illustrating the basic flow of events through an Event Hub, with the goal of quickly allowing you to view events being published and read from the Event Hubs service. + +- [Event Hubs Clients](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md) + An overview of the Event Hubs clients, detailing the available client types, the scenarios they serve, and demonstrating options for customizing their configuration, such as specifying a proxy. + +- [Event Hubs Metadata](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md) + A discussion of the metadata available for an Event Hub instance and demonstration of how to query and inspect the information. + +- [Publishing Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md) + A deep dive into publishing events using the Event Hubs client library, detailing the different options available and illustrating common scenarios. + +- [Reading Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md) + A deep dive into reading events using the Event Hubs client library, detailing the different options available and illustrating common scenarios. + +- [Identity and Shared Access Credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md) + A discussion of the different types of authorization supported, focusing on identity-based credentials for Azure Active Directory and use the of shared access signatures and keys. + +- [Earlier Language Versions](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md) A demonstration of how to interact with the client library using earlier versions of C#, where newer syntax for asynchronous enumeration and disposal are not available. -- [Building a Custom Event Processor using EventProcessor<TPartition>](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md) +- [Building a Custom Event Processor using EventProcessor<TPartition>](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md) An introduction to the `EventProcessor` base class which is used when building advanced processors which need full control over state management. -- [Observable Event Data Batch](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md) +- [Observable Event Data Batch](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md) A demonstration of how to write an `ObservableEventDataBatch` class that wraps an `EventDataBatch` in order to allow an application to read events that have been added to a batch. -- [Capturing Event Hubs logs using AzureEventSourceListener class](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md) +- [Capturing Event Hubs logs using AzureEventSourceListener class](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md) A demonstration of how to use the [`AzureEventSourceListener`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md#logging) from the `Azure.Core` package to capture logs emitted by the Event Hubs client library. - -- [Mocking Client Types](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md) + +- [Mocking Client Types](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md) A demonstration of how to mock the types in the Event Hubs client library, focusing on common application scenarios. -## Contributing +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md index 56f67e85c7710..150f714509535 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md @@ -15,9 +15,11 @@ To begin, please ensure that you're familiar with the items discussed in the [Ge To interact with Event Hubs, a client is needed for each area of functionality - such as publishing and reading of events. All clients are scoped to a single Event Hub instance under an Event Hubs namespace, and clients that read events are also scoped to a consumer group. For this example, we'll configure our clients using the set of information that follows. ```C# Snippet:EventHubs_SamplesCommon_ConsumerBasicConfig -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; + +var credential = new DefaultAzureCredential(); ``` Each of the Event Hubs client types are safe to cache and use for the lifetime of the application, which is best practice when the application publishes or reads events regularly or semi-regularly. The clients hold responsibility for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling either the `CloseAsync` or `DisposeAsync` method on a client as the application is shutting down will ensure that network resources and other unmanaged objects are properly cleaned up. @@ -29,7 +31,7 @@ var consumer = new EventHubConsumerClient(consumerGroup, connectionString, event ## Publish events -To publish events, we will need the `EventHubsProducerClient` that was created. Because this is the only area of our sample that will be publishing events, we will close the client once publishing has completed. In the majority of real-world scenarios, closing the producer when the application exits is often the preferred pattern. +To publish events, we will need the `EventHubsProducerClient` that was created. Because this is the only area of our sample that will be publishing events, we will close the client once publishing has completed. In the majority of real-world scenarios, closing the producer when the application exits is often the preferred pattern. So that we have something to read, our example will publish a full batch of events. The `EventHubDataBatch` exists to ensure that a set of events can safely be published without exceeding the size allowed by the Event Hub. The `EventDataBatch` queries the service to understand the maximum size and is responsible for accurately measuring each event as it is added to the batch. When its `TryAdd` method returns `false`, the event is too large to fit into the batch. @@ -80,11 +82,11 @@ finally Now that the events have been published, we'll read back all events from the Event Hub using the `EventHubConsumerClient` that was created. It's important to note that because events are not removed when reading, if you're using an existing Event Hub, you are likely to see events that had been previously published as well as those from the batch that we just sent. -An Event Hub consumer is associated with a specific Event Hub and [consumer group](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." The default group is what we'll be using for illustration. +An Event Hub consumer is associated with a specific Event Hub and [consumer group](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." The default group is what we'll be using for illustration. Each consumer has a unique view of the events in a partition that it reads from, which means that events are available to all consumers and are not removed from the partition when read. This allows consumers to read and process events from the Event Hub at different speeds without interfering with one another. -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://docs.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ```C# Snippet:EventHubs_Sample01_ReadEvents try @@ -125,6 +127,6 @@ finally } ``` -This example makes use of the `ReadEvents` method of the `EventHubConsumerClient`, which allows it to see events from all [partitions](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#partitions) of an Event Hub. While this is convenient to use for exploration, we strongly recommend not using it for production scenarios. `ReadEvents` does not guarantee fairness amongst the partitions during iteration; each of the partitions compete to publish events to be read. Depending on how service communication takes place, there may be a clustering of events per partition and a noticeable bias for a given partition or subset of partitions. +This example makes use of the `ReadEvents` method of the `EventHubConsumerClient`, which allows it to see events from all [partitions](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#partitions) of an Event Hub. While this is convenient to use for exploration, we strongly recommend not using it for production scenarios. `ReadEvents` does not guarantee fairness amongst the partitions during iteration; each of the partitions compete to publish events to be read. Depending on how service communication takes place, there may be a clustering of events per partition and a noticeable bias for a given partition or subset of partitions. -To read from all partitions in a production application, we recommend preferring the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) or a custom [EventProcessor](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) implementation. \ No newline at end of file +To read from all partitions in a production application, we recommend preferring the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) or a custom [EventProcessor](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) implementation. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md index f5f70c1d665f6..0727e9e678820 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample02_EventHubsClients.md @@ -20,25 +20,25 @@ This sample details the client types available for the Event Hubs client library ## Hierarchy -Because each client provides the developer experience for an area of Event Hubs functionality, to provide the best experience, it is important that it offers an API focused on a concrete set of scenarios. Because applications have different needs, we wanted to offer support for more specialized scenarios without introducing additional complexity to the more common scenarios. To achieve this, the client hierarchy was designed to align with two general categories, mainstream and specialized. +Because each client provides the developer experience for an area of Event Hubs functionality, to provide the best experience, it is important that it offers an API focused on a concrete set of scenarios. Because applications have different needs, we wanted to offer support for more specialized scenarios without introducing additional complexity to the more common scenarios. To achieve this, the client hierarchy was designed to align with two general categories, mainstream and specialized. The mainstream set of clients provides an approachable onboarding experience for those new to Event Hubs with a clear step-up path to production use for the most common application scenarios. The specialized set of clients is focused on high-throughput and allowing developers to assert a higher degree of control, at the cost of more complexity in their use. This section will briefly introduce the clients in both categories, though samples will continue to focus heavily on the mainstream clients. **Mainstream** -- The [EventHubBufferedProducerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) publishes events using a deferred model where events are collected into a buffer and the producer has responsibility for implicitly batching and sending them. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hub-buffered-producer.md). +- The [EventHubBufferedProducerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) publishes events using a deferred model where events are collected into a buffer and the producer has responsibility for implicitly batching and sending them. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hub-buffered-producer.md). -- The [EventHubProducerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer.eventhubproducerclient?view=azure-dotnet) publishes events with explicit model where callers have responsibility for management of batches and controlling when events are sent. - -- The [EventHubConsumerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventhubconsumerclient?view=azure-dotnet) supports reading events from a single partition and also offers an easy way to familiarize yourself with Event Hubs by reading from all partitions without the rigor and complexity that you would need in a production application. For reading events from all partitions in a production scenario, we strongly recommend using the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package over the `EventHubConsumerClient`. +- The [EventHubProducerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer.eventhubproducerclient?view=azure-dotnet) publishes events with explicit model where callers have responsibility for management of batches and controlling when events are sent. + +- The [EventHubConsumerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventhubconsumerclient?view=azure-dotnet) supports reading events from a single partition and also offers an easy way to familiarize yourself with Event Hubs by reading from all partitions without the rigor and complexity that you would need in a production application. For reading events from all partitions in a production scenario, we strongly recommend using the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package over the `EventHubConsumerClient`. **Specialized** -- The [PartitionReceiver](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.partitionreceiver?view=azure-dotnet) is responsible for reading events from a specific partition of an Event Hub, with a greater level of control over communication with the Event Hubs service than is offered by other event consumers. More detail on the design and philosophy for the `PartitionReceiver` can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-partition-receiver.md). +- The [PartitionReceiver](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.partitionreceiver?view=azure-dotnet) is responsible for reading events from a specific partition of an Event Hub, with a greater level of control over communication with the Event Hubs service than is offered by other event consumers. More detail on the design and philosophy for the `PartitionReceiver` can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-partition-receiver.md). -- The [PluggableCheckpointStoreEventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet) provides a base for creating a custom processor for reading and processing events from all partitions of an Event Hub, using the provided checkpoint store for state persistence. It fills a role similar to the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package, with cooperative load balancing and resiliency as its core features. However, `PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. +- The [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet) provides a base for creating a custom processor for reading and processing events from all partitions of an Event Hub, using the provided checkpoint store for state persistence. It fills a role similar to the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package, with cooperative load balancing and resiliency as its core features. However, `PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. -- The [EventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). +- The [EventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). ## Lifetime @@ -48,15 +48,16 @@ Each of the Event Hubs client types is safe to cache and use as a singleton for Each of the Event Hubs client types in the library supports a set of options to configure its behavior. In addition to influencing a client's area of functionality, the options also support configuration common across all areas. These common options are focused on communication with the Event Hubs service and core functionality; they appear as members of the client options. -### Using web sockets +### Using web sockets Communication with the Event Hubs service can be configured by adjusting the `EventHubConfigurationOptions` that are exposed by the `ConnectionOptions` member of a client options type. By default, the Event Hubs clients communicate using the AMQP protocol over TCP. Some application host environments prefer to restrict raw TCP socket use, especially in many enterprise or VPN scenarios. In these environments, or when a proxy is in use, communication with the Event Hubs service can make use of web sockets by configuring the client's connection settings. For illustration, the `EventHubProducerClientOptions` are demonstrated, but the concept and form are common across the client options types. ```C# Snippet:EventHubs_Sample02_ProducerTransportFullConnectionOptions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var producerOptions = new EventHubProducerClientOptions { @@ -67,34 +68,38 @@ var producerOptions = new EventHubProducerClientOptions }; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` The connection options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Sample02_ProducerTransportProperty -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` ### Setting a custom proxy -A common scenario for adjusting the connection options is configuring a proxy. Proxy support takes the form of the [IWebProxy](https://docs.microsoft.com/dotnet/api/system.net.iwebproxy?view=netcore-3.1) interface, of which [WebProxy](https://docs.microsoft.com/dotnet/api/system.net.webproxy?view=netcore-3.1) is the most common default implementation. Event Hubs supports a proxy only when using `AmqpWebSockets` as the transport type. +A common scenario for adjusting the connection options is configuring a proxy. Proxy support takes the form of the [IWebProxy](https://learn.microsoft.com/dotnet/api/system.net.iwebproxy?view=netcore-3.1) interface, of which [WebProxy](https://learn.microsoft.com/dotnet/api/system.net.webproxy?view=netcore-3.1) is the most common default implementation. Event Hubs supports a proxy only when using `AmqpWebSockets` as the transport type. For illustration, the `EventHubProducerClientOptions` are demonstrated, but the concept and form are common across the client options types. ```C# Snippet:EventHubs_Sample02_ProducerProxyFullConnectionOptions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var producerOptions = new EventHubProducerClientOptions { @@ -106,30 +111,33 @@ var producerOptions = new EventHubProducerClientOptions }; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` The connection options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Sample02_ProducerProxyProperty -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; producerOptions.ConnectionOptions.Proxy = new WebProxy("https://proxyserver:80", true); var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` ### Using the default system proxy -To use the default proxy for your environment, the recommended approach is to make use of [HttpClient.DefaultProxy](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1), which will attempt to detect proxy settings from the ambient environment in a manner consistent with expectations for the target platform. Unfortunately, this member was added for .NET Core 3.1 and is not supported for earlier target frameworks. +To use the default proxy for your environment, the recommended approach is to make use of [HttpClient.DefaultProxy](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient.defaultproxy?view=netcore-3.1), which will attempt to detect proxy settings from the ambient environment in a manner consistent with expectations for the target platform. Unfortunately, this member was added for .NET Core 3.1 and is not supported for earlier target frameworks. ```C# Snippet:EventHubs_Sample02_ConnectionOptionsDefaultProxy var options = new EventHubConnectionOptions @@ -146,27 +154,30 @@ Connections to the Azure Event Hubs service are made using the fully qualified n Some environments using unconventional proxy configurations or with certain configurations of an Express Route circuit require a custom address be used for proper routing, leaving are unable to connect from their on-premises network to the Event Hubs service using the assigned endpoint address. To support these scenarios, a custom endpoint address may be specified as part of the connection options. This custom address will take precedence for establishing the connection to the Event Hubs service. ```C# Snippet:EventHubs_Sample02_ConnectionOptionsCustomEndpoint -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.CustomEndpointAddress = new Uri("amqps://app-gateway.mycompany.com"); var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` ### Influencing SSL certificate validation -For some environments using a proxy or custom gateway for routing traffic to Event Hubs, a certificate not trusted by the root certificate authorities may be issued. This can often be a self-signed certificate from the gateway or one issued by a company's internal certificate authority. +For some environments using a proxy or custom gateway for routing traffic to Event Hubs, a certificate not trusted by the root certificate authorities may be issued. This can often be a self-signed certificate from the gateway or one issued by a company's internal certificate authority. -By default, these certificates are not trusted by the Event Hubs client library and the connection will be refused. To enable these scenarios, a [RemoteCertificateValidationCallback](https://docs.microsoft.com/dotnet/api/system.net.security.remotecertificatevalidationcallback) can be registered to provide custom validation logic for remote certificates. This allows an application to override the default trust decision and assert responsibility for accepting or rejecting the certificate. +By default, these certificates are not trusted by the Event Hubs client library and the connection will be refused. To enable these scenarios, a [RemoteCertificateValidationCallback](https://learn.microsoft.com/dotnet/api/system.net.security.remotecertificatevalidationcallback) can be registered to provide custom validation logic for remote certificates. This allows an application to override the default trust decision and assert responsibility for accepting or rejecting the certificate. ```C# Snippet:EventHubs_Sample02_RemoteCertificateValidationCallback -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); static bool ValidateServerCertificate( object sender, @@ -189,8 +200,9 @@ var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.CertificateValidationCallback = ValidateServerCertificate; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); ``` @@ -201,8 +213,9 @@ The built-in retry policy offers an implementation for an exponential back-off s The values used as thresholds for the different aspects of these strategies can be configured by adjusting the `EventHubsRetryOptions` that are exposed by the `RetryOptions` member of a client options type. For illustration, the `EventHubConsumerClientOptions` are demonstrated, but the concept and form are common across the client options types. ```C# Snippet:EventHubs_Sample02_ConsumerRetryWithFullOptions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumerOptions = new EventHubConsumerClientOptions @@ -218,16 +231,18 @@ var consumerOptions = new EventHubConsumerClientOptions var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, consumerOptions); ``` The retry options are populated by default; you may set just the desired properties rather than creating a new instance, if you prefer. ```C# Snippet:EventHubs_Sample02_ConsumerRetryByProperty -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumerOptions = new EventHubConsumerClientOptions(); @@ -236,8 +251,9 @@ consumerOptions.RetryOptions.MaximumRetries = 5; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, consumerOptions); ``` @@ -288,4 +304,4 @@ var options = new EventHubsRetryOptions { CustomRetryPolicy = new ExampleRetryPolicy() }; -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md index 198b62bb51ac2..85759f4524b03 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md @@ -11,7 +11,7 @@ This sample discusses the metadata available for an Event Hub instance and demon # Client types -Querying and inspecting metadata is a common scenario when publishing and reading events. As a result, the core operations are available to the `EventHubProducerClient` and `EventHubConsumerClient`. +Querying and inspecting metadata is a common scenario when publishing and reading events. As a result, the core operations are available to the `EventHubProducerClient` and `EventHubConsumerClient`. Both the `EventHubProducerClient` and `EventHubConsumerClient` are safe to cache and use for the lifetime of an application, which is best practice when the application publishes or reads events regularly or semi-regularly. The clients are responsible for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling either the `CloseAsync` or `DisposeAsync` method on a client as the application is shutting down will ensure that network resources and other unmanaged objects are properly cleaned up. @@ -20,10 +20,14 @@ Both the `EventHubProducerClient` and `EventHubConsumerClient` are safe to cache Because the Event Hubs clients operate on a specific Event Hub, it is often helpful for them to have knowledge of its context. In particular, it is common for clients to understand the partitions available. The ability to query the Event Hub properties is available using the `EventHubProducerClient` and `EventHubConsumerClient`. For illustration, the `EventHubProducerClient` is demonstrated, but the concept and form are common across both clients. ```C# Snippet:EventHubs_Sample03_InspectHub -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -45,10 +49,14 @@ finally Due to their importance, there is also a shorthand way to query the partitions of an Event Hub. This capability is available using the `EventHubProducerClient` and `EventHubConsumerClient`. For illustration, the `EventHubProducerClient` is demonstrated, but the concept and form are common across both clients. ```C# Snippet:EventHubs_Sample03_QueryPartitions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -70,11 +78,16 @@ This query is useful for occasionally inspecting partitions, but should not be u For illustration, the `EventHubConsumerClient` is demonstrated, but the concept and form are common across both clients. ```C# Snippet:EventHubs_Sample03_InspectPartition -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; -var consumer = new EventHubConsumerClient(consumerGroup, connectionString, eventHubName); +var consumer = new EventHubConsumerClient( + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -94,4 +107,4 @@ finally { await consumer.CloseAsync(); } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md index 523c0d66d6f7b..94ca65f799719 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md @@ -33,11 +33,11 @@ The `EventHubBufferedProducerClient` aims to reduce complexity by owning the res ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://docs.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Publishing size constraints -There is a limit to the size (in bytes) that can be published in a single operation. To accurately determine the size of an event, it must be measured in the format used by the active protocol in order to properly account for overhead. The size limit is controlled by the Event Hubs service and differs for different types of Event Hub instances. +There is a limit to the size (in bytes) that can be published in a single operation. To accurately determine the size of an event, it must be measured in the format used by the active protocol in order to properly account for overhead. The size limit is controlled by the Event Hubs service and differs for different types of Event Hub instances. Applications using the `EventHubBufferedProducerClient` do not need to track size limitations; the producer will ensure that batches are correctly sized when publishing. @@ -50,10 +50,14 @@ All of the events that belong to an `EventDataBatch` are considered part of a si To create an `EventDataBatch`, the `EventProducerClient` must be used, as the size limit is queried from the Event Hubs service the first time that a batch is created. After the size has been queried once, batch creation will not incur the cost of a service request. The `EventDataBatch` follows a `TryAdd` pattern; if the call returns `true` then the event was accepted into the batch. If not, then the event was unable to fit. To avoid accidentally losing events, it is recommended to check the return value when adding events. ```C# Snippet:EventHubs_Sample04_EventBatch -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -76,7 +80,7 @@ The `EventDataBatch` is scoped to a single publish operation. Once that operati ## Publishing and partitions -Every event that is published is sent to one of the [partitions](https://docs.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. The application may request publishing to a specific partition, grouped using a partition key, or allow the partition to be chosen automatically. +Every event that is published is sent to one of the [partitions](https://learn.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. The application may request publishing to a specific partition, grouped using a partition key, or allow the partition to be chosen automatically. When using the `EventHubProducerClient`, each batch must choose the partition assignment strategy at the time it is created, and that strategy is applied to all events in the batch. The `EventHubBufferedProducerClient` allows the partition assignment strategy to be chosen for each individual event that is enqueued, and the producer will ensure that batches are constructed with the proper strategy. @@ -89,10 +93,14 @@ Allowing automatic assignment to partitions is recommended when publishing needs When using the `EventHubBufferedProducerClient`, events enqueued with no options specified will be automatically routed. Because the producer manages publishing, there is no explicit call. When the producer is closed, it will ensure that any remaining enqueued events have been published. All of your event data will be published to one of the Event Hub partitions, though there may be a slight delay until it is available to be read. ```C# Snippet:EventHubs_Sample04_AutomaticRoutingBuffered -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); +var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -133,10 +141,14 @@ finally When using the `EventHubProducerClient` a batch is first created and then published. The `SendAsync` call will receive an acknowledgment from the Event Hubs service; so long as no exception is thrown, your application can consider publishing successful. All of your event data will be published to one of the Event Hub partitions, though there may be a slight delay until it is available to be read. ```C# Snippet:EventHubs_Sample04_AutomaticRouting -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -163,7 +175,7 @@ finally ## Publishing events with a partition key When publishing events, it may be desirable to request that the Event Hubs service keep the different event batches together on the same partition. This can be accomplished by setting a partition key when creating the batch. The partition key is NOT the identifier of a specific partition. Rather, it is an arbitrary piece of string data that Event Hubs uses as the basis to compute a hash value. Event Hubs will associate the hash value with a specific partition, ensuring that any events published with the same partition key are routed to the same partition. - + There is no means of predicting which partition will be associated with a given partition key; we can only be assured that it will be a consistent choice of partition. If you have a need to understand which exact partition an event is published to, you will need to specify the partition directly rather than using a partition key. ### Event Hub Buffered Producer Client @@ -173,10 +185,14 @@ When using the `EventHubBufferedProducerClient`, events are enqueued with a part **Note:** It is important to be aware that if you are using a partition key, you may not also specify a partition identifier; they are mutually exclusive. ```C# Snippet:EventHubs_Sample04_PartitionKeyBuffered -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); +var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -224,10 +240,14 @@ When using the `EventHubProducerClient` a batch is first created with a partitio **Note:** It is important to be aware that if you are using a partition key, you may not also specify a partition identifier; they are mutually exclusive. ```C# Snippet:EventHubs_Sample04_PartitionKey -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -258,7 +278,7 @@ finally ## Publishing events to a specific partition -When publishing, it may be desirable to request that the Event Hubs service place a batch on a specific partition, for organization and processing. For example, you may have designated one partition of your Event Hub as being responsible for all of your telemetry-related events. This can be accomplished by setting the identifier of the desired partition when creating the batch. +When publishing, it may be desirable to request that the Event Hubs service place a batch on a specific partition, for organization and processing. For example, you may have designated one partition of your Event Hub as being responsible for all of your telemetry-related events. This can be accomplished by setting the identifier of the desired partition when creating the batch. ### Event Hub Buffered Producer Client @@ -267,10 +287,14 @@ When using the `EventHubBufferedProducerClient`, events are enqueued with a part **Note:** It is important to be aware that if you are using a partition key, you may not also specify a partition identifier; they are mutually exclusive. ```C# Snippet:EventHubs_Sample04_PartitionIdBuffered -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); +var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -320,10 +344,14 @@ When using the `EventHubProducerClient` a batch is first created with a partitio **Note:** It is important to be aware that if you are using a partition identifier, you may not also specify a partition key; they are mutually exclusive. ```C# Snippet:EventHubs_Sample04_PartitionId -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -361,10 +389,14 @@ Because an event consists mainly of an opaque set of bytes, it may be difficult This metadata is not used by, or in any way meaningful to, the Event Hubs service; it exists only for coordination between event publishers and consumers. ```C# Snippet:EventHubs_Sample04_CustomMetadata -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); +var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -426,15 +458,15 @@ It is also important that you guard against exceptions in your handler code; it ## Tuning throughput for buffered publishing -To ensure consistent performance and throughput, it is common for applications to make decisions around the pattern of publishing that they use - adjusting the frequency that batches are sent and how many operations take place concurrently. Because the `EventHubBufferedProducerClient` manages batches and publishing in the background, your application cannot directly control these aspects. +To ensure consistent performance and throughput, it is common for applications to make decisions around the pattern of publishing that they use - adjusting the frequency that batches are sent and how many operations take place concurrently. Because the `EventHubBufferedProducerClient` manages batches and publishing in the background, your application cannot directly control these aspects. Because the handlers are awaited, it is strongly advised that you *not* invoke `CloseAsync` or `DisposeAsync` from the handlers; doing so is likely to result in a deadlock scenario. It is safe to attempt to resend events by adding them to the back of the buffer by calling `EnqueueEventAsync` or `EnqueueEventsAsync` -By default, the `EventHubBufferedProducerClient` uses a set of values that will perform well for general-case scenarios, balancing consistent performance with ensuring that the order of events is maintained. In the case where your application has different needs, it can provide a set of options when constructing the producer that will influence publishing behavior and help ensure that it is optimal for your specific scenarios. +By default, the `EventHubBufferedProducerClient` uses a set of values that will perform well for general-case scenarios, balancing consistent performance with ensuring that the order of events is maintained. In the case where your application has different needs, it can provide a set of options when constructing the producer that will influence publishing behavior and help ensure that it is optimal for your specific scenarios. The performance-related settings are: -- **MaximumWaitTime**: This is the longest that the producer will wait for a batch to be full before publishing. For applications that publish frequently, waiting longer for a full batch may improve efficiency. For applications that publish infrequently or sporadically, a lower value will ensure that events are not held in buffer waiting. The default wait time is 1 second. +- **MaximumWaitTime**: This is the longest that the producer will wait for a batch to be full before publishing. For applications that publish frequently, waiting longer for a full batch may improve efficiency. For applications that publish infrequently or sporadically, a lower value will ensure that events are not held in buffer waiting. The default wait time is 1 second. - **MaximumConcurrentSends**: The number of concurrent `SendAsync` calls that the producer will make. Each call is a network request that publishes a single batch. A higher degree of concurrency can improve throughput for applications that use an Event Hub with a large number of partitions. Because the producer is highly asynchronous and is running background tasks, we recommend being careful when selecting a value to avoid creating contention in the thread pool. Testing under normal load is essential. The default concurrency is equal to the number of cores in the host environment. @@ -442,13 +474,14 @@ The performance-related settings are: - **MaximumEventBufferLengthPerPartition**: The maximum number of events that can be buffered for each individual partition. This is intended to ensure that your application does not run out of memory if buffering happens more frequently than events can be published. When this limit is reached, your application can continue to call `EnqueueEventAsync` or `EnqueueEventsAsync` without an error; the call will block until space is available. For applications that publish a high number of smaller-sized events, increasing this limit may help to improve throughput. For scenarios where the application is buffering large events and needs to control memory use, lowering this limit may be helpful. The default buffer length is 1500 events per partition. -- **EnableIdempotentRetries**: Indicates whether or not events should be published using idempotent semantics for retries. If enabled, retries during publishing will attempt to avoid duplication with a small cost to overall performance and throughput. +- **EnableIdempotentRetries**: Indicates whether or not events should be published using idempotent semantics for retries. If enabled, retries during publishing will attempt to avoid duplication with a small cost to overall performance and throughput. **_NOTE:_** Enabling idempotent retries does not guarantee exactly-once semantics. The Event Hubs at-least-once delivery contract still applies; duplicates are still possible but the chance of them occurring is much lower when idempotent retries are enabled. ```C# Snippet:EventHubs_Sample04_BufferedConfiguration -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var options = new EventHubBufferedProducerClientOptions { @@ -459,7 +492,11 @@ var options = new EventHubBufferedProducerClientOptions EnableIdempotentRetries = true }; -var producer = new EventHubBufferedProducerClient(connectionString, eventHubName, options); +var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential, + options); // The failure handler is required and invoked after all allowable // retries were applied. @@ -497,17 +534,22 @@ finally ## Creating and publishing multiple batches -Because an `EventDataBatch` is scoped to a single publish operation, it is often necessary to more than a single batch to publish events. This can take many forms, with varying levels of sophistication and complexity, depending on an application's needs. One common approach is to stage the events to be published in a `Queue` and use that as a source for building batches. +Because an `EventDataBatch` is scoped to a single publish operation, it is often necessary to more than a single batch to publish events. This can take many forms, with varying levels of sophistication and complexity, depending on an application's needs. One common approach is to stage the events to be published in a `Queue` and use that as a source for building batches. The following illustration breaks the process into discrete steps, transforming the queue of events into a set of batches to be published. This is done to help isolate the logic of creating batches for readability. Production applications may wish to publish batches as they become full to make more efficient use of resources. **Note:** The batch is responsible for unmanaged resources; it is recommended that you `Dispose` the batch after it has been published. ```C# Snippet:EventHubs_Sample04_MultipleBatches -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); + +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); -var producer = new EventHubProducerClient(connectionString, eventHubName); var batches = default(IEnumerable); var eventsToSend = new Queue(); @@ -576,17 +618,21 @@ private static async Task> BuildBatchesAsync( ## Publishing events with an implicit batch -In scenarios where an application using the `EventProducerClient` wishes to publish events more frequently and is not concerned with exceeding the size limitation, it is reasonable to bypass the safety offered by using the `EventDataBatch` to offer minor throughput gains and fewer memory allocations. In support of this scenario, the `EventProducerClient` offers a `SendAsync` overload that accepts a set of events. This method delegates validation to the Event Hubs service to avoid the performance cost of a client-side measurement. If the set of events that was published exceeds the size limit, an [EventHubsException](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception?view=azure-dotnet) will be surfaced with its `Reason` set to [MessageSizeExceeded](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception.failurereason?view=azure-dotnet). +In scenarios where an application using the `EventProducerClient` wishes to publish events more frequently and is not concerned with exceeding the size limitation, it is reasonable to bypass the safety offered by using the `EventDataBatch` to offer minor throughput gains and fewer memory allocations. In support of this scenario, the `EventProducerClient` offers a `SendAsync` overload that accepts a set of events. This method delegates validation to the Event Hubs service to avoid the performance cost of a client-side measurement. If the set of events that was published exceeds the size limit, an [EventHubsException](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception?view=azure-dotnet) will be surfaced with its `Reason` set to [MessageSizeExceeded](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventhubsexception.failurereason?view=azure-dotnet). When events are passed in this form, the `EventProducerClient` will package them as a single publishing operation. When the set is published, the result is atomic; either publishing was successful for all events, or it has failed for all events. Partial success or failure when publishing a batch is not possible. When published, the `EventHubProducerClient` will receive an acknowledgment from the Event Hubs service; so long as no exception is thrown by this call, your application can consider publishing successful. The service assumes responsibility for delivery of the set. All of your event data will be published to one of the Event Hub partitions, though there may be a slight delay until it is available to be read. ```C# Snippet:EventHubs_Sample04_NoBatch -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -611,10 +657,14 @@ finally In some scenarios, such as when bandwidth is limited or publishers need to maintain control over how much data is transmitted at a time, a custom size limit (in bytes) may be specified when creating an `EventDataBatch`. This will override the default limit specified by the Event Hub and allows an application to use the `EventDataBatch` to ensure that the size of events can be measured accurately and deterministically. It is important to note that the custom limit may not exceed the limit specified by the Event Hub. ```C# Snippet:EventHubs_Sample04_CustomBatchSize -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -641,4 +691,4 @@ finally { await producer.CloseAsync(); } -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md index 445232b74daf3..7350b783ebd02 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md @@ -27,37 +27,39 @@ Each of the event consumer client types are safe to cache and use for the lifeti ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://docs.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Reading and consumer groups -An Event Hub consumer is associated with a specific Event Hub and [consumer group](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." These examples will make use of the default consumer group for illustration. +An Event Hub consumer is associated with a specific Event Hub and [consumer group](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it, named "$Default." These examples will make use of the default consumer group for illustration. Each consumer has a unique view of the events in a partition that it reads from, which means that events are available to all consumers and are not removed from the partition when read. This allows consumers to read and process events from the Event Hub at different speeds without interfering with one another. ## Reading and partitions -Every event that is published is sent to one of the [partitions](https://docs.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. When reading events, an application may be interested in reading events from all partitions or limiting to a single partition, depending on the application scenarios and throughput needs. The `EventHubConsumerClient` is not associated with any specific partition and the same instance can be used for reading from multiple partitions. +Every event that is published is sent to one of the [partitions](https://learn.microsoft.com/azure/architecture/reference-architectures/event-hubs/partitioning-in-event-hubs-and-kafka) of the Event Hub. When reading events, an application may be interested in reading events from all partitions or limiting to a single partition, depending on the application scenarios and throughput needs. The `EventHubConsumerClient` is not associated with any specific partition and the same instance can be used for reading from multiple partitions. The `EventHubConsumerClient` supports reading events from a single partition and also offers an easy way to familiarize yourself with Event Hubs by reading from all partitions without the rigor and complexity that you would need in a production application. For reading events from all partitions in a production scenario, we strongly recommend using the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package over the `EventHubConsumerClient`. ## Read events from all partitions -The `ReadEventsAsync` method of the `EventHubConsumerClient` allows events to be read from each partition for prototyping and exploring, but is not a recommended approach for production scenarios. Events are consumed as an [Async Enumerable](https://docs.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8), where enumeration will emit events one-by-one. By default, reading starts from the beginning of partitions and all events present will be surfaced. +The `ReadEventsAsync` method of the `EventHubConsumerClient` allows events to be read from each partition for prototyping and exploring, but is not a recommended approach for production scenarios. Events are consumed as an [Async Enumerable](https://learn.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8), where enumeration will emit events one-by-one. By default, reading starts from the beginning of partitions and all events present will be surfaced. -Because an Event Hub represents a potentially infinite series of events, the enumerator will not exit when no events are available in the Event Hub partitions. Instead, it will wait for more events to be published. To stop reading, applications will need to either signal a [CancellationToken](https://docs.microsoft.com/dotnet/api/system.threading.cancellationtoken?view=netcore-3.1) or call `break` from the body of the loop. +Because an Event Hub represents a potentially infinite series of events, the enumerator will not exit when no events are available in the Event Hub partitions. Instead, it will wait for more events to be published. To stop reading, applications will need to either signal a [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken?view=netcore-3.1) or call `break` from the body of the loop. This example illustrates stopping after either 3 events have been read or 45 seconds has elapsed, whichever occurs first. ```C# Snippet:EventHubs_Sample05_ReadAllPartitions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -94,19 +96,21 @@ finally ## Read events from all partitions with a maximum wait time -When using `ReadEventAsync`, it can sometimes be advantageous to ensure that the [Async Enumerable](https://docs.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8) returns control to the application's code in the loop body periodically, whether an event was available or not. This allows for the application to detect when events are no longer being published and is often used for emitting heartbeat data as a health check for consumers. +When using `ReadEventAsync`, it can sometimes be advantageous to ensure that the [Async Enumerable](https://learn.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8) returns control to the application's code in the loop body periodically, whether an event was available or not. This allows for the application to detect when events are no longer being published and is often used for emitting heartbeat data as a health check for consumers. This example illustrates waiting for a maximum of one second for an event to be read; if no event was available in that time, the loop ticks with an empty `PartitionEvent`. Once the example loop has ticked a total of 10 times, with or without an event available, it will exit. ```C# Snippet:EventHubs_Sample05_ReadAllPartitionsWaitTime -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -152,14 +156,16 @@ By default, reading starts from the beginning of partitions. It is possible to This example illustrates reading from the end of each partition, and will do so for 30 seconds regardless of how many events have been read. ```C# Snippet:EventHubs_Sample05_ReadAllPartitionsFromLatest -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -189,21 +195,23 @@ finally ## Read events from a partition -The `ReadEventsFromPartitionAsync` method of the `EventHubConsumerClient` allows events to be read from a specific partition and is suitable for production scenarios. Events are consumed as an [Async Enumerable](https://docs.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8), where enumeration will emit events one-by-one. `ReadEventsFromPartitionAsync` targets a single partition, allowing consumers to request reading from a specific location in the partition's event stream by creating an [EventPosition](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventposition?view=azure-dotnet). +The `ReadEventsFromPartitionAsync` method of the `EventHubConsumerClient` allows events to be read from a specific partition and is suitable for production scenarios. Events are consumed as an [Async Enumerable](https://learn.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8), where enumeration will emit events one-by-one. `ReadEventsFromPartitionAsync` targets a single partition, allowing consumers to request reading from a specific location in the partition's event stream by creating an [EventPosition](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventposition?view=azure-dotnet). -Because an Event Hub represents a potentially infinite series of events, the enumerator will not exit when no further events are available in the Event Hub partitions. Instead, it will wait for more events to be published. To stop reading, applications will need to either signal a [CancellationToken](https://docs.microsoft.com/dotnet/api/system.threading.cancellationtoken?view=netcore-3.1) or call `break` from the body of the loop. +Because an Event Hub represents a potentially infinite series of events, the enumerator will not exit when no further events are available in the Event Hub partitions. Instead, it will wait for more events to be published. To stop reading, applications will need to either signal a [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken?view=netcore-3.1) or call `break` from the body of the loop. This example illustrates the `CancellationToken` approach, reading from the beginning of the partition for only 30 seconds, regardless of how many events are read. ```C# Snippet:EventHubs_Sample05_ReadPartition -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -237,19 +245,21 @@ finally ## Read events from a partition with a maximum wait time -When using `ReadEventsFromPartitionAsync`, it can sometimes be advantageous to ensure that the [Async Enumerable](https://docs.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8) returns control to the application's code in the loop body periodically, whether an event was available or not. This allows for the application to detect when events are no longer being published and is often used for emitting heartbeat data as a health check for consumers. +When using `ReadEventsFromPartitionAsync`, it can sometimes be advantageous to ensure that the [Async Enumerable](https://learn.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8) returns control to the application's code in the loop body periodically, whether an event was available or not. This allows for the application to detect when events are no longer being published and is often used for emitting heartbeat data as a health check for consumers. This example illustrates waiting for a maximum of one second for an event to be read; if no event was available, the loop ticks with an empty `PartitionEvent`. Once the example loop has ticked a total of 10 times, with or without an event available, it will exit. ```C# Snippet:EventHubs_Sample05_ReadPartitionWaitTime -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -308,14 +318,16 @@ finally When reading event from a partition, consumers can request to begin reading from the partition's event stream at a specific point in time. This example illustrates reading events starting with an hour prior to the current time, and will continue reading for a duration of 30 seconds before cancellation is triggered. ```C# Snippet:EventHubs_Sample05_ReadPartitionFromDate -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -356,14 +368,16 @@ When reading event from a partition, consumers can request to begin reading from This example illustrates reading events starting with the last offset that was published to the partition, and will do so for 30 seconds regardless of how many events have been read. ```C# Snippet:EventHubs_Sample05_ReadPartitionFromOffset -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -398,19 +412,21 @@ finally ## Read events from a partition, starting from a specific sequence number -When reading event from a partition, consumers can request to begin reading from the partition's event stream at a specific sequence number. This is often used when a consumer has already processed some events from the partition and would like to resume from that point rather than reprocessing. Sequence numbers follow a consistent pattern within the context of a specific partition; they will be contiguous and in increasing order. +When reading event from a partition, consumers can request to begin reading from the partition's event stream at a specific sequence number. This is often used when a consumer has already processed some events from the partition and would like to resume from that point rather than reprocessing. Sequence numbers follow a consistent pattern within the context of a specific partition; they will be contiguous and in increasing order. This example illustrates reading events starting with the last sequence number that was published to the partition, and will do so for 30 seconds regardless of how many events have been read. ```C# Snippet:EventHubs_Sample05_ReadPartitionFromSequence -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -445,21 +461,23 @@ finally ## Query partition information while reading -Some application scenarios call for understanding the "backlog" of events in an Event Hub, where an event being consumed is compared with the latest event available in the partition to understand how many events have accumulated and have yet to be processed. This allows applications to make reasoned decisions about scaling consumers or throttling publishers to ensure that event processing does not fall too far behind. +Some application scenarios call for understanding the "backlog" of events in an Event Hub, where an event being consumed is compared with the latest event available in the partition to understand how many events have accumulated and have yet to be processed. This allows applications to make reasoned decisions about scaling consumers or throttling publishers to ensure that event processing does not fall too far behind. While the `EventHubConsumerClient` can be used to directly query the partition, doing so frequently is likely to impact performance. When partition information is needed often, an option can be set when reading events to query the last published event information for the partition in real-time and surface it with events being processed. This example illustrates requesting information on the last published event for the partition while reading events. Reading will be performed for 30 seconds regardless of how many events have been read. ```C# Snippet:EventHubs_Sample05_ReadPartitionTrackLastEnqueued -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -505,12 +523,13 @@ finally When an application is working at a high volume and is willing to accept additional complexity to maximize throughput, the `PartitionReceiver` is worthy of consideration. It provides a very thin wrapper over the Event Hubs transport, allowing events to be read in batches as well as supporting options to control transport behavior. More detail on the design and philosophy for the `PartitionReceiver` can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-partition-receiver.md). -Because the receiver endeavors to avoid adding overhead, it does not follow the patterns established in the `EventHubConsumerClient` nor offer some of its convenience. Of particular note is that the model for reading events is based on polling with its `ReceiveBatchAsync` method instead of an iterator. It is also important to be aware that the transport library is timeout-based and will not honor cancellation when a service operation is active. +Because the receiver endeavors to avoid adding overhead, it does not follow the patterns established in the `EventHubConsumerClient` nor offer some of its convenience. Of particular note is that the model for reading events is based on polling with its `ReceiveBatchAsync` method instead of an iterator. It is also important to be aware that the transport library is timeout-based and will not honor cancellation when a service operation is active. This example illustrates the basic flow of reading events and will do so for 30 seconds regardless of how many events have been read. ```C# Snippet:EventHubs_Sample05_ReadPartitionWithReceiver -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; using CancellationTokenSource cancellationSource = new CancellationTokenSource(); @@ -518,7 +537,10 @@ cancellationSource.CancelAfter(TimeSpan.FromSeconds(30)); string firstPartition; -await using (var producer = new EventHubProducerClient(connectionString, eventHubName)) +await using (var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential)) { firstPartition = (await producer.GetPartitionIdsAsync()).First(); } @@ -527,8 +549,9 @@ var receiver = new PartitionReceiver( consumerGroup, firstPartition, EventPosition.Earliest, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md index 01ab385b5b05a..6fd231158eee7 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample06_IdentityAndSharedAccessCredentials.md @@ -23,29 +23,29 @@ Depending on the type of authorization that you wish to use, additional setup ma ### Identity authorization -**Azure.Identity** +**Azure.Identity** -The `Azure.Identity` library is recommended for identity-based authentication across the different sources supported by the Azure platform for [role-based access control (RBAC)](https://docs.microsoft.com/azure/role-based-access-control/overview). This includes Azure Active Directory principals and Managed Identities. To allow for the best developer experience, and one that supports promoting applications between environments without code changes, this sample will concentrate on the `DefaultAzureCredential`. Please see the [Azure.Identity README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential) for details on configuring your environment for `DefaultAzureCredential` integration. +The `Azure.Identity` library is recommended for identity-based authentication across the different sources supported by the Azure platform for [role-based access control (RBAC)](https://learn.microsoft.com/azure/role-based-access-control/overview). This includes Azure Active Directory principals and Managed Identities. To allow for the best developer experience, and one that supports promoting applications between environments without code changes, this sample will concentrate on the `DefaultAzureCredential`. Please see the [Azure.Identity README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential) for details on configuring your environment for `DefaultAzureCredential` integration. -**Role Assignments** +**Role Assignments** -Once your environment is configured, you'll need to ensure that the principal that you've chosen has access to your Event Hubs resources in Azure. To do so, they will need to be assigned the appropriate role. For those unfamiliar with role assignments, it is recommended to follow [these steps](https://docs.microsoft.com/azure/event-hubs/authenticate-managed-identity?tabs=latest#to-assign-azure-roles-using-the-azure-portal) in the Azure portal for the most intuitive experience. Roles may also be assigned via the [Azure CLI](https://docs.microsoft.com/cli/azure/role/assignment?view=azure-cli-latest#az_role_assignment_create) or [PowerShell](https://docs.microsoft.com/powershell/module/az.resources/new-azroleassignment), though these require more in-depth knowledge of the Azure platform and may be difficult for developers exploring Azure for the first time. +Once your environment is configured, you'll need to ensure that the principal that you've chosen has access to your Event Hubs resources in Azure. To do so, they will need to be assigned the appropriate role. For those unfamiliar with role assignments, it is recommended to follow [these steps](https://learn.microsoft.com/azure/event-hubs/authenticate-managed-identity?tabs=latest#to-assign-azure-roles-using-the-azure-portal) in the Azure portal for the most intuitive experience. Roles may also be assigned via the [Azure CLI](https://learn.microsoft.com/cli/azure/role/assignment?view=azure-cli-latest#az_role_assignment_create) or [PowerShell](https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignment), though these require more in-depth knowledge of the Azure platform and may be difficult for developers exploring Azure for the first time. -The available role choices for Event Hubs are: +The available role choices for Event Hubs are: -- [Azure Event Hubs Data Owner](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-owner) for full access to read and publish events. -- [Azure Event Hubs Data Receiver](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-receiver) for the ability to read events but not publish them. -- [Azure Event Hubs Data Sender](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-sender) for the ability to publish events but not read them. +- [Azure Event Hubs Data Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-owner) for full access to read and publish events. +- [Azure Event Hubs Data Receiver](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-receiver) for the ability to read events but not publish them. +- [Azure Event Hubs Data Sender](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-event-hubs-data-sender) for the ability to publish events but not read them. ### Event Hubs Shared Access Signature authorization Shared access signatures (SAS) are recommended over shared access keys when RBAC cannot be used. A shared access signature allows for granular and time-limited access to Event Hubs resources. In order to use SAS-based authorization, a token needs to be generated and the associated Event Hubs resource needs to be configured to authorize its use. -The steps to generate a SAS token can be found in the [example below](#generating-sas-tokens) and are detailed in the article "[Authenticate access to Event Hubs resources using shared access signatures (SAS)](https://docs.microsoft.com/azure/event-hubs/authenticate-shared-access-signature)". Details for for some additional languages are discussed in the article "[Generate SAS token](https://docs.microsoft.com/rest/api/eventhub/generate-sas-token)". Information about configuring SAS authorization can be found in the article "[Authorizing access to Event Hubs resources using Shared Access Signatures](https://docs.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature)". +The steps to generate a SAS token can be found in the [example below](#generating-sas-tokens) and are detailed in the article "[Authenticate access to Event Hubs resources using shared access signatures (SAS)](https://learn.microsoft.com/azure/event-hubs/authenticate-shared-access-signature)". Details for for some additional languages are discussed in the article "[Generate SAS token](https://learn.microsoft.com/rest/api/eventhub/generate-sas-token)". Information about configuring SAS authorization can be found in the article "[Authorizing access to Event Hubs resources using Shared Access Signatures](https://learn.microsoft.com/azure/event-hubs/authorize-access-shared-access-signature)". ### Event Hubs Shared Access Key authorization -Shared access keys for Event Hubs authorization are generated when access policies are created for an Event Hubs namespace or one of its Event Hub instances. Since these keys are most often used in association with a connection string, the article "[Get an Event Hubs connection string](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string#get-connection-string-from-the-portal)" is the best source of information on generating and accessing them. +Shared access keys for Event Hubs authorization are generated when access policies are created for an Event Hubs namespace or one of its Event Hub instances. Since these keys are most often used in association with a connection string, the article "[Get an Event Hubs connection string](https://learn.microsoft.com/azure/event-hubs/event-hubs-get-connection-string#get-connection-string-from-the-portal)" is the best source of information on generating and accessing them. In step 6 of the article, the policy that you select will be the name of your shared access key when used for credential authorization. In step 7, you'll want to copy the "Primary key" rather than connection string. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md index f63525cf3146e..b10c08f00868f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample07_EarlierLanguageVersions.md @@ -1,25 +1,29 @@ # Using Earlier Versions of C# and Visual Studio -The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. +The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal. - You can still use the Event Hubs client library with previous C# language versions, by managing asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version that can consume a `netstandard2.0` package, including earlier versions of .NET Core or the .NET framework. For more information, see the [.NET Standard](https://docs.microsoft.com/dotnet/standard/net-standard) documentation and [how to specify target frameworks](https://docs.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). - + You can still use the Event Hubs client library with previous C# language versions, by managing asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version that can consume a `netstandard2.0` package, including earlier versions of .NET Core or the .NET framework. For more information, see the [.NET Standard](https://learn.microsoft.com/dotnet/standard/net-standard) documentation and [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). + ## Table of contents - [Publish a batch of events using C# 7](#publish-a-batch-of-events-using-c-7) - [Read events from all partitions using C# 7](#read-events-from-all-partitions-using-c-7) ## Publish a batch of events using C# 7 - + This example illustrates publishing a batch with a single event, allowing the Event Hubs service to assign the partition to which it will be published. For more information on publishing, see: [Sample04_PublishingEvents](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md). - + ```C# Snippet:EventHubs_Sample07_Publish -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -47,14 +51,16 @@ The `ReadEventsAsync` method of the `EventHubConsumerClient` allows events to be This example illustrates reading either 50 events or stopping after 30 seconds has elapsed, whichever occurs first. For more information on publishing, see: [Sample05_ReadingEvents](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md). ```C# Snippet:EventHubs_Sample07_ReadAllPartitions -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -101,6 +107,6 @@ finally await consumer.CloseAsync(); } ``` - - + + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md index 38db6ff2f12cf..4bee9d82a794e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md @@ -58,15 +58,17 @@ public class CustomProcessor : PluggableCheckpointStoreEventProcessor diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md index cc41ffb6798f6..687f3c2805f35 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample09_ObservableEventBatch.md @@ -93,10 +93,14 @@ An `EventHubProducerClient` is safe to cache and use for the lifetime of the app ## Accessing the EventData Instances ```C# Snippet:Sample09_AccessingEventData -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -135,10 +139,14 @@ finally This sample demonstrates how to add an `EventData` identification property that can be used to verify that a given event ID was added to the observable batch. ```C# Snippet:Sample09_CheckingBatch -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; +var credential = new DefaultAzureCredential(); -var producer = new EventHubProducerClient(connectionString, eventHubName); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md index d9b9be2f36651..b1e656b278b4a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample10_AzureEventSourceListener.md @@ -1,6 +1,6 @@ # Capturing Event Hubs logs using the AzureEventSourceListener -The Event Hubs client library is instrumented using the .NET [`EventSource`](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource) mechanism for logging. When instrumenting or diagnosing issues with applications that consume the library, it is often helpful to have access to the Event Hubs logs. The following scenarios demonstrate how to use the [`AzureEventSourceListener`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md#logging) from the `Azure.Core` package to capture logs emitted by the Event Hubs client library. +The Event Hubs client library is instrumented using the .NET [`EventSource`](https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource) mechanism for logging. When instrumenting or diagnosing issues with applications that consume the library, it is often helpful to have access to the Event Hubs logs. The following scenarios demonstrate how to use the [`AzureEventSourceListener`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md#logging) from the `Azure.Core` package to capture logs emitted by the Event Hubs client library. ## Table of contents @@ -28,9 +28,14 @@ The following snippet demonstrates an example of capturing all log information f This example captures all Azure SDK logs from any client library in use, writing them to the standard `Console` output stream. ```C# Snippet:EventHubs_Sample10_ConsoleListener -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; -var producer = new EventHubProducerClient(connectionString, eventHubName); +var credential = new DefaultAzureCredential(); + +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener consoleListener = AzureEventSourceListener.CreateConsoleLogger(EventLevel.LogAlways); @@ -52,12 +57,17 @@ finally ## Capture all events and write them to `Trace` -Similar to the previous example, this snippet captures all logs, but writes them to [`Trace`](https://docs.microsoft.com/dotnet/api/system.diagnostics.trace) output. This approach may be desirable for applications that do not have the `Console` available. +Similar to the previous example, this snippet captures all logs, but writes them to [`Trace`](https://learn.microsoft.com/dotnet/api/system.diagnostics.trace) output. This approach may be desirable for applications that do not have the `Console` available. ```C# Snippet:EventHubs_Sample10_TraceListener -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; -var producer = new EventHubProducerClient(connectionString, eventHubName); +var credential = new DefaultAzureCredential(); + +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener traceListener = AzureEventSourceListener.CreateTraceLogger(EventLevel.LogAlways); @@ -83,12 +93,17 @@ This examples demonstrates using a callback with the listener to allow custom lo In the snippet below, the `Verbose` messages for the `Azure-Identity` event source are captured and written to `Trace` output. Log messages for the `Azure-Messaging-EventHubs` event source are filtered to capture only a specific set to aid in debugging publishing, which are then written to the standard `Console` output. -More information about the `args` parameter for the callback can be found in the [EventWrittenEventArgs](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventwritteneventargs) documentation.. +More information about the `args` parameter for the callback can be found in the [EventWrittenEventArgs](https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventwritteneventargs) documentation.. ```C# Snippet:EventHubs_Sample10_CustomListenerWithFilter -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; -var producer = new EventHubProducerClient(connectionString, eventHubName); +var credential = new DefaultAzureCredential(); + +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener customListener = new AzureEventSourceListener((args, message) => { @@ -130,12 +145,17 @@ finally For scenarios where capturing logs to `Trace` or `Console` outputs isn't ideal, log information can be streamed into a variety of targets, such as Azure Storage, databases, and files for durable persistence. This example demonstrates capturing error logs to a text file so that they can be analyzed later, while capturing non-error information to `Console` output. ```C# Snippet:EventHubs_Sample10_CustomListenerWithFile -var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; +var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; -var producer = new EventHubProducerClient(connectionString, eventHubName); +var credential = new DefaultAzureCredential(); using Stream stream = new FileStream("<< PATH TO THE FILE >>", FileMode.OpenOrCreate, FileAccess.Write); +var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); + using StreamWriter streamWriter = new StreamWriter(stream) { AutoFlush = true diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md index 261fe72ca2432..e148dd792149c 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md @@ -20,8 +20,8 @@ For more general information and examples on mocking with the Azure SDK, please ## Publishing events with the `EventHubProducerClient` -When using batches to publish to Event Hubs, the key interactions with the `EventHubProducerClient` are calling `CreateBatchAsync` to create the batch and `SendAsync` to publish it. - Mocked batches accept a `List` that is used as a backing store and can be inspected to verify that the application is adding events to the batch as expected. The custom `TryAdd` callback can be used to control the decision for whether an event is accepted into the batch or is rejected. +When using batches to publish to Event Hubs, the key interactions with the `EventHubProducerClient` are calling `CreateBatchAsync` to create the batch and `SendAsync` to publish it. + Mocked batches accept a `List` that is used as a backing store and can be inspected to verify that the application is adding events to the batch as expected. The custom `TryAdd` callback can be used to control the decision for whether an event is accepted into the batch or is rejected. This snippet demonstrates mocking the `EventHubProducerClient`, and creating `EventDataBatch` instances using the `EventHubsModelFactory`. @@ -321,7 +321,7 @@ await foreach (PartitionEvent receivedEvent in consumer.ReadEventsFromPartitionA ## Consuming events using the `PartitionReceiver` -The sample below illustrates how to mock a `PartitionReceiver`, and set up its `ReceiveBatchAsync` method to return a simple data batch. +The sample below illustrates how to mock a `PartitionReceiver`, and set up its `ReceiveBatchAsync` method to return a simple data batch. Given the purpose of the `PartitionReceiver`, it is anticipated that most applications will have complex code surrounding their receivers, so this snippet is intentionally simple, with the focus being on using the `EventHubsModelFactory` to mock events being returned from the broker. @@ -493,4 +493,4 @@ string[] consumerPartitions = new string[] { "0", "1", "2" }; mockConsumer .Setup(p => p.GetPartitionIdsAsync(It.IsAny())) .ReturnsAsync(consumerPartitions); -``` \ No newline at end of file +``` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs index 39a8be6f94af2..bd9bb804f9228 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs @@ -198,9 +198,11 @@ public async Task ConnectionTransportCanRetrieveProperties(EventHubsTransportTyp await using (EventHubScope scope = await EventHubScope.CreateAsync(partitionCount)) { - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - - await using (var connection = new TestConnectionWithRetryPolicy(connectionString, scope.EventHubName, new EventHubConnectionOptions { TransportType = transportType })) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConnectionOptions { TransportType = transportType })) { EventHubProperties properties = await connection.GetPropertiesAsync(); @@ -228,18 +230,11 @@ public async Task ConnectionTransportCanRetrievePartitionProperties(EventHubsTra { var options = new EventHubConnectionOptions(); - var credential = new SharedAccessCredential - ( - new SharedAccessSignature - ( - $"{ options.TransportType.GetUriScheme() }://{ EventHubsTestEnvironment.Instance.FullyQualifiedNamespace }/{ scope.EventHubName }".ToLowerInvariant(), - EventHubsTestEnvironment.Instance.SharedAccessKeyName, - EventHubsTestEnvironment.Instance.SharedAccessKey, - TimeSpan.FromHours(4) - ) - ); - - await using (var connection = new TestConnectionWithRetryPolicy(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential, new EventHubConnectionOptions { TransportType = transportType })) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConnectionOptions { TransportType = transportType })) { var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(20)); var properties = await connection.GetPropertiesAsync(); @@ -266,9 +261,10 @@ public async Task ConnectionTransportPartitionIdsMatchPartitionProperties() { await using (EventHubScope scope = await EventHubScope.CreateAsync(4)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new TestConnectionWithRetryPolicy(connectionString)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { EventHubProperties properties = await connection.GetPropertiesAsync(); var partitions = await connection.GetPartitionIdsAsync(); @@ -291,9 +287,10 @@ public async Task ConnectionTransportCannotRetrieveMetadataWhenClosed() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new TestConnectionWithRetryPolicy(connectionString)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await connection.GetPartitionIdsAsync()).First(); @@ -324,9 +321,10 @@ public async Task ConnectionTransportCannotRetrievePartitionPropertiesWhenPartit { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new TestConnectionWithRetryPolicy(connectionString)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { Assert.That(async () => await connection.GetPartitionPropertiesAsync(invalidPartition), Throws.TypeOf()); } @@ -343,7 +341,6 @@ public async Task ConnectionTransportCannotRetrieveMetadataWhenProxyIsInvalid() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var retryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }; var clientOptions = new EventHubConnectionOptions @@ -352,8 +349,16 @@ public async Task ConnectionTransportCannotRetrieveMetadataWhenProxyIsInvalid() TransportType = EventHubsTransportType.AmqpWebSockets }; - await using (var connection = new TestConnectionWithRetryPolicy(connectionString)) - await using (var invalidProxyConnection = new TestConnectionWithRetryPolicy(connectionString, clientOptions)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var invalidProxyConnection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { connection.RetryPolicy = new BasicRetryPolicy(retryOptions); invalidProxyConnection.RetryPolicy = new BasicRetryPolicy(retryOptions); @@ -377,7 +382,6 @@ public async Task ConnectionTransportCannotRetrieveMetadataWhenCustomValidationR { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var retryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }; var clientOptions = new EventHubConnectionOptions @@ -385,8 +389,16 @@ public async Task ConnectionTransportCannotRetrieveMetadataWhenCustomValidationR CertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) => false }; - await using (var connection = new TestConnectionWithRetryPolicy(connectionString)) - await using (var certificateRejectingConnection = new TestConnectionWithRetryPolicy(connectionString, clientOptions)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var certificateRejectingConnection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { connection.RetryPolicy = new BasicRetryPolicy(retryOptions); certificateRejectingConnection.RetryPolicy = new BasicRetryPolicy(retryOptions); @@ -410,7 +422,6 @@ public async Task ConnectionTransportCanRetrieveMetadataWhenCustomValidationAcce { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var retryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }; var clientOptions = new EventHubConnectionOptions @@ -418,7 +429,11 @@ public async Task ConnectionTransportCanRetrieveMetadataWhenCustomValidationAcce CertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) => true }; - await using (var connection = new TestConnectionWithRetryPolicy(connectionString, clientOptions)) + await using (var connection = new TestConnectionWithRetryPolicy( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { connection.RetryPolicy = new BasicRetryPolicy(retryOptions); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs index 4188aa6467ab5..b322cbc6777d3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs @@ -56,9 +56,11 @@ public async Task ConsumerWithNoOptionsCanRead(EventHubsTransportType transportT using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString, new EventHubConnectionOptions { TransportType = transportType })) + await using (var connection = new EventHubConnection( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConnectionOptions { TransportType = transportType })) { var partition = (await connection.GetPartitionIdsAsync(new EventHubsRetryOptions().ToRetryPolicy(), cancellationSource.Token)).First(); @@ -91,7 +93,12 @@ public async Task ConsumerWithOptionsCanRead(EventHubsTransportType transportTyp options.RetryOptions.MaximumRetries = 7; options.ConnectionOptions.TransportType = transportType; - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); Assert.That(async () => await ReadNothingAsync(consumer, partition, cancellationSource.Token, EventPosition.Latest), Throws.Nothing); @@ -125,7 +132,12 @@ public async Task ConsumerWithCustomBufferSizesCanRead(EventHubsTransportType tr } }; - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); Assert.That(async () => await ReadNothingAsync(consumer, partition, cancellationSource.Token, EventPosition.Latest), Throws.Nothing); @@ -148,13 +160,16 @@ public async Task ConsumerCanReadSingleZeroLengthEvent() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var singleEvent = EventGenerator.CreateEventFromBody(Array.Empty()); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -182,13 +197,16 @@ public async Task ConsumerCanReadSingleEvent() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var singleEvent = EventGenerator.CreateEvents(1).Single(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -220,12 +238,15 @@ public async Task ConsumerCanReadSingleLargeEvent() new Random().NextBytes(buffer); var singleEvent = EventGenerator.CreateEventFromBody(buffer); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -253,17 +274,19 @@ public async Task ConsumerCanReadBatchOfZeroLengthEvents() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var sourceEvents = Enumerable .Range(0, 25) .Select(index => EventGenerator.CreateEventFromBody(Array.Empty())) .ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -295,13 +318,16 @@ public async Task ConsumerCanReadBatchOfEvents() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -333,13 +359,16 @@ public async Task ConsumerWithAnIdentifierCanReadEvents() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, new EventHubConsumerClientOptions { Identifier = "BobTheConsumer" })) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConsumerClientOptions { Identifier = "BobTheConsumer" })) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -371,13 +400,16 @@ public async Task ConsumerCanReadBatchOfEventsWithCustomPrefetchAndBatchCounts() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -410,13 +442,16 @@ public async Task ConsumerCanReadBatchOfEventsWithCustomPrefetchAndBatchCountsAn using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -449,13 +484,16 @@ public async Task ConsumerCanReadEventsWithPrefetchDisabled() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -487,8 +525,6 @@ [Test]public async Task ConsumerCanReadEventsWithCustomProperties() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var sourceEvents = EventGenerator.CreateEvents(50) .Select(current => { @@ -499,10 +535,14 @@ [Test]public async Task ConsumerCanReadEventsWithCustomProperties() }) .ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -533,8 +573,6 @@ [Test]public async Task ConsumerCanReadEventsWithBinaryProperties() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var sourceEvents = EventGenerator.CreateEvents(5) .Select(current => { @@ -545,10 +583,14 @@ [Test]public async Task ConsumerCanReadEventsWithBinaryProperties() }) .ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -573,22 +615,19 @@ [Test]public async Task ConsumerCanReadEventsWithBinaryProperties() ///
/// [Test] - public async Task ConsumerCanReadEventsUsingAnIdentityCredential() + public async Task ConsumerCanReadEventsUsingTheConnectionString() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var credential = EventHubsTestEnvironment.Instance.Credential; var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -626,9 +665,7 @@ public async Task ConsumerCanReadEventsUsingTheSharedKeyCredential() await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -669,9 +706,7 @@ public async Task ConsumerCanReadEventsUsingTheSasCredential() await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential, options)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -703,13 +738,16 @@ public async Task ConsumerCanReadFromEarliest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -741,15 +779,18 @@ public async Task ConsumerCanReadFromLatest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Send a set of seed events to the partition, which should not be read. var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Begin reading though no events have been published. This is necessary to open the connection and // ensure that the consumer is watching the partition. @@ -759,7 +800,7 @@ public async Task ConsumerCanReadFromLatest() // Give the consumer a moment to ensure that it is established and then send events for it to read. await Task.Delay(250); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Await reading of the events and validate the resulting state. @@ -794,11 +835,14 @@ public async Task ConsumerCanReadFromOffset(bool isInclusive) using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Seed the partition with a set of events prior to reading. When the send call returns, all events were // accepted by the Event Hubs service and should be available in the partition. Provide a minor delay to @@ -806,7 +850,7 @@ public async Task ConsumerCanReadFromOffset(bool isInclusive) var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(250); // Query the partition and determine the offset of the last enqueued event, then send the new set @@ -815,7 +859,7 @@ public async Task ConsumerCanReadFromOffset(bool isInclusive) var lastOffset = (await consumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffset; var startingPosition = EventPosition.FromOffset(lastOffset, isInclusive); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -861,11 +905,14 @@ public async Task ConsumerCanReadFromSequenceNumber(bool isInclusive) using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Seed the partition with a set of events prior to reading. When the send call returns, all events were // accepted by the Event Hubs service and should be available in the partition. Provide a minor delay to @@ -873,7 +920,7 @@ public async Task ConsumerCanReadFromSequenceNumber(bool isInclusive) var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(250); // Query the partition and determine the offset of the last enqueued event, then send the new set @@ -882,7 +929,7 @@ public async Task ConsumerCanReadFromSequenceNumber(bool isInclusive) var lastSequence = (await consumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedSequenceNumber; var startingPosition = EventPosition.FromSequenceNumber(lastSequence, isInclusive); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -926,11 +973,14 @@ public async Task ConsumerCanReadFromEnqueuedTime() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Seed the partition with a set of events prior to reading. When the send call returns, all events were // accepted by the Event Hubs service and should be available in the partition. Provide a minor delay to @@ -938,7 +988,7 @@ public async Task ConsumerCanReadFromEnqueuedTime() var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(TimeSpan.FromSeconds(2)); // Query the partition and determine the offset of the last enqueued event, then send the new set @@ -947,7 +997,7 @@ public async Task ConsumerCanReadFromEnqueuedTime() var lastEnqueuedTime = (await consumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedTime; var startingPosition = EventPosition.FromEnqueuedTime(lastEnqueuedTime); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -984,18 +1034,22 @@ public async Task ConsumerCanReadConcurrentlyFromMultiplePartitions() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, new EventHubConsumerClientOptions { Identifier = "BobTheConsumer" })) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConsumerClientOptions { Identifier = "BobTheConsumer" })) { var partitions = await consumer.GetPartitionIdsAsync(cancellationSource.Token); await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); // Read the events and validate the resulting state. @@ -1041,15 +1095,23 @@ public async Task ConsumerCanReadFromMultipleConsumerGroups() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var customConsumer = new EventHubConsumerClient(customConsumerGroup, connectionString)) - await using (var defaultConsumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var customConsumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var defaultConsumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await defaultConsumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read the events and validate the resulting state. @@ -1089,15 +1151,16 @@ public async Task ConsumerCannotReadAcrossPartitions() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var credential = EventHubsTestEnvironment.Instance.Credential; var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token); // Attempt to read from the empty partition and verify that no events are observed. Because no events are expected, the // read operation will not naturally complete; limit the read to only a couple of seconds and trigger cancellation. @@ -1129,13 +1192,16 @@ public async Task ConsumerCannotReadWhenClosed() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Create a local function that will close the consumer after five events have // been read. Because the close happens in the middle of iteration, allow for a short @@ -1175,14 +1241,13 @@ public async Task ConsumerCannotReadWhenSharedConnectionIsClosed() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connection)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Create a local function that will close the connection after five events have // been read. Because the close happens in the middle of iteration, allow for a short @@ -1222,7 +1287,11 @@ public async Task ConsumerCannotReadFromInvalidPartition() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var invalidPartition = "-1"; var readTask = ReadNothingAsync(consumer, invalidPartition, cancellationSource.Token); @@ -1250,8 +1319,8 @@ public async Task ConsumerCannotReadFromInvalidConsumerGroup() var invalidConsumerGroup = "ThisIsFake"; - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) - await using (var consumer = new EventHubConsumerClient(invalidConsumerGroup, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) + await using (var consumer = new EventHubConsumerClient(invalidConsumerGroup, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var readTask = ReadNothingAsync(consumer, partition, cancellationSource.Token); @@ -1284,8 +1353,8 @@ public async Task ConsumerCannotReadWithInvalidProxy() clientOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); clientOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) - await using (var invalidProxyConsumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, clientOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) + await using (var invalidProxyConsumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, clientOptions)) { var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); @@ -1316,13 +1385,16 @@ public async Task ConsumerCannotReadAsNonExclusiveWhenAnExclusiveReaderIsActive( exclusiveOptions.PrefetchCount = LowPrefetchCount; exclusiveOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); var exclusiveMonitor = MonitorReadingEventsFromPartition(consumer, partition, null, cancellationSource.Token, readOptions: exclusiveOptions); await Task.WhenAny(exclusiveMonitor.StartCompletion.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); @@ -1359,13 +1431,16 @@ public async Task ConsumerCannotReadWithLowerOwnerLevelThanActiveReader() lowerOptions.PrefetchCount = LowPrefetchCount; lowerOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); var higherMonitor = MonitorReadingEventsFromPartition(consumer, partition, null, cancellationSource.Token, readOptions: higherOptions); await Task.WhenAny(higherMonitor.StartCompletion.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); @@ -1402,11 +1477,14 @@ public async Task ConsumerCanReadFromMultiplePartitionsWithDifferentActiveOwnerL lowerOptions.PrefetchCount = LowPrefetchCount; lowerOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).Take(2).ToArray(); @@ -1414,8 +1492,8 @@ public async Task ConsumerCanReadFromMultiplePartitionsWithDifferentActiveOwnerL await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); // Read from each partition, allowing the higher level operation to begin first. Both read operations should be @@ -1462,15 +1540,23 @@ public async Task ConsumerCanReadFromMultipleConsumerGroupsWithDifferentActiveOw lowerOptions.PrefetchCount = LowPrefetchCount; lowerOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var firstGroupConsumer = new EventHubConsumerClient(scope.ConsumerGroups[0], connectionString)) - await using (var secondGroupConsumer = new EventHubConsumerClient(scope.ConsumerGroups[1], connectionString)) + await using (var firstGroupConsumer = new EventHubConsumerClient( + consumerGroups[0], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var secondGroupConsumer = new EventHubConsumerClient( + consumerGroups[1], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await firstGroupConsumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Read from each partition, allowing the higher level operation to begin first. Both read operations should be // successful and read all events from their respective partition. @@ -1515,14 +1601,17 @@ public async Task ExclusiveConsumerSupersedesNonExclusiveActiveReader() nonExclusiveOptions.CacheEventCount = 10; nonExclusiveOptions.MaximumWaitTime = TimeSpan.FromMilliseconds(150); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(2500).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1581,14 +1670,17 @@ public async Task ConsumerWithHigherOwnerLevelSupersedesActiveReader() lowerOptions.OwnerLevel = 20; lowerOptions.MaximumWaitTime = TimeSpan.FromMilliseconds(150); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(2500).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Start the lower level read, waiting until at least some events were read before starting the higher reader. @@ -1640,11 +1732,14 @@ public async Task ExclusiveConsumerDoesNotSupersedeNonExclusiveActiveReaderOnAno exclusiveOptions.PrefetchCount = LowPrefetchCount; exclusiveOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).Take(2).ToArray(); @@ -1652,8 +1747,8 @@ public async Task ExclusiveConsumerDoesNotSupersedeNonExclusiveActiveReaderOnAno await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1707,15 +1802,23 @@ public async Task ExclusiveConsumerDoesNotSupersedeNonExclusiveActiveReaderOnAno exclusiveOptions.PrefetchCount = LowPrefetchCount; exclusiveOptions.OwnerLevel = 20; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var nonExclusiveConsumer = new EventHubConsumerClient(scope.ConsumerGroups[0], connectionString)) - await using (var exclusiveConsumer = new EventHubConsumerClient(scope.ConsumerGroups[1], connectionString)) + await using (var nonExclusiveConsumer = new EventHubConsumerClient( + consumerGroups[0], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var exclusiveConsumer = new EventHubConsumerClient( + consumerGroups[1], + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await exclusiveConsumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1762,13 +1865,16 @@ public async Task ConsumerIsNotCompromisedByFailureToReadFromInvalidPartition() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Attempt to read from an invalid partition and confirm failure. @@ -1816,11 +1922,14 @@ public async Task ConsumerIsNotCompromisedByBeingSupersededByAnotherReaderWithHi lowerOptions.CacheEventCount = 10; lowerOptions.MaximumWaitTime = TimeSpan.FromMilliseconds(150); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(2500).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).Take(2).ToArray(); @@ -1828,8 +1937,8 @@ public async Task ConsumerIsNotCompromisedByBeingSupersededByAnotherReaderWithHi await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); // Start the lower level read, waiting until at least some events were read before starting the higher reader. @@ -1885,7 +1994,11 @@ public async Task ConsumerRespectsTheWaitTimeWhenReading() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var options = new ReadEventOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(100) }; @@ -1931,7 +2044,12 @@ public async Task ConsumerCanQueryEventHubProperties(EventHubsTransportType tran using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, clientOptions)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { var properties = await consumer.GetEventHubPropertiesAsync(cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -1961,10 +2079,14 @@ public async Task ConsumerCanQueryPartitionProperties(EventHubsTransportType tra using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var clientOptions = new EventHubConsumerClientOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, scope.EventHubName, clientOptions)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { var properties = await consumer.GetEventHubPropertiesAsync(); var partition = properties.PartitionIds.First(); @@ -1995,7 +2117,11 @@ public async Task ConnectionTransportPartitionIdsMatchPartitionProperties() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var properties = await consumer.GetEventHubPropertiesAsync(cancellationSource.Token); var partitions = await consumer.GetPartitionIdsAsync(cancellationSource.Token); @@ -2022,7 +2148,11 @@ public async Task ConsumerCannotRetrieveMetadataWhenClosed() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); @@ -2058,7 +2188,11 @@ public async Task ConsumerCannotRetrievePartitionPropertiesWithInvalidPartitionI using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { Assert.That(async () => await consumer.GetPartitionPropertiesAsync(invalidPartition, cancellationSource.Token), Throws.TypeOf()); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -2079,8 +2213,6 @@ public async Task ConsumerCannotRetrieveMetadataWithInvalidProxy() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var invalidProxyOptions = new EventHubConsumerClientOptions(); invalidProxyOptions.RetryOptions.MaximumRetries = 0; invalidProxyOptions.RetryOptions.MaximumDelay = TimeSpan.FromMilliseconds(5); @@ -2088,8 +2220,18 @@ public async Task ConsumerCannotRetrieveMetadataWithInvalidProxy() invalidProxyOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); invalidProxyOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) - await using (var invalidProxyConsumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, invalidProxyOptions)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var invalidProxyConsumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + invalidProxyOptions)) { var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); @@ -2118,14 +2260,17 @@ public async Task ConsumerCanReadFromAllPartitions() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); - var sendCount = await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); + var sendCount = await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); Assert.That(sendCount, Is.EqualTo(sourceEvents.Count), "All of the events should have been sent."); // Read the events and validate the resulting state. @@ -2158,20 +2303,23 @@ public async Task ConsumerCanReadFromAllPartitionsWithCustomPrefetchAndBatchCoun using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); - var sendCount = await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); + var sendCount = await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); Assert.That(sendCount, Is.EqualTo(sourceEvents.Count), "All of the events should have been sent."); // Read the events and validate the resulting state. var readOptions = new ReadEventOptions { PrefetchCount = 50, CacheEventCount = 50 }; - var readState = await ReadEventsFromAllPartitionsAsync(consumer,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, readOptions: readOptions); + var readState = await ReadEventsFromAllPartitionsAsync(consumer, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, readOptions: readOptions); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -2192,22 +2340,21 @@ public async Task ConsumerCanReadFromAllPartitionsWithCustomPrefetchAndBatchCoun ///
/// [Test] - public async Task ConsumerCanReadFromAllPartitionsUsingAnIdentityCredential() + public async Task ConsumerCanReadFromAllPartitionsUsingTheConnectionString() { await using (EventHubScope scope = await EventHubScope.CreateAsync(4)) { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var credential = EventHubsTestEnvironment.Instance.Credential; + var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; var sourceEvents = EventGenerator.CreateEvents(100).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, scope.EventHubName)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); + var sendCount = await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); - var sendCount = await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); Assert.That(sendCount, Is.EqualTo(sourceEvents.Count), "All of the events should have been sent."); // Read the events and validate the resulting state. @@ -2245,10 +2392,9 @@ public async Task ConsumerCanReadFromAllPartitionsUsingTheSharedKeyCredential() await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); + var sendCount = await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); - var sendCount = await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); Assert.That(sendCount, Is.EqualTo(sourceEvents.Count), "All of the events should have been sent."); // Read the events and validate the resulting state. @@ -2289,10 +2435,9 @@ public async Task ConsumerCanReadFromAllPartitionsUsingTheSasCredential() await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential, options)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); + var sendCount = await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); - var sendCount = await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); Assert.That(sendCount, Is.EqualTo(sourceEvents.Count), "All of the events should have been sent."); // Read the events and validate the resulting state. @@ -2325,25 +2470,28 @@ public async Task ConsumerCanReadFromAllPartitionsStartingWithLatest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var sourceEvents = EventGenerator.CreateEvents(100).ToList(); + var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString)) + await using (var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Send a set of seed events, which should not be read. var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); - await SendEventsToAllPartitionsAsync(connectionString, EventGenerator.CreateEvents(50), partitions, cancellationSource.Token); + await SendEventsToAllPartitionsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), partitions, cancellationSource.Token); // Begin reading though no events have been published. This is necessary to open the connection and // ensure that the consumer is watching the partition. - var readTask = ReadEventsFromAllPartitionsAsync(consumer,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, startFromEarliest: false); + var readTask = ReadEventsFromAllPartitionsAsync(consumer, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, startFromEarliest: false); // Give the consumer a moment to ensure that it is established and then send events for it to read. - await Task.Delay(250); - await SendEventsToAllPartitionsAsync(connectionString, sourceEvents, partitions, cancellationSource.Token); + await Task.Delay(1500); + await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); // Read the events and validate the resulting state. @@ -2537,21 +2685,24 @@ private async Task ReadNothingAsync(EventHubConsumerClient consumer, /// Sends a set of events using a new producer to do so. ///
/// - /// The connection string to use when creating the producer. + /// The name of the Event Hub to use when creating the producer. /// The set of events to send. /// The set of options to apply when creating batches. /// The token used to signal a cancellation request. /// /// The count of events that were sent. /// - private async Task SendEventsAsync(string connectionString, + private async Task SendEventsAsync(string eventHubName, IEnumerable sourceEvents, CreateBatchOptions batchOptions = default, CancellationToken cancellationToken = default) { var sentCount = 0; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubName, + EventHubsTestEnvironment.Instance.Credential)) { foreach (var batch in (await EventGenerator.BuildBatchesAsync(sourceEvents, producer, batchOptions, cancellationToken))) { @@ -2570,14 +2721,14 @@ private async Task SendEventsAsync(string connectionString, /// distribution with no guaranteed ordering. ///
/// - /// The connection string to use when creating the producer. + /// The Event Hub name to use when creating the producer. /// The set of events to send. /// The set of partitions to send events to. /// The token used to signal a cancellation request. /// /// The count of events that were sent. /// - private async Task SendEventsToAllPartitionsAsync(string connectionString, + private async Task SendEventsToAllPartitionsAsync(string eventHubName, IEnumerable sourceEvents, string[] partitionIds, CancellationToken cancellationToken = default) @@ -2587,7 +2738,7 @@ private async Task SendEventsToAllPartitionsAsync(string connectionString, .Select(eventGroup => { var options = new CreateBatchOptions { PartitionId = partitionIds[eventGroup.Key] }; - return SendEventsAsync(connectionString, eventGroup, options, cancellationToken); + return SendEventsAsync(eventHubName, eventGroup, options, cancellationToken); }); var sendCounts = await Task.WhenAll(sendTasks).ConfigureAwait(false); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs index 4389704f6148e..ef02b92dff63b 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs @@ -56,13 +56,21 @@ public async Task ReceiverWithNoOptionsCanRead(EventHubsTransportType transportT using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString, new EventHubConnectionOptions { TransportType = transportType })) + await using (var connection = new EventHubConnection( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubConnectionOptions { TransportType = transportType })) { var partition = (await connection.GetPartitionIdsAsync(new EventHubsRetryOptions().ToRetryPolicy(), cancellationSource.Token)).First(); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { Assert.That(async () => await ReadNothingAsync(receiver, cancellationSource.Token), Throws.Nothing); } @@ -91,10 +99,16 @@ public async Task ReceiverWithOptionsCanRead(EventHubsTransportType transportTyp options.RetryOptions.MaximumRetries = 7; options.ConnectionOptions.TransportType = transportType; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, options)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options)) { Assert.That(async () => await ReadNothingAsync(receiver, cancellationSource.Token), Throws.Nothing); } @@ -116,13 +130,18 @@ public async Task ReceiverCanReadSingleZeroLengthEvent() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var singleEvent = EventGenerator.CreateEventFromBody(Array.Empty()); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var readState = await ReadEventsAsync(receiver, new HashSet { singleEvent.MessageId }, cancellationSource.Token); @@ -148,13 +167,18 @@ public async Task ReceiverCanReadSingleEvent() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var singleEvent = EventGenerator.CreateEvents(1).Single(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var readState = await ReadEventsAsync(receiver, new HashSet { singleEvent.MessageId }, cancellationSource.Token); @@ -184,12 +208,17 @@ public async Task ReceiverCanReadSingleLargeEvent() new Random().NextBytes(buffer); var singleEvent = EventGenerator.CreateEventFromBody(buffer); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, new EventData[] { singleEvent }, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var readState = await ReadEventsAsync(receiver, new HashSet { singleEvent.MessageId }, cancellationSource.Token); @@ -220,13 +249,18 @@ public async Task ReceiverCanReadBatchOfZeroLengthEvents() .Select(index => EventGenerator.CreateEventFromBody(Array.Empty())) .ToList(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -254,15 +288,20 @@ public async Task ReceiverCanReadBatchOfEvents() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -290,20 +329,26 @@ public async Task ReceiverCanReadBatchOfEventsWithPrefetchSize() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); var recieverOptions = new PartitionReceiverOptions { PrefetchSizeInBytes = 64 }; - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, recieverOptions)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + recieverOptions)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -341,13 +386,18 @@ public async Task ReceiverCanReadEventsWithCustomProperties() }) .ToList(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -368,7 +418,7 @@ public async Task ReceiverCanReadEventsWithCustomProperties() /// /// [Test] - public async Task ReceiverCanReadEventsUsingAnIdentityCredential() + public async Task ReceiverCanReadEventsUsingTheConnectionString() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { @@ -379,12 +429,12 @@ public async Task ReceiverCanReadEventsUsingAnIdentityCredential() var sourceEvents = EventGenerator.CreateEvents(50).ToList(); var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -415,13 +465,12 @@ public async Task ReceiverCanReadEventsUsingTheSharedKeyCredential() var credential = new AzureNamedKeyCredential(EventHubsTestEnvironment.Instance.SharedAccessKeyName, EventHubsTestEnvironment.Instance.SharedAccessKey); var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -455,13 +504,12 @@ public async Task ReceiverCanReadEventsUsingTheSasCredential() var credential = new AzureSasCredential(signature.Value); var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential, options)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -489,15 +537,20 @@ public async Task ReceiverCanReadFromEarliest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); foreach (var sourceEvent in sourceEvents) @@ -525,25 +578,30 @@ public async Task ReceiverCanReadFromLatest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var sourceEvents = EventGenerator.CreateEvents(200).ToList(); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Latest, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Latest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Send a set of seed events to the partition, which should not be read. - await SendEventsAsync(connectionString, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Begin reading though no events have been published. This is necessary to open the connection and // ensure that the receiver is watching the partition. - var readTask = ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readTask = ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); // Give the receiver a moment to ensure that it is established and then send events for it to read. await Task.Delay(250); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Await reading of the events and validate the resulting state. @@ -578,8 +636,7 @@ public async Task ReceiverCanReadFromOffset(bool isInclusive) using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); @@ -593,20 +650,29 @@ public async Task ReceiverCanReadFromOffset(bool isInclusive) long lastOffset; EventPosition startingPosition; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(250); lastOffset = (await producer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffset; startingPosition = EventPosition.FromOffset(lastOffset, isInclusive); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); } // Read the events and validate the resulting state. - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, startingPosition, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + startingPosition, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var expectedCount = sourceEvents.Count; var expectedEvents = sourceEvents.Select(evt => evt.MessageId); @@ -650,8 +716,7 @@ public async Task ReceiverCanReadFromSequenceNumber(bool isInclusive) using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); @@ -665,20 +730,29 @@ public async Task ReceiverCanReadFromSequenceNumber(bool isInclusive) long lastSequence; EventPosition startingPosition; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(250); lastSequence = (await producer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedSequenceNumber; startingPosition = EventPosition.FromSequenceNumber(lastSequence, isInclusive); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); } // Read the events and validate the resulting state. - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, startingPosition, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + startingPosition, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var expectedCount = sourceEvents.Count; var expectedEvents = sourceEvents.Select(evt => evt.MessageId); @@ -720,8 +794,7 @@ public async Task ReceiverCanReadFromEnqueuedTime() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var seedEvents = EventGenerator.CreateEvents(50).ToList(); var sourceEvents = EventGenerator.CreateEvents(100).ToList(); @@ -735,22 +808,31 @@ public async Task ReceiverCanReadFromEnqueuedTime() DateTimeOffset lastEnqueuedTime; EventPosition startingPosition; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - await SendEventsAsync(connectionString, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(TimeSpan.FromSeconds(2)); lastEnqueuedTime = (await producer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedTime; startingPosition = EventPosition.FromEnqueuedTime(lastEnqueuedTime); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); } // Read the events and validate the resulting state. - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, startingPosition, connectionString)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + startingPosition, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); // The exact number of events returned by the service may vary due to clock skew and how reader is positioned; ensure that @@ -785,14 +867,26 @@ public async Task ReceiverCanReadFromMultipleConsumerGroups() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var customReceiver = new PartitionReceiver(customConsumerGroup, partition, EventPosition.Earliest, connectionString)) - await using (var defaultReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var customReceiver = new PartitionReceiver( + customConsumerGroup, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var defaultReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var expectedEvents = sourceEvents.Select(evt => evt.MessageId); @@ -833,10 +927,20 @@ public async Task ReceiverCannotReadFromInvalidConsumerGroup() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var invalidConsumerGroup = "ThisIsFake"; - var partition = (await QueryPartitionsAsync(EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName), cancellationSource.Token)).First(); - - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) - await using (var receiver = new PartitionReceiver(invalidConsumerGroup, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) + + await using (var receiver = new PartitionReceiver( + invalidConsumerGroup, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var readTask = ReadNothingAsync(receiver, cancellationSource.Token); @@ -868,9 +972,16 @@ public async Task ReceiverCannotReadWithInvalidProxy() clientOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); clientOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - var partition = (await QueryPartitionsAsync(EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName), cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - await using (var invalidProxyReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, clientOptions)) + await using (var invalidProxyReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + clientOptions)) { // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to @@ -895,16 +1006,20 @@ public async Task ReceiverCannotReadAcrossPartitions() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var credential = EventHubsTestEnvironment.Instance.Credential; var sourceEvents = EventGenerator.CreateEvents(50).ToList(); // Send events to the second partition, which should not be visible to the receiver. - var partitions = await QueryPartitionsAsync(connectionString, cancellationSource.Token); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token); + var partitions = await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[0], EventPosition.Earliest, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[0], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { // Attempt to read from the empty partition and verify that no events are observed. Because no events are expected, the // read operation will not naturally complete; limit the read to only a couple of seconds and trigger cancellation. @@ -912,7 +1027,7 @@ public async Task ReceiverCannotReadAcrossPartitions() using var readCancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationSource.Token); readCancellation.CancelAfter(TimeSpan.FromSeconds(15)); - var readState = await ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), readCancellation.Token, waitTime: TimeSpan.FromMilliseconds(250)); + var readState = await ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), readCancellation.Token, waitTime: TimeSpan.FromMilliseconds(250)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The main cancellation token should not have been signaled."); Assert.That(readState.Events.Count, Is.Zero, "No events should have been read from the empty partition."); @@ -936,13 +1051,19 @@ public async Task ReceiverCannotReadWhenClosed() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); - - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, LowPrefetchOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + LowPrefetchOptions)) { // Create a local function that will close the receiver after five events have // been read. Because the close happens during the read loop, allow for a short @@ -959,7 +1080,7 @@ async Task closeAfterFewRead(ReadState state) return true; } - var readTask = ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, iterationCallback: closeAfterFewRead); + var readTask = ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, iterationCallback: closeAfterFewRead); Assert.That(async () => await readTask, Throws.InstanceOf().And.Property(nameof(EventHubsException.Reason)).EqualTo(EventHubsException.FailureReason.ClientClosed)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -982,14 +1103,22 @@ public async Task ReceiverCannotReadWhenSharedConnectionIsClosed() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(100).ToList(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await using (var connection = new EventHubConnection( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) - await using (var connection = new EventHubConnection(connectionString)) - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connection, LowPrefetchOptions)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + connection, + LowPrefetchOptions)) { // Create a local function that will close the connection after five events have // been read. Because the close happens during the read loop, allow for a short @@ -1006,7 +1135,7 @@ async Task closeAfterFewRead(ReadState state) return true; } - var readTask = ReadEventsAsync(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, iterationCallback: closeAfterFewRead); + var readTask = ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, iterationCallback: closeAfterFewRead); Assert.That(async () => await readTask, Throws.InstanceOf().And.Property(nameof(EventHubsException.Reason)).EqualTo(EventHubsException.FailureReason.ClientClosed)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -1029,7 +1158,13 @@ public async Task ReceiverCannotReadFromInvalidPartition() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, "-1", EventPosition.Earliest, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + "-1", + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var readTask = ReadNothingAsync(receiver, cancellationSource.Token); @@ -1054,13 +1189,19 @@ public async Task ReceiversWithAnIdentityCanRead() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, new PartitionReceiverOptions { Identifier = "first" })) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new PartitionReceiverOptions { Identifier = "first" })) { var monitor = MonitorReadingEvents(receiver,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); @@ -1093,18 +1234,32 @@ public async Task MultipleReceiversCanReadConcurrently() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - var partitions = await QueryPartitionsAsync(connectionString, cancellationSource.Token); + var partitions = await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token); await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); - await using (var firstReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[0], EventPosition.Earliest, connectionString, new PartitionReceiverOptions { Identifier = "first" })) - await using (var secondReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[1], EventPosition.Earliest, connectionString, new PartitionReceiverOptions { Identifier = "second" })) + await using (var firstReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[0], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new PartitionReceiverOptions { Identifier = "first" })) + + await using (var secondReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[1], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new PartitionReceiverOptions { Identifier = "second" })) { var expectedEvents = sourceEvents.Select(evt => evt.MessageId); var firstMonitor = MonitorReadingEvents(firstReceiver, expectedEvents, cancellationSource.Token); @@ -1147,14 +1302,28 @@ public async Task ReceiverCannotReadAsNonExclusiveWhenAnExclusiveReaderIsActive( cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var exclusiveOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var exclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, exclusiveOptions)) - await using (var nonExclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, LowPrefetchOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var exclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + exclusiveOptions)) + + await using (var nonExclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + LowPrefetchOptions)) { var exclusiveMonitor = MonitorReadingEvents(exclusiveReceiver, null, cancellationSource.Token); await Task.WhenAny(exclusiveMonitor.StartCompletion.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); @@ -1185,14 +1354,28 @@ public async Task ReceiverCannotReadWithLowerOwnerLevelThanActiveReader() var higherOptions = new PartitionReceiverOptions { OwnerLevel = 40, PrefetchCount = LowPrefetchCount }; var lowerOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var higherReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, higherOptions)) - await using (var lowerReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, lowerOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var higherReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + higherOptions)) + + await using (var lowerReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + lowerOptions)) { var expectedEvents = sourceEvents.Select(evt => evt.MessageId); @@ -1225,23 +1408,37 @@ public async Task ReceiverCanReadFromMultiplePartitionsWithDifferentActiveOwnerL var higherOptions = new PartitionReceiverOptions { OwnerLevel = 40, PrefetchCount = LowPrefetchCount }; var lowerOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - var partitions = await QueryPartitionsAsync(connectionString, cancellationSource.Token); + var partitions = await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token); // Send the same set of events to both partitions. await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); // Read from each partition, allowing the higher level operation to begin first. Both read operations should be // successful and read all events from their respective partition. - await using (var higherReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[0], EventPosition.Earliest, connectionString, higherOptions)) - await using (var lowerReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[1], EventPosition.Earliest, connectionString, lowerOptions)) + await using (var higherReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[0], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + higherOptions)) + + await using (var lowerReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[1], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + lowerOptions)) { var expectedEvents = sourceEvents.Select(evt => evt.MessageId); var higherMonitor = MonitorReadingEvents(higherReceiver, expectedEvents, cancellationSource.Token); @@ -1279,14 +1476,28 @@ public async Task ReceiverCanReadFromMultipleConsumerGroupsWithDifferentActiveOw var higherOptions = new PartitionReceiverOptions { OwnerLevel = 40, PrefetchCount = LowPrefetchCount }; var lowerOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var higherReceiver = new PartitionReceiver(scope.ConsumerGroups[0], partition, EventPosition.Earliest, connectionString, higherOptions)) - await using (var lowerReceiver = new PartitionReceiver(scope.ConsumerGroups[1], partition, EventPosition.Earliest, connectionString, lowerOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var higherReceiver = new PartitionReceiver( + scope.ConsumerGroups[0], + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + higherOptions)) + + await using (var lowerReceiver = new PartitionReceiver( + scope.ConsumerGroups[1], + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + lowerOptions)) { // Read from each partition, allowing the higher level operation to begin first. Both read operations should be // successful and read all events from their respective partition. @@ -1324,15 +1535,29 @@ public async Task ExclusiveReceiverSupercedesNonExclusiveActiveReader() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var exclusiveOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var nonExclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, LowPrefetchOptions)) - await using (var exclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, exclusiveOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var nonExclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + LowPrefetchOptions)) + + await using (var exclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + exclusiveOptions)) { // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1382,15 +1607,29 @@ public async Task ReceiverWithHigherOwnerLevelSupercedesActiveReader() var higherOptions = new PartitionReceiverOptions { OwnerLevel = 40, PrefetchCount = LowPrefetchCount }; var lowerOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var higherReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, higherOptions)) - await using (var lowerReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, lowerOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var higherReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + higherOptions)) + + await using (var lowerReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + lowerOptions)) { // Start the lower level read, waiting until at least some events were read before starting the higher reader. @@ -1431,7 +1670,7 @@ public async Task ReceiverWithHigherOwnerLevelSupercedesActiveReader() /// /// [Test] - public async Task ExclusiveReceiverDoesNotSupercedNonExclusiveActiveReaderOnAnotherPartition() + public async Task ExclusiveReceiverDoesNotSupersedeNonExclusiveActiveReaderOnAnotherPartition() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { @@ -1439,21 +1678,35 @@ public async Task ExclusiveReceiverDoesNotSupercedNonExclusiveActiveReaderOnAnot cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var exclusiveOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - var partitions = await QueryPartitionsAsync(connectionString, cancellationSource.Token); + var partitions = await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token); // Send the same set of events to both partitions. await Task.WhenAll ( - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), - SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[0] }, cancellationSource.Token), + SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partitions[1] }, cancellationSource.Token) ); - await using (var nonExclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[0], EventPosition.Earliest, connectionString, LowPrefetchOptions)) - await using (var exclusiveReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partitions[1], EventPosition.Earliest, connectionString, exclusiveOptions)) + await using (var nonExclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[0], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + LowPrefetchOptions)) + + await using (var exclusiveReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partitions[1], + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + exclusiveOptions)) { // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1493,7 +1746,7 @@ await Task.WhenAll /// /// [Test] - public async Task ExclusiveReceiverDoesNotSupercedNonExclusiveActiveReaderOnAnotherConsumerGroup() + public async Task ExclusiveReceiverDoesNotSupersedeNonExclusiveActiveReaderOnAnotherConsumerGroup() { var ConsumerGroups = new[] { "customGroup", "customTwo" }; @@ -1503,15 +1756,29 @@ public async Task ExclusiveReceiverDoesNotSupercedNonExclusiveActiveReaderOnAnot cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var exclusiveOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var nonExclusiveReceiver = new PartitionReceiver(scope.ConsumerGroups[0], partition, EventPosition.Earliest, connectionString, LowPrefetchOptions)) - await using (var exclusiveReceiver = new PartitionReceiver(scope.ConsumerGroups[1], partition, EventPosition.Earliest, connectionString, exclusiveOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var nonExclusiveReceiver = new PartitionReceiver( + scope.ConsumerGroups[0], + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + LowPrefetchOptions)) + + await using (var exclusiveReceiver = new PartitionReceiver( + scope.ConsumerGroups[1], + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + exclusiveOptions)) { // Start the non-exclusive read, waiting until at least some events were read before starting the exclusive reader. @@ -1560,15 +1827,29 @@ public async Task ReceiverIsNotCompromisedByBeingSupercededByAnotherReaderWithHi var higherOptions = new PartitionReceiverOptions { OwnerLevel = 40, PrefetchCount = LowPrefetchCount }; var lowerOptions = new PartitionReceiverOptions { OwnerLevel = 20, PrefetchCount = LowPrefetchCount }; - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var sourceEvents = EventGenerator.CreateSmallEvents(200).ToList(); var expectedEvents = sourceEvents.Select(evt => evt.MessageId); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - - await using (var higherReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, higherOptions)) - await using (var lowerReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, lowerOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + + await using (var higherReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + higherOptions)) + + await using (var lowerReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + lowerOptions)) { // Start the lower level read, waiting until at least some events were read before starting the higher reader. @@ -1619,12 +1900,11 @@ public async Task ExclusiveReceiverDetectsAnotherExclusiveReaderWithSameLevel() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); // Seed the partition with events. - await SendEventsAsync(connectionString, EventGenerator.CreateSmallEvents(250), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateSmallEvents(250), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Create the receivers and read concurrently in the background until the initial receiver recognizes the partition has been stolen. @@ -1633,8 +1913,23 @@ public async Task ExclusiveReceiverDetectsAnotherExclusiveReaderWithSameLevel() var capturedException = default(Exception); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - await using var firstReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, receiverOptions); - await using var secondReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, receiverOptions); + await using var firstReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + receiverOptions); + + await using var secondReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + receiverOptions); var firstReceiverTask = Task.Run(async () => { @@ -1709,12 +2004,11 @@ public async Task ExclusiveReceiverCanReassertOwnershipFromAnotherExclusiveReade using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); // Seed the partition with events. - await SendEventsAsync(connectionString, EventGenerator.CreateSmallEvents(250), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateSmallEvents(250), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); // Create the receivers and read concurrently in the background until the initial receiver recognizes the partition has been stolen. @@ -1723,8 +2017,23 @@ public async Task ExclusiveReceiverCanReassertOwnershipFromAnotherExclusiveReade var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var secondReceiverStolen = false; - await using var firstReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, receiverOptions); - await using var secondReceiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, receiverOptions); + await using var firstReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + receiverOptions); + + await using var secondReceiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + receiverOptions); var firstReceiverTask = Task.Run(async () => { @@ -1826,10 +2135,15 @@ public async Task ReceiverRespectsTheWaitTimeWhenReading() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential)) { var waitTime = TimeSpan.FromMilliseconds(100); var desiredEmptyBatches = 10; @@ -1869,8 +2183,7 @@ public async Task ReceiverCanReadEventsWithAFullyPopulatedAmqpMessage() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var message = new AmqpAnnotatedMessage(AmqpMessageBody.FromData(new ReadOnlyMemory[] { new byte[] { 0x11, 0x22, 0x33 } })); var eventData = new EventData(message); @@ -1921,10 +2234,21 @@ public async Task ReceiverCanReadEventsWithAFullyPopulatedAmqpMessage() // Publish the event and then read it back. - await using var producer = new EventHubProducerClient(connectionString); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + await producer.SendAsync(new[] { eventData }, new SendEventOptions { PartitionId = partition }); - await using var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString); + await using var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + var readState = await ReadEventsAsync(receiver, new HashSet { eventData.MessageId }, cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -1980,8 +2304,7 @@ public async Task ReceiverCanReadEventsWithAValueBody() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var value = new Dictionary { { "key", "value" } }; var message = new AmqpAnnotatedMessage(AmqpMessageBody.FromValue(value)); var eventData = new EventData(message) { MessageId = Guid.NewGuid().ToString() }; @@ -1990,10 +2313,21 @@ public async Task ReceiverCanReadEventsWithAValueBody() // Publish the event and then read it back. - await using var producer = new EventHubProducerClient(connectionString); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + await producer.SendAsync(new[] { eventData }, new SendEventOptions { PartitionId = partition }); - await using var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString); + await using var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + var readState = await ReadEventsAsync(receiver, new HashSet { eventData.MessageId }, cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -2024,8 +2358,7 @@ public async Task ReceiverCanReadEventsWithASequenceBody() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var value = new[] { new List { "1", 2 } }; var message = new AmqpAnnotatedMessage(AmqpMessageBody.FromSequence(value)); var eventData = new EventData(message) { MessageId = Guid.NewGuid().ToString() }; @@ -2034,10 +2367,21 @@ public async Task ReceiverCanReadEventsWithASequenceBody() // Publish the event and then read it back. - await using var producer = new EventHubProducerClient(connectionString); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + await producer.SendAsync(new[] { eventData }, new SendEventOptions { PartitionId = partition }); - await using var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString); + await using var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + var readState = await ReadEventsAsync(receiver, new HashSet { eventData.MessageId }, cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -2072,11 +2416,17 @@ public async Task ReceiverCanRetrievePartitionProperties(EventHubsTransportType using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var receiverOptions = new PartitionReceiverOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); - - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, receiverOptions)) + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); + + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + receiverOptions)) { var partitionProperties = await receiver.GetPartitionPropertiesAsync(cancellationSource.Token); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -2104,14 +2454,20 @@ public async Task ReceiverCannotRetrievePartitionPropertiesWhenConnectionIsClose using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var connection = new EventHubConnection(connectionString); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var connection = new EventHubConnection( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); + + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connection)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + connection)) { Assert.That(async () => await receiver.GetPartitionPropertiesAsync(cancellationSource.Token), Throws.Nothing); - await connection.CloseAsync(cancellationSource.Token); Assert.That(async () => await receiver.GetPartitionPropertiesAsync(cancellationSource.Token), Throws.InstanceOf().And.Property(nameof(EventHubsException.Reason)).EqualTo(EventHubsException.FailureReason.ClientClosed)); @@ -2133,8 +2489,7 @@ public async Task ReceiverCannotRetrieveMetadataWithInvalidProxy() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var partition = (await QueryPartitionsAsync(connectionString, cancellationSource.Token)).First(); + var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); var invalidProxyOptions = new PartitionReceiverOptions(); invalidProxyOptions.RetryOptions.MaximumRetries = 0; @@ -2143,7 +2498,14 @@ public async Task ReceiverCannotRetrieveMetadataWithInvalidProxy() invalidProxyOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); invalidProxyOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString, invalidProxyOptions)) + await using (var receiver = new PartitionReceiver( + EventHubConsumerClient.DefaultConsumerGroupName, + partition, + EventPosition.Earliest, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + invalidProxyOptions)) { // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to @@ -2159,15 +2521,18 @@ public async Task ReceiverCannotRetrieveMetadataWithInvalidProxy() /// Reads the list of partition identifiers for an Event Hub instance. /// /// - /// The connection string to use when creating the producer. + /// The Event Hub Name to use when creating the producer. /// The token used to signal a cancellation request. /// /// The set of partition identifiers. /// - private async Task QueryPartitionsAsync(string connectionString, + private async Task QueryPartitionsAsync(string eventHubName, CancellationToken cancellationToken = default) { - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubName, + EventHubsTestEnvironment.Instance.Credential)) { return await producer.GetPartitionIdsAsync(cancellationToken); } @@ -2177,21 +2542,24 @@ private async Task QueryPartitionsAsync(string connectionString, /// Sends a set of events using a new producer to do so. /// /// - /// The connection string to use when creating the producer. + /// The Event Hub Name to use when creating the producer. /// The set of events to send. /// The set of options to apply when creating batches. /// The token used to signal a cancellation request. /// /// The count of events that were sent. /// - private async Task SendEventsAsync(string connectionString, + private async Task SendEventsAsync(string eventHubName, IEnumerable sourceEvents, CreateBatchOptions batchOptions = default, CancellationToken cancellationToken = default) { var sentCount = 0; - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + eventHubName, + EventHubsTestEnvironment.Instance.Credential)) { foreach (var batch in (await EventGenerator.BuildBatchesAsync(sourceEvents, producer, batchOptions, cancellationToken))) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs index e7cfd9cf875f1..18882e31e5301 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs @@ -53,7 +53,7 @@ public async Task ProducerCanPublishRoundRobinWithDefaultOptions() var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); producer.SendEventBatchSucceededAsync += args => { @@ -103,7 +103,10 @@ public async Task ProducerCanPublishRoundRobinWithDefaultOptions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -148,7 +151,7 @@ public async Task ProducerCanPublishUsingPartitionKeysWithDefaultOptions() var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); producer.SendEventBatchSucceededAsync += args => { @@ -206,7 +209,10 @@ public async Task ProducerCanPublishUsingPartitionKeysWithDefaultOptions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -251,7 +257,7 @@ public async Task ProducerCanPublishToPartitionIdsWithDefaultOptions() var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var partitions = await producer.GetPartitionIdsAsync(cancellationSource.Token); @@ -311,7 +317,10 @@ public async Task ProducerCanPublishToPartitionIdsWithDefaultOptions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -355,7 +364,7 @@ public async Task ProducerCanPublishHeterogeneousEventsWithDefaultOptions() var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var partitions = await producer.GetPartitionIdsAsync(cancellationSource.Token); @@ -421,7 +430,10 @@ public async Task ProducerCanPublishHeterogeneousEventsWithDefaultOptions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -467,7 +479,7 @@ public async Task ProducerCanPublishWithRestrictedConcurrency() var options = new EventHubBufferedProducerClientOptions { MaximumConcurrentSends = concurrentSends }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); var partitions = await producer.GetPartitionIdsAsync(cancellationSource.Token); @@ -533,7 +545,10 @@ public async Task ProducerCanPublishWithRestrictedConcurrency() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -582,7 +597,7 @@ public async Task ProducerCanPublishWithConcurrentPartitions() }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -632,7 +647,10 @@ public async Task ProducerCanPublishWithConcurrentPartitions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -686,7 +704,7 @@ public async Task ProducerCanPublishAfterIdle() .Callback(() => idleCompletionSource.TrySetResult(true)); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var partitions = await producer.GetPartitionIdsAsync(cancellationSource.Token); @@ -760,7 +778,10 @@ public async Task ProducerCanPublishAfterIdle() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -806,7 +827,7 @@ public async Task ProducerCanPublishAfterFlush() var options = new EventHubBufferedProducerClientOptions { MaximumConcurrentSends = eventSetCount }; await using var scope = await EventHubScope.CreateAsync(1); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -846,7 +867,10 @@ public async Task ProducerCanPublishAfterFlush() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -894,7 +918,7 @@ public async Task FlushSendsAllEventsAndWaitsForHandlersWithDefaultOptions() var options = new EventHubBufferedProducerClientOptions { MaximumConcurrentSends = partitionCount }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -940,7 +964,10 @@ public async Task FlushSendsAllEventsAndWaitsForHandlersWithDefaultOptions() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -995,7 +1022,7 @@ public async Task FlushSendsAllEventsAndWaitsForHandlersWithConcurrentPartitions }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -1041,7 +1068,10 @@ public async Task FlushSendsAllEventsAndWaitsForHandlersWithConcurrentPartitions // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -1089,7 +1119,7 @@ public async Task CloseSendsAllEventsAndWaitsForHandlersWhenFlushingWithDefaultO var options = new EventHubBufferedProducerClientOptions { MaximumConcurrentSends = partitionCount }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -1135,7 +1165,10 @@ public async Task CloseSendsAllEventsAndWaitsForHandlersWhenFlushingWithDefaultO // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -1185,7 +1218,7 @@ public async Task CloseSendsAllEventsAndWaitsForHandlersWhenFlushingWithConcurre }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchSucceededAsync += args => { @@ -1231,7 +1264,10 @@ public async Task CloseSendsAllEventsAndWaitsForHandlersWhenFlushingWithConcurre // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -1273,7 +1309,7 @@ public async Task CloseAbandonsEventsAndHandlersWhenClearingWithDefaultOptions() var options = new EventHubBufferedProducerClientOptions { MaximumConcurrentSends = partitionCount }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchFailedAsync += args => { @@ -1319,7 +1355,7 @@ public async Task CloseAbandonsEventsAndHandlersWhenClearingWithConcurrentPartit }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.SendEventBatchFailedAsync += args => { @@ -1373,7 +1409,7 @@ public async Task CloseSendsEventsWhenFlushingAfterIdle() .Callback(() => idleCompletionSource.TrySetResult(true)); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.Logger = mockLogger.Object; @@ -1433,7 +1469,10 @@ public async Task CloseSendsEventsWhenFlushingAfterIdle() // Read back the events and ensure all were successfully published. - await using var consumerClient = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var consumerClient = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); await foreach (var partitionEvent in consumerClient.ReadEventsAsync(cancellationSource.Token)) { @@ -1483,7 +1522,7 @@ public async Task CloseIsSuccessfulWhileIdle() .Callback(() => completionSource.TrySetResult(true)); await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, options); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options); producer.Logger = mockLogger.Object; producer.SendEventBatchSucceededAsync += args => Task.CompletedTask; @@ -1523,11 +1562,10 @@ public async Task CloseIsSuccessfulWhileIdle() public async Task ProducerCanRetrieveEventHubProperties(EventHubsTransportType transportType) { var partitionCount = 4; - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; var producerOptions = new EventHubBufferedProducerClientOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(connectionString, scope.EventHubName, producerOptions); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions); var properties = await producer.GetEventHubPropertiesAsync(); @@ -1548,11 +1586,10 @@ public async Task ProducerCanRetrieveEventHubProperties(EventHubsTransportType t public async Task ProducerCanRetrievePartitionProperties(EventHubsTransportType transportType) { var partitionCount = 4; - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; var producerOptions = new EventHubBufferedProducerClientOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; await using var scope = await EventHubScope.CreateAsync(partitionCount); - await using var producer = new EventHubBufferedProducerClient(connectionString, scope.EventHubName, producerOptions); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions); var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(20)); var properties = await producer.GetEventHubPropertiesAsync(); @@ -1576,7 +1613,7 @@ public async Task ProducerCanRetrievePartitionProperties(EventHubsTransportType public async Task ConnectionTransportPartitionIdsMatchPartitionProperties() { await using var scope = await EventHubScope.CreateAsync(4); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var properties = await producer.GetEventHubPropertiesAsync(); var partitions = await producer.GetPartitionIdsAsync(); @@ -1596,7 +1633,7 @@ public async Task ConnectionTransportPartitionIdsMatchPartitionProperties() public async Task ProducerCannotRetrieveMetadataWhenClosed() { await using var scope = await EventHubScope.CreateAsync(1); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var partition = (await producer.GetPartitionIdsAsync()).First(); @@ -1624,7 +1661,7 @@ public async Task ProducerCannotRetrieveMetadataWhenClosed() public async Task ProducerCannotRetrievePartitionPropertiesWhenPartitionIdIsInvalid(string invalidPartition) { await using var scope = await EventHubScope.CreateAsync(1); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); Assert.That(async () => await producer.GetPartitionPropertiesAsync(invalidPartition), Throws.TypeOf()); } @@ -1649,8 +1686,8 @@ public async Task ProducerCannotRetrieveMetadataWhenProxyIsInvalid() }; await using var scope = await EventHubScope.CreateAsync(1); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); - await using var invalidProxyProducer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName, invalidProxyOptions); + await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); + await using var invalidProxyProducer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, invalidProxyOptions); var partition = (await producer.GetPartitionIdsAsync()).First(); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs index 05cdb4dcf1f5d..38bb0890967f1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs @@ -14,7 +14,6 @@ using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Producer; -using Microsoft.Azure.Amqp.Framing; using NUnit.Framework; namespace Azure.Messaging.EventHubs.Tests @@ -52,9 +51,7 @@ public async Task ProducerWithNoOptionsCanSend(EventHubsTransportType transportT { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString, new EventHubConnectionOptions { TransportType = transportType })) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, new EventHubConnectionOptions { TransportType = transportType })) await using (var producer = new EventHubProducerClient(connection)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("AWord")) }; @@ -75,15 +72,13 @@ public async Task ProducerWithOptionsCanSend(EventHubsTransportType transportTyp { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var producerOptions = new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { MaximumRetries = 5 }, ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - await using (var producer = new EventHubProducerClient(connectionString, producerOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("AWord")) }; Assert.That(async () => await producer.SendAsync(events), Throws.Nothing); @@ -103,8 +98,6 @@ public async Task ProducerWithCustomBufferSizesCanSend(EventHubsTransportType tr { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var producerOptions = new EventHubProducerClientOptions { ConnectionOptions = new EventHubConnectionOptions @@ -114,7 +107,7 @@ public async Task ProducerWithCustomBufferSizesCanSend(EventHubsTransportType tr } }; - await using (var producer = new EventHubProducerClient(connectionString, producerOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("AWord")) }; Assert.That(async () => await producer.SendAsync(events), Throws.Nothing); @@ -132,9 +125,7 @@ public async Task ProducerWithIdentifierCanSend() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString, new EventHubProducerClientOptions { Identifier = "CustomIdentif13r!" })) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, new EventHubProducerClientOptions { Identifier = "CustomIdentif13r!" })) { var events = new[] { new EventData(Encoding.UTF8.GetBytes("AWord")) }; Assert.That(async () => await producer.SendAsync(events), Throws.Nothing); @@ -151,7 +142,7 @@ public async Task ProducerWithIdentifierCanSend() public async Task ProducerCanSendToASpecificPartition() { await using EventHubScope scope = await EventHubScope.CreateAsync(4); - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -177,8 +168,9 @@ public async Task ProducerCanSendToASpecificPartition() await using var consumer = new EventHubConsumerClient( EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.EventHubsConnectionString, - scope.EventHubName); + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); try { @@ -212,7 +204,7 @@ public async Task ProducerCanSendToASpecificPartition() public async Task ProducerCanSendAnEventBatchToASpecificPartition() { await using EventHubScope scope = await EventHubScope.CreateAsync(4); - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -245,8 +237,9 @@ public async Task ProducerCanSendAnEventBatchToASpecificPartition() await using var consumer = new EventHubConsumerClient( EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.EventHubsConnectionString, - scope.EventHubName); + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); try { @@ -295,9 +288,7 @@ public async Task ProducerCanSendEventsWithCustomProperties() events[index].Properties["Type"] = $"com.microsoft.test.Type{ index }"; } - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { Assert.That(async () => await producer.SendAsync(events), Throws.Nothing); } @@ -313,7 +304,7 @@ public async Task ProducerCanSendEventsWithCustomProperties() public async Task ProducerCanSendEventsUsingAPartitionHashKey() { await using EventHubScope scope = await EventHubScope.CreateAsync(4); - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -339,8 +330,9 @@ public async Task ProducerCanSendEventsUsingAPartitionHashKey() await using var consumer = new EventHubConsumerClient( EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.EventHubsConnectionString, - scope.EventHubName); + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); try { @@ -379,7 +371,7 @@ public async Task ProducerCanSendEventsUsingAPartitionHashKey() public async Task ProducerCanSendAnEventBatchUsingAPartitionHashKey() { await using EventHubScope scope = await EventHubScope.CreateAsync(4); - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -412,8 +404,9 @@ public async Task ProducerCanSendAnEventBatchUsingAPartitionHashKey() await using var consumer = new EventHubConsumerClient( EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.EventHubsConnectionString, - scope.EventHubName); + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); try { @@ -453,13 +446,14 @@ public async Task ProducerCanSendSingleLargeEventInASet() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString, new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) { // Actual limit is 1046520 for a single event. EventData[] eventSet = new[] { new EventData(new byte[100000]) }; - Assert.That(async () => await producer.SendAsync(eventSet), Throws.Nothing); } } @@ -475,9 +469,7 @@ public async Task ProducerCanSendASetOfEvents() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventData[] events = new[] { @@ -501,9 +493,7 @@ public async Task ProducerCanSendZeroLengthSet() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventData[] events = new[] { @@ -527,9 +517,11 @@ public async Task ProducerCanSendLargeSet() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString, new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) { // Actual limit is 1046520 for a single event. EventData[] events = new[] @@ -554,9 +546,7 @@ public async Task ProducerCanSendAnEventBatch() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { using EventDataBatch batch = await producer.CreateBatchAsync(); @@ -576,13 +566,13 @@ public async Task ProducerCanSendAnEventBatch() /// /// [Test] - public async Task ProducerCanSendAnEventBatchUsingAnIdentityCredential() + public async Task ProducerCanSendAnEventBatchUsingAConnectionString() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { var credential = EventHubsTestEnvironment.Instance.Credential; - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, credential)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.EventHubsConnectionString, scope.EventHubName)) { using EventDataBatch batch = await producer.CreateBatchAsync(); @@ -667,9 +657,7 @@ public async Task ProducerCanSendZeroLengthEventBatch() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { using EventDataBatch batch = await producer.CreateBatchAsync(); batch.TryAdd(new EventData(new BinaryData(Array.Empty()))); @@ -690,9 +678,11 @@ public async Task ProducerCanSendLargeEventBatch() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString, new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) + await using (var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(5) } })) { using EventDataBatch batch = await producer.CreateBatchAsync(); @@ -718,9 +708,7 @@ public async Task ProducerCanSendWithBinaryApplicationProperties() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using var producer = new EventHubProducerClient(connectionString); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); var eventData = new EventData(Encoding.UTF8.GetBytes("AWord")); eventData.Properties["TestByteArray"] = new byte[] { 0x12, 0x34, 0x56, 0x78 }; @@ -740,9 +728,7 @@ public async Task ProducerCannotSendSetLargerThanMaximumSize() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { // Actual limit is 1046520 for a single event. @@ -768,9 +754,7 @@ public async Task ProducerCanSendWhenPartitionIsNull() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("Will it work")) }; Assert.That(async () => await producer.SendAsync(events, new SendEventOptions { PartitionId = null }), Throws.Nothing); @@ -788,9 +772,7 @@ public async Task ProducerCannotSendWhenClosed() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("Dummy event")) }; Assert.That(async () => await producer.SendAsync(events), Throws.Nothing); @@ -811,9 +793,7 @@ public async Task ProducerCannotSendWhenSharedConnectionIsClosed() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) await using (var producer = new EventHubProducerClient(connection)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("Dummy event")) }; @@ -839,9 +819,7 @@ public async Task ProducerCannotSendToInvalidPartition(string invalidPartition) { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("Lorem Ipsum")) }; @@ -863,9 +841,7 @@ public async Task SendSetUpdatesPartitionProperties() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { var partition = (await connection.GetPartitionIdsAsync(DefaultRetryPolicy)).First(); EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("I should update stuff")) }; @@ -877,13 +853,11 @@ public async Task SendSetUpdatesPartitionProperties() await producer.SendAsync(events, new SendEventOptions { PartitionId = partition }); PartitionProperties oldPartitionProperties = await producer.GetPartitionPropertiesAsync(partition); - Assert.That(oldPartitionProperties, Is.Not.Null, "A set of partition properties should have been returned."); await producer.SendAsync(events); PartitionProperties newPartitionProperties = await producer.GetPartitionPropertiesAsync(partition); - Assert.That(newPartitionProperties, Is.Not.Null, "A set of partition properties should have been returned."); // The following properties should not have been altered. @@ -911,9 +885,7 @@ public async Task SendBatchUpdatesPartitionProperties() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { var partition = (await connection.GetPartitionIdsAsync(DefaultRetryPolicy)).First(); @@ -964,9 +936,7 @@ public async Task SendDoesNotUpdatePartitionPropertiesWhenSendingToDifferentPart { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { var partitionIds = await connection.GetPartitionIdsAsync(DefaultRetryPolicy); EventData[] events = new[] { new EventData(Encoding.UTF8.GetBytes("I should not update stuff")) }; @@ -1015,9 +985,7 @@ public async Task ProducerDoesNotSendToSpecificPartitionWhenPartitionIdIsNotSpec await using (EventHubScope scope = await EventHubScope.CreateAsync(partitions)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { await using (var producer = new EventHubProducerClient(connection)) await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connection)) @@ -1089,9 +1057,7 @@ public async Task ProducerSendsEventsInTheSameSetToTheSamePartition() await using (EventHubScope scope = await EventHubScope.CreateAsync(partitions)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) await using (var producer = new EventHubProducerClient(connection)) await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connection)) { @@ -1158,9 +1124,7 @@ public async Task ProducerSendsEventsWithTheSamePartitionHashKeyToTheSamePartiti await using (EventHubScope scope = await EventHubScope.CreateAsync(partitions)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var connection = new EventHubConnection(connectionString)) + await using (var connection = new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) await using (var producer = new EventHubProducerClient(connection)) await using (var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connection)) { @@ -1225,8 +1189,6 @@ public async Task ProducerCannotSendWhenProxyIsInvalid() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var producerOptions = new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }, @@ -1238,7 +1200,11 @@ public async Task ProducerCannotSendWhenProxyIsInvalid() } }; - await using (var invalidProxyProducer = new EventHubProducerClient(connectionString, producerOptions)) + await using (var invalidProxyProducer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + producerOptions)) { Assert.That(async () => await invalidProxyProducer.SendAsync(new[] { new EventData(new byte[1]) }), Throws.InstanceOf().Or.InstanceOf()); } @@ -1304,7 +1270,7 @@ public async Task ProducerCanSendEventsWithAFullyPopulatedAmqpMessage() // Attempt to send and validate the operation was not rejected. - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName)); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); Assert.That(async () => await producer.SendAsync(new[] { eventData }), Throws.Nothing); } } @@ -1325,7 +1291,7 @@ public async Task ProducerCanSendEventsWithValueBodies() // Attempt to send and validate the operation was not rejected. - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName)); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); Assert.That(async () => await producer.SendAsync(new[] { eventData }), Throws.Nothing); } } @@ -1346,7 +1312,7 @@ public async Task ProducerCanSendEventsWithSequenceBodies() // Attempt to send and validate the operation was not rejected. - await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName)); + await using var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); Assert.That(async () => await producer.SendAsync(new[] { eventData }), Throws.Nothing); } } @@ -1368,7 +1334,7 @@ public async Task ProducerCanRetrieveEventHubProperties(EventHubsTransportType t var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; var producerOptions = new EventHubProducerClientOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - await using (var producer = new EventHubProducerClient(connectionString, scope.EventHubName, producerOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions)) { EventHubProperties properties = await producer.GetEventHubPropertiesAsync(); @@ -1395,10 +1361,9 @@ public async Task ProducerCanRetrievePartitionProperties(EventHubsTransportType await using (EventHubScope scope = await EventHubScope.CreateAsync(partitionCount)) { var options = new EventHubConnectionOptions(); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var producerOptions = new EventHubProducerClientOptions { ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - await using (var producer = new EventHubProducerClient(connectionString, scope.EventHubName, producerOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, producerOptions)) { var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(20)); var properties = await producer.GetEventHubPropertiesAsync(); @@ -1425,9 +1390,7 @@ public async Task ConnectionTransportPartitionIdsMatchPartitionProperties() { await using (EventHubScope scope = await EventHubScope.CreateAsync(4)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { EventHubProperties properties = await producer.GetEventHubPropertiesAsync(); var partitions = await producer.GetPartitionIdsAsync(); @@ -1450,9 +1413,7 @@ public async Task ProducerCannotRetrieveMetadataWhenClosed() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { var partition = (await producer.GetPartitionIdsAsync()).First(); @@ -1483,9 +1444,7 @@ public async Task ProducerCannotRetrievePartitionPropertiesWhenPartitionIdIsInva { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - - await using (var producer = new EventHubProducerClient(connectionString)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) { Assert.That(async () => await producer.GetPartitionPropertiesAsync(invalidPartition), Throws.TypeOf()); } @@ -1502,8 +1461,6 @@ public async Task ProducerCannotRetrieveMetadataWhenProxyIsInvalid() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var invalidProxyOptions = new EventHubProducerClientOptions { RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }, @@ -1515,8 +1472,8 @@ public async Task ProducerCannotRetrieveMetadataWhenProxyIsInvalid() } }; - await using (var producer = new EventHubProducerClient(connectionString)) - await using (var invalidProxyProducer = new EventHubProducerClient(connectionString, invalidProxyOptions)) + await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) + await using (var invalidProxyProducer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, invalidProxyOptions)) { var partition = (await producer.GetPartitionIdsAsync()).First(); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/IdempotentPublishingLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/IdempotentPublishingLiveTests.cs index ef92884946624..b9db032af87ca 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/IdempotentPublishingLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/IdempotentPublishingLiveTests.cs @@ -36,13 +36,17 @@ public async Task ProducerCanOptIntoIdempotentPublishing() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using var producer = new EventHubProducerClient(connectionString, options); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + Assert.That(async () => await producer.GetPartitionIdsAsync(cancellationSource.Token), Throws.Nothing); } } @@ -59,13 +63,16 @@ public async Task ProducerCanPublishEvents(EventHubsTransportType transportType) { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true, ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; + var cancellationSource = new CancellationTokenSource(); + cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using var producer = new EventHubProducerClient(connectionString, options); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true, ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var sendOptions = new SendEventOptions { PartitionId = partition }; @@ -87,14 +94,17 @@ public async Task ProducerCanPublishBatches(EventHubsTransportType transportType { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true, ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true, ConnectionOptions = new EventHubConnectionOptions { TransportType = transportType } }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync()).First(); var batchOptions = new CreateBatchOptions { PartitionId = partition }; @@ -123,10 +133,13 @@ public async Task ProducerCanPublishEventsAfterAnException() var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - await using var producer = new EventHubProducerClient(connectionString, options); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); var partition = (await producer.GetPartitionIdsAsync()).First(); var sendOptions = new SendEventOptions { PartitionId = partition }; @@ -167,10 +180,13 @@ public async Task ProducerCanPublishBatchesAfterAnException() var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - await using var producer = new EventHubProducerClient(connectionString, options); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); var partition = (await producer.GetPartitionIdsAsync()).First(); var batchOptions = new CreateBatchOptions { PartitionId = partition }; @@ -214,14 +230,17 @@ public async Task ProducerInitializesPropertiesWhenRequested() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); var partitionProperties = await producer.GetPartitionPublishingPropertiesAsync(partition); @@ -243,14 +262,17 @@ public async Task ProducerInitializesPropertiesWhenPublishing() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var sendOptions = new SendEventOptions { PartitionId = partition }; @@ -276,14 +298,17 @@ public async Task ProducerManagesConcurrencyWhenPublishingEvents() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var sendOptions = new SendEventOptions { PartitionId = partition }; @@ -313,14 +338,17 @@ public async Task ProducerManagesConcurrencyWhenPublishingBatches() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var batchOptions = new CreateBatchOptions { PartitionId = partition }; @@ -356,13 +384,16 @@ public async Task ProducerAllowsPublishingConcurrentlyToDifferentPartitions() { await using (EventHubScope scope = await EventHubScope.CreateAsync(4)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + var cancellationSource = new CancellationTokenSource(); + cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await using var producer = new EventHubProducerClient(connectionString, options); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); async Task sendEvents(string partition, int delayMilliseconds) { @@ -393,14 +424,17 @@ public async Task ProducerSequencesEvents() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); var sendOptions = new SendEventOptions { PartitionId = partition }; @@ -430,14 +464,17 @@ public async Task ProducerSequencesBatches() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); var batchOptions = new CreateBatchOptions { PartitionId = partition }; @@ -479,14 +516,17 @@ public async Task ProducerUpdatesPropertiesAfterPublishingEvents() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var initialPartitionProperties = await producer.GetPartitionPublishingPropertiesAsync(partition); @@ -512,14 +552,17 @@ public async Task ProducerUpdatesPropertiesAfterPublishingBatches() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); - var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; - - await using var producer = new EventHubProducerClient(connectionString, options); - var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); var initialPartitionProperties = await producer.GetPartitionPublishingPropertiesAsync(partition); var batchOptions = new CreateBatchOptions { PartitionId = partition }; @@ -549,7 +592,6 @@ public async Task ProducerCanInitializeWithPartitionOptions() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; var cancellationSource = new CancellationTokenSource(); @@ -560,7 +602,7 @@ public async Task ProducerCanInitializeWithPartitionOptions() // Create a producer for a small scope that will Send some events and read the properties. - await using (var initialProducer = new EventHubProducerClient(connectionString, options)) + await using (var initialProducer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options)) { partition = (await initialProducer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); @@ -577,7 +619,12 @@ public async Task ProducerCanInitializeWithPartitionOptions() StartingSequenceNumber = partitionProperties.LastPublishedSequenceNumber }); - await using var producer = new EventHubProducerClient(connectionString, options); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); + Assert.That(async () => await producer.SendAsync(EventGenerator.CreateEvents(10), new SendEventOptions { PartitionId = partition }, cancellationSource.Token), Throws.Nothing); } } @@ -592,7 +639,6 @@ public async Task ProducerCanInitializeWithPartialPartitionOptions() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; var cancellationSource = new CancellationTokenSource(); @@ -603,7 +649,7 @@ public async Task ProducerCanInitializeWithPartialPartitionOptions() // Create a producer for a small scope that will Send some events and read the properties. - await using (var initialProducer = new EventHubProducerClient(connectionString, options)) + await using (var initialProducer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options)) { partition = (await initialProducer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); @@ -620,7 +666,12 @@ public async Task ProducerCanInitializeWithPartialPartitionOptions() }); Assert.That(options.PartitionOptions[partition].StartingSequenceNumber.HasValue, Is.False, "The partition options should not specifiy a starting sequence number."); - await using var producer = new EventHubProducerClient(connectionString, options); + + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); // Verify that the properties were fully initialized when using partial options. @@ -647,7 +698,6 @@ public async Task ProducerIsRejectedWithPartitionOptionsForInvalidState() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { - var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName); var options = new EventHubProducerClientOptions { EnableIdempotentPartitions = true }; var cancellationSource = new CancellationTokenSource(); @@ -658,7 +708,7 @@ public async Task ProducerIsRejectedWithPartitionOptionsForInvalidState() // Create a producer for a small scope that will Send some events and read the properties. - await using (var initialProducer = new EventHubProducerClient(connectionString, options)) + await using (var initialProducer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, options)) { partition = (await initialProducer.GetPartitionIdsAsync(cancellationSource.Token)).Last(); @@ -675,7 +725,11 @@ public async Task ProducerIsRejectedWithPartitionOptionsForInvalidState() StartingSequenceNumber = (partitionProperties.LastPublishedSequenceNumber - 5) }); - await using var producer = new EventHubProducerClient(connectionString, options); + await using var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential, + options); Assert.That(async () => await producer.SendAsync(EventGenerator.CreateEvents(10), new SendEventOptions { PartitionId = partition }, cancellationSource.Token), Throws.InstanceOf().And.Property("Reason").EqualTo(EventHubsException.FailureReason.InvalidClientState)); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/ReadMeSnippetsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/ReadMeSnippetsLiveTests.cs index 14d6f446a2d39..516efb9c9add6 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/ReadMeSnippetsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/ReadMeSnippetsLiveTests.cs @@ -37,7 +37,7 @@ public async Task CreateWithConnectionString() var eventHubName = "<< NAME OF THE EVENT HUB >>"; #else var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fakeHub"; + var eventHubName = "fake"; #endif // It is recommended that you cache the Event Hubs clients for the lifetime of your diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample01_HelloWorldLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample01_HelloWorldLiveTests.cs index 1624d277a6062..fb570965c0d5b 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample01_HelloWorldLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample01_HelloWorldLiveTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -57,9 +58,10 @@ public async Task PublishEvents() { await using var scope = await EventHubScope.CreateAsync(1); - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = scope.EventHubName; - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); #region Snippet:EventHubs_Sample01_PublishEvents @@ -116,9 +118,11 @@ public async Task ReadEvents() { await using var scope = await EventHubScope.CreateAsync(1); - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = scope.EventHubName; - var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, connectionString, eventHubName); + var consumer = new EventHubConsumerClient( + EventHubConsumerClient.DefaultConsumerGroupName, + EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, + scope.EventHubName, + EventHubsTestEnvironment.Instance.Credential); #region Snippet:EventHubs_Sample01_ReadEvents diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs index b15f992a99146..1583a2560b021 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample02_EventHubsClientsLiveTests.cs @@ -8,6 +8,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -34,11 +35,13 @@ public async Task ConfigureProducerTransportWithFullOptions() #region Snippet:EventHubs_Sample02_ProducerTransportFullConnectionOptions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var producerOptions = new EventHubProducerClientOptions @@ -50,8 +53,9 @@ public async Task ConfigureProducerTransportWithFullOptions() }; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -72,19 +76,22 @@ public async Task ConfigureProducerTransportByProperty() #region Snippet:EventHubs_Sample02_ProducerTransportProperty #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -105,11 +112,13 @@ public async Task ConfigureProducerProxyWithFullOptions() #region Snippet:EventHubs_Sample02_ProducerProxyFullConnectionOptions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var producerOptions = new EventHubProducerClientOptions @@ -122,8 +131,9 @@ public async Task ConfigureProducerProxyWithFullOptions() }; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -144,11 +154,13 @@ public async Task ConfigureProducerProxyByProperty() #region Snippet:EventHubs_Sample02_ProducerProxyProperty #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var producerOptions = new EventHubProducerClientOptions(); @@ -156,8 +168,9 @@ public async Task ConfigureProducerProxyByProperty() producerOptions.ConnectionOptions.Proxy = new WebProxy("https://proxyserver:80", true); var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -178,19 +191,22 @@ public async Task ConfigureCustomEndpointAddress() #region Snippet:EventHubs_Sample02_ConnectionOptionsCustomEndpoint #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var producerOptions = new EventHubProducerClientOptions(); producerOptions.ConnectionOptions.CustomEndpointAddress = new Uri("amqps://app-gateway.mycompany.com"); var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -211,11 +227,13 @@ public async Task ConfigureRemoteCertificateValidationCallback() #region Snippet:EventHubs_Sample02_RemoteCertificateValidationCallback #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; - var eventHubName = "fake"; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; + var eventHubName = "fakse"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif static bool ValidateServerCertificate( @@ -239,8 +257,9 @@ static bool ValidateServerCertificate( producerOptions.ConnectionOptions.CertificateValidationCallback = ValidateServerCertificate; var producer = new EventHubProducerClient( - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, producerOptions); #endregion @@ -261,11 +280,13 @@ public async Task ConfigureConsumerRetryWithFullOptions() #region Snippet:EventHubs_Sample02_ConsumerRetryWithFullOptions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; @@ -282,8 +303,9 @@ public async Task ConfigureConsumerRetryWithFullOptions() var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, consumerOptions); #endregion @@ -304,11 +326,13 @@ public async Task ConfigureConsumerRetryByProperty() #region Snippet:EventHubs_Sample02_ConsumerRetryByProperty #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = "fake"; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; @@ -318,8 +342,9 @@ public async Task ConfigureConsumerRetryByProperty() var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, consumerOptions); #endregion diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs index 0baaba8e76137..c758b7b90efe7 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -32,14 +33,19 @@ public async Task InspectHub() #region Snippet:EventHubs_Sample03_InspectHub #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -70,14 +76,19 @@ public async Task QueryPartitions() #region Snippet:EventHubs_Sample03_QueryPartitions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -104,15 +115,21 @@ public async Task InspectPartition() #region Snippet:EventHubs_Sample03_InspectPartition #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; - var consumer = new EventHubConsumerClient(consumerGroup, connectionString, eventHubName); + var consumer = new EventHubConsumerClient( + consumerGroup, + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample04_PublishingEventsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample04_PublishingEventsLiveTests.cs index bd42c3c9b92d0..c5702ebac6e73 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample04_PublishingEventsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample04_PublishingEventsLiveTests.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -33,14 +34,19 @@ public async Task EventBatch() #region Snippet:EventHubs_Sample04_EventBatch #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -73,14 +79,19 @@ public async Task AutomaticRouting() #region Snippet:EventHubs_Sample04_AutomaticRouting #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -118,14 +129,19 @@ public async Task AutomaticRoutingBuffered() #region Snippet:EventHubs_Sample04_AutomaticRoutingBuffered #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); + var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -175,14 +191,19 @@ public async Task PartitionKey() #region Snippet:EventHubs_Sample04_PartitionKey #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -225,14 +246,19 @@ public async Task PartitionKeyBuffered() #region Snippet:EventHubs_Sample04_PartitionKeyBuffered #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); + var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -287,14 +313,19 @@ public async Task PartitionId() #region Snippet:EventHubs_Sample04_PartitionId #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -339,14 +370,19 @@ public async Task PartitionIdBuffered() #region Snippet:EventHubs_Sample04_PartitionIdBuffered #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); + var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -403,14 +439,19 @@ public async Task CustomMetadata() #region Snippet:EventHubs_Sample04_CustomMetadata #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubBufferedProducerClient(connectionString, eventHubName); + var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); // The failure handler is required and invoked after all allowable // retries were applied. @@ -478,11 +519,13 @@ public async Task BufferedConfiguration() #region Snippet:EventHubs_Sample04_BufferedConfiguration #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var options = new EventHubBufferedProducerClientOptions @@ -494,7 +537,11 @@ public async Task BufferedConfiguration() EnableIdempotentRetries = true }; - var producer = new EventHubBufferedProducerClient(connectionString, eventHubName, options); + var producer = new EventHubBufferedProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential, + options); // The failure handler is required and invoked after all allowable // retries were applied. @@ -544,14 +591,19 @@ public async Task NoBatch() #region Snippet:EventHubs_Sample04_NoBatch #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -585,14 +637,20 @@ public async Task MultipleBatches() #region Snippet:EventHubs_Sample04_MultipleBatches #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); + var batches = default(IEnumerable); var eventsToSend = new Queue(); @@ -635,14 +693,19 @@ public async Task CustomBatchSize() #region Snippet:EventHubs_Sample04_CustomBatchSize #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs index 598fd6bd77a53..0f7cf87fe79f8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs @@ -9,6 +9,7 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Primitives; using Azure.Messaging.EventHubs.Producer; @@ -38,18 +39,21 @@ public async Task ReadAllPartitions() #region Snippet:EventHubs_Sample05_ReadAllPartitions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -98,18 +102,21 @@ public async Task ReadAllPartitionsWaitTime() #region Snippet:EventHubs_Sample05_ReadAllPartitionsWaitTime #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -163,18 +170,21 @@ public async Task ReadAllPartitionsFromLatest() #region Snippet:EventHubs_Sample05_ReadAllPartitionsFromLatest #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -216,18 +226,21 @@ public async Task ReadPartition() #region Snippet:EventHubs_Sample05_ReadPartition #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -273,18 +286,21 @@ public async Task ReadPartitionWaitTime() #region Snippet:EventHubs_Sample05_ReadPartitionWaitTime #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -352,18 +368,21 @@ public async Task ReadPartitionFromDate() #region Snippet:EventHubs_Sample05_ReadPartitionFromDate #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -411,18 +430,21 @@ public async Task ReadPartitionFromOffset() #region Snippet:EventHubs_Sample05_ReadPartitionFromOffset #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -469,18 +491,21 @@ public async Task ReadPartitionFromSequence() #region Snippet:EventHubs_Sample05_ReadPartitionFromSequence #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -527,18 +552,21 @@ public async Task ReadPartitionTrackLastEnqueued() #region Snippet:EventHubs_Sample05_ReadPartitionTrackLastEnqueued #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -594,11 +622,13 @@ public async Task ReadPartitionWithReceiver() #region Snippet:EventHubs_Sample05_ReadPartitionWithReceiver #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; @@ -607,7 +637,10 @@ public async Task ReadPartitionWithReceiver() string firstPartition; - await using (var producer = new EventHubProducerClient(connectionString, eventHubName)) + await using (var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential)) { firstPartition = (await producer.GetPartitionIdsAsync()).First(); } @@ -616,8 +649,9 @@ public async Task ReadPartitionWithReceiver() consumerGroup, firstPartition, EventPosition.Earliest, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample07_EarlierLanguageVersionsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample07_EarlierLanguageVersionsLiveTests.cs index c3476139f9759..b4ac38e697b2b 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample07_EarlierLanguageVersionsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample07_EarlierLanguageVersionsLiveTests.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -34,14 +35,19 @@ public async Task Publish() #region Snippet:EventHubs_Sample07_Publish #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -76,18 +82,21 @@ public async Task ReadAllPartitions() #region Snippet:EventHubs_Sample07_ReadAllPartitions #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; var consumer = new EventHubConsumerClient( consumerGroup, - connectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample08_CustomEventProcessorLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample08_CustomEventProcessorLiveTests.cs index 597c620fba3ad..cbda1869d4343 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample08_CustomEventProcessorLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample08_CustomEventProcessorLiveTests.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Identity; using Azure.Messaging.EventHubs.Consumer; using Azure.Messaging.EventHubs.Primitives; using Azure.Messaging.EventHubs.Processor; @@ -48,18 +49,26 @@ public async Task CustomProcessorUse() #region Snippet:EventHubs_Sample08_CustomProcessorUse #if SNIPPET - var storageConnectionString = "<< CONNECTION STRING FOR THE STORAGE ACCOUNT >>"; + var credential = new DefaultAzureCredential(); + + var storageAccountEndpoint = "<< Account Uri (likely similar to https://{your-account}.blob.core.windows.net) >>"; var blobContainerName = "<< NAME OF THE BLOB CONTAINER >>"; - var eventHubsConnectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = "<< NAME OF THE EVENT HUB CONSUMER GROUP >>"; + var blobUriBuilder = new BlobUriBuilder(new Uri(storageAccountEndpoint)) + { + BlobContainerName = blobContainerName + }; + var storageClient = new BlobContainerClient( - storageConnectionString, - blobContainerName); + blobUriBuilder.ToUri(), + credential); #else - var eventHubsConnectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var credential = EventHubsTestEnvironment.Instance.Credential; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = eventHubScope.EventHubName; var consumerGroup = eventHubScope.ConsumerGroups.First(); var storageClient = Mock.Of(); @@ -71,8 +80,9 @@ public async Task CustomProcessorUse() storageClient, maximumBatchSize, consumerGroup, - eventHubsConnectionString, - eventHubName); + fullyQualifiedNamespace, + eventHubName, + credential); using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(TimeSpan.FromSeconds(30)); @@ -113,8 +123,9 @@ public CustomProcessor( BlobContainerClient storageClient, int eventBatchMaximumCount, string consumerGroup, - string connectionString, + string fullyQualifiedNamespace, string eventHubName, + TokenCredential credential, EventProcessorOptions clientOptions = default) : base( #if SNIPPET @@ -124,8 +135,9 @@ public CustomProcessor( #endif eventBatchMaximumCount, consumerGroup, - connectionString, + fullyQualifiedNamespace, eventHubName, + credential, clientOptions) { } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample09_ObservableEventBatchLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample09_ObservableEventBatchLiveTests.cs index 51fa5e13c1789..4c1983986ba2b 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample09_ObservableEventBatchLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample09_ObservableEventBatchLiveTests.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Azure.Identity; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -32,14 +33,19 @@ public async Task Sample09_AccessingEventData() #region Snippet:Sample09_AccessingEventData #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { @@ -86,14 +92,19 @@ public async Task Sample09_CheckingBatch() #region Snippet:Sample09_CheckingBatch #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); try { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample10_AzureEventSourceListenerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample10_AzureEventSourceListenerTests.cs index edb4fe5a9b443..3b11046118e61 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample10_AzureEventSourceListenerTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample10_AzureEventSourceListenerTests.cs @@ -7,6 +7,7 @@ using System.IO; using System.Threading.Tasks; using Azure.Core.Diagnostics; +using Azure.Identity; using Azure.Messaging.EventHubs.Producer; using NUnit.Framework; @@ -33,13 +34,19 @@ public async Task ConsoleListener() #region Snippet:EventHubs_Sample10_ConsoleListener #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener consoleListener = AzureEventSourceListener.CreateConsoleLogger(EventLevel.LogAlways); @@ -71,13 +78,19 @@ public async Task TraceListener() #region Snippet:EventHubs_Sample10_TraceListener #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener traceListener = AzureEventSourceListener.CreateTraceLogger(EventLevel.LogAlways); @@ -109,13 +122,19 @@ public async Task CustomListenerWithFilter() #region Snippet:EventHubs_Sample10_CustomListenerWithFilter #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; + var credential = new DefaultAzureCredential(); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; + var credential = EventHubsTestEnvironment.Instance.Credential; #endif - var producer = new EventHubProducerClient(connectionString, eventHubName); + + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); using AzureEventSourceListener customListener = new AzureEventSourceListener((args, message) => { @@ -164,19 +183,24 @@ public async Task CustomListenerWithFile() #region Snippet:EventHubs_Sample10_CustomListenerWithFile #if SNIPPET - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; - var producer = new EventHubProducerClient(connectionString, eventHubName); + var credential = new DefaultAzureCredential(); using Stream stream = new FileStream("<< PATH TO THE FILE >>", FileMode.OpenOrCreate, FileAccess.Write); #else - var connectionString = EventHubsTestEnvironment.Instance.EventHubsConnectionString; + var fullyQualifiedNamespace = EventHubsTestEnvironment.Instance.FullyQualifiedNamespace; var eventHubName = scope.EventHubName; - var producer = new EventHubProducerClient(connectionString, eventHubName); + var credential = EventHubsTestEnvironment.Instance.Credential; using Stream stream = new MemoryStream(); #endif + var producer = new EventHubProducerClient( + fullyQualifiedNamespace, + eventHubName, + credential); + using StreamWriter streamWriter = new StreamWriter(stream) { AutoFlush = true diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/SamplesCommonTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/SamplesCommonTests.cs index c6d01c3da7b4b..fe1ced34a650f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/SamplesCommonTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/SamplesCommonTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using Azure.Messaging.EventHubs.Consumer; +using Azure.Identity; using NUnit.Framework; namespace Azure.Messaging.EventHubs.Tests @@ -23,14 +24,17 @@ public void ConsumerBasicConfiguration() { #region Snippet:EventHubs_SamplesCommon_ConsumerBasicConfig - var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>"; + var fullyQualifiedNamespace = "<< NAMESPACE (likely similar to {your-namespace}.servicebus.windows.net) >>"; var eventHubName = "<< NAME OF THE EVENT HUB >>"; var consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; + var credential = new DefaultAzureCredential(); + #endregion - Assert.That(connectionString, Is.Not.Null); + Assert.That(fullyQualifiedNamespace, Is.Not.Null); Assert.That(eventHubName, Is.Not.Null); + Assert.That(credential, Is.Not.Null); Assert.That(consumerGroup, Is.Not.Null); } } From 31c0f37d41ea8bf87e7bf36f25b6031f16c516a5 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Tue, 8 Oct 2024 14:49:06 -0700 Subject: [PATCH 40/43] [EngSys] Update central Service Bus version (#46483) The focus of these changes is to update the central version for the `Azure.Messaging.ServiceBus` package to use the latest release. --- eng/Packages.Data.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 99681333eaf17..cd19e2dbff416 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -115,7 +115,7 @@ - + @@ -255,7 +255,7 @@ - + From 6b8988c16ce3b319c8bd312126e273bb0e907b3b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:37:33 -0700 Subject: [PATCH 41/43] Use equality function check for persist oidc token step (#46485) Co-authored-by: Ben Broderick Phillips --- eng/common/TestResources/deploy-test-resources.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index 6cd2a441e22a3..cba2c3e28d60f 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -42,7 +42,7 @@ steps: - template: /eng/common/TestResources/setup-environments.yml - - ${{ if parameters.PersistOidcToken }}: + - ${{ if eq(parameters.PersistOidcToken, true) }}: - task: AzureCLI@2 displayName: Set OIDC token env: @@ -61,7 +61,7 @@ steps: env: TEMP: $(Agent.TempDirectory) PoolSubnet: $(PoolSubnet) - ${{ if parameters.PersistOidcToken }}: + ${{ if eq(parameters.PersistOidcToken, true) }}: ARM_OIDC_TOKEN: $(ARM_OIDC_TOKEN) ${{ insert }}: ${{ parameters.EnvVars }} inputs: From 3f46696550378c81f066707242f5dd431576e8c5 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:57:47 -0700 Subject: [PATCH 42/43] Sync eng/common directory with azure-sdk-tools for PR 9106 (#46482) Co-authored-by: Scott Beddall --- eng/common/scripts/Generate-PR-Diff.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Generate-PR-Diff.ps1 b/eng/common/scripts/Generate-PR-Diff.ps1 index 3b508b1cb9942..5c3d764009fe3 100644 --- a/eng/common/scripts/Generate-PR-Diff.ps1 +++ b/eng/common/scripts/Generate-PR-Diff.ps1 @@ -41,8 +41,13 @@ if (!(Test-Path $ArtifactPath)) $ArtifactPath = Resolve-Path $ArtifactPath $ArtifactName = Join-Path $ArtifactPath "diff.json" +$changedFiles = @() +$changedServices = @() + $changedFiles = Get-ChangedFiles -DiffPath $TargetPath -$changedServices = Get-ChangedServices -ChangedFiles $changedFiles +if ($changedFiles) { + $changedServices = Get-ChangedServices -ChangedFiles $changedFiles +} $result = [PSCustomObject]@{ "ChangedFiles" = $changedFiles From d8915411745592e860fe8c397d596e7b8b4a8067 Mon Sep 17 00:00:00 2001 From: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:17:38 -0400 Subject: [PATCH 43/43] Update version of System.Text.Json (#46508) --- eng/Packages.Data.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index cd19e2dbff416..0ee40a4c51f81 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -98,7 +98,7 @@ - +