Set-AzEventHubNamespace
Aggiornamenti uno spazio dei nomi EventHub
Sintassi
Set-AzEventHubNamespace
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-AlternateName <String>]
[-DisableLocalAuth]
[-KeyVaultProperty <IKeyVaultProperties[]>]
[-RequireInfrastructureEncryption]
[-IdentityType <ManagedServiceIdentityType>]
[-UserAssignedIdentityId <String[]>]
[-EnableAutoInflate]
[-MaximumThroughputUnit <Int32>]
[-MinimumTlsVersion <String>]
[-PublicNetworkAccess <PublicNetworkAccess>]
[-SkuCapacity <Int32>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzEventHubNamespace
-InputObject <IEventHubIdentity>
[-AlternateName <String>]
[-DisableLocalAuth]
[-KeyVaultProperty <IKeyVaultProperties[]>]
[-RequireInfrastructureEncryption]
[-IdentityType <ManagedServiceIdentityType>]
[-UserAssignedIdentityId <String[]>]
[-EnableAutoInflate]
[-MaximumThroughputUnit <Int32>]
[-MinimumTlsVersion <String>]
[-PublicNetworkAccess <PublicNetworkAccess>]
[-SkuCapacity <Int32>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Descrizione
Aggiornamenti uno spazio dei nomi EventHub
Esempio
Esempio 1: Aggiungere un oggetto ManagedIdentity a uno spazio dei nomi EventHub
$eventHubNamespace = Get-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace
$identityId = $eventHubNamespace.UserAssignedIdentity.Keys
$identityId += "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mySecondIdentity"
Set-AzEventHubNamespace -InputObject $eventHubNamespace -UserAssignedIdentityId $identityId
AlternateName :
ClusterArmId :
CreatedAt : 11/17/2022 2:56:32 PM
DisableLocalAuth : False
EnableAutoInflate : False
Id : /subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/myNamespace
IdentityType : UserAssigned
KafkaEnabled : True
KeySource : Microsoft.KeyVault
KeyVaultProperty : {{
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key1",
"keyVaultUri": "https://testkeyvault.vault.azure.net/",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key2",
"keyVaultUri": "https://testkeyvault.vault.azure.net/",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key3",
"keyVaultUri": "https://testkeyvault.vault.azure.net/",
"keyVersion": ""
}}
Location : North Europe
MaximumThroughputUnit : 0
MetricId : 000000000000000:myNamespace
MinimumTlsVersion : 1.2
Name : myNamespace
PrincipalId :
PrivateEndpointConnection :
ProvisioningState : Succeeded
PublicNetworkAccess : Enabled
RequireInfrastructureEncryption : False
ResourceGroupName : myResourceGroup
ServiceBusEndpoint : https://myNamespace.servicebus.windows.net:443/
SkuCapacity : 1
SkuName : Premium
SkuTier : Premium
Status : Active
Tag : {
}
TenantId :
Type : Microsoft.EventHub/Namespaces
UpdatedAt : 11/17/2022 3:03:50 PM
UserAssignedIdentity : {
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity": {
},
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mySecondIdentity": {
}
}
ZoneRedundant : True
Il tipo di output dei cmdlet IEhNamespace
New e Set ha una proprietà denominata UserAssignedIdentity
che è una tabella hash.
Le chiavi di questa tabella sono l'ID risorsa delle identità gestite di cui fa parte lo spazio dei nomi.
Per aggiungere o rimuovere un IdentityId, estrarre le chiavi dalla tabella hash, che genera una matrice di stringhe che possono quindi essere sottoposte a query e inserite come input per impostare il cmdlet come illustrato in precedenza.
Esempio 2: Aggiungere un keyVaultProperty a uno spazio dei nomi EventHub esistente
$eventHubNamespace = Get-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace
$newKeyVaultProperty = New-AzEventHubKeyVaultPropertiesObject -KeyName key3 -KeyVaultUri https://testkeyvault.vault.azure.net -UserAssignedIdentity "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
$eventHubNamespace.KeyVaultProperty += $newKeyVaultProperty
Set-AzEventHubNamespace -InputObject $eventHubNamespace -KeyVaultProperty $eventHubNamespace.KeyVaultProperty
AlternateName :
ClusterArmId :
CreatedAt : 11/17/2022 2:56:32 PM
DisableLocalAuth : False
EnableAutoInflate : False
Id : /subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/myNamespace
IdentityType : UserAssigned
KafkaEnabled : True
KeySource : Microsoft.KeyVault
KeyVaultProperty : {{
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key1",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key2",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key3",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}}
Location : North Europe
MaximumThroughputUnit : 0
MetricId : 000000000000000:myNamespace
MinimumTlsVersion : 1.2
Name : myNamespace
PrincipalId :
PrivateEndpointConnection :
ProvisioningState : Succeeded
PublicNetworkAccess : Enabled
RequireInfrastructureEncryption : False
ResourceGroupName : myResourceGroup
ServiceBusEndpoint : https://myNamespace.servicebus.windows.net:443/
SkuCapacity : 1
SkuName : Premium
SkuTier : Premium
Status : Active
Tag : {
}
TenantId :
Type : Microsoft.EventHub/Namespaces
UpdatedAt : 11/17/2022 3:03:50 PM
UserAssignedIdentity : {
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity": {
},
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mySecondIdentity": {
}
}
ZoneRedundant : True
Aggiunge un nuovo KeyVaultProperty allo spazio dei nomi myNamespace
EventHub .
Esempio 3: Rimuovere keyVaultProperty da uno spazio dei nomi EventHub esistente
$eventHubNamespace = Get-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace
# Remove the last KeyVaultProperty from the list of KeyVaultProperties
$eventHubNamespace.KeyVaultProperty = $eventHubNamespace.KeyVaultProperty | Where-Object { $_ -ne $eventHubNamespace.KeyVaultProperty[2] }
Set-AzEventHubNamespace -InputObject $eventHubNamespace -KeyVaultProperty $eventHubNamespace.KeyVaultProperty
AlternateName :
ClusterArmId :
CreatedAt : 11/17/2022 2:56:32 PM
DisableLocalAuth : False
EnableAutoInflate : False
Id : /subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/myNamespace
IdentityType : UserAssigned
KafkaEnabled : True
KeySource : Microsoft.KeyVault
KeyVaultProperty : {{
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key1",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key2",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}}
Location : North Europe
MaximumThroughputUnit : 0
MetricId : 000000000000000:myNamespace
MinimumTlsVersion : 1.2
Name : myNamespace
PrincipalId :
PrivateEndpointConnection :
ProvisioningState : Succeeded
PublicNetworkAccess : Enabled
RequireInfrastructureEncryption : False
ResourceGroupName : myResourceGroup
ServiceBusEndpoint : https://myNamespace.servicebus.windows.net:443/
SkuCapacity : 1
SkuName : Premium
SkuTier : Premium
Status : Active
Tag : {
}
TenantId :
Type : Microsoft.EventHub/Namespaces
UpdatedAt : 11/17/2022 3:03:50 PM
UserAssignedIdentity : {
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity": {
},
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mySecondIdentity": {
}
}
ZoneRedundant : True
Rimuove un nuovo KeyVaultProperty nello spazio dei nomi myNamespace
EventHub.
Esempio 4: Impostare DisableLocalAuth su true in uno spazio dei nomi EventHub esistente
Set-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace -DisableLocalAuth
AlternateName :
ClusterArmId :
CreatedAt : 11/17/2022 2:56:32 PM
DisableLocalAuth : False
EnableAutoInflate : False
Id : /subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/myNamespace
IdentityType : UserAssigned
KafkaEnabled : True
KeySource : Microsoft.KeyVault
KeyVaultProperty : {{
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key1",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}, {
"identity": {
"userAssignedIdentity": "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
},
"keyName": "key2",
"keyVaultUri": "https://testkeyvault.vault.azure.net",
"keyVersion": ""
}}
Location : North Europe
MaximumThroughputUnit : 0
MetricId : 000000000000000:myNamespace
MinimumTlsVersion : 1.2
Name : myNamespace
PrincipalId :
PrivateEndpointConnection :
ProvisioningState : Succeeded
PublicNetworkAccess : Enabled
RequireInfrastructureEncryption : False
ResourceGroupName : myResourceGroup
ServiceBusEndpoint : https://myNamespace.servicebus.windows.net:443/
SkuCapacity : 1
SkuName : Premium
SkuTier : Premium
Status : Active
Tag : {
}
TenantId :
Type : Microsoft.EventHub/Namespaces
UpdatedAt : 11/17/2022 3:03:50 PM
UserAssignedIdentity : {
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity": {
},
"/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mySecondIdentity": {
}
}
ZoneRedundant : True
Imposta DisableLocalAuth
su true in uno spazio dei nomi myNamespace
EventHub.
Esempio 5: # Creare uno spazio dei nomi con UserAssignedIdentity e usare il cmdlet Set-Az per impostare IdentityType su Nessuno.
$eventHubNamespace = New-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace -SkuName Premium -Location northeurope -IdentityType UserAssigned -UserAssignedIdentityId "/subscriptions/000000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myFirstIdentity"
$eventHubNamespace = Set-AzEventHubNamespace -ResourceGroupName myResourceGroup -Name myNamespace -IdentityType None -UserAssignedIdentityId @()
AlternateName :
ClusterArmId :
CreatedAt : 11/21/2022 3:21:29 PM
DisableLocalAuth : False
EnableAutoInflate : False
Id : /subscriptions/000000000000000/resourceGroups/myResourceGroup/provide
rs/Microsoft.EventHub/namespaces/myNamespace
IdentityType :
KafkaEnabled : True
KeySource :
KeyVaultProperty :
Location : North Europe
MaximumThroughputUnit : 0
MetricId : 000000000000000:myNamespace
MinimumTlsVersion : 1.2
Name : myNamespace
PrincipalId :
PrivateEndpointConnection :
ProvisioningState : Succeeded
PublicNetworkAccess : Enabled
RequireInfrastructureEncryption :
ResourceGroupName : myResourceGroup
ServiceBusEndpoint : https://myNamespace.servicebus.windows.net:443/
SkuCapacity : 1
SkuName : Premium
SkuTier : Premium
Status : Active
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
TenantId :
Type : Microsoft.EventHub/Namespaces
UpdatedAt : 11/21/2022 3:31:03 PM
UserAssignedIdentity : {
}
ZoneRedundant : True
Creare uno spazio dei nomi con UserAssignedIdentity e usare il cmdlet Set-Az per impostare IdentityType su Nessuno.
Parametri
-AlternateName
Nome alternativo specificato quando i nomi alias e spazio dei nomi sono uguali
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AsJob
Eseguire il comando come processo
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Le credenziali, l’account, il tenant e la sottoscrizione usati per comunicare con Azure.
Type: | PSObject |
Aliases: | AzureRMContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableLocalAuth
Questa proprietà disabilita l'autenticazione sas per lo spazio dei nomi di Hub eventi.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableAutoInflate
Valore che indica se AutoInflate è abilitato per lo spazio dei nomi eventhub.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IdentityType
Tipo di identità del servizio gestito.
Type: | ManagedServiceIdentityType |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Parametro Identity. Per costruire, vedere la sezione NOTES per le proprietà INPUTOBJECT e creare una tabella hash.
Type: | IEventHubIdentity |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-KeyVaultProperty
Proprietà per configurare Crittografia per costruire, vedere la sezione NOTES per le proprietà KEYVAULTPROPERTY e creare una tabella hash.
Type: | IKeyVaultProperties[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaximumThroughputUnit
Limite massimo di unità elaborate quando l'aumento automatico è abilitato, il valore deve essere compreso tra 0 e 20 unità elaborate. ( '0' se AutoInflateEnabled = true)
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MinimumTlsVersion
Versione minima di TLS per il supporto del cluster, ad esempio '1.2'
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Nome dello spazio dei nomi EventHub.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublicNetworkAccess
Determina se il traffico è consentito in rete pubblica. Per impostazione predefinita, è abilitata.
Type: | PublicNetworkAccess |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequireInfrastructureEncryption
Abilitare la crittografia dell'infrastruttura (crittografia doppia)
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceGroupName
Nome del gruppo di risorse. Il nome non fa distinzione tra maiuscole e minuscole.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkuCapacity
Le unità elaborate di Hub eventi per i livelli Basic o Standard, dove il valore deve essere compreso tra 0 e 20 unità elaborate. Le unità Premium di Hub eventi per il livello Premium, dove il valore deve essere compreso tra 0 e 10 unità Premium.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SubscriptionId
ID della sottoscrizione di destinazione.
Type: | String |
Position: | Named |
Default value: | (Get-AzContext).Subscription.Id |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Tag
Tag dello spazio dei nomi EventHub.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserAssignedIdentityId
Proprietà per le identità assegnate dall'utente
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Input
Output
Note
ALIAS
Set-AzEventHubNamespaceV2
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per