private async Task SeedStorage() { // Check for test bucket var testBucket = await Storage.Buckets.FindByNameAsync(BucketName); // If test bucket doesn't exist try to create if (testBucket == null) { // Create bucket var createResults = await Storage.Buckets.CreateAsync(BucketName, BucketType.AllPrivate); createResults.EnsureSuccessStatusCode(); Logger.LogDebug($"Bucket '{BucketName}' created during storage seed initialization."); // Set bucket id bucketId = createResults.Response.BucketId; } else { bucketId = testBucket.BucketId; } //Check for test key var testKey = await Storage.Keys.FindByNameAsync(KeyName); // If test key doesn't exist try to create if (testKey == null) { // Create a test key var keyResults = await Storage.Keys.CreateAsync(KeyName, Capabilities.AllControl()); keyResults.EnsureSuccessStatusCode(); Logger.LogDebug($"Key '{KeyName}' created during storage seed initialization."); } Logger.LogInformation("Storage seed initialization completed"); }