The Az.EventHub
PowerShell module version 9.0.0 of Azure PowerShell that would be released in October introduces improvised cmdlets for public use.
These changes are focused towards making the PowerShell use more productive and seamless for the end users.
The following example installs the latest version of the Az.Eventhub
Azure PowerShell module.
Install-Module -Name Az.EventHub -Repository PSGallery -Scope CurrentUser
Until Module 8.3.0, -InputObject supports passing an in memory object to additional cmdlet in pipeline. Due to above design, updating resources becomes a multi step approach.
With the new module release, -InputObject parameter set would be changing for a seamless experience.
In contrast to earlier approach, -InputObject would now support object of corresponding input type as well as resource Id directly to the cmdlet. This would make cmdlet usage fairly easy and faster as compared to the old approach.
Below example shows the difference in -InputObject Usage:
Below example shows how to update capture description on existing event hub with Module version 8.3.0 or older
$createdEventHub = Get-AzEventHub -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -Name MyCreatedEventHub
$createdEventHub.CaptureDescription = New-Object -TypeName Microsoft.Azure.Commands.EventHub.Models.PSCaptureDescriptionAttributes
$createdEventHub.CaptureDescription.Enabled = $true
$createdEventHub.CaptureDescription.IntervalInSeconds = 120
$createdEventHub.CaptureDescription.Encoding = "Avro"
$createdEventHub.CaptureDescription.SizeLimitInBytes = 10485763
$createdEventHub.CaptureDescription.Destination.Name = "EventHubArchive.AzureBlockBlob"
$createdEventHub.CaptureDescription.Destination.BlobContainer = "container"
$createdEventHub.CaptureDescription.Destination.ArchiveNameFormat = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
$createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/{SubscriptionId}/resourceGroups/MyResourceGroupName/providers/Microsoft.ClassicStorage/storageAccounts/teststorage"
Set-AzEventHub -ResourceGroupName MyResourceGroupName -Namespace MyNamespaceName -Name MyEventHubName -InputObject $createdEventHub
Below example shows how to update capture description on existing event hub with starting with / after Module version 9.0.0
$eventhub = Get-AzEventHub -InputObject <ResourceID of event hub>
Set-AzEventHub -InputObject $eventhub -CaptureEnabled -SizeLimitInBytes 10485763 -IntervalInSeconds 120 -Encoding Avro -DestinationName EventHubArchive.AzureBlockBlob -BlobContainer container -ArchiveNameFormat "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" -StorageAccountResourceId "/subscriptions/{SubscriptionId}/resourceGroups/MyResourceGroupName/providers/Microsoft.ClassicStorage/storageAccounts/teststorage"
- Accept pipeline Input for InputObject (InputObject pipelining) can be implemented in the following manner:
Get-AzEventHub -InputObject <ResourceId of the eventhub> | Set-AzEventHub -MessageRetentionInDays 6
-
Property pipelining would be disabled. In other words, none of the cmdlet parameters apart from
-InputObject
would accept pipeline input. -
-InputObject
parameter would no longer support parameter aliasing.
- Positional binding is not supported.
With new release,below cmdlets are marked to be deprecated:
- Add-AzEventHubIPRule
- Add-AzEventHubVirtualNetworkRule
- Remove-AzEventHubIPRule
- Remove-AzEventHubVirtualNetworkRule
- Remove-AzEventHubNetworkRuleSet
Use Set-AzEventHubNetworkRuleSet to add/remove IP or virtual network rules.
Below list talks about the changes to existing cmdlets in detailed manner:
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubApplicationGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubApplicationGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup
. -ThrottlingPolicyConfig
would be renamed to-Policy
and type would change fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubThrottlingPolicyConfigAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroupPolicy[]
. New-AzEventHubThrottlingPolicyConfig can still be used to construct this object.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubApplicationGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup
. -ThrottlingPolicyConfig
would be renamed to-Policy
and type would change fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubThrottlingPolicyConfigAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroupPolicy[]
. New-AzEventHubThrottlingPolicyConfig can still be used to construct this object.-InputObject
parameter set would have a change in behaviour. Refer the section to know more.-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubThrottlingPolicyConfigAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IThrottlingPolicy
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubApplicationGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
-
Input type of parameter
-InputObject
and Output type has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSNetworkRuleSetAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.INetworkRuleSet
. -
Parameter
-IPRule
is changing type fromMicrosoft.Azure.Commands.EventHub.Models.PSNWRuleSetIpRulesAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.INwRuleSetIPRules[]
. Please useNew-AzEventHubIPRuleConfig
cmdlet to construct an in-memory object which can be fed as input to-IPRule
. -
Parameter
-VirtualNetworkRule
is changing type fromMicrosoft.Azure.Commands.EventHub.Models.PSNWRuleSetVirtualNetworkRulesAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.INwRuleSetVirtualNetworkRules[]
. Please useNew-AzEventHubVirtualNetworkRuleConfig
cmdlet to construct an in-memory object which can then be fed as input to-VirtualNetworkRule
. -
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided to-InputObject
parameter. -
-InputObject
parameter set would have a change in behaviour. Refer the section to know more.
- Output type has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSNetworkRuleSetAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.INetworkRuleSet
.
- Output type has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAuthorizationRule
.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAuthorizationRule
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-AuthRuleObj
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSSharedAccessAuthorizationRuleAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAuthorizationRule
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSListKeysAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAccessKeys
. - Parameter
-ResourceGroupName
would no longer support alias-ResourceGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSListKeysAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAccessKeys
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSConsumerGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IConsumerGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSConsumerGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IConsumerGroup
. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSConsumerGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IConsumerGroup
. - Parameter
-MaxCount
has been removed. Use-Skip
and-Top
pagination use case.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSConsumerGroupAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IConsumerGroup
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubClusterAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ICluster
. -ResourceId
would be removed as it is not supported for Creation operation and is available for use after resource is created.
- Input type of parameter
-InputObject
and Output type of the cmdlet has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubClusterAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ICluster
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.-InputObject
parameter set would have a change in behaviour. Refer the section to know more.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubClusterAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ICluster
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubClusterAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ICluster
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models. PSEventHubsAvailableCluster[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAvailableCluster
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
. -InputObject
would be removed as it is not supported for Creation operation and is available for use after resource is created.
- Input type of parameter
-InputObject
and output type of the cmdlet have been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
. CaptureDescription class data members would be flattened and would directly be accessible as data members within Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
. Please refer to example on top to know more. -InputObject
parameter set would have a change in behaviour. Refer the section to know more.-InputObject
parameter would no longer support alias-EventHubObj
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
-
Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
. -
Parameter
-MaxCount
has been removed. Use-Skip
and-Top
for pagination use case. -
Parameter
-NamespaceObject
is being replaced by-InputObject
of typeMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEventhub
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubPrivateEndpointConnectionAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IPrivateEndpointConnection
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubPrivateLinkResourceAttributes[]
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IPrivateLinkResourcesListResult
.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSNamespaceAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
. - Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSNamespaceAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
. -InputObject
and-ResourceId
are not supported during resource creation, hence are being removed.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
.
-ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubDRConfigurationAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IArmDisasterRecovery
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubsSchemaRegistryAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ISchemaGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models.PSEventHubsSchemaRegistryAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ISchemaGroup
. -ResourceId
parameter would be deprecated. Henceforth, resource id can be provided as input to-InputObject
parameter.
- Input type of parameter
-InputObject
has been changed fromMicrosoft.Azure.Commands.EventHub.Models.PSEventHubsSchemaRegistryAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ISchemaGroup
.
- Output type of the cmdlet has been changed from
Microsoft.Azure.Commands.EventHub.Models. PSCheckNameAvailabilityResultAttributes
toMicrosoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.ICheckNameAvailabilityResult
.