Skip to content

Commit 6c3b934

Browse files
Merge pull request #16 from georgewallace/master
removed CreateIfNotExistsAsync methods
2 parents d56148d + 6a6332f commit 6c3b934

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

ImageResizeWebApp/ImageResizeWebApp/Controllers/ImagesController.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ public async Task<IActionResult> Upload(ICollection<IFormFile> files)
6161
{
6262
isUploaded = await StorageHelper.UploadFileToStorage(stream, formFile.FileName, storageConfig);
6363
}
64-
65-
if (isUploaded)
66-
{
67-
// TODO
68-
}
69-
else
70-
{
71-
return BadRequest("There is something went wrong while uploading the image");
72-
}
7364
}
7465
}
7566
else

ImageResizeWebApp/ImageResizeWebApp/Helpers/StorageHelper.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public static async Task<bool> UploadFileToStorage(Stream fileStream, string fil
4141
// Get reference to the blob container by passing the name by reading the value from the configuration (appsettings.json)
4242
CloudBlobContainer container = blobClient.GetContainerReference(_storageConfig.ImageContainer);
4343

44-
// Create the container if not already exist
45-
await container.CreateIfNotExistsAsync();
46-
4744
// Get the reference to the block blob from the container
4845
CloudBlockBlob blockBlob = container.GetBlockBlobReference(fileName);
4946

@@ -69,9 +66,6 @@ public static async Task<List<string>> GetThumbNailUrls(AzureStorageConfig _stor
6966
// Get reference to the container
7067
CloudBlobContainer container = blobClient.GetContainerReference(_storageConfig.ThumbnailContainer);
7168

72-
// Create the container if it is not exists
73-
await container.CreateIfNotExistsAsync();
74-
7569
// Set the permission of the container to public
7670
await container.SetPermissionsAsync(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
7771

ImageResizeWebApp/ImageResizeWebApp/appsettings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"AzureStorageConfig": {
1717
"AccountName": "",
1818
"AccountKey": "",
19-
"QueueName": "",
20-
"ImageContainer": "",
21-
"ThumbnailContainer": ""
19+
"ImageContainer": "images",
20+
"ThumbnailContainer": "thumbnails"
2221
}
2322
}

0 commit comments

Comments
 (0)