你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzEventHubNamespace
创建事件中心命名空间。
语法
New-AzEventHubNamespace
[-ResourceGroupName] <String>
[-Name] <String>
[-Location] <String>
[[-SkuName] <String>]
[[-SkuCapacity] <Int32>]
[[-Tag] <Hashtable>]
[-EnableKafka]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzEventHubNamespace
[-ResourceGroupName] <String>
[-Name] <String>
[-Location] <String>
[[-SkuName] <String>]
[[-SkuCapacity] <Int32>]
[[-Tag] <Hashtable>]
[-EnableAutoInflate]
[[-MaximumThroughputUnits] <Int32>]
[-EnableKafka]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzEventHubNamespace cmdlet 创建事件中心类型的新命名空间。
示例
示例 1
PS C:\> New-AzEventHubNamespace -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location MyLocation
Name : MyNamespaceName
Id : /subscriptions/{subscriptionId}/resourceGroups/Default-EventHub-WestCentralUS/providers/Microsoft.EventHub/namespaces/MyNamespaceName
ResourceGroupName : Default-EventHub-WestCentralUS
Location : West US
Sku : Name : Standard , Capacity : 1 , Tier : Standard
Tags :
ProvisioningState : Succeeded
Status : Active
CreatedAt : 5/24/2019 12:47:27 AM
UpdatedAt : 5/24/2019 12:48:14 AM
ServiceBusEndpoint : #########
Enabled : True
IsAutoInflateEnabled : False
MaximumThroughputUnits : 0
在资源组“MyResourceGroupName”的指定地理位置“MyLocation”中创建事件中心命名空间“MyNamespaceName”。
示例 2
PS C:\> New-AzEventHubNamespace -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location MyLocation -EnableAutoInflate -MaximumThroughputUnits 10
Name : MyNamespaceName
Id : /subscriptions/{subscriptionId}/resourceGroups/Default-EventHub-WestCentralUS/providers/Microsoft.EventHub/namespaces/MyNamespaceName
ResourceGroupName : Default-EventHub-WestCentralUS
Location : West US
Sku : Name : Standard , Capacity : 1 , Tier : Standard
Tags :
ProvisioningState : Succeeded
Status : Active
CreatedAt : 5/24/2019 12:47:27 AM
UpdatedAt : 5/24/2019 12:48:14 AM
ServiceBusEndpoint : #########
Enabled : True
IsAutoInflateEnabled : True
MaximumThroughputUnits : 10
在指定的地理位置“MyLocation”中创建事件中心命名空间“MyNamespaceName”,在资源组“MyResourceGroupName”和 AutoInflate 中启用了 MaximumThroughputUnits 10。
示例 3 - 已启用 Kafka 的命名空间
PS C:\> New-AzEventHubNamespace -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location MyLocation -EnableAutoInflate -EnableKafka
Name : MyNamespaceName
Id : /subscriptions/{subscriptionId}/resourceGroups/Default-EventHub-WestCentralUS/providers/Microsoft.EventHub/namespaces/MyNamespaceName
ResourceGroupName : Default-EventHub-WestCentralUS
Location : West US
Sku : Name : Standard , Capacity : 1 , Tier : Standard
Tags :
ProvisioningState : Succeeded
Status : Active
CreatedAt : 5/24/2019 12:47:27 AM
UpdatedAt : 5/24/2019 12:48:14 AM
ServiceBusEndpoint : #########
Enabled : True
IsAutoInflateEnabled : True
MaximumThroughputUnits : 12
在指定的地理位置“MyLocation”中创建事件中心命名空间“MyNamespaceName”,并在启用了 Kafka 和 AutoInflate 的资源组“MyResourceGroupName”中创建一个。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnableAutoInflate
指示是否启用 AutoInflate
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-EnableKafka
启用或禁用 Kafka for namespace
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
EventHub Namespace位置。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-MaximumThroughputUnits
启用 AutoInflate 时吞吐量单位的上限,值应在 0 到 20 个吞吐量单位内。
类型: | Nullable<T>[Int32] |
Position: | 7 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Name
EventHub Namespace名称。
类型: | String |
别名: | NamespaceName |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
资源组名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SkuCapacity
eventhub 吞吐量单位。
类型: | Nullable<T>[Int32] |
Position: | 4 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-SkuName
Namespace Sku 名称。
类型: | String |
接受的值: | Basic, Standard, Premium |
Position: | 3 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Tag
表示资源标记的哈希表。
类型: | Hashtable |
Position: | 5 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
Nullable<T>[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]