1 回答
TA贡献1830条经验 获得超9个赞
根据Connect to the emulator account using the well-known account name and key官方文档的部分Use the Azure storage emulator for development and testing,Azure Storage Emulator 的连接字符串应该如下所示。
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;
BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;
QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;
src/AzureStorageServiceProvider.php看了下plugin的源码matthewbdaly/laravel-azure-storage,发现下图的代码只支持云上Azure Storage的连接字符串,不支持Emulator。

因此,如果不更改插件的任何代码,将config/filesystems.php文件配置为插件 repo 的内容的解决方法README如下。
'azure' => [
'driver' => 'azure',
'name' => 'devstoreaccount1',
'key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;',
'container' => env('AZURE_STORAGE_CONTAINER'),
'url' => env('AZURE_STORAGE_URL'),
'prefix' => null,
],
然后,模拟器连接字符串可以正确地由key上面的值与字符串模板代码补充'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s'。
- 1 回答
- 0 关注
- 175 浏览
添加回答
举报
