Dela via


Set-AzEventHub

Uppdaterar den angivna händelsehubben.

Syntax

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

Description

Set-AzEventHub-cmdleten uppdaterar egenskaperna för den angivna händelsehubben.

Exempel

Exempel 1

Följ stegen nedan om du vill uppdatera Eventhub med egenskaper för avbildningsbeskrivning.

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

Uppdaterar eventhubben "MyEventHubName" som representeras av objektet "MyCreatedEventHub" och anger meddelandekvarhållningsperioden till 4 dagar, antalet partitioner till 2 och CaptureDescription-egenskaper

Exempel 2

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

Uppdaterar eventhubben "MyEventHubName" som representeras av objektet "MyCreatedEventHub" och anger kvarhållningsperioden för meddelanden till 4 dagar och antalet partitioner till 2.

Parametrar

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Typ:SwitchParameter
Alias:cf
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Typ:IAzureContextContainer
Alias:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-InputObject

EventHub-objekt

Typ:PSEventHubAttributes
Alias:EventHubObj
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-messageRetentionInDays

Kvarhållning av eventhub-meddelanden i dagar

Typ:Nullable<T>[Int64]
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-Name

Namn på namnområde

Typ:String
Alias:EventHubName
Position:2
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-Namespace

Namn på namnområde

Typ:String
Alias:NamespaceName
Position:1
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-partitionCount

Eventhub PartitionCount

Typ:Nullable<T>[Int64]
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-ResourceGroupName

Namnet på resursgruppen

Typ:String
Position:0
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-WhatIf

Visar vad som skulle hända om cmdleten kördes. Cmdleten körs inte.

Typ:SwitchParameter
Alias:wi
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

Indata

String

PSEventHubAttributes

Nullable<T>[[System.Int64, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Utdata

PSEventHubAttributes