Storing Images on Azure from Blazor App

megan paterson 1 Reputation point
2022-09-27T14:20:15.14+00:00

I followed this tutorial on how to upload/download to Azure blob storage with Blazor.

https://code-maze.com/upload-files-to-azure-aspnet-core-blazor-webassembly/

As far as I'm aware, I've followed the tutorial correctly but I still cant upload or download to my azure blob storage.

I don't think its my code as I downloaded the finished source code from the tutorial and tried it with that (as the code works fine for others) but still no luck.

I was wondering if there's any settings I should know about that might affect this or if anyone has any ideas?

Below is what I've tried already:

  1. CORS - My account type on Azure didnt support CORS, so I changed it to Blob storage rather than GV1 or GV2, this still didnt work
  2. I tried using the normal access keys for the connection string and I tried using the shared access signature - neither of these made any difference
  3. I made sure the access level on the container was Blob and not private
  4. I tried with the following setting both on and off: 'Secure transfer required'
  5. I made sure the public network access was set to enabled from all networks'

Not sure if it makes a difference but when I try and access the container from google it says the following:
<Error>
<Code>ResourceNotFound</Code>
<Message>The specified resource does not exist. RequestId:338fe720-a01e-0008-237b-d2732b000000 Time:2022-09-27T14:16:33.0466081Z</Message>
</Error>

Any advice at all would be greatly appreciated and If this post is in the wrong forum please let me know and I will remove it.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,639 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,500 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JasonPan - MSFT 4,811 Reputation points Microsoft Vendor
    2022-09-28T05:52:12.073+00:00

    Hi @megan paterson

    I check the blogs and reproduce the issue in my local.

    You should enable Allow Blob public access and find the container then change access level like below. And the issue can be fixed.

    245358-image.png

    245366-image.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Jason

    0 comments No comments