Edit

Share via


Enable-AzHDInsightAzureMonitor

Enables Azure Monitor in a specified HDInsight cluster.

Syntax

EnableByNameParameterSet (Default)

Enable-AzHDInsightAzureMonitor
    [[-ResourceGroupName] <String>]
    [-ClusterName] <String>
    [-WorkspaceId] <String>
    [-PrimaryKey] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

EnableByResourceIdParameterSet

Enable-AzHDInsightAzureMonitor
    [-ResourceId] <String>
    [-WorkspaceId] <String>
    [-PrimaryKey] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

EnableByInputObjectParameterSet

Enable-AzHDInsightAzureMonitor
    [-InputObject] <AzureHDInsightCluster>
    [-WorkspaceId] <String>
    [-PrimaryKey] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet Enable-AzHDInsightAzureMonitor enables Azure Monitor in a specified HDInsight cluster.

Examples

Example 1

# Cluster info
$clusterName = "your-hadoop-001"
$resourceGroupName = "Group"
$workspaceId = "your-workspace-id"
$primaryKey = "your-primary-key"
Enable-AzHDInsightAzureMonitor -ClusterName $clusterName -ResourceGroupName $resourceGroupName -WorkspaceId $workspaceId -PrimaryKey $primaryKey

This cmdlet enables the azure monitor in a specified HDInsight cluster.

Example 2

# Cluster info
$clusterName = "your-hadoop-001"
$cluster=Get-AzHDInsightCluster -ClusterName $clusterName
$workspaceId = "your-workspace-id"
$primaryKey = "your-primary-key"
$cluster | Enable-AzHDInsightAzureMonitor -WorkspaceId $workspaceId -PrimaryKey $primaryKey

This cmdlet enables the azure monitor in a specified HDInsight cluster with pipeline.

Parameters

-ClusterName

Gets or sets the name of the cluster.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableByNameParameterSet
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Gets or sets the input object.

Parameter properties

Type:AzureHDInsightCluster
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableByInputObjectParameterSet
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-PrimaryKey

Gets to sets the primary key of the Log Analytics workspace.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Gets or sets the name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableByNameParameterSet
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

Gets or sets the resource id.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableByResourceIdParameterSet
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkspaceId

Gets or sets the ID of the Log Analytics workspace.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

AzureHDInsightCluster

Outputs

Boolean