mirror of
https://github.com/rclone/rclone.git
synced 2025-01-03 12:59:32 +01:00
azureblob: fix "409 Public access is not permitted on this storage account"
This error was caused by rclone supplying an empty `x-ms-blob-public-access:` header when creating a container for private access, rather than omitting it completely. This is a valid way of specifying containers should be private, but if the storage account has the flag "Blob public access" unset then it gives "409 Public access is not permitted on this storage account". This patch fixes the problem by only supplying the header if the access is set. Fixes #6645
This commit is contained in:
parent
d3e09d86e0
commit
bc214291d5
@ -1363,15 +1363,16 @@ func (f *Fs) makeContainer(ctx context.Context, container string) error {
|
||||
return nil
|
||||
}
|
||||
opt := service.CreateContainerOptions{
|
||||
// Specifies whether data in the container may be accessed publicly and the level of access
|
||||
Access: &f.publicAccess,
|
||||
|
||||
// Optional. Specifies a user-defined name-value pair associated with the blob.
|
||||
//Metadata map[string]string
|
||||
|
||||
// Optional. Specifies the encryption scope settings to set on the container.
|
||||
//CpkScopeInfo *CpkScopeInfo
|
||||
}
|
||||
if f.publicAccess != "" {
|
||||
// Specifies whether data in the container may be accessed publicly and the level of access
|
||||
opt.Access = &f.publicAccess
|
||||
}
|
||||
// now try to create the container
|
||||
return f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.svc.CreateContainer(ctx, container, &opt)
|
||||
|
Loading…
Reference in New Issue
Block a user