在服务器资源管理器中配置开发存储帐户

Configuring Development Storage Account in Server Explorer

我已将运行 Azure 存储模拟器的端口从 "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\WAStorageEmulator.exe.config"

的配置文件中的 10000,10001,10002 更改为 10003,10004,10005

现在,当我在 Visual Studio 2013 年尝试从服务器资源管理器访问开发存储时,它无法访问更新的端口。我尝试手动添加外部存储并指定端点以使用以下信息默认存储帐户信息反映更新的端口:

默认端点协议=http

账户名=devstoreaccount1

帐号密钥=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

BlobEndpoint=http://127.0.0.1:10003/devstoreaccount1

QueueEndpoint=http://127.0.0.1:10004/devstoreaccount1

TableEndpoint=http://127.0.0.1:10005/devstoreaccount1

但这仍然不允许它连接。我也尝试了相同的端点,但没有存储帐户后缀。当我刷新外部存储时,它甚至将端口恢复为 10000、10001、10002。我假设它正在从某处的某个配置中读取,但我似乎无法 google 任何关于从何处读取的答案。

那么如何配置服务器资源管理器以反映更新的端口?

遗憾的是,不支持更改 Azure 存储模拟器端口。

这些端口被硬编码到 CloudStorageAccount class 所以你不能修改它们:

 private static CloudStorageAccount GetDevelopmentStorageAccount(Uri proxyUri)
        {
            UriBuilder uriBuilder = proxyUri != (Uri)null ? new UriBuilder(proxyUri.Scheme, proxyUri.Host) : new UriBuilder("http", "127.0.0.1");
            uriBuilder.Path = "devstoreaccount1";
            uriBuilder.Port = 10000;
            Uri uri1 = uriBuilder.Uri;
            uriBuilder.Port = 10001;
            Uri uri2 = uriBuilder.Uri;
            uriBuilder.Port = 10002;
            Uri uri3 = uriBuilder.Uri;
            uriBuilder.Path = "devstoreaccount1-secondary";
            uriBuilder.Port = 10000;
            Uri uri4 = uriBuilder.Uri;
            uriBuilder.Port = 10001;
            Uri uri5 = uriBuilder.Uri;
            uriBuilder.Port = 10002;
            Uri uri6 = uriBuilder.Uri;
            CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(new StorageCredentials("devstoreaccount1", "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="), new StorageUri(uri1, uri4), new StorageUri(uri2, uri5), new StorageUri(uri3, uri6), (StorageUri)null);
            cloudStorageAccount.Settings = (IDictionary<string, string>)new Dictionary<string, string>();
            cloudStorageAccount.Settings.Add("UseDevelopmentStorage", "true");
            if (proxyUri != (Uri)null)
                cloudStorageAccount.Settings.Add("DevelopmentStorageProxyUri", proxyUri.ToString());
            cloudStorageAccount.IsDevStoreAccount = true;
            return cloudStorageAccount;
        }