Пример #1
0
        private static StorageProfile GetStorageProfile(ClusterCreateParameters createProperties)
        {
            // Note: Only WASB and ADLS Gen 1 storage accounts will be populated directly into configurations.
            //       Other storage account types will be populated into StorageProfile.
            AzureDataLakeStoreGen2Info adlsGen2Info = createProperties.DefaultStorageInfo as AzureDataLakeStoreGen2Info;

            if (adlsGen2Info == null)
            {
                return(null);
            }

            return(new StorageProfile
            {
                Storageaccounts = new[]
                {
                    new StorageAccount
                    {
                        Name = adlsGen2Info.StorageAccountName,
                        FileSystem = adlsGen2Info.StorageFileSystem,
                        Key = adlsGen2Info.StorageAccountKey,
                        IsDefault = true
                    }
                }
            });
        }
Пример #2
0
        public static void ValidateStorageProfile(StorageInfo inputStorageInfo, StorageProfile convertedStorageProfile)
        {
            // Note: WASB and ADLS Gen 1 details are validated in configuration validation
            AzureDataLakeStoreGen2Info adlsGen2Info = inputStorageInfo as AzureDataLakeStoreGen2Info;

            if (adlsGen2Info != null)
            {
                Assert.NotNull(convertedStorageProfile);
                Assert.NotNull(convertedStorageProfile.Storageaccounts);
                Assert.NotEmpty(convertedStorageProfile.Storageaccounts);
                StorageAccount defaultStorageAccount = convertedStorageProfile.Storageaccounts.Single(storageAccount => storageAccount.IsDefault.Value);
                Assert.Equal(adlsGen2Info.StorageAccountName, defaultStorageAccount.Name);
                Assert.Equal(adlsGen2Info.StorageAccountKey, defaultStorageAccount.Key);
                Assert.Equal(adlsGen2Info.StorageFileSystem, defaultStorageAccount.FileSystem);
            }
        }