protected override void ProcessRecord()
        {
            if (ParameterSetName.Equals(BlobParameterSetName, StringComparison.InvariantCultureIgnoreCase))
            {
                var toAdd = new StorageAccount
                {
                    Name = Blob,
                    Properties = new StorageAccountProperties
                    {
                        AccessKey = AccessKey
                    }
                };

                DataLakeAnalyticsClient.SetStorageAccount(ResourceGroupName, Account, toAdd);
            }
            else if (Default)
            {
                var toAdd = new DataLakeStoreAccount
                {
                    Name = DataLakeStore
                };

                DataLakeAnalyticsClient.SetDefaultDataLakeStoreAccount(ResourceGroupName, Account, toAdd);
            }
            else
            {
                WriteWarning(Resources.InvalidDataLakeStoreAccountModificationAttempt);
            }
        }
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName.Equals(BlobParameterSetName, StringComparison.InvariantCultureIgnoreCase))
            {
                var toAdd = new StorageAccount
                {
                    Name = Blob,
                    Properties = new StorageAccountProperties
                    {
                        AccessKey = AccessKey
                    }
                };

                DataLakeAnalyticsClient.AddStorageAccount(ResourceGroupName, Account, toAdd);
            }
            else
            {
                var toAdd = new DataLakeStoreAccount
                {
                    Name = DataLakeStore
                };

                DataLakeAnalyticsClient.AddDataLakeStoreAccount(ResourceGroupName, Account, toAdd);

                if (Default)
                {
                    DataLakeAnalyticsClient.SetDefaultDataLakeStoreAccount(ResourceGroupName, Account, toAdd);
                }
            }
        }
コード例 #3
0
        public void SetStorageAccount(string resourceGroupName, string accountName, StorageAccount storageToSet)
        {
            if (string.IsNullOrEmpty(resourceGroupName))
            {
                resourceGroupName = GetResourceGroupByAccountName(accountName);
            }

            var storageParams = new AddStorageAccountParameters
            {
                Properties = storageToSet.Properties
            };

            _accountClient.DataLakeAnalyticsAccount.UpdateStorageAccount(resourceGroupName, accountName,
                storageToSet.Name, storageParams);
        }