IronXL'i Azure'da .NET ile Çalıştırabilir miyim?
Evet, IronXL, C# ve VB .NET Uygulamalarında QR ve Barkod'lar oluşturmak için Azure'da kullanılabilir ve ayrıca taranan resimlerden Barkod ve QR Kodları okuyabilir.
IronXL, MVC web siteleri, Azure İşlevleri ve daha birçokları dahil olmak üzere birden fazla Azure platformunda kapsamlı bir şekilde test edilmiştir.
Adım 1
1. Başlamak için IronXL'i Yükleyin
İlk olarak NuGet ile yükleyin: https://www.nuget.org/packages/IronXL.Excel
Install-Package IronXL.Excel
Nasıl Rehberi
2. Performans ve Azure Katmanları
Azure B1 barındırma seviyelerinin, son kullanıcılarımızın Kütüphane ihtiyaçları için çok uygun olduğunu öneriyoruz. Yüksek iş hacmi gerçekleştiren bir sistem oluşturuyorlarsa, bu yükseltilmesi gerekebilir.
3. Çerçeve Seçimi
IronXL'in hem Core hem de Framework sürümlerinin Azure üzerinde çalıştığını gördük. .NET Standard uygulamaları, hız ve kararlılık açısında küçük bir performans avantajına sahip gibi görünüyor, ancak işlemde daha fazla bellek kullanıyor.
Azure ücretsiz katman barındırma yavaştır
Azure ücretsiz ve paylaşılan katmanlar ve tüketim planı, QR işleme için uygun değildir. Kendi kullandığınız Azure B1 barındırma/Premium planı öneririz.
4. Azure'da Docker
Azure'da performansı kontrol etme yeteneğini kazanmanın bir yolu, IronXL uygulamalarını ve İşlevlerini Docker Konteynerlerinden çalıştırmaktır.
Linux ve Windows örnekleri için kapsamlı bir IronXL Azure Docker eğitimi sunuyoruz ve bu önerilen bir okumadır.
5. Resmi Azure İşlev Desteği
IronXL, Azure İşlevi'ni (Azure İşlevleri V3) destekler. Şu ana kadar V4 ile test edilmedi, ancak sıramızda yer alıyor.
Çalışan Azure İşlev Kodu Örneği
Azure İşlevleri v3.3.1.0+'da test edilmiştir. İşte bir örnek kod:
using System.Net;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using IronXL;
using System.Net.Http.Headers;
// This is an Azure Function that processes an HTTP request and returns an Excel file
[FunctionName("excel")]
public static HttpResponseMessage Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
// Log the processing of the request
log.LogInformation("C# HTTP trigger function processed a request.");
// Set the IronXL license key
IronXl.License.LicenseKey = "Key";
// Load an existing workbook
var workBook = WorkBook.Load("test-wb.xlsx");
// Create a response with the workbook content as an attachment
var result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new ByteArrayContent(workBook.ToByteArray());
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx"
};
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// Return the response
return result;
}
using System.Net;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using IronXL;
using System.Net.Http.Headers;
// This is an Azure Function that processes an HTTP request and returns an Excel file
[FunctionName("excel")]
public static HttpResponseMessage Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
// Log the processing of the request
log.LogInformation("C# HTTP trigger function processed a request.");
// Set the IronXL license key
IronXl.License.LicenseKey = "Key";
// Load an existing workbook
var workBook = WorkBook.Load("test-wb.xlsx");
// Create a response with the workbook content as an attachment
var result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new ByteArrayContent(workBook.ToByteArray());
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx"
};
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// Return the response
return result;
}
Imports System.Net
Imports Microsoft.Azure.WebJobs
Imports Microsoft.Azure.WebJobs.Extensions.Http
Imports Microsoft.AspNetCore.Http
Imports Microsoft.Extensions.Logging
Imports IronXL
Imports System.Net.Http.Headers
' This is an Azure Function that processes an HTTP request and returns an Excel file
<FunctionName("excel")>
Public Shared Function Run(
<HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route:=Nothing)> req As HttpRequest,
log As ILogger) As HttpResponseMessage
' Log the processing of the request
log.LogInformation("C# HTTP trigger function processed a request.")
' Set the IronXL license key
IronXl.License.LicenseKey = "Key"
' Load an existing workbook
Dim workBook = WorkBook.Load("test-wb.xlsx")
' Create a response with the workbook content as an attachment
Dim result = New HttpResponseMessage(HttpStatusCode.OK)
result.Content = New ByteArrayContent(workBook.ToByteArray())
result.Content.Headers.ContentDisposition = New ContentDispositionHeaderValue("attachment") With {
.FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx"
}
result.Content.Headers.ContentType = New MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
' Return the response
Return result
End Function
Sıkça Sorulan Sorular
.NET uygulamalarını Azure'da nasıl çalıştırabilirim?
IronXL'i kullanarak .NET uygulamalarını Azure'da çalıştırabilirsiniz. Bu, C# & VB .NET uygulamalarında QR & Barkodlar oluşturmanıza ve taranmış görüntülerden onları okumanıza olanak tanır. MVC web siteleri ve Azure Fonksiyonları dahil olmak üzere çeşitli Azure platformlarında test edilmiştir.
Optimal performans için önerilen Azure barındırma seviyeleri nelerdir?
IronXL ile optimal performans için Azure B1 barındırma seviyelerini öneriyoruz. Yüksek geçiş hızına sahip bir sistem tasarlıyorsanız, daha üst düzey bir katmana geçmeyi düşünün.
Azure üzerinde hangi .NET çerçevesi en iyi çalışır?
IronXL, Azure'da hem .NET Core hem de .NET Framework üzerinde çalışır. Ancak, .NET Standard uygulamaları hız ve istikrar açısından küçük bir performans avantajı sağlar, ancak artan bellek kullanımı ile.
Azure'un ücretsiz katmanı QR işlem için yeterli mi?
IronXL ile QR işlemi için Azure'un ücretsiz ve paylaşımlı katmanları ile tüketim planı önerilmemektedir. Bunun yerine, daha iyi performans için Azure B1 barındırmayı veya bir Premium planı kullanmanızı öneririz.
Docker, IronXL uygulamalarını Azure'da yönetmek için kullanılabilir mi?
Evet, Docker'ı Azure'da IronXL uygulamalarını ve Fonksiyonlarını yönetmek için kullanabilirsiniz. Bu yapılandırma performans üzerinde daha iyi kontrol sağlar. Hem Linux hem de Windows örnekleri için ayrıntılı bir Azure Docker eğitimi mevcuttur.
IronXL, Azure Fonksiyonlarını destekliyor mu?
Evet, IronXL Azure Fonksiyonları V3'ü destekler. Azure Fonksiyonları V4'ü test etme süreci devam ediyor ve gelecekte desteğin genişletilmesi planlanıyor.
Azure'da kullanmak için IronXL nasıl yüklenir?
IronXL'i NuGet kullanarak nuget install IronXL.Excel komutuyla yükleyebilirsiniz.
Azure Fonksiyonları ile IronXL kullanmanın bir örneği var mı?
Evet, makale bir HTTP isteği işleyen ve bir Excel dosyası döndüren örnek bir Azure Fonksiyonu kodu sağlar. Bu örnek, Azure Fonksiyonları v3.3.1.0+ üzerinde test edilmiştir.

