@@ -83,14 +83,11 @@ public static IResourceBuilder<AzureStorageResource> AddAzureStorage(this IDistr
83
83
84
84
var azureResource = ( AzureStorageResource ) infrastructure . AspireResource ;
85
85
86
- foreach ( var blobStorageResources in azureResource . Blobs )
86
+ foreach ( var blobContainer in azureResource . BlobContainers )
87
87
{
88
- foreach ( var blobContainer in blobStorageResources . BlobContainers )
89
- {
90
- var cdkBlobContainer = blobContainer . ToProvisioningEntity ( ) ;
91
- cdkBlobContainer . Parent = blobs ;
92
- infrastructure . Add ( cdkBlobContainer ) ;
93
- }
88
+ var cdkBlobContainer = blobContainer . ToProvisioningEntity ( ) ;
89
+ cdkBlobContainer . Parent = blobs ;
90
+ infrastructure . Add ( cdkBlobContainer ) ;
94
91
}
95
92
96
93
// We need to output name to externalize role assignments.
@@ -159,12 +156,9 @@ public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourc
159
156
throw new DistributedApplicationException ( $ "ResourceReadyEvent was published for the '{ builder . Resource . Name } ' resource but the connection string was null.") ;
160
157
}
161
158
162
- foreach ( var blobStorageResources in builder . Resource . Blobs )
159
+ foreach ( var blobContainer in builder . Resource . BlobContainers )
163
160
{
164
- foreach ( var blobContainer in blobStorageResources . BlobContainers )
165
- {
166
- await blobServiceClient . GetBlobContainerClient ( blobContainer . BlobContainerName ) . CreateIfNotExistsAsync ( cancellationToken : ct ) . ConfigureAwait ( false ) ;
167
- }
161
+ await blobServiceClient . GetBlobContainerClient ( blobContainer . BlobContainerName ) . CreateIfNotExistsAsync ( cancellationToken : ct ) . ConfigureAwait ( false ) ;
168
162
}
169
163
} ) ;
170
164
@@ -314,8 +308,6 @@ public static IResourceBuilder<AzureBlobStorageResource> AddBlobs(this IResource
314
308
ArgumentException . ThrowIfNullOrEmpty ( name ) ;
315
309
316
310
var resource = new AzureBlobStorageResource ( name , builder . Resource ) ;
317
- builder . Resource . Blobs . Add ( resource ) ;
318
-
319
311
return builder . ApplicationBuilder . AddResource ( resource ) ;
320
312
}
321
313
@@ -335,7 +327,7 @@ public static IResourceBuilder<AzureBlobStorageContainerResource> AddBlobContain
335
327
336
328
AzureBlobStorageContainerResource resource = new ( name , blobContainerName , builder . Resource ) ;
337
329
338
- builder . Resource . BlobContainers . Add ( resource ) ;
330
+ builder . Resource . Parent . BlobContainers . Add ( resource ) ;
339
331
340
332
return builder . ApplicationBuilder . AddResource ( resource ) ;
341
333
}
0 commit comments