第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

嘗試在 Laravel 中使用 Azure 存儲(chǔ)模擬器

嘗試在 Laravel 中使用 Azure 存儲(chǔ)模擬器

PHP
藍(lán)山帝景 2022-07-16 10:54:15
我正在嘗試在 Laravel 5.8 中實(shí)現(xiàn) Azure 存儲(chǔ)模擬器它適用于 Azure 開(kāi)發(fā)和生產(chǎn),但不適用于本地 Windows。郵遞員返回"message": "Fail:\nCode: 403\nValue: Server failed to authenticate the request.確保 Authorization header 的值包括簽名在內(nèi)的格式正確。\ndetails (if any): .",    "異常": "MicrosoftAzure\\Storage\\Common\\Exceptions\\ServiceException",    "file": "C:\\Code\\web-portal-laravel\\vendor\\microsoft\\azure-storage-common\\src\\Common\\Internal\\ServiceRestProxy.php",像公共和私人文件夾一樣,我們正在嘗試將其實(shí)現(xiàn)為存儲(chǔ)磁盤。我們認(rèn)為只使用相同類型的條目 - 而是使用 .env 文件中的共享密鑰憑據(jù)會(huì)起作用:    AZURE_STORAGE_URL_EMU = "http://127.0.0.1:10000/devstoreaccount1/local"    AZURE_STORAGE_KEY_EMU =        "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVERCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="    AZURE_STORAGE_ACCOUNT_EMU = "devstoreaccount1"    AZURE_STORAGE_CONTAINER_EMU = "本地"存儲(chǔ)資源管理器已安裝并可以看到 Blob、隊(duì)列和表。模擬器的狀態(tài)報(bào)告:    Windows Azure Storage Emulator 5.10.0.0 命令行工具    正在運(yùn)行:真    BlobEndpoint:http://127.0.0.1:10000/    隊(duì)列端點(diǎn):http://127.0.0.1:10001/    表端點(diǎn):http://127.0.0.1:10002/我不知道什么樣的 Authorization 標(biāo)頭可以使它起作用。我們正在使用 matthewbdaly/laravel-azure-storage 插件。
查看完整描述

1 回答

?
慕標(biāo)琳琳

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。

http://img1.sycdn.imooc.com//62d229370001550509540851.jpg

因此,如果不更改插件的任何代碼,將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'。


查看完整回答
反對(duì) 回復(fù) 2022-07-16
  • 1 回答
  • 0 關(guān)注
  • 133 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)