JustJordanT / cloudFileUploader

☁️ CloudFileUploader: is a service that will allow you to upload your file to an Azure storage account, and also pull files down and list them, out as well. Made with microservice architecture in mind along with best coding practices.
1 stars 0 forks source link

Delete method: the file by name removes the storage account. #8

Closed JustJordanT closed 3 years ago

JustJordanT commented 3 years ago

Expected Behavior

Delete the file by name.

Actual Behavior

When deleting a file by name, the container from the storage account is removed from Azure

Steps to Reproduce the Problem

  1. POST request to the CFU API
  2. DELETE request to the CFU API

Specifications

Reference

6 Backend API

JustJordanT commented 3 years ago

Still now working need to resolve.

JustJordanT commented 3 years ago

Issue resolved, this was due to a typo in the BlobServices.cs file.

 public async Task<bool> DeleteBlob(string name, string containerName)
        {
            //Allow us to access the data inside the container.
            var containerClient = _blobClient.GetBlobContainerClient(containerName);

            //Get access to a certain file, inside the container, ie (FILENAME).
            var blobClient = containerClient.GetBlobClient(name);

            //if the file exists the file wi;; be deleted.
            return await blobClient.DeleteIfExistsAsync();  //<<<<This line was calling out the containerClient and not the blobClient.
        }