次の方法で共有


Add-AzHDInsightStorage

クラスター構成オブジェクトに Azure Storage キーを追加します。

構文

Add-AzHDInsightStorage
   [-Config] <AzureHDInsightConfig>
   [-StorageAccountName] <String>
   [-StorageAccountKey] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

説明

Add-AzHDInsightStorage コマンドレットは、New-AzHDInsightClusterConfig コマンドレットによって作成された Azure HDInsight 構成オブジェクトに Azure Storage アカウント エントリを追加します。

例 1: クラスター構成オブジェクトに Azure ストレージ キーを追加する

# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value


$storageContainer = "container001"

# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential

# If the cluster's resource group doesn't exist yet, run:
#   New-AzResourceGroup -Name $clusterResourceGroupName -Location $location

# Second storage account info
$secondStorageAccountResourceGroupName = "Group"
$secondStorageAccountName = "yourstorageacct002"
$secondStorageAccountKey = Get-AzStorageAccountKey `
-ResourceGroupName $secondStorageAccountResourceGroupName `
            -Name $secondStorageAccountName | ForEach-Object{ $_.Key1 }

# Create the cluster
New-AzHDInsightClusterConfig `
            | Add-AzHDInsightStorage `
                -StorageAccountName "$secondStorageAccountName.blob.core.contoso.net" `
                -StorageAccountKey $key2 `
            | New-AzHDInsightCluster `
                -ClusterType Hadoop `
                -OSType Windows `
                -ClusterSizeInNodes 4 `
                -ResourceGroupName $clusterResourceGroupName `
                -ClusterName $clusterName `
                -HttpCredential $clusterCreds `
                -Location $location `
                -StorageAccountResourceId $storageAccountResourceId `
                -StorageAccountKey $storageAccountKey `
                -StorageContainer $storageContainer

このコマンドは、your-hadoop-001 という名前の HDInsight 構成に BLOB ストレージ アカウント エントリを追加します。

パラメーター

-Config

このコマンドレットが変更する HDInsight クラスター構成オブジェクトを指定します。 このオブジェクトは、New-AzHDInsightClusterConfig コマンドレットによって作成されます。

型:AzureHDInsightConfig
配置:0
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-DefaultProfile

Azure との通信に使用される資格情報、アカウント、テナント、サブスクリプション

型:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-StorageAccountKey

新しいクラスターに追加するストレージ アカウントのストレージ アカウント キーを指定します。

型:String
配置:2
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-StorageAccountName

クラスターに追加するストレージ アカウントのストレージ アカウント名を指定します。

型:String
配置:1
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

入力

AzureHDInsightConfig

出力

AzureHDInsightConfig