Azure / Azurite

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

Azurite vscode extension settings do not respect relative paths #787

Open jamesfielder opened 3 years ago

jamesfielder commented 3 years ago

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the Azurite was used?

3.12.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

Visual Studio Code Extension

What's the Node.js version?

14.16.0

What problem was encountered?

Azurite errors when setting the cert and key settings to point at files in the current directory. For example if your settings were:

image

for local development, with certs created using mkcert as the docs suggest, then Azurite will fail to start with a ENOENT: no such file or directory, open '.\127.0.0.1.pem' error. This is the same with setting the path to .\127.0.0.1.pem, as it is with ./127.0.0.1.pem, and ${workspaceFolder}/127.0.0.1.pem.

Steps to reproduce the issue?

Azurite Blob Service starts failed with error: ENOENT: no such file or directory, open '.\127.0.0.1.pem' Error: ENOENT: no such file or directory, open '.\127.0.0.1.pem'
    at Object.openSync (fs.js:476:3)
    at Object.func [as openSync] (electron/js2c/asar_bundle.js:5:1846)
    at Object.readFileSync (fs.js:377:35)
    at Object.e.readFileSync (electron/js2c/asar_bundle.js:5:8643)
    at BlobConfiguration.getCert (c:\Users\jcfie\.vscode\extensions\azurite.azurite-3.12.0\dist\src\common\ConfigurationBase.js:41:30)
    at new BlobServer (c:\Users\jcfie\.vscode\extensions\azurite.azurite-3.12.0\dist\src\blob\BlobServer.js:51:63)
    at VSCServerManagerBlob.createImpl (c:\Users\jcfie\.vscode\extensions\azurite.azurite-3.12.0\dist\src\common\VSCServerManagerBlob.js:35:23)
    at async VSCServerManagerClosedState.start (c:\Users\jcfie\.vscode\extensions\azurite.azurite-3.12.0\dist\src\common\VSCServerManagerClosedState.js:6:9)
    at async VSCServerManagerBlob.start (c:\Users\jcfie\.vscode\extensions\azurite.azurite-3.12.0\dist\src\common\VSCServerManagerBase.js:38:26)

Have you found a mitigation/solution?

Absolute paths work, but make it more difficult to distribute settings! Appreciate this might not really be fixable, just wanted to raise an issue incase it was something that could be sorted.

XiaoningLiu commented 3 years ago

Thanks for reporting! It's an unsupported feature. Will track here for further triage. In the same time, contributions are welcome!

mattmichal commented 1 year ago

I ran in to this issue when I was setting up my first Azure Functions project that would be shared with my team. I was really hoping to add the cert and key to the repository and then configure the extension with Workspace scope settings pointed at the files in the repo with a relative path so that there wasn't any manual config required per user.

Supporting relative paths in azurite.cert and azurite.key would be a huge value-add for me and my team!

blueww commented 1 year ago

@mattmichal

We are working on some other storage features and fixes, so this might won't be our priority in the recent future.

In the same time, contributions are welcome! It would be great if you could raise a PR to add the support! (It would be better to raise a design doc and get agreement in review with us to have a smooth PR review.)