azure-sdk-for-php icon indicating copy to clipboard operation
azure-sdk-for-php copied to clipboard

Package microsoft/azure-storage is abandoned

Open deJong-IT opened this issue 7 years ago • 7 comments

When installing this package with composer you get the following warning:

Package microsoft/azure-storage is abandoned, you should avoid using it. Use microsoft/azure-storage-blob, microsoft/azure-storage-table, microsoft/azure-storage-queue, microsoft/azure-storage-file instead.

And because I already use the new azure-storage-blob package, I get a lot of extra errors about Ambiguous class resolution and nothing works anymore.

How can I use the Azure Media Service with the new azure-storage-blob packages?

deJong-IT avatar Apr 18 '18 15:04 deJong-IT

This is a very good Question, but Microsoft does not want to answer!

See here :) https://github.com/Azure/azure-sdk-for-php/issues/963

boredom2 avatar Apr 18 '18 16:04 boredom2

Yes, I read your question, but I thought, maybe give it another try with a new thread, you never know :)

deJong-IT avatar Apr 18 '18 17:04 deJong-IT

Go ahead! More People, more Issues please :) I still have Hope, that someone finally reads this here...

boredom2 avatar Apr 18 '18 19:04 boredom2

Any news in 2019 ?

kant2002 avatar Feb 20 '19 20:02 kant2002

Problem still exists - any solution? Do other php packages exist for managing the Mediaservices?

kawe avatar Jul 30 '19 13:07 kawe

The issue persists and is quite problematic.

I am trying to use the Service Bus queues here, and as my company decided to use Azure extensively I also need to use the API for Azure Storage.

The Microsoft Azure Storage Library for PHP seems up to date and refers to the current package for Service Bus-related operations:

Note

If you are looking for the Service Bus, Service Runtime, Service Management or Media Services libraries, please visit https://github.com/Azure/azure-sdk-for-php.

The official documentation also points to this package, the problem being that it relies on microsoft/azure-storage, which is currently abandoned.

Moreover, both packages share a similar namespace, which leads to conflicts when trying to use them both:

Warning: Ambiguous class resolution, "MicrosoftAzure\Storage\Common\Logger" was found in both "/var/www/vendor/microsoft/azure-storage-common/src/Common/Logger.php" and "/var/www/vendor/microsoft/azure-storage/src/Common/Logger.php", the first will be used.
Warning: Ambiguous class resolution, "MicrosoftAzure\Storage\Common\SharedAccessSignatureHelper" was found in both "/var/www/vendor/microsoft/azure-storage-common/src/Common/SharedAccessSignatureHelper.php" and "/var/www/vendor/microsoft/azure-storage/src/Common/SharedAccessSignatureHelper.php", the first will be used.
Warning: Ambiguous class resolution, "MicrosoftAzure\Storage\Common\Middlewares\IMiddleware" was found in both "/var/www/vendor/microsoft/azure-storage-common/src/Common/Middlewares/IMiddleware.php" and "/var/www/vendor/microsoft/azure-storage/src/Common/Middlewares/IMiddleware.php", the first will be used.
Warning: Ambiguous class resolution, "MicrosoftAzure\Storage\Common\Middlewares\RetryMiddlewareFactory" was found in both "/var/www/vendor/microsoft/azure-storage-common/src/Common/Middlewares/RetryMiddlewareFactory.php" and "/var/www/vendor/microsoft/azure-storage/src/Common/Middlewares/RetryMiddlewareFactory.php", the first will be used.
...

@sergey-shandar you seem to be the last active member here, could you please bring this to the relevant person's attention at Microsoft? It really feels like we're on our own here, and as I understand it, with the current state of things it is virtually impossible to use different Azure Cloud Services together with PHP, and this has been going on for at least a year and a half.

osteel avatar Dec 18 '19 16:12 osteel

A workaround is to have the following in your composer.json:

"replace": {
    "microsoft/azure-storage": "*"
}

This prevents the microsoft/azure-storage package from being installed and fixes the Ambiguous class resolution warnings.

Caution: I haven't investigated any drawbacks in detail. In any case, be careful when using storage related classes from this SDK as it now might be using the classes from the microsoft/azure-storage-* packages which probably has some incompatibilities.

jsor avatar Jun 20 '20 12:06 jsor