-
Hello. I'm trying to use ImageSharp.web for image processing using .net Core. After testing with an image stored in wwwroot, which successfully worked, I'm now trying to process images that are stored in Azure Blob storage and I'm not being successful. I've followed the Sixlabors tutorials and I can't get an image result on: https://localhost:5001/X/foto-teste10515264.jpg -> X is the container name. I've got the following configurations in startup.cs: public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddImageSharp()
.SetRequestParser<QueryCollectionRequestParser>()
.Configure<AzureBlobStorageImageProviderOptions>(options =>
{
// The "BlobContainers" collection allows registration of multiple containers.
options.BlobContainers.Add(new AzureBlobContainerClientOptions
{
ConnectionString = "DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;EndpointSuffix=core.windows.net",
ContainerName = "X"
});
})
.AddProvider<AzureBlobStorageImageProvider>()
} And my Configure: public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseDefaultFiles();
app.UseImageSharp();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
});
} Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I solved it by clearing the provides before. Thanks anyway! |
Beta Was this translation helpful? Give feedback.
I solved it by clearing the provides before. Thanks anyway!