public static AzureStorageConnectionParams FromConfig(ConfigParams config)
        {
            var result = new AzureStorageConnectionParams();

            var credentials = CredentialParams.ManyFromConfig(config);

            foreach (var credential in credentials)
            {
                result.Append(credential);
            }

            var connections = ConnectionParams.ManyFromConfig(config);

            foreach (var connection in connections)
            {
                result.Append(connection);
            }

            return(result);
        }
        public async Task <AzureStorageConnectionParams> ResolveAsync(string correlationId)
        {
            var result = new AzureStorageConnectionParams();

            var connection = await _connectionResolver.ResolveAsync(correlationId);

            result.Append(connection);

            var credential = await _credentialResolver.LookupAsync(correlationId);

            result.Append(credential);

            // Perform validation
            var err = result.Validate(correlationId);

            if (err != null)
            {
                throw err;
            }

            return(result);
        }
Ejemplo n.º 3
0
        public void TestStorageConnectionParametersFromConfig()
        {
            var protocol    = "test_protocol";
            var container   = "test_container";
            var suffix      = "test_suffix";
            var accountName = "test_account_name";
            var accountKey  = "test_account_key";

            var config = ConfigParams.FromTuples(
                "connection.protocol", protocol,
                "connection.container", container,
                "connection.suffix", suffix,
                "credential.access_id", accountName,
                "credential.access_key", accountKey
                );

            var connectionParameters = AzureStorageConnectionParams.FromConfig(config);

            Assert.Equal(protocol, connectionParameters.Protocol);
            Assert.Equal(container, connectionParameters.Container);
            Assert.Equal(suffix, connectionParameters.Suffix);
            Assert.Equal(accountName, connectionParameters.AccessId);
            Assert.Equal(accountKey, connectionParameters.AccessKey);
        }