From f46ae2e267e006bc1f4f26614b4ea82e055cfa1b Mon Sep 17 00:00:00 2001 From: m-nash <64171366+m-nash@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:46:29 -0800 Subject: [PATCH] update name of blob service (#42015) * hard code blob service name * update after merge * update api --- .../api/Azure.Provisioning.net6.0.cs | 4 ++-- .../api/Azure.Provisioning.netstandard2.0.cs | 4 ++-- .../Azure.Provisioning/src/storage/BlobService.cs | 7 +++---- .../src/storage/StorageExtensions.cs | 5 ++--- .../Infrastructure/StorageBlobDefaults/main.bicep | 10 +++++----- .../Infrastructure/StorageBlobDropDown/main.bicep | 10 +++++----- .../Azure.Provisioning/tests/ProvisioningTests.cs | 4 ++-- 7 files changed, 21 insertions(+), 23 deletions(-) diff --git a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net6.0.cs b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net6.0.cs index 5094694d9e053..4657803ba85d0 100644 --- a/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net6.0.cs +++ b/sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net6.0.cs @@ -215,7 +215,7 @@ namespace Azure.Provisioning.Storage { public partial class BlobService : Azure.Provisioning.Resource { - public BlobService(Azure.Provisioning.IConstruct scope, string name = "blob") : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func)) { } + public BlobService(Azure.Provisioning.IConstruct scope) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func)) { } protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; } } public partial class StorageAccount : Azure.Provisioning.Resource @@ -226,7 +226,7 @@ public partial class StorageAccount : Azure.Provisioning.Resource { - public BlobService(Azure.Provisioning.IConstruct scope, string name = "blob") : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func)) { } + public BlobService(Azure.Provisioning.IConstruct scope) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func)) { } protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; } } public partial class StorageAccount : Azure.Provisioning.Resource @@ -226,7 +226,7 @@ public partial class StorageAccount : Azure.Provisioning.Resource /// Initializes a new instance of the . /// /// The scope. - /// The name. - public BlobService(IConstruct scope, string name = "blob") - : base(scope, null, name, ResourceTypeName, "2022-09-01", (name) => ArmStorageModelFactory.BlobServiceData( - name: name, + public BlobService(IConstruct scope) + : base(scope, null, "default", ResourceTypeName, "2022-09-01", (name) => ArmStorageModelFactory.BlobServiceData( + name: "default", resourceType: ResourceTypeName)) { } diff --git a/sdk/provisioning/Azure.Provisioning/src/storage/StorageExtensions.cs b/sdk/provisioning/Azure.Provisioning/src/storage/StorageExtensions.cs index 8294472b04a76..d85805e907bc0 100644 --- a/sdk/provisioning/Azure.Provisioning/src/storage/StorageExtensions.cs +++ b/sdk/provisioning/Azure.Provisioning/src/storage/StorageExtensions.cs @@ -29,11 +29,10 @@ public static StorageAccount AddStorageAccount(this IConstruct scope, StorageKin /// Adds a to the construct. /// /// The scope. - /// The name. /// - public static BlobService AddBlobService(this IConstruct scope, string name = "blob") + public static BlobService AddBlobService(this IConstruct scope) { - return new BlobService(scope, name); + return new BlobService(scope); } } } diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDefaults/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDefaults/main.bicep index fe8ed79f4ee14..0edd84b5ad46e 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDefaults/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDefaults/main.bicep @@ -9,9 +9,9 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' } } -resource storageAccount_TDwXOzG67 'Microsoft.Storage/storageAccounts@2022-09-01' = { +resource storageAccount_SIHb28RDV 'Microsoft.Storage/storageAccounts@2022-09-01' = { scope: resourceGroup_I6QNkoPsb - name: 'photoAcct-7f1b0ebf61714c' + name: 'photoAcct-4f6f922c331347' location: 'westus' sku: { name: 'Premium_LRS' @@ -21,9 +21,9 @@ resource storageAccount_TDwXOzG67 'Microsoft.Storage/storageAccounts@2022-09-01' } } -resource blobService_JcufSwMPd 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { - parent: storageAccount_TDwXOzG67 - name: 'photos-TEST' +resource blobService_lyt6uqODr 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { + parent: storageAccount_SIHb28RDV + name: 'default' properties: { cors: { } diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDropDown/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDropDown/main.bicep index 50896072b7ea7..c6b29f0ddf3ea 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDropDown/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/StorageBlobDropDown/main.bicep @@ -9,9 +9,9 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' } } -resource storageAccount_LayX88MCA 'Microsoft.Storage/storageAccounts@2022-09-01' = { +resource storageAccount_bhaja5ROZ 'Microsoft.Storage/storageAccounts@2022-09-01' = { scope: resourceGroup_I6QNkoPsb - name: 'photoAcct-94212d55456a47' + name: 'photoAcct-96a1eefb1ac845' location: 'westus' sku: { name: 'Premium_LRS' @@ -21,9 +21,9 @@ resource storageAccount_LayX88MCA 'Microsoft.Storage/storageAccounts@2022-09-01' } } -resource blobService_mmxB2GeFN 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { - parent: storageAccount_LayX88MCA - name: 'photos-TEST' +resource blobService_PQ7aICJK8 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { + parent: storageAccount_bhaja5ROZ + name: 'default' properties: { cors: { } diff --git a/sdk/provisioning/Azure.Provisioning/tests/ProvisioningTests.cs b/sdk/provisioning/Azure.Provisioning/tests/ProvisioningTests.cs index 6a99870be8659..b10ff65946689 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/ProvisioningTests.cs +++ b/sdk/provisioning/Azure.Provisioning/tests/ProvisioningTests.cs @@ -103,7 +103,7 @@ public void StorageBlobDefaults() { var infra = new TestInfrastructure(); infra.AddStorageAccount(name: "photoAcct", sku: StorageSkuName.PremiumLrs, kind: StorageKind.BlockBlobStorage); - infra.AddBlobService(name: "photos"); + infra.AddBlobService(); infra.Build(GetOutputPath()); } @@ -112,7 +112,7 @@ public void StorageBlobDropDown() { var infra = new TestInfrastructure(); infra.AddStorageAccount(name: "photoAcct", sku: StorageSkuName.PremiumLrs, kind: StorageKind.BlockBlobStorage); - var blob = infra.AddBlobService(name: "photos"); + var blob = infra.AddBlobService(); blob.Properties.DeleteRetentionPolicy = new DeleteRetentionPolicy() { IsEnabled = true