Giter Club home page Giter Club logo

laravel-azure-storage's Introduction

DEPRECATION NOTICE

This package is dependent on Flysystem's Azure Blob Storage integration. The creator of that has announced that because Microsoft are dropping support for their PHP storage client, he will also be dropping Azure support from Flysystem in 2024.

As a result, there is no viable path for me to continue to maintain this package past that point. In addition, I myself have never actually had the need to use this package and only maintained it for reasons of inertia. It's therefore deprecated as of March 2024.

There is a project to maintain a fork of the original Microsoft PHP SDK. While this is not a drop-in replacement for this package as it does not at this time provide a replacement for the Flysystem driver or this abstraction on top of that, if you're planning to continue using Azure with Laravel, that is probably the best place to start.

Microsoft Azure Blob Storage integration for Laravel's Storage API.

This is a custom driver for Laravel's File Storage API, which is itself built on top of Flysystem 3. It uses Flysystem's own Azure blob storage adapter, and so can't easily add any more functionality than that has - indeed, adding that would be out of scope for the project.

Installation

Install the package using composer:

composer require matthewbdaly/laravel-azure-storage

Then add this to the disks section of config/filesystems.php:

        'azure' => [ // NB This need not be set to "azure", because it's just the name of the connection - feel free to call it what you want, or even set up multiple blobs with different names
            'driver'    => 'azure', // As this is the name of the driver, this MUST be set to "azure"
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'connection_string' => env('AZURE_STORAGE_CONNECTION_STRING') // optional, will override default endpoint builder 
        ],

Finally, add the fields AZURE_STORAGE_NAME, AZURE_STORAGE_KEY, AZURE_STORAGE_CONTAINER and AZURE_STORAGE_URL to your .env file with the appropriate credentials. The AZURE_STORAGE_URL field is optional, this allows you to set a custom URL to be returned from Storage::url(), if using the $root container the URL will be returned without the container path. A prefix can be optionally used. If it's not set, the container root is used. Then you can set the azure driver as either your default or cloud driver and use it to fetch and retrieve files as usual.

For details on how to use this driver, refer to the Laravel documentation on the file storage API.

Custom endpoints

The package supports using a custom endpoint, as in this example:

        'azure' => [
            'driver'    => 'azure',
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'connection_string' => null,
            'endpoint'  => env('AZURE_STORAGE_ENDPOINT'),
        ],

Then you can specify a suitable value for AZURE_STORAGE_ENDPOINT in your .env file as normal.

SAS token authentication

With SAS token authentication the endpoint is required. The value has the following format: https://[accountName].blob.core.windows.net

        'azure' => [
            'driver'    => 'azure',
            'sasToken'  => env('AZURE_STORAGE_SAS_TOKEN'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'endpoint'  => env('AZURE_STORAGE_ENDPOINT'),
        ],

Retries

The Azure Storage SDK ships a middleware to retry failed requests. To enable the retry middewalre, add a retry directive to the disk's configuration options.

        'azure' => [
            'driver'    => 'azure',
            // Other Disk Options...
            'retry'     => [
                'tries' => 3,                   // number of retries, default: 3
                'interval' => 500,              // wait interval in ms, default: 1000ms
                'increase' => 'exponential'     // how to increase the wait interval, options: linear, exponential, default: linear
            ]
        ],

Unsupported features

As this package uses the Flysystem Azure integration, it shares the following limitations with that:

  • Visibility setting or retrieving is not supported.
  • Mimetypes are always resolved, where others do not.
  • Directory creation is not supported in any way.

Support policy

This package is supported on the current Laravel LTS version, and any later versions. If you are using an older Laravel version, it may work, but I offer no guarantees, nor will I accept pull requests to add this support.

By extension, as the current Laravel LTS version required PHP 7.0 or greater, I don't test it against PHP < 7, nor will I accept any pull requests to add this support.

Can you add support for storage backend X?

No. This is exclusively for Azure Blob storage, and I am categorically not interested in expanding the scope of it to support other backends.

As long as Flysystem supports it, you can roll your own Laravel filesystem driver easily as described at https://laravel.com/docs/9.x/filesystem#custom-filesystems if you need to - this is the method I used to build this package.

laravel-azure-storage's People

Contributors

bernhardtd avatar eldor avatar eliesauveterre avatar hakan0xff avatar ingalless avatar john-dent avatar keatliang2005 avatar martinopp avatar matthewbdaly avatar matthewbdaly-mission avatar mihaliak avatar nklido avatar rymanalu avatar sebdesign avatar solvesoul avatar zaalbarxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-azure-storage's Issues

Blob service REST API

Hi, I managed to set up the storage. However, I have an issue with the video(.mp4) files. I have my blobs set as block blobs ( suitable for streaming) The problem that I face is: it takes 10-20 seconds for a video to load on the browser and I can't seek the video (jump forwards/backward). I browsed the web for a couple of days and I couldn't find much. I found some answers suggesting progressive loading, but in ASP.net. Any idea how to make it in laravel? (sorry if this is not the right place for this question)

New feature requesting for removed file from Azure Storage

matthewbdaly/laravel-azure-storage package working great while uploading file to Azure Storage but I'm not able to removing file from Azure Storage

Because this project has no functionality for removing file yet:

Is your feature request related to a problem? Please describe.
We are shifting lots of project from AWS to Azure. Now we are facing issue like removing files

Describe the solution you'd like
function remove_file_azure($file){ return Storage::disk('azure')->delete($file); }

Additional context
Screenshot from 2021-06-18 09-16-36 .

Thankyou so much

Instantiate from Connection String

Is your feature request related to a problem? Please describe.
I'd like to instantiate the Filesystem with a connection string like this, which is published in the Azure Portal and which is what is passed as a secret to my docker container via CI/CD:

DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey];BlobEndpoint=<url>

I used to have my own code like this:

        $client = BlobRestProxy::createBlobService($connectionString);
        $adapter = new AzureBlobStorageAdapter($client, $container, $prefix);
        return new Filesystem($adapter);

This is quite concise. Now I have to write a class just to parse the connection string and pass it into this adapter as individual elements. This is more work than I used to do.

Describe the solution you'd like
The adapter should accept a single 'connection_string' configuration element in lieu of separate key. name, endpoint, etc.

Describe alternatives you've considered
Sticking with my own convenience class to return the Filesystem adapter.

SessionHandler

Checklist

Because this project is:

The scope of any changes that can be made can be quite limited. If Flysystem, the Laravel storage API or the Azure PHP SDK don't support the feature you want, then it's very unlikely it can be done. As such, please confirm the following:

  • I have checked and confirmed that the Laravel storage API can support this feature
  • I have checked and confirmed that Flysystem can support this feature

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Prefix for filesystem directory does not apply into Storage::url

I trying to upload the files to different directory based on environment.
For example:
local - https://storagepath.blob.core.windows.net/container_name/{local}/image.jpg
production- https://storagepath.blob.core.windows.net/container_name/{production}/image.jpg

To do so, this is the config
'azure' => [
'driver' => 'azure',
'name' => env('AZURE_STORAGE_NAME'),
'key' => env('AZURE_STORAGE_KEY'),
'container' => env('AZURE_STORAGE_CONTAINER'),
'url' => env('AZURE_STORAGE_URL'),
'prefix' => env('APP_ENV'),
],

So now the files was stored correctly, but i found that when i using Storage::url("image.jpg");
The path returned was "https://storagepath.blob.core.windows.net/container_name/image.jpg" because it using the url in config,
But url customization also won't worked because it always prepend the container name to the end of url we set and become like "https://storagepath.blob.core.windows.net/container_name/local/container_name/image.jpg"
Of course i can add the prefix like Storage::url("local/image.jpg"); but it seem like not a proper way.

I'm not sure is this a bug or not. Appreciate for any suggestions and comments

No getter method to get Blob Client Object and class can not be extended as it is declared as final

Hi,

I'm using this package in our projects and I'm facing an issue when I'm trying to get the Blob client. Actually,
I'm unable to get Blob Client object because it is private property. For this, we need getter method called "getClass()" in AzureBlobStorageAdapter class.

Even I can not extend this class as it is declared as final.

I need below things from your end:

  1. Either you can add getter method to get BlobClient in AzureBlobStorageAdapter class.
    or
  2. You can make the class as normal class by removing "final" so that I can extend the class.

Out of curiosity I just wanted to ask you that is there any reason behind declaring that class as "final" ?

Accessing Blob Client is required for me to get Meta data of the file stored in Blob.

Note: If you want me to submit pull request for this - I can do that.

Thanks

Undefined index: endpoint

    "class": "ErrorException",
    "message": "Undefined index: endpoint",
    "code": 0,
    "file": "/www/vendor/matthewbdaly/laravel-azure-storage/src/AzureStorageServiceProvider.php:28",

Since upgrade to 1.3.10, the config/filesystems.php array for 'azure' MUST contain an 'endpoint' (can be null), otherwise the value is unset and will throw an error at AzureStorageServiceProvider.php:28.

Dynamically change Azure Container

Hi,

Thank you so much for creating this. I love it!

I am new to laravel so I might have missed it but is there a way to select a different Container to upload to during run time?

Use Azure driver on lumen

Hi, I have tried to use this on a Lumen environment. Previously I use S3 filesystem and it works great, but when I install your library with composer install and add the azure disk this error come up. Am I missing something?

lumen.ERROR: InvalidArgumentException: Driver [azure] is not supported. in /var/www/vendor/illuminate/filesystem/FilesystemManager.php:126 Stack trace: #0 /var/www/vendor/illuminate/filesystem/FilesystemManager.php(102): Illuminate\Filesystem\FilesystemManager->resolve('azure') #1 /var/www/vendor/illuminate/filesystem/FilesystemManager.php(79): Illuminate\Filesystem\FilesystemManager->get('azure') #2 /var/www/vendor/illuminate/support/Facades/Facade.php(221): Illuminate\Filesystem\FilesystemManager->disk('azure')

Are custom URLs really supported?

We're configuring Azurite in our development environment and, since the URL isn't overridden on the Azure client, things don't work.

I've managed to make it well by playing with the provider and configuring the BlobEndpoint on the Azure client (it works 100% with only Flysystem azure adapter, btw):

<?php

namespace Matthewbdaly\LaravelAzureStorage;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
use function sprintf;

/**
 * Service provider for Azure Blob Storage
 */
final class AzureStorageServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        Storage::extend('azure', static function (Application $app, array $config): Filesystem {
            $config['client'] = self::createClient($config);

            $adapter = new AzureBlobStorageAdapter(
                $config['client'],
                $config['container'],
                $config['url'] ?? null,
                $config['prefix'] ?? null
            );
            return new Filesystem($adapter, $config);
        });
    }

    /** @param array<string, string|null> $config */
    private static function createClient(array $config): BlobRestProxy
    {
        $endpoint = sprintf(
            'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;',
            $config['name'],
            $config['key']
        );

        if (isset($config['blob_endpoint'])) {
            $endpoint .= sprintf('BlobEndpoint=%s;', $config['blob_endpoint']);
        }

        return BlobRestProxy::createBlobService($endpoint);
    }
}

Is there any reason why you haven't used this approach on this package?

Guzzle problem

Problem 1
- Installation request for matthewbdaly/laravel-azure-storage ^1.4 -> satisfiable by matthewbdaly/laravel-azure-storage[1.4.0].
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0].
- Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0].
- Conclusion: install guzzlehttp/guzzle 6.5.x-dev
- Installation request for guzzlehttp/guzzle (locked at 7.2.0, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.2.0].

So it looks like it's not supported for latest Guzzle 7.2.0 version

SAS token authentication

I'm under the impression that the SAS token is appended to the URL when making a request to a specific resource. The config setting makes it look like it's some sort of copied and pasted string and then provides no details on how it works. Does anyone know how to view a resource with SAS is supposed to work?

setContentType

Hi,

This works great for uploading an image, but the content-type is set to "application/octet-stream" which means images will only be downloaded and not open in the user's browser. To open in the browser, the content-type needs to be "image/jpeg".

I have tried to set the content-type at time of upload, and after the upload on the existing blob but with no success.

Please could you provide a solution to change the content-type.

Thank you

KeyNotSet error when using connection_string

Describe the bug
When using AZURE_STORAGE_CONNECTION_STRING variable, I receive an
Matthewbdaly\ LaravelAzureStorage \ Exceptions \ KeyNotSet

When using the exact same config in separate variables (AZURE_STORAGE_URL, AZURE_STORAGE_KEY etc)
the connection works an no errors are thrown.

Packages and PHP version

  • PHP version: 8.1
  • Laravel version: 9.19
  • Version of this package: 2.0.4

Getting the url of the file

Great project! Thanks so much for it. I am looking at getting the URL for the azure resource. The current implementation only allows to grab the file contents like so:

$fileData = Storage::get($path);

Would then like to let the user download the file. Any thoughts on the best way to handle that?

The provided account key '' is not a valid base64 string

Hi there, I believe I managed to set up the package by downgrading guzzle ...etc. I can see the uploaded files in the Azure blob, but when I try to upload files from Laravel to the Blob I get a 500 (Internal Server Error). The message is saying:
"The provided account key '' is not a valid base64 string. It has to pass the check 'base64_decode(<user_account_key>, true)'."

I am using this format for the drive:

  'azure' => [
            'driver'    => 'azure',
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
        ],

I've tried: double/single quotes, removing the '==', switching the keys. I am using the key from 'Access Keys' inside Azure Any ideas on that? pls help

Change in prefix causes incompatibility with

Checklist

This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:

  • I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
  • The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
  • I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that

Describe the bug
It seems that this change 6ef1a1a that updated the default disk prefix from null to the actual string 'prefix' is causing issues. I have a project with around 4000 uploaded files. After upgrading this package from 1.6.0 to the latest version, all of my files disappeared.

I noticed that files uploaded after the upgrade would be named "prefix/foo.jpg" instead of just "foo.jpg". Changing the prefix value to an empty string fixed the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Upload a file with an older version. e.g. 1.6
  2. Upgrade to the latest version
  3. run Storage::allFiles()
  4. The previously uploaded file wont be listed
  5. Change prefix in config/filesystems.php from null to an empty string
  6. The previously uploaded file will now be listed

Packages and PHP version

  • PHP version: 8.1
  • Laravel version: 9.17
  • Version of this package: 20.

How to use multiple azure storage?

Hi,

I have different modules in my project where files are uploading to same container for example "abc1"

How its possible to use multiple azure storage containers in a single project? so that each module will have different storage on azure.

Regards

Soft deleted files being returned

Hi, since a few days I'm experiencing the following problem: the files method returns also soft deleted files. Is there any option to exclude them from the response?

Thank you

prefix not working as properly on laravel 9x and 10x

Please ensure you complete this checklist in full. If you fail to do so, you're wasting my time and I will reserve to right to close the issue without looking

Checklist

This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:

  • I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
  • The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
  • I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that

Describe the bug
When I add the prefix property and use the Storage::disk('azure')->url($filename) method
prefix in url is returned twice
prefix: my-prefix
filename: 'report.xlsx'
output: https://test.blob.core.windows.net/my-storage/my-prefix/my-prefix/report.xlsx

To Reproduce
Steps to reproduce the behavior:

  1. create a new project with laravel 10x
  2. install matthewbdaly/laravel-azure-storage
  3. put .env variables with azure storage credentials
  4. edit config/filesystems.php with env variables
  5. fill config/filesystems.php > disks -> azure -> prefix with my-prefix
  6. upload file and try get file url

Expected behavior
output: https://test.blob.core.windows.net/my-storage/my-prefix/report.xlsx

Packages and PHP version

  • PHP version 8.2
  • Laravel version 10x
  • Version of this package 2.0.8

Screenshots

image
image

Error: This driver does not support creating temporary URLs.

Checklist

This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:

  • I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
  • The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
  • I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that

Describe the bug
Getting the above error (This driver does not support creating temporary URLs.) when doing something basic like this:

use Illuminate\Support\Facades\Storage;

Route::get('test/{file}', function ($file) {

    $path = "$file";
    $url = Storage::disk('azure')->temporaryUrl($path, 60);
    return $url;

}

The entry in filesystems.php:

        'azure' => [
            'driver'    => 'azure',
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => env('AZURE_STORAGE_PREFIX'),
            'retry'     => [
                'tries' => 3,
                'interval' => 500,
                'increase' => 'exponential',
            ],
        ],

To Reproduce
See code above

Expected behavior
That error not to appear

Screenshots
Screen Shot 2022-03-28 at 6 29 08 PM

Desktop (please complete the following information):

  • OS: macOS 12.3
  • Browser Safari
  • Version 15.4

Additional context
Unsure of any other additional context I can offer but happy to answer any questions to clarify things.

Can't use azure

Hi, I'm new to Azure storage. I applied the instructions provided in the ReadMe file.
I don't know how to import or use files in the storage account.
Can you help me set this up so I can use the Azure storage file as the main storage file

Invalid URL generation when using the `prefix` config

Checklist

This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:

  • I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
  • The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
  • I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that

Describe the bug
When using a configured prefix, the URL returned by the url method ignores the prefix and is invalid.

To Reproduce

  1. Config a disk with a prefix: my_prefix.
  2. Using the package, create a simple file test.txt with any content.
  3. Generate the URL for the file using the url() method.
  4. Notice that the URL does not contain the prefix.
  5. Open the URL in the browser and confirm that the file is not accessible on the informed URL.
  6. Manually add the prefix in the URL and open in the browser.
  7. Confirm that the file was created with the correct prefix.

Expected behavior
The URL returned form the url() method should be correct and contain the prefix configured.

Packages and PHP version
Any

Screenshots
image
image
image
image

Desktop (please complete the following information):
Any

Smartphone (please complete the following information):
Any

Warning - this package will be deprecated on 17 March 2024

DEPRECATION NOTICE

Microsoft have announced the retirement of the Azure Storage PHP client on 17 March 2024. Off the back of this Frank de Jonge, who maintains the Flysystem library and the Azure Storage integration for it, has announced that the Azure Storage integration, will no longer be maintained as of the same date.

This package is entirely dependent on the Azure Storage integration, and by extension the Microsoft client libraries. As such, maintaining it past that point will be impractical. In addition, I myself have never had the occasion to use this package, and only wound up using Azure once when a client insisted on it. I've therefore decided this package will also be retired as at the same date.

If you're using it now, I suggest you consider migrating your existing application off Azure Storage sometime in the next year. If not, you will need to make alternative arrangements for interacting with the REST API.

Value: Block blobs are

MicrosoftAzure\Storage\Common\Exceptions\ServiceException: Fail:↵Code: 400↵Value: Block blobs are

I have read the documentation, i'm student junior programmer i'have configure as the documentation but when put image to disk have some error.

Storage::disk('azure')->put($fileName,$image);
$path = Storage::url($fileName);

Converting to request via API

Can we convert this project to access using the Storage API directly when the 17th of March Arrives, what are the blockers?

getTemporaryUrl does not consider the prefix

I'm using a path prefix in the configuration, but I noticed that getTemporaryUrl only considers the container. I would expect that I could pass a relative path consistent to put and get to generate a URL to those files.

Almost certainly user error but I am stumped

First of all, thank you for this package. If I can get it working, it will be an absolute lifesaver!

I'm currently trying to store data to an Azure Blob Storage account but keep getting

Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required"

whenever I try and do anything.

In the .env file, I've added the following lines:

AZURE_STORAGE_NAME=[THE NAME OF THE STORAGE ACCOUNT]
AZURE_STORAGE_KEY=[KEY1 (TRIED SURROUNDING IT IN DOUBLE QUOTES, SINGLE QUOTATION MARKS, AND NOTHING) FROM THE SETTINGS->ACCESS KEYS PAGE ON THE ABOVE STORAGE ACCOUNT]
AZURE_STORAGE_CONTAINER=[THE CONTAINER I CREATED IN THAT ACCOUNT]

Can you clear up what I'm missing here? I'm sure it's something I'm doing wrong but I can't figure out where I could be messing up.

Thank you!

Server failed to authenticate the request

Hi Matthew,

I have been using the laravel-azure-storage to store documents to a General Purpose V2 account for over a month now. Recently, I have observed that it generates the following error when I try to load slightly larger file sizes (like over 3.7 MB). Is this due to some setting on Azure that limits file sizes? I don't have this issue with smaller files around 2 MB. My post_max_size and upload_max_size are set to 10 MB - so that's not an issue.

"message": "Fail:\nCode: 403\nValue: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\ndetails (if any): \ufeff<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:d8b2ceac-601e-0016-2f29-fd17e5000000\nTime:2021-02-07T08:17:46.8684637Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'CLyWOIZjBxp0dEJuTUHrrazunQc49AP83kFwVLQvz34=' is not the same as any computed signature. Server used following string to sign: 'PUT\n\n\n\n\napplication/x-www-form-urlencoded\nSun, 07 Feb 2021 08:17:46 GMT\n\n\n\n\n\nx-ms-blob-content-type:application/pdf\nx-ms-blob-type:BlockBlob\nx-ms-client-request-id:601fa22ad0de2\nx-ms-version:2017-11-09\n/somename/invoice/iirfiles/USA_latest.pdf'.</AuthenticationErrorDetail></Error>.",
    "exception": "MicrosoftAzure\\Storage\\Common\\Exceptions\\ServiceException",
    "file": "/var/www/html/mir/vendor/microsoft/azure-storage-common/src/Common/Internal/ServiceRestProxy.php",

I would really appreciate your advice on this one.

Calling exists on directory returns false

Hello,

Thank you for the package, I have used this for a few years and it has been amazing.

I have recently started using Spatie Media Library with Azure storage, when deleting a media model the related files and directories does not get removed. After looking over the code I have pinned the issue down to the command "exists" getting called on a directory and returning false when the directory exists.

use Illuminate\Support\Facades\Storage;
dd(
    Storage::has('16'),
    Storage::has('16/'),
    Storage::exists('16'),
    Storage::exists('16/'),
    Storage::allDirectories()
);

Produces:

false
false
false
false
array:1 [▼
  0 => "16"
]

If I swap to the local file adapter and add the folder this works as expected.

Exists is called in the media library and is returning false which is leaving the files on the azure storage: Spatie Media Library Filesystem

Storage::deleteDirectory('16'); works as expected and the folder deletes without issue.

Versions:
Laravel: 8.68.1
Azure-storage: 1.6.2

Any help with this would be great,

Thanks

Dynamically change azure container for each request

Upload , download, list blobs , list containers are API's written using this package.

Problem is each time call is made to any of the API's the default value of "AZURE_STORAGE_CONTAINER" will be taken from .env instead of the value beeing set using config(filesystem.azure.containe => $container_name);

Setting the container everytime just before storage upload/download , config is used to set the AZURE_STORAGE_CONTAINER.

laravel 8 can not install

problem 1
    - Installation request for matthewbdaly/laravel-azure-storage ^1.3 -> satisfiable by matthewbdaly/laravel-azure-storage[1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
    - Can only install one of: guzzlehttp/guzzle[7.0.1, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
    - Conclusion: install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for guzzlehttp/guzzle (locked at 7.0.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.0.1].

can not install this package on laravel 8.

can you guide how to install in laravel 8
thanks

The Share does not exists

How can I upload file in Azure File Share instead of containers. I have a file which is accessible by multiple application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.