Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public IActionResult VerArquivos()
{
//Cria um blob client
CloudBlobClient blobClient = _storageAccount.CreateCloudBlobClient();
//Recupera a referencia do container documentos
CloudBlobContainer container = blobClient.GetContainerReference("documentos");
//Caso não exista, ele cria
container.CreateIfNotExists();
//Setar permissão de acesso para 'público'
container.SetPermissions(
new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob }
);
//Recupera os arquivos de um container
var arquivos = container.ListBlobs();
return View("Documentos", arquivos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment