2020-06-19 18:39:08 +02:00
|
|
|
|
using System;
|
|
|
|
|
using Azure.Storage.Blobs;
|
|
|
|
|
|
|
|
|
|
namespace squirrowse.db
|
|
|
|
|
{
|
|
|
|
|
public class Bloob
|
|
|
|
|
{
|
|
|
|
|
private readonly BlobServiceClient _blobServiceClient;
|
|
|
|
|
|
|
|
|
|
public BlobContainerClient Container;
|
|
|
|
|
|
|
|
|
|
public Bloob()
|
|
|
|
|
{
|
|
|
|
|
_blobServiceClient =
|
|
|
|
|
new BlobServiceClient(
|
2020-06-20 21:40:56 +02:00
|
|
|
|
"DefaultEndpointsProtocol=https;AccountName=squirrowse;AccountKey=/S09Er70NmQ6vNwJU0eVG0pbV5DklBx8vdp4M28dEfr0ZRmSzd5B/STrzDTfkbxg4BcN+rRu93pRowC/4Ys48A==;EndpointSuffix=core.windows.net");
|
2020-06-19 18:39:08 +02:00
|
|
|
|
Container = CreateImgBloob("squirrowseimg");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private BlobContainerClient CreateImgBloob(string name)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return _blobServiceClient.CreateBlobContainer(name);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
return _blobServiceClient.GetBlobContainerClient(name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|