簡體   English   中英

無法連接到本地 Azure 存儲帳戶

[英]unable to connect to local Azure storage account

我已經在本地機器上初始化了一個 azure 存儲模擬器,但我無法從 Visual Studio 或 Azure 存儲資源管理器連接到它。 我錯過了什么?

當我嘗試連接到本地 azure 存儲帳戶模擬器時出錯:

Unable to retrieve child resources.
A network error occurred (NetworkTimeoutError: connect ECONNREFUSED 127.0.0.1:10002)

如果我嘗試探索存儲=> 開發,則 Visual Studio 服務器資源管理器中出現錯誤:

  Cannot create database 'AzureStorageEmulatorDb59' : The database 'AzureStorageEmulatorDb59' does not exist. Supply a valid database name. To see available databases, use sys.databases..
    Learn more about known storage blob issues and solutions at https://go.microsoft.com/fwlink/?LinkId=532762.

在我的機器上初始化 Azure 存儲模擬器的命令。

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init -server . -sqlinstance SQLEXPRESS -forcecreate
Windows Azure Storage Emulator 5.9.0.0 command line tool
Attempting to use server specified.
User specified an instance through /server or /sqlInstance options.
Probing SQL Instance: '.\SQLEXPRESS'.
Found SQL Instance .\SQLEXPRESS.
Creating database AzureStorageEmulatorDb59 on SQL instance '.\SQLEXPRESS'.

Granting database access to user DESKTOP-2LS7578\AjitGoel.
Database access for user DESKTOP-2LS7578\AjitGoel was granted.

Initialization successful. The storage emulator is now ready for use.
The storage emulator was successfully initialized and is ready to use.

更新:我試過了。 添加與 C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\Storage Emulator\\storageemulatorexplorer.exe.config 中提供的名稱相同的名稱。 http://127.0.0.1添加到 Internet Explorer 中的本地 Internet 區域,c。 刪除 %AppData%\\Roaming\\StorageExplorer 中的文件,但上述選項都沒有幫助。

Azure 存儲資源管理器屏幕截圖Azure 存儲資源管理器截圖

首先,所有關於Azure Storage Emulator的使用都在這里使用Azure存儲模擬器進行開發和測試,需要仔細閱讀。

其次,根據您的描述,它似乎只是重新初始化模擬器,而不是啟動它。

在此處輸入圖片說明

然后,您可以通過命令AzureStorageEmulator status檢查模擬器AzureStorageEmulator status 在此處輸入圖片說明

如果沒有True ,運行netstat -ano | findstr ":1000." netstat -ano | findstr ":1000." 檢查這些端口是否被其他人占用並找出PID以殺死相關的端口。 在此處輸入圖片說明

或者如GitHub問題@YASWANTH-MSFT鏈接所說,在同一台機器上安裝不同版本的SQL Server的多個實例會導致模擬器無法正常運行,那么你需要刪除其中一個SQL Server。

同時,建議您也可以升級您的AzureStorageExplorer,再次嘗試連接模擬器。 我可以將舊版本5.7.0.0模擬器與最新版本1.6.2資源5.7.0.0器連接起來。

在此處輸入圖片說明

以下是我嘗試過的一些方法,它終於奏效了。

一種。 卸載 sql server express 並僅安裝 sql server localdb。

確保 HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\UserInstances 父實例項具有正確的值。 我從: LocalDB parent instance version invalid: MSSQL13E.LOCALDB

C。 刪除 SQL 實例:

sqllocaldb stop MSSQLLocalDB
sqllocaldb delete MSSQLLocalDB

現在刪除以下數據庫文件:

%USERPROFILE%\AzureStorageEmulatorDb*.mdf
%USERPROFILE%\AzureStorageEmulatorDb*.ldf

最后,重新創建 sql 實例:

sqllocaldb start MSSQLLocalDB

我從: 添加 VS 2015 SDK 后 Azure 存儲模擬器失敗

d. 創建azurestorageemulator init命令嘗試在 Visual Studio=>sql server 對象資源管理器中手動創建的數據庫。

e. 運行azurestorageemulator start命令,查看 azurestorageemulator 是否已啟動。

希望這有助於某人。

鏈接中提到的步驟對我有用,因此與更廣泛的受眾分享,以防萬一,上述步驟對他們不起作用。 他們沒有為我工作。

Github 鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM