0

I am getting error on test and development server for uploading file with azure blob storage.IT is uploading locally without any problem.We are using Nuget for File handling. On debugging we are getting error on container.CreateIfNotExist() Could anybody help me solving the error.

Thanks in advance!

Fluminda
  • 85
  • 2
  • 13

2 Answers2

0

Based on your description, I assumed that you are using the azure storage client library WindowsAzure.Storage for uploading files to your blob storage.

On debugging we are getting error on container.CreateIfNotExist()

If you construct the CloudStorageAccount with the AccountName and AccountKey, please make sure your AccountKey is correct, and you could login into azure portal and check with it. If you construct the CloudStorageAccount via the account-level SAS token, please make sure the SAS token is valid and it contains the related permissions. Moreover, you could re-generate your account key or new SAS token to narrow this issue. Also, you could leverage fiddler to capture the network traces when executing the operations to narrow this issue.

Additionally, you need to check your server time. As Authentication for the Azure Storage Services states as follows:

The storage services ensure that a request is no older than 15 minutes by the time it reaches the service. This guards against certain security attacks, including replay attacks. When this check fails, the server returns response code 403 (Forbidden).

Also, you could Enabling Storage Logging and Accessing Log Data to retrieve the detailed error message.

Bruce Chen
  • 18,207
  • 2
  • 21
  • 35
  • AccountKey should not be the issue because the same key works on other project. – Fluminda Jan 02 '18 at 08:08
  • Have you checked the server time? If the same project could work on your local side, but fail on test and development server, I recommend you check your server time and try to sync the time for narrow this issue. – Bruce Chen Jan 02 '18 at 08:14
  • The other project I mentioned is uploading files on local and test.So I guess server time is also not an issue. – Fluminda Jan 02 '18 at 08:24
  • I have listed the possible causes, and we could not locate this issue without further detailed info. Please update your question with the code snippets. Also, try to check your storage logging. – Bruce Chen Jan 02 '18 at 08:33
0

Problem was Microsoft.ApplicationInsights 2.4.0. Solved by downgrading to 2.3.0.

It is really strange but below links really helped me out to solve the issue

Azure Storage Emulator 403 Forbidden

Azure CloudBlobContainer.CreateIfNotExists() throws Forbidden (403) on Local Development

Thanks!

Fluminda
  • 85
  • 2
  • 13