Partilhar via


Set-AzEventHub

Updates the specified Event Hub.

Sintaxe

EventhubInputObjectSet

Set-AzEventHub
    [-ResourceGroupName] <String>
    [-Namespace] <String>
    [-Name] <String>
    [-InputObject <PSEventHubAttributes>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

EventhubPropertiesSet

Set-AzEventHub
    [-ResourceGroupName] <String>
    [-Namespace] <String>
    [-Name] <String>
    [-messageRetentionInDays <Int64>]
    [-partitionCount <Int64>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzEventHub cmdlet updates the properties of the specified Event Hub.

Exemplos

Example 1

To update Eventhub with Capture description properties, please follow the below steps.

PS C:\> $CreatedEventHub = Get-AzEventHub -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -Name MyEventHubName
PS C:\> $createdEventHub.CaptureDescription = New-Object -TypeName Microsoft.Azure.Commands.EventHub.Models.PSCaptureDescriptionAttributes
PS C:\> $createdEventHub.CaptureDescription.Enabled = $true
PS C:\> $createdEventHub.CaptureDescription.IntervalInSeconds  = 120
PS C:\> $createdEventHub.CaptureDescription.Encoding  = "Avro"
PS C:\> $createdEventHub.CaptureDescription.SizeLimitInBytes = 10485763
PS C:\> $createdEventHub.CaptureDescription.Destination.Name = "EventHubArchive.AzureBlockBlob"
PS C:\> $createdEventHub.CaptureDescription.Destination.BlobContainer = "container"
PS C:\> $createdEventHub.CaptureDescription.Destination.ArchiveNameFormat = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
PS C:\> $createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/{SubscriptionId}/resourceGroups/MyResourceGroupName/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage"
PS C:\> Set-AzEventHub -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -Name MyEventHubName -InputObject MyCreatedEventHub -messageRetentionInDays 4 -partitionCount 2

Updates the Event Hub `MyEventHubName` represented by the `MyCreatedEventHub` object, setting the message retention period to 4 days, the number of partitions to 2 and CaptureDescription properties

Example 2

PS C:\> Set-AzEventHub -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -Name MyEventHubName -InputObject MyCreatedEventHub -messageRetentionInDays 4 -partitionCount 2

Updates the Event Hub `MyEventHubName` represented by the `MyCreatedEventHub` object, setting the message retention period to 4 days, and the number of partitions to 2.

Parâmetros

-Confirm

Prompts you for confirmation before running the cmdlet.

Propriedades dos parâmetros

Tipo:SwitchParameter
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:cf

Conjuntos de parâmetros

(All)
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:False
Valor dos restantes argumentos:False

-DefaultProfile

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

Propriedades dos parâmetros

Tipo:IAzureContextContainer
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:AzContext, AzureRmContext, AzureCredential

Conjuntos de parâmetros

(All)
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:False
Valor dos restantes argumentos:False

-InputObject

EventHub object

Propriedades dos parâmetros

Tipo:PSEventHubAttributes
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:EventHubObj

Conjuntos de parâmetros

EventhubInputObjectSet
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-messageRetentionInDays

Eventhub Message Retention In Days

Propriedades dos parâmetros

Tipo:

Nullable<T>[Int64]

Default value:None
Suporta carateres universais:False
NãoMostrar:False

Conjuntos de parâmetros

EventhubPropertiesSet
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-Name

Namespace Name

Propriedades dos parâmetros

Tipo:String
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:EventHubName

Conjuntos de parâmetros

(All)
Position:2
Obrigatório:True
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-Namespace

Namespace Name

Propriedades dos parâmetros

Tipo:String
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:NamespaceName

Conjuntos de parâmetros

(All)
Position:1
Obrigatório:True
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-partitionCount

Eventhub PartitionCount

Propriedades dos parâmetros

Tipo:

Nullable<T>[Int64]

Default value:None
Suporta carateres universais:False
NãoMostrar:False

Conjuntos de parâmetros

EventhubPropertiesSet
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-ResourceGroupName

Resource Group Name

Propriedades dos parâmetros

Tipo:String
Default value:None
Suporta carateres universais:False
NãoMostrar:False

Conjuntos de parâmetros

(All)
Position:0
Obrigatório:True
Valor do pipeline:False
Valor do pipeline por nome de propriedade:True
Valor dos restantes argumentos:False

-WhatIf

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

Propriedades dos parâmetros

Tipo:SwitchParameter
Default value:None
Suporta carateres universais:False
NãoMostrar:False
Aliases:wi

Conjuntos de parâmetros

(All)
Position:Named
Obrigatório:False
Valor do pipeline:False
Valor do pipeline por nome de propriedade:False
Valor dos restantes argumentos: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.

Entradas

String

PSEventHubAttributes

Nullable<T>

Saídas

PSEventHubAttributes