在Server Explorer中配置开发存储帐户

时间:2015-03-17 02:04:18

标签: visual-studio configuration azure-storage azure-storage-emulator

我已将“Azure存储模拟器”运行的端口从“C:\ Program Files(x86)\ Microsoft SDKs \ Azure \ Storage Emulator \ WAStorageEmulator”中的配置文件中的10000,10001,10002更改为10003,10004,10005 .exe.config“

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

DefaultEndpointsProtocol = HTTP

帐户名= devstoreaccount1

AccountKey = 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。我认为它是从某个配置读取的地方,但我似乎无法谷歌任何答案,从这里读取。

那么如何配置Server Explorer以反映更新的端口?

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

端口被硬编码到CloudStorageAccount类中,所以不能修改它们:

 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;
        }