Skip to content

Commit

Permalink
update name of blob service (#42015)
Browse files Browse the repository at this point in the history
* hard code blob service name

* update after merge

* update api
  • Loading branch information
m-nash authored Feb 15, 2024
1 parent fbef263 commit f46ae2e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ namespace Azure.Provisioning.Storage
{
public partial class BlobService : Azure.Provisioning.Resource<Azure.ResourceManager.Storage.BlobServiceData>
{
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<string, Azure.ResourceManager.Storage.BlobServiceData>)) { }
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<string, Azure.ResourceManager.Storage.BlobServiceData>)) { }
protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; }
}
public partial class StorageAccount : Azure.Provisioning.Resource<Azure.ResourceManager.Storage.StorageAccountData>
Expand All @@ -226,7 +226,7 @@ public partial class StorageAccount : Azure.Provisioning.Resource<Azure.Resource
}
public static partial class StorageExtensions
{
public static Azure.Provisioning.Storage.BlobService AddBlobService(this Azure.Provisioning.IConstruct scope, string name = "blob") { throw null; }
public static Azure.Provisioning.Storage.BlobService AddBlobService(this Azure.Provisioning.IConstruct scope) { throw null; }
public static Azure.Provisioning.Storage.StorageAccount AddStorageAccount(this Azure.Provisioning.IConstruct scope, Azure.ResourceManager.Storage.Models.StorageKind kind, Azure.ResourceManager.Storage.Models.StorageSkuName sku, Azure.Provisioning.ResourceManager.ResourceGroup? parent = null, string name = "sa") { throw null; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ namespace Azure.Provisioning.Storage
{
public partial class BlobService : Azure.Provisioning.Resource<Azure.ResourceManager.Storage.BlobServiceData>
{
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<string, Azure.ResourceManager.Storage.BlobServiceData>)) { }
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<string, Azure.ResourceManager.Storage.BlobServiceData>)) { }
protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; }
}
public partial class StorageAccount : Azure.Provisioning.Resource<Azure.ResourceManager.Storage.StorageAccountData>
Expand All @@ -226,7 +226,7 @@ public partial class StorageAccount : Azure.Provisioning.Resource<Azure.Resource
}
public static partial class StorageExtensions
{
public static Azure.Provisioning.Storage.BlobService AddBlobService(this Azure.Provisioning.IConstruct scope, string name = "blob") { throw null; }
public static Azure.Provisioning.Storage.BlobService AddBlobService(this Azure.Provisioning.IConstruct scope) { throw null; }
public static Azure.Provisioning.Storage.StorageAccount AddStorageAccount(this Azure.Provisioning.IConstruct scope, Azure.ResourceManager.Storage.Models.StorageKind kind, Azure.ResourceManager.Storage.Models.StorageSkuName sku, Azure.Provisioning.ResourceManager.ResourceGroup? parent = null, string name = "sa") { throw null; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ public class BlobService : Resource<BlobServiceData>
/// Initializes a new instance of the <see cref="BlobService"/>.
/// </summary>
/// <param name="scope">The scope.</param>
/// <param name="name">The name.</param>
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))
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ public static StorageAccount AddStorageAccount(this IConstruct scope, StorageKin
/// Adds a <see cref="BlobService"/> to the construct.
/// </summary>
/// <param name="scope">The scope.</param>
/// <param name="name">The name.</param>
/// <returns></returns>
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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: {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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: {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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
Expand Down

0 comments on commit f46ae2e

Please sign in to comment.