Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 325 forks source link

Unable to connect Azurite using azure javascript library #54

Open shefalimittal-fujitsu opened 6 years ago

shefalimittal-fujitsu commented 6 years ago

Hi,

I am trying to connect azurite using azure javascript library.

When I make a get request to any container, the browser tries to send preflight request which is failed with error code 501-not implemented. Even when I make a options request using fiddler, it fails with same error.

What configuration I need to do to make it work.

edwin-huber commented 6 years ago

Hi @shefalimittal-fujitsu , could you provide a sample of the code that you are using? I'll add it to a test case.

tomhosking commented 5 years ago

@edwin-huber I'm getting a similar issue - it looks like a trailing slash in the URL matters.

The following request works in Postman: OPTIONS http://localhost:10000/devstoreaccount1/<container-name>/?restype=container

But this does not: OPTIONS http://localhost:10000/devstoreaccount1/<container-name>?restype=container

The Azure JS library makes the request without the trailing slash, and therefore fails.

tomhosking commented 5 years ago

There's some more inconsistency here:

This works in postman DELETE http://localhost:10000/devstoreaccount1/<container-name>?restype=container but DELETE http://localhost:10000/devstoreaccount1/<container-name>/?restype=container returns a 404 "blob not found error".

So the OPTIONS handler requires that the request have a trailing slash, but the DELETE handler requires no trailing slash.

edwin-huber commented 5 years ago

Thanks for looking into this.
We are just about to release a new version, you can check it out in the newarch-dev branch.
Once we have completed this, we will start on the backlog and address issues like this if they persist in the new architecture.

tomhosking commented 5 years ago

Understood, thanks. I'm running azurite for development only so happy to try it out. Any chance you could check in an example Dockerfile for the new version?

tomhosking commented 5 years ago

I've got v3 up and running in Docker - the same issues appear to still be present.

XiaoningLiu commented 5 years ago

@tomhosking V3 doesn't support OPTIONS yet, it's marked as one of not implemented features. https://github.com/Azure/Azurite/projects/1#card-18684936