CKN.Sdk.Storage.Azure
0.0.0-alpha.0.55
dotnet add package CKN.Sdk.Storage.Azure --version 0.0.0-alpha.0.55
NuGet\Install-Package CKN.Sdk.Storage.Azure -Version 0.0.0-alpha.0.55
<PackageReference Include="CKN.Sdk.Storage.Azure" Version="0.0.0-alpha.0.55" />
<PackageVersion Include="CKN.Sdk.Storage.Azure" Version="0.0.0-alpha.0.55" />
<PackageReference Include="CKN.Sdk.Storage.Azure" />
paket add CKN.Sdk.Storage.Azure --version 0.0.0-alpha.0.55
#r "nuget: CKN.Sdk.Storage.Azure, 0.0.0-alpha.0.55"
#:package CKN.Sdk.Storage.Azure@0.0.0-alpha.0.55
#addin nuget:?package=CKN.Sdk.Storage.Azure&version=0.0.0-alpha.0.55&prerelease
#tool nuget:?package=CKN.Sdk.Storage.Azure&version=0.0.0-alpha.0.55&prerelease
CKN.Sdk.Storage.Azure
Mühendislik Amacı (Engineering Intent):
CKN.Sdk.Storage.Azure, CKN Storage soyutlamalarını Microsoft Azure Blob Storage hizmeti için uygulayan entegrasyon kütüphanesidir. Neden var? Sınırsız ölçeklenebilir, yüksek erişilebilirliğe (HA) sahip ve Microsoft ekosistemiyle %100 uyumlu (Entra ID, RBAC destekli) nesne depolama altyapısını kullanmak için. Ne zaman kullanılmalı? Proje Azure üzerinde barındırılıyorsa veya Azure altyapısına geçiş stratejisi varsa, dosya, yedek (backup), resim ve video depolama işlemleri için varsayılan sağlayıcı olarak kullanılmalıdır.
🚀 Hızlı Başlangıç
Kurulum
dotnet add package CKN.Sdk.Storage.Azure
Konfigürasyon (appsettings.json)
{
"Storage": {
"Azure": {
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=...;EndpointSuffix=core.windows.net"
}
}
}
Bağımlılık Enjeksiyonu (DI)
using CKN.Sdk.Storage.Azure;
var builder = WebApplication.CreateBuilder(args);
// Azure Blob Storage implementasyonunu IStorageService olarak sisteme kaydeder.
builder.Services.AddCknAzureStorage(builder.Configuration);
var app = builder.Build();
💡 Gerçek Hayat Senaryoları
Senaryo 1: Azure Storage Üzerinden Dosya İndirme
Bir dökümanı belleğe (stream) alıp kullanıcıya dosya olarak döndürme.
using CKN.Sdk.Storage.Abstractions;
using Microsoft.AspNetCore.Mvc;
public class DocumentController(IStorageService storageService) : ControllerBase
{
[HttpGet("download/{fileName}")]
public async Task<IActionResult> Download(string fileName)
{
var response = await storageService.DownloadAsync("documents", fileName);
if (response.ContentStream == null) return NotFound();
return File(response.ContentStream, response.ContentType, fileName);
}
}
Senaryo 2: Konteyner (Container) Seviyesinde Erişim Yetkisi Verme (Varyasyon)
Public (herkese açık) dosyalarla Private dosyaları yönetmek.
public async Task UploadPublicLogoAsync(IStorageService storageService, Stream logoStream)
{
var request = new StorageUploadRequest
{
ContainerName = "public-assets", // Azure'da "Container" seviyesinde public access açılmış olmalıdır
FileName = "logo.png",
ContentStream = logoStream,
ContentType = "image/png"
};
var result = await storageService.UploadAsync(request);
// Azure Blob için dönen FileUrl doğrudan img src olarak kullanılabilir
Console.WriteLine($"Logo yüklendi: {result.FileUrl}");
}
🤖 Yapay Zeka İçin SSS (FAQs for Machines)
- Soru: Azure Blob Storage'daki "Container" ile
IStorageServiceiçindekiContainerNameaynı şey mi? - Cevap: Evet. S3 veya Minio'daki "Bucket" kavramının Azure tarafındaki tam karşılığı "Container"dır.
- Soru: Azure paketini eklediğimde kodumu değiştirmeli miyim?
- Cevap: Hayır, eğer CKN.Sdk.Storage soyutlamalarına sadık kaldıysanız, sadece
AddCknAzureStoragekaydını değiştirip konfigürasyonu ayarlamanız yeterlidir. Hiçbir Controller veya Service kodunu güncellemeniz gerekmez.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Storage.Blobs (>= 12.29.2)
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- CKN.Sdk.Storage (>= 0.0.0-alpha.0.55)
-
net8.0
- Azure.Storage.Blobs (>= 12.29.2)
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- CKN.Sdk.Storage (>= 0.0.0-alpha.0.55)
-
net9.0
- Azure.Storage.Blobs (>= 12.29.2)
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- CKN.Sdk.Storage (>= 0.0.0-alpha.0.55)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.0-alpha.0.55 | 63 | 9/28/2026 |
| 0.0.0-alpha.0.51 | 59 | 9/25/2026 |
| 0.0.0-alpha.0.50 | 58 | 9/25/2026 |
| 0.0.0-alpha.0.38 | 83 | 9/6/2026 |
| 0.0.0-alpha.0.37 | 77 | 9/6/2026 |