1 回答

TA貢獻(xiàn)1830條經(jīng)驗(yàn) 獲得超9個(gè)贊
根據(jù)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 的連接字符串應(yīng)該如下所示。
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,發(fā)現(xiàn)下圖的代碼只支持云上Azure Storage的連接字符串,不支持Emulator。
因此,如果不更改插件的任何代碼,將config/filesystems.php文件配置為插件 repo 的內(nèi)容的解決方法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上面的值與字符串模板代碼補(bǔ)充'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s'。
- 1 回答
- 0 關(guān)注
- 133 瀏覽
添加回答
舉報(bào)