Edit

Share via


Set-AzHDInsightGatewayCredential

Sets the gateway HTTP credentials of an Azure HDInsight cluster.

Syntax

SetByNameParameterSet (Default)

Set-AzHDInsightGatewayCredential
    [-Name] <String>
    [[-HttpCredential] <PSCredential>]
    [-ResourceGroupName <String>]
    [-EntraUserIdentity <String[]>]
    [-EntraUserFullInfo <Hashtable[]>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByInputObjectParameterSet

Set-AzHDInsightGatewayCredential
    [[-HttpCredential] <PSCredential>]
    -InputObject <AzureHDInsightCluster>
    [-EntraUserIdentity <String[]>]
    [-EntraUserFullInfo <Hashtable[]>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByResourceIdParameterSet

Set-AzHDInsightGatewayCredential
    [[-HttpCredential] <PSCredential>]
    -ResourceId <String>
    [-EntraUserIdentity <String[]>]
    [-EntraUserFullInfo <Hashtable[]>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzHDInsightGatewayCredential cmdlet sets gateway credential of an Azure HDInsight cluster.

Examples

Example 1: Set Gateway Credential for an HDInsight Cluster by Name Parameter Set

# Cluster info
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential

Set-AzHDInsightGatewayCredential `
            -ClusterName $clusterName `
            -HttpCredential $clusterCreds

Example 2: Set Gateway Credential for an HDInsight Cluster by ResourceId Parameter Set

Set-AzHDInsightGatewayCredential `
            -ResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/your-hadoop-001" `
            -HttpCredential $clusterCreds

Example 3: Set Gateway Credential for an HDInsight Cluster by InputObject Parameter Set

# Cluster info
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential

Get-AzHDInsightCluster -ClusterName $clusterName | Set-AzHDInsightGatewayCredential `
            -HttpCredential $clusterCreds

Example 4: Set Gateway Entra Users for an HDInsight Cluster by EntraUser Full Info

# Cluster info
$clusterName = "your-hadoop-001"
$entraUserFullInfo = @(@{ObjectId = "ObjectId1"; Upn = "Upn1"; DisplayName = "DisplayName1"},@{ObjectId = "ObjectId2"; Upn = "Upn2"; DisplayName = "DisplayName2"})

Set-AzHDInsightGatewayCredential `
            -ClusterName $clusterName `
            -EntraUserFullInfo $entraUserFullInfo

To use the -EntraUserFullInfo parameter, you must provide each user's ObjectId, Upn, and DisplayName. This information can be obtained either through the Azure Portal by viewing the user's profile under Microsoft Entra ID > Users, or programmatically using the Get-AzADUser cmdlet from the Az.Resources module in PowerShell. For example: Get-AzADUser -UserPrincipalName "user@contoso.com" returns fields such as Id (ObjectId), UserPrincipalName (Upn), and DisplayName. For more details, refer to the official documentation: Get-AzADUser.

Example 5: Set Gateway Entra Users for an HDInsight Cluster by ObjectId or Upn

# Cluster info
$clusterName = "your-hadoop-001"
$entraUserIdentity = @("user1@contoso.com","user2@contoso.com","objectid3","objectid4")

Set-AzHDInsightGatewayCredential `
            -ClusterName $clusterName `
            -EntraUserIdentity $entraUserIdentity

Parameters

-AsJob

Run cmdlet in the background.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
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

-EntraUserFullInfo

Gets or sets a list of Entra users as an array of hashtables. Each hashtable should contain keys such as ObjectId, Upn, and DisplayName.

Parameter properties

Type:

Hashtable[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-EntraUserIdentity

Gets or sets the Entra user data. Accepts one or more ObjectId/Upn values.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-HttpCredential

Gets or sets the login for the cluster's user.

Parameter properties

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

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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

SetByInputObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Gets or sets the name of the cluster.

Parameter properties

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

Parameter sets

SetByNameParameterSet
Position:0
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

SetByNameParameterSet
Position:Named
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

SetByResourceIdParameterSet
Position:Named
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

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

None

Outputs

AzureHDInsightGatewaySettings