Skip to content

Instantly share code, notes, and snippets.

Last active January 9, 2021 15:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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