Skip to content

Instantly share code, notes, and snippets.

Last active January 9, 2021 15:12
What would you like to do?
using System;
using System.IO;
using System.Threading.Tasks;
using Azure.Storage;
using Azure.Storage.Blobs;
namespace UniversidadWebsite.Helpers
public static class StorageHelper
public static async Task<string> SubirArchivo(Stream contenido, string nombre, AzureStorageConfig config)
var url = $"https://{config.Cuenta}{config.Contenedor}/{nombre}";
var uri = new Uri(url);
var credenciales = new StorageSharedKeyCredential(config.Cuenta, config.Llave);
var cliente = new BlobClient(uri, credenciales);
await cliente.UploadAsync(contenido);
return url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment