azureblob: allow remote emulator (azurite) - fixes #6290

This commit is contained in:
Lorenzo Maiorfi 2022-07-06 12:54:04 +02:00 committed by GitHub
parent 3ec07d5db9
commit b5efffee9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -600,7 +600,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
if err != nil {
return nil, fmt.Errorf("failed to parse credentials: %w", err)
}
u, err = url.Parse(emulatorBlobEndpoint)
var actualEmulatorEndpoint = emulatorBlobEndpoint
if opt.Endpoint != "" {
actualEmulatorEndpoint = opt.Endpoint
}
u, err = url.Parse(actualEmulatorEndpoint)
if err != nil {
return nil, fmt.Errorf("failed to make azure storage url from account and endpoint: %w", err)
}

View File

@ -526,7 +526,8 @@ See [List of backends that do not support rclone about](https://rclone.org/overv
## Azure Storage Emulator Support
You can test rclone with storage emulator locally, to do this make sure azure storage emulator
installed locally and set up a new remote with `rclone config` follow instructions described in
introduction, set `use_emulator` config as `true`, you do not need to provide default account name
or key if using emulator.
You can run rclone with storage emulator (usually _azurite_).
To do this, just set up a new remote with `rclone config` following instructions described in introduction and set `use_emulator` config as `true`. You do not need to provide default account name neither an account key.
Also, if you want to access a storage emulator instance running on a different machine, you can override _Endpoint_ parameter in advanced settings, setting it to `http(s)://<host>:<port>/devstoreaccount1` (e.g. `http://10.254.2.5:10000/devstoreaccount1`).