使用 Azure 儲存體模擬器進行開發和測試Use the Azure storage emulator for development and testing

Microsoft Azure 儲存體模擬器提供了模擬 Azure Blob、佇列和資料表服務的本機環境,以供進行開發。The Microsoft Azure storage emulator provides a local environment that emulates the Azure Blob, Queue, and Table services for development purposes. 您可以使用儲存體模擬器,針對儲存體服務在本機測試您的應用程式,而不需建立 Azure 訂用帳戶,也不會產生任何費用。Using the storage emulator, you can test your application against the storage services locally, without creating an Azure subscription or incurring any costs. 如果您滿意應用程式在模擬器中的運作方式,就可以切換成使用雲端的 Azure 儲存體帳戶。When you're satisfied with how your application is working in the emulator, you can switch to using an Azure storage account in the cloud.

取得儲存體模擬器Get the storage emulator

儲存體模擬器隨 Microsoft Azure SDK提供。The storage emulator is available as part of the Microsoft Azure SDK. 您也可以使用獨立安裝程式 (直接下載) 來安裝儲存體模擬器。You can also install the storage emulator by using the standalone installer (direct download). 若要安裝儲存體模擬器,您必須具有電腦上的系統管理權限。To install the storage emulator, you must have administrative privileges on your computer.

儲存體模擬器目前只能在 Windows 上執行。The storage emulator currently runs only on Windows. 針對考慮適用於 Linux 之儲存體模擬器的使用者,有一個選擇是社群維護的開放原始碼儲存體模擬器 AzuriteFor those considering a storage emulator for Linux, one option is the community maintained, open source storage emulator Azurite.

注意

在某個儲存體模擬器版本中建立的資料不保證可在使用不同版本時加以存取。Data created in one version of the storage emulator is not guaranteed to be accessible when using a different version. 如果您需要長期保存資料,建議您將該資料儲存於 Azure 儲存體帳戶中 (而不是儲存體模擬器中)。If you need to persist your data for the long term, we recommended that you store that data in an Azure storage account, rather than in the storage emulator.

儲存體模擬器取決於特定的 OData 程式庫版本。The storage emulator depends on specific versions of the OData libraries. 不支援將儲存體模擬器所使用的 OData DLL 更換為其他版本,而且可能會造成非預期的行為。Replacing the OData DLLs used by the storage emulator with other versions is unsupported, and may cause unexpected behavior. 不過,儲存體服務支援的任何版本 OData 可能用來將要求傳送至模擬器。However, any version of OData supported by the storage service may be used to send requests to the emulator.

儲存體模擬器的運作方式How the storage emulator works

儲存體模擬器會使用本機 Microsoft SQL Server 執行個體及本機檔案系統來模擬 Azure 儲存體服務。The storage emulator uses a local Microsoft SQL Server instance and the local file system to emulate Azure storage services. 儲存體模擬器預設會使用 Microsoft SQL Server 2012 Express LocalDB 中的資料庫。By default, the storage emulator uses a database in Microsoft SQL Server 2012 Express LocalDB. 您可以選擇設定儲存體模擬器存取 SQL Server 本機執行個體,而非 LocalDB 執行個體。You can choose to configure the storage emulator to access a local instance of SQL Server instead of the LocalDB instance. 如需詳細資訊,請參閱本文稍後的啟動及初始化儲存體模擬器一節。For more information, see the Start and initialize the storage emulator section later in this article.

儲存體模擬器會使用 Windows 驗證,連接到 SQL Server 或 LocalDB。The storage emulator connects to SQL Server or LocalDB using Windows authentication.

儲存體模擬器與 Azure 儲存體服務的功能有所差異。Some differences in functionality exist between the storage emulator and Azure storage services. 如需有關這些差異的詳細資訊,請參閱本文稍後的儲存體模擬器和 Azure 儲存體之間的差異一節。For more information about these differences, see the Differences between the storage emulator and Azure Storage section later in this article.

啟動及初始化儲存體模擬器Start and initialize the storage emulator

啟動 Azure 儲存體模擬器:To start the Azure storage emulator:

  1. 選取 [開始] 按鈕或按下 [Windows] 鍵。Select the Start button or press the Windows key.
  2. 開始輸入 Azure Storage EmulatorBegin typing Azure Storage Emulator.
  3. 從顯示的應用程式清單中選取模擬器。Select the emulator from the list of displayed applications.

當儲存體模擬器啟動時,將會出現 [命令列提示字元] 視窗。When the storage emulator starts, a Command Prompt window will appear. 您可以使用此主控台視窗,來啟動和停止儲存體模擬器、清除資料、取得狀態,以及初始化模擬器。You can use this console window to start and stop the storage emulator, clear data, get status, and initialize the emulator. 如需詳細資訊,請參閱本文稍後的儲存體模擬器命令列工具參考一節。For more information, see the Storage emulator command-line tool reference section later in this article.

如果模擬器正在執行,您就會在 Windows 工作列通知區域看到圖示。When the emulator is running, you'll see an icon in the Windows taskbar notification area.

當您關閉儲存體模擬器的 [命令提示字元] 視窗時,儲存體模擬器將會繼續執行。When you close the storage emulator Command Prompt window, the storage emulator will continue to run. 若要再次顯示 [儲存體模擬器] 主控台視窗,請遵循先前步驟,如同啟動儲存體模擬器一樣。To bring up the Storage Emulator console window again, follow the preceding steps as if starting the storage emulator.

當您第一次執行儲存體模擬器時,系統會為您初始化本機儲存體環境。The first time you run the storage emulator, the local storage environment is initialized for you. 初始化處理程序會在 LocalDB 中建立資料庫,並為每個本機儲存體服務保留 HTTP 連接埠。The initialization process creates a database in LocalDB and reserves HTTP ports for each local storage service.

預設會將儲存體模擬器安裝至 C:\Program Files (x86)\Microsoft SDKs\Azure\Storage EmulatorThe storage emulator is installed by default to C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator.

提示

您可以使用 Microsoft Azure 儲存體總管來使用本機儲存體模擬器資源。You can use the Microsoft Azure Storage Explorer to work with local storage emulator resources. 當您安裝並啟動儲存體模擬器之後,在 [儲存體總管] 資源樹狀目錄中的 [儲存體帳戶] 下方尋找 [(開發)]。Look for "(Development)" under "Storage Accounts" in the Storage Explorer resources tree after you've installed and started the storage emulator.

初始化儲存體模擬器以使用不同的 SQL 資料庫Initialize the storage emulator to use a different SQL database

您可以使用儲存體模擬器命令列工具來初始化儲存體模擬器,以指向預設 LocalDB 執行個體以外的 SQL 資料庫執行個體:You can use the storage emulator command-line tool to initialize the storage emulator to point to a SQL database instance other than the default LocalDB instance:

  1. 開啟 [儲存體模擬器] 主控台視窗,如啟動及初始化儲存體模擬器一節中所述。Open the Storage Emulator console window as described in the Start and initialize the storage emulator section.

  2. 在主控台視窗中,輸入下列命令,其中 <SQLServerInstance> 是 SQL Server 執行個體的名稱。In the console window, type the following command, where <SQLServerInstance> is the name of the SQL Server instance. 若要使用 LocalDB,請指定 (localdb)\MSSQLLocalDb 做為 SQL Server 執行個體。To use LocalDB, specify (localdb)\MSSQLLocalDb as the SQL Server instance.

    AzureStorageEmulator.exe init /server <SQLServerInstance>

    您也可以使用下列命令,引導模擬器使用預設的 SQL Server 執行個體:You can also use the following command, which directs the emulator to use the default SQL Server instance:

    AzureStorageEmulator.exe init /server .

    或者,您也可以使用下列命令,將資料庫重新初始化至預設 LocalDB 執行個體:Or, you can use the following command, which reinitializes the database to the default LocalDB instance:

    AzureStorageEmulator.exe init /forceCreate

如需有關這些命令的詳細資訊,請參閱儲存體模擬器命令列工具參考For more information about these commands, see Storage emulator command-line tool reference.

提示

您可以使用 Microsoft SQL Server Management Studio (SSMS) 來管理您的 SQL Server 執行個體,包括 LocalDB 安裝。You can use the Microsoft SQL Server Management Studio (SSMS) to manage your SQL Server instances, including the LocalDB installation. 在 SMSS [連接到伺服器] 對話方塊中,於 [伺服器名稱:] 欄位中指定 (localdb)\MSSQLLocalDb,以連接到 LocalDB 執行個體。In the SMSS Connect to Server dialog, specify (localdb)\MSSQLLocalDb in the Server name: field to connect to the LocalDB instance.

對儲存體模擬器的驗證要求Authenticating requests against the storage emulator

一旦您安裝並啟動儲存體模擬器之後,就可以針對它測試您的程式碼。Once you've installed and started the storage emulator, you can test your code against it. 就像雲端中的 Azure 儲存體一樣,您傳送給儲存體模擬器的每個要求都必須經過授權,除非它是匿名的要求。As with Azure Storage in the cloud, every request you make against the storage emulator must be authorized, unless it is an anonymous request. 您可以使用共用金鑰驗證或共用存取簽章 (SAS),授權傳送給儲存體模擬器的要求。You can authorize requests against the storage emulator using Shared Key authentication or with a shared access signature (SAS).

使用共用金鑰認證進行授權Authorize with Shared Key credentials

儲存體模擬器支援共用金鑰驗證的單一固定帳戶及已知驗證金鑰。The storage emulator supports a single fixed account and a well-known authentication key for Shared Key authentication. 此帳戶和金鑰都是唯一允許搭配儲存體模擬器使用的共用金鑰認證。This account and key are the only Shared Key credentials permitted for use with the storage emulator. 如下:They are:

Account name: devstoreaccount1
Account key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

注意

儲存體模擬器所支援的驗證金鑰僅可用來測試用戶端驗證碼的功能。The authentication key supported by the storage emulator is intended only for testing the functionality of your client authentication code. 它不提供任何安全性用途。It does not serve any security purpose. 您無法將生產儲存體帳戶和金鑰與儲存體模擬器搭配使用。You cannot use your production storage account and key with the storage emulator. 您不應該將開發帳戶與生產資料搭配使用。You should not use the development account with production data.

儲存體模擬器只透過 HTTP 支援連線。The storage emulator supports connection via HTTP only. 不過,HTTPS 是建議的通訊協定,用於存取生產 Azure 儲存體帳戶中的資源。However, HTTPS is the recommended protocol for accessing resources in a production Azure storage account.

使用捷徑連接到模擬器帳戶Connect to the emulator account using a shortcut

從您的應用程式連線到儲存體模擬器的最簡單方法,就是在應用程式參照捷徑 UseDevelopmentStorage=true 的組態檔中設定連接字串。The easiest way to connect to the storage emulator from your application is to configure a connection string in your application's configuration file that references the shortcut UseDevelopmentStorage=true. 以下是 app.config 檔中儲存體模擬器連接字串的範例:Here's an example of a connection string to the storage emulator in an app.config file:

<appSettings>
  <add key="StorageConnectionString" value="UseDevelopmentStorage=true" />
</appSettings>

使用已知的帳戶名稱和金鑰連接到模擬器帳戶Connect to the emulator account using the well-known account name and key

若要建立參考模擬器帳戶名稱與金鑰的連接字串,您必須針對每一個您希望從連接字串中的模擬器使用的服務指定端點。To create a connection string that references the emulator account name and key, you must specify the endpoints for each of the services you wish to use from the emulator in the connection string. 這是必要的,這樣一來連接字串將會參考模擬器端點 (不同於正式作業儲存體帳戶的模擬器端點)。This is necessary so that the connection string will reference the emulator endpoints, which are different than those for a production storage account. 例如,連接字串的值看起來會像這樣:For example, the value of your connection string will look like this:

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;

此值等同於上面顯示的捷徑 UseDevelopmentStorage=trueThis value is identical to the shortcut shown above, UseDevelopmentStorage=true.

指定 HTTP proxySpecify an HTTP proxy

您也可以指定在對儲存體模擬器測試服務時要使用的 HTTP Proxy。You can also specify an HTTP proxy to use when you're testing your service against the storage emulator. 當您正在對儲存體服務進行作業偵錯時,這對於觀察 HTTP 要求和回應非常有用。This can be useful for observing HTTP requests and responses while you're debugging operations against the storage services. 若要指定 Proxy,可將 DevelopmentStorageProxyUri 選項新增至連接字串,並將其值設為 Proxy URI。To specify a proxy, add the DevelopmentStorageProxyUri option to the connection string, and set its value to the proxy URI. 例如,以下是指向儲存體模擬器並設定 HTTP Proxy 的連接字串:For example, here is a connection string that points to the storage emulator and configures an HTTP proxy:

UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri

如需連接字串的詳細資訊,請參閱設定 Azure 儲存體連接字串For more information on connection strings, see Configure Azure Storage connection strings.

使用共用存取簽章進行授權Authorize with a shared access signature

注意

本文已更新為使用新的 Azure PowerShell Az 模組。This article has been updated to use the new Azure PowerShell Az module. AzureRM 模組在至少 2020 年 12 月之前都還會持續收到錯誤 (Bug) 修正,因此您仍然可以持續使用。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要深入了解新的 Az 模組和 AzureRM 的相容性,請參閱新的 Azure PowerShell Az 模組簡介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 如需 Az 模組安裝指示,請參閱安裝 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

某些 Azure 儲存體用戶端程式庫 (例如 Xamarin 程式庫),僅支援使用共用存取簽章 (SAS) 權杖進行的驗證。Some Azure storage client libraries, such as the Xamarin library, only support authentication with a shared access signature (SAS) token. 您可以使用類似儲存體總管的工具或其他支援共用金鑰驗證的應用程式來建立 SAS 權杖。You can create the SAS token using a tool like the Storage Explorer or another application that supports Shared Key authentication.

您也可以使用 Azure PowerShell 來產生 SAS 權杖。You can also generate a SAS token by using Azure PowerShell. 下列範例會產生 SAS 權杖且對 blob 容器具有完整權限:The following example generates a SAS token with full permissions to a blob container:

  1. 安裝 Azure PowerShell (如果您尚未安裝,建議使用 Azure PowerShell Cmdlet 的最新版本)。Install Azure PowerShell if you haven't already (using the latest version of the Azure PowerShell cmdlets is recommended). 如需安裝指示,請參閱安裝和設定 Azure PowerShellFor installation instructions, see Install and configure Azure PowerShell.
  2. 開啟 Azure PowerShell 並執行下列命令,使用您所選的名稱來取代 CONTAINER_NAMEOpen Azure PowerShell and run the following commands, replacing CONTAINER_NAME with a name of your choosing:
$context = New-AzStorageContext -Local

New-AzStorageContainer CONTAINER_NAME -Permission Off -Context $context

$now = Get-Date

New-AzStorageContainerSASToken -Name CONTAINER_NAME -Permission rwdl -ExpiryTime $now.AddDays(1.0) -Context $context -FullUri

針對新容器產生的共用存取簽章 URI 應該類似下列項目:The resulting shared access signature URI for the new container should be similar to:

http://127.0.0.1:10000/devstoreaccount1/sascontainer?sv=2012-02-12&se=2015-07-08T00%3A12%3A08Z&sr=c&sp=wl&sig=t%2BbzU9%2B7ry4okULN9S0wst%2F8MCUhTjrHyV9rDNLSe8g%3Dsss

使用此範例建立的共用存取簽章的效期為一天。The shared access signature created with this example is valid for one day. 簽章會將完整存取權限 (讀取、寫入、刪除、列出) 授與容器內的 Blob。The signature grants full access (read, write, delete, list) to blobs within the container.

如需共用存取簽章的詳細資訊,請參閱在 Azure 儲存體中使用共用存取簽章 (SAS)For more information on shared access signatures, see Using shared access signatures (SAS) in Azure Storage.

在儲存體模擬器中為資源定址Addressing resources in the storage emulator

儲存體模擬器的服務端點與 Azure 儲存體帳戶的服務端點不同。The service endpoints for the storage emulator are different from those of an Azure storage account. 這項差別的原因是,本機電腦不會執行網域名稱解析,需要儲存體模擬器端點為本機位址。The difference is because the local computer does not perform domain name resolution, requiring the storage emulator endpoints to be local addresses.

當您在 Azure 儲存體帳戶中定址資源時,可使用下列配置。When you address a resource in an Azure storage account, you use the following scheme. 帳戶名稱是 URI 主機名稱的一部分,而要定址的資源是 URI 路徑的一部分:The account name is part of the URI host name, and the resource being addressed is part of the URI path:

<http|https>://<account-name>.<service-name>.core.windows.net/<resource-path>

例如,下列 URI 是 Azure 儲存體帳戶中的有效 blob 位址:For example, the following URI is a valid address for a blob in an Azure storage account:

https://myaccount.blob.core.windows.net/mycontainer/myblob.txt

但是,在儲存體模擬器中,因為本機電腦不會執行網域名稱解析,所以帳戶名稱是 URI 路徑的一部分,而不是主機名稱的一部分。However, the storage emulator, because the local computer does not perform domain name resolution, the account name is part of the URI path instead of the host name. 針對儲存體模擬器中的資源使用下列 URI 格式:Use the following URI format for a resource in the storage emulator:

http://<local-machine-address>:<port>/<account-name>/<resource-path>

例如,下列位址可能會用於存取儲存體模擬器中的 Blob:For example, the following address might be used for accessing a blob in the storage emulator:

http://127.0.0.1:10000/myaccount/mycontainer/myblob.txt

儲存體模擬器的服務端點包括:The service endpoints for the storage emulator are:

  • Blob 服務:http://127.0.0.1:10000/<account-name>/<resource-path>Blob service: http://127.0.0.1:10000/<account-name>/<resource-path>
  • 佇列服務:http://127.0.0.1:10001/<account-name>/<resource-path>Queue service: http://127.0.0.1:10001/<account-name>/<resource-path>
  • 表格服務:http://127.0.0.1:10002/<account-name>/<resource-path>Table service: http://127.0.0.1:10002/<account-name>/<resource-path>

使用 RA-GRS 為帳戶次要位址定址Addressing the account secondary with RA-GRS

從 3.1 版開始,儲存體模擬器就支援讀取存取地理備援複寫 (RA-GRS)。Beginning with version 3.1, the storage emulator supports read-access geo-redundant replication (RA-GRS). 針對同時位於雲端和本機模擬器中的儲存體資源,您可以藉由將 -secondary 附加到帳戶名稱來存取次要位置。For storage resources both in the cloud and in the local emulator, you can access the secondary location by appending -secondary to the account name. 例如,下列位址可能會用於在儲存體模擬器中使用唯讀的次要位置來存取 Blob:For example, the following address might be used for accessing a blob using the read-only secondary in the storage emulator:

http://127.0.0.1:10000/myaccount-secondary/mycontainer/myblob.txt

注意

如需以程式設計方式使用儲存體模擬器來存取次要位置,請使用 Storage Client Library for.NET 3.2 版或更新版本。For programmatic access to the secondary with the storage emulator, use the Storage Client Library for .NET version 3.2 or later. 如需詳細資訊,請參閱 Microsoft Azure Storage Client Library for .NET (適用於 .NET 的 Microsoft Azure 儲存體用戶端程式庫)。See the Microsoft Azure Storage Client Library for .NET for details.

儲存體模擬器命令列工具參考Storage emulator command-line tool reference

從 3.0 版開始,當您啟動儲存體模擬器時,就會顯示主控台視窗。Starting in version 3.0, a console window is displayed when you start the Storage Emulator. 在主控台視窗中使用命令列,來啟動和停止模擬器,以及查詢狀態和執行其他作業。Use the command line in the console window to start and stop the emulator as well as query for status and perform other operations.

注意

如果您已安裝 Microsoft Azure 計算模擬器,當您啟動儲存體模擬器時,就會出現系統匣圖示。If you have the Microsoft Azure compute emulator installed, a system tray icon appears when you launch the Storage Emulator. 使用滑鼠右鍵按一下圖示即可顯示功能表,提供圖形化方式來啟動和停止儲存體模擬器。Right-click on the icon to reveal a menu that provides a graphical way to start and stop the Storage Emulator.

命令列語法Command line syntax

AzureStorageEmulator.exe [start] [stop] [status] [clear] [init] [help]

選項Options

若要檢視選項清單,請在命令提示字元輸入 /helpTo view the list of options, type /help at the command prompt.

選項Option 描述Description 命令Command 引數Arguments
啟動Start 啟動儲存體模擬器。Starts up the storage emulator. AzureStorageEmulator.exe start [-inprocess] -inprocess:在目前的處理序中啟動模擬器,而不是建立新的處理序。-inprocess: Start the emulator in the current process instead of creating a new process.
停止Stop 停止儲存體模擬器。Stops the storage emulator. AzureStorageEmulator.exe stop
狀態Status 列印儲存體模擬器的狀態。Prints the status of the storage emulator. AzureStorageEmulator.exe status
ClearClear 清除命令列上指定的所有服務中的資料。Clears the data in all services specified on the command line. AzureStorageEmulator.exe clear [blob] [table] [queue] [all] blob:清除 blob 資料。blob: Clears blob data.
queue:清除佇列資料。queue: Clears queue data.
table:清除資料表資料。table: Clears table data.
all:清除所有服務中的所有資料。all: Clears all data in all services.
InitInit 執行一次初始化以設定模擬器。Performs one-time initialization to set up the emulator. AzureStorageEmulator.exe init [-server serverName] [-sqlinstance instanceName] [-forcecreate|-skipcreate] [-reserveports|-unreserveports] [-inprocess] -server serverName\instanceName:指定裝載 SQL 執行個體的伺服器。-server serverName\instanceName: Specifies the server hosting the SQL instance.
-sqlinstance instanceName:指定在預設伺服器執行個體中使用之 SQL 執行個體的名稱。-sqlinstance instanceName: Specifies the name of the SQL instance to be used in the default server instance.
-forcecreate:強制建立 SQL 資料庫,即使它已經存在。-forcecreate: Forces creation of the SQL database, even if it already exists.
-skipcreate:略過建立 SQL 資料庫。-skipcreate: Skips creation of the SQL database. 其優先順序高於 -forcecreate。This takes precedence over -forcecreate.
-reserveports:嘗試保留與服務建立關聯的 HTTP 連接埠。-reserveports: Attempts to reserve the HTTP ports associated with the services.
-unreserveports:嘗試移除與服務建立關聯之 HTTP 連接埠的保留。-unreserveports: Attempts to remove reservations for the HTTP ports associated with the services. 其優先順序高於 -reserveports。This takes precedence over -reserveports.
-inprocess:在目前的處理序中執行初始化,而不是繁衍新的處理序。-inprocess: Performs initialization in the current process instead of spawning a new process. 如果變更連接埠保留,必須以提高權限啟動目前的處理程序。The current process must be launched with elevated permissions if changing port reservations.

儲存體模擬器和 Azure 儲存體之間的差異Differences between the storage emulator and Azure Storage

因為儲存體模擬器是在本機 SQL 執行個體中執行的模擬環境,所以模擬器和雲端 Azure 儲存體帳戶之間會有功能上的差異:Because the storage emulator is an emulated environment running in a local SQL instance, there are differences in functionality between the emulator and an Azure storage account in the cloud:

  • 儲存體模擬器僅支援單一固定帳戶及已知的驗證金鑰。The storage emulator supports only a single fixed account and a well-known authentication key.
  • 儲存體模擬器不是可擴充的儲存體服務,也不支援大量並行用戶端。The storage emulator is not a scalable storage service and does not support a large number of concurrent clients.
  • 在儲存體模擬器中定址資源中所述,資源在儲存體模擬器與在 Azure 儲存體帳戶中的定址方式不同。As described in Addressing resources in the storage emulator, resources are addressed differently in the storage emulator versus an Azure storage account. 這項差別的原因是,雲端提供網域名稱解析,而本機電腦沒有提供。This difference is because domain name resolution is available in the cloud but not on the local computer.
  • 從 3.1 版開始,儲存體模擬器帳戶就支援讀取存取地理備援複寫 (RA-GRS)。Beginning with version 3.1, the storage emulator account supports read-access geo-redundant replication (RA-GRS). 在模擬器中,所有帳戶均已啟用 RA-GRS,而且主要和次要複本之間絕對不會有延遲。In the emulator, all accounts have RA-GRS enabled, and there is never any lag between the primary and secondary replicas. 次要帳戶支援 Get Blob Service Stats、Get Queue Service Stats 和 Get Table Service Stats 作業,且這些作業一律會根據基礎 SQL 資料庫傳回 LastSyncTime 回應元素的值當成目前的時間。The Get Blob Service Stats, Get Queue Service Stats, and Get Table Service Stats operations are supported on the account secondary and will always return the value of the LastSyncTime response element as the current time according to the underlying SQL database.
  • 儲存體模擬器目前不支援檔案服務和 SMB 通訊協定服務端點。The File service and SMB protocol service endpoints are not currently supported in the storage emulator.
  • 如果模擬器尚不支援您使用的儲存體服務版本,該儲存體模擬器就會傳回 VersionNotSupportedByEmulator 錯誤 (HTTP 狀態碼 400-不正確的要求)。If you use a version of the storage services that is not yet supported by the emulator, the storage emulator returns a VersionNotSupportedByEmulator error (HTTP status code 400 - Bad Request).

Blob 儲存體的差異Differences for Blob storage

下列差異適用於模擬器中的 Blob 儲存體:The following differences apply to Blob storage in the emulator:

  • 儲存體模擬器最多只支援 2 GB 的 blob 大小。The storage emulator only supports blob sizes up to 2 GB.
  • 儲存體模擬器中的 Blob 名稱長度上限是 256 個字元,而 Azure 儲存體中的 Blob 名稱長度上限是 1024 個字元。The maximum length of a blob name in the storage emulator is 256 characters, while the maximum length of a blob name in Azure Storage is 1024 characters.
  • 增量複本會讓來自覆寫 blob 的快照進行複製,其會在服務時傳回失敗。Incremental copy allows snapshots from overwritten blobs to be copied, which returns a failure on the service.
  • 取得頁面範圍差異無法在使用累加複製 Blob 複製的快照之間運作。Get Page Ranges Diff does not work between snapshots copied using Incremental Copy Blob.
  • 針對存在於儲存體模擬器中的 blob 進行的 Put Blob 作業會成功,並擁有作用中的租用 (即使要求中並未指定租用識別碼)。A Put Blob operation may succeed against a blob that exists in the storage emulator with an active lease, even if the lease ID has not been specified in the request.
  • 模擬器不支援附加 Blob 作業。Append Blob operations are not supported by the emulator. 在附加 Blob 上嘗試作業會傳回 FeatureNotSupportedByEmulator 錯誤 (HTTP 狀態碼 400-不正確的要求)。Attempting an operation on an append blob returns a FeatureNotSupportedByEmulator error (HTTP status code 400 - Bad Request).

資料表儲存體的差異Differences for Table storage

下列差異適用於模擬器中的資料表儲存體:The following differences apply to Table storage in the emulator:

  • 在儲存體模擬器中,表格服務的日期屬性只支援 SQL Server 2005 所支援的範圍 (它們必須晚於 1753 年 1 月 1 日)。Date properties in the Table service in the storage emulator support only the range supported by SQL Server 2005 (they are required to be later than January 1, 1753). 1753 年 1 月 1 日之前的所有日期都會變成此值。All dates before January 1, 1753 are changed to this value. 日期的精確度受限於 SQL Server 2005 的精確度,也就是會精確度達到 1/300 秒。The precision of dates is limited to the precision of SQL Server 2005, meaning that dates are precise to 1/300th of a second.
  • 儲存體模擬器支援屬性值小於 512 個位元組的資料分割索引鍵與資料列索引鍵。The storage emulator supports partition key and row key property values of less than 512 bytes each. 此外,帳戶名稱、資料表名稱和索引鍵屬性名稱的大小總計不得超過 900 個位元組。Additionally, the total size of the account name, table name, and key property names together cannot exceed 900 bytes.
  • 在儲存體模擬器中,資料表的資料列大小總計限制為小於 1 MB。The total size of a row in a table in the storage emulator is limited to less than 1 MB.
  • 在儲存體模擬器中,資料類型 Edm.GuidEdm.Binary 的屬性只支援查詢篩選字串中的 Equal (eq)NotEqual (ne) 比較運算子。In the storage emulator, properties of data type Edm.Guid or Edm.Binary support only the Equal (eq) and NotEqual (ne) comparison operators in query filter strings.

佇列儲存體的差異Differences for Queue storage

模擬器中的佇列儲存體沒有特定差異。There are no differences specific to Queue storage in the emulator.

儲存體模擬器版本資訊Storage emulator release notes

5.7 版Version 5.7

已修正啟用記錄時會造成當機的錯誤。Fixed a bug that would cause a crash if logging was enabled.

5.6 版Version 5.6

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上 2018-03-28 版的儲存體服務。The storage emulator now supports version 2018-03-28 of the storage services on Blob, Queue, and Table service endpoints.

版本 5.5Version 5.5

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上 2017-11-09 版的儲存體服務。The storage emulator now supports version 2017-11-09 of the storage services on Blob, Queue, and Table service endpoints.
  • 已新增 Blob Created 屬性的支援,它會傳回 Blob 建立時間。Support has been added for the blob Created property, which returns the blob's creation time.

版本 5.4Version 5.4

若要改善安裝穩定性,模擬器不會嘗試在安裝時保留連接埠。To improve installation stability, the emulator no longer attempts to reserve ports at install time. 如果想要保留連接埠,可以使用 init 命令的 -reserveports 選項來指定連接埠。If port reservations are desired, use the -reserveports option of the init command to specify them.

版本 5.3Version 5.3

儲存體模擬器現在支援 Blob、佇列和資料表服務端點上 2017-07-29 版的儲存體服務。The storage emulator now supports version 2017-07-29 of the storage services on Blob, Queue, and Table service endpoints.

5.2 版Version 5.2

  • 儲存體模擬器現在支援 Blob、佇列和表格服務端點上 2017-04-17 版的儲存體服務。The storage emulator now supports version 2017-04-17 of the storage services on Blob, Queue, and Table service endpoints.
  • 已修正資料表屬性值未正確編碼的錯誤。Fixed a bug where table property values were not being properly encoded.

版本 5.1Version 5.1

修正了儲存體模擬器在某些回應中傳回 DataServiceVersion 標頭 (但服務未傳回) 的問題。Fixed a bug where the storage emulator was returning the DataServiceVersion header in some responses where the service was not.

版本 5.0Version 5.0

  • 儲存體模擬器安裝程式不再會檢查現有的 MSSQL 和 .NET Framework 安裝。The storage emulator installer no longer checks for existing MSSQL and .NET Framework installs.
  • 儲存體模擬器安裝程式不再會隨著安裝建立資料庫。The storage emulator installer no longer creates the database as part of install. 必要時仍會隨著啟動建立資料庫。Database will still be created if needed as part of startup.
  • 建立資料庫不再需要提高權限。Database creation no longer requires elevation.
  • 啟動不再需要保留連接埠。Port reservations are no longer needed for startup.
  • 將下列選項新增至 init-reserveports (需要提高權限)、-unreserveports (需要提高權限)、-skipcreateAdds the following options to init: -reserveports (requires elevation), -unreserveports (requires elevation), -skipcreate.
  • 系統匣圖示上的儲存體模擬器 UI 上選項現在會啟動命令列介面。The Storage Emulator UI option on the system tray icon now launches the command line interface. 已不再使用舊 GUI。The old GUI is no longer available.
  • 某些 DLL 已移除或重新命名。Some DLLs have been removed or renamed.

版本 4.6Version 4.6

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上的 2016-05-31 版儲存體服務。The storage emulator now supports version 2016-05-31 of the storage services on Blob, Queue, and Table service endpoints.

版本 4.5Version 4.5

  • 已修正在重新命名備份資料庫時,會導致儲存體模擬器的初始化與安裝失敗的錯誤。Fixed a bug that caused initialization and installation of the storage emulator to fail when the backing database was renamed.

4.4 版Version 4.4

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上 2015-12-11 版的儲存體服務。The storage emulator now supports version 2015-12-11 of the storage services on Blob, Queue, and Table service endpoints.
  • 現在,處理大量 blob 時,儲存體模擬器的 blob 資料記憶體回收更有效率。The storage emulator's garbage collection of blob data is now more efficient when dealing with large numbers of blobs.
  • 修正了造成容器 ACL XML 的驗證方式與儲存體服務的運作方式稍有不同的錯誤。Fixed a bug that caused container ACL XML to be validated slightly differently from how the storage service does it.
  • 修正了有時造成報告的日期時間上限和下限值時區不正確的錯誤。Fixed a bug that sometimes caused max and min DateTime values to be reported in the incorrect time zone.

版本 4.3Version 4.3

  • 儲存體模擬器現在支援 Blob、佇列和表格服務端點上的 2015-07-08 版儲存體服務。The storage emulator now supports version 2015-07-08 of the storage services on Blob, Queue, and Table service endpoints.

4.2 版Version 4.2

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上 2015-04-05 版的儲存體服務。The storage emulator now supports version 2015-04-05 of the storage services on Blob, Queue, and Table service endpoints.

4.1 版Version 4.1

  • 除了新的附加 Blob 功能,儲存體模擬器現在支援 Blob、佇列和表格服務端點上的 2015-02-21 版儲存體服務。The storage emulator now supports version 2015-02-21 of the storage services on Blob, Queue, and Table service endpoints, except for the new Append Blob features.
  • 如果模擬器尚不支援您使用的儲存體服務版本,該模擬器會傳回有意義的錯誤訊息。If you use a version of the storage services that is not yet supported by the emulator, the emulator returns a meaningful error message. 我們建議使用最新版本的模擬器。We recommend using the latest version of the emulator. 如果您遇到 VersionNotSupportedByEmulator 錯誤 (HTTP 狀態碼 400-不正確的要求),請下載最新版的儲存體模擬器。If you encounter a VersionNotSupportedByEmulator error (HTTP status code 400 - Bad Request), please download the latest version of the storage emulator.
  • 修正競爭情形造成資料表實體資料在並行合併作業期間會不正確的 bug。Fixed a bug wherein a race condition caused table entity data to be incorrect during concurrent merge operations.

4.0 版Version 4.0

  • 儲存體模擬器的可執行檔已重新命名為 AzureStorageEmulator.exeThe storage emulator executable has been renamed to AzureStorageEmulator.exe.

3.2 版Version 3.2

  • 儲存體模擬器現在支援 Blob、佇列和資料表服務端點上的 2014-02-14 版儲存體服務。The storage emulator now supports version 2014-02-14 of the storage services on Blob, Queue, and Table service endpoints. 儲存體模擬器目前不支援檔案服務端點。File service endpoints are not currently supported in the storage emulator. 如需有關 2014-02-14 版本的詳細資訊,請參閱 為 Microsoft Azure 中的 Blob、佇列和表格服務進行版本設定See Versioning for the Azure Storage Services for details about version 2014-02-14.

3.1 版Version 3.1

  • 儲存體模擬器現在支援讀取權限異地備援儲存體 (RA-GRS)。Read-access geo-redundant storage (RA-GRS) is now supported in the storage emulator. 針對次要帳戶支援 Get Blob Service Stats、Get Queue Service Stats 和 Get Table Service Stats API,且這些 API 一律會根據基礎 SQL Database 傳回 LastSyncTime 回應元素的值當成目前的時間。The Get Blob Service Stats, Get Queue Service Stats, and Get Table Service Stats APIs are supported for the account secondary and will always return the value of the LastSyncTime response element as the current time according to the underlying SQL database. 如需以程式設計方式使用儲存體模擬器來存取次要位置,請使用 Storage Client Library for.NET 3.2 版或更新版本。For programmatic access to the secondary with the storage emulator, use the Storage Client Library for .NET version 3.2 or later. 如需詳細資訊,請參閱「Microsoft Azure Storage Client Library for .NET」。See the Microsoft Azure Storage Client Library for .NET Reference for details.

3.0 版Version 3.0

  • Azure 儲存體模擬器不再隨附於計算模擬器封裝。The Azure storage emulator is no longer shipped in the same package as the compute emulator.
  • 儲存體模擬器圖形化使用者介面已由可編寫指令碼的命令列介面取代。The storage emulator graphical user interface is deprecated in favor of a scriptable command-line interface. 如需有關命令列介面的詳細資訊,請參閱儲存體模擬器命令列工具參考。For details on the command-line interface, see Storage Emulator Command-Line Tool Reference. 3.0 版仍將提供圖形化介面,除非在系統匣圖示按一下滑鼠右鍵並選取 [顯示儲存體模擬器 UI] 的方式安裝計算模擬器,否則無法存取圖形化介面。The graphical interface will continue to be present in version 3.0, but it can only be accessed when the Compute Emulator is installed by right-clicking on the system tray icon and selecting Show Storage Emulator UI.
  • 現在完全支援 2013-08-15 版的 Azure 儲存體服務。Version 2013-08-15 of the Azure storage services is now fully supported. (先前只有儲存體模擬器 2.2.1 版預覽才支援此版本)。(Previously this version was only supported by Storage Emulator version 2.2.1 Preview.)

後續步驟Next steps