New-AzureRmVirtualHubVnetConnection
Cmdlet New-AzureRmVirtualHubVnetConnection membuat sumber daya HubVirtualNetworkConnection yang mengintip Virtual Network ke Azure Virtual Hub.
Peringatan
Modul AzureRM PowerShell telah resmi tidak digunakan lagi per 29 Februari 2024. Pengguna disarankan untuk bermigrasi dari AzureRM ke modul Az PowerShell untuk memastikan dukungan dan pembaruan yang berkelanjutan.
Meskipun modul AzureRM mungkin masih berfungsi, modul tersebut tidak lagi dipertahankan atau didukung, menempatkan penggunaan berkelanjutan berdasarkan kebijaksanaan dan risiko pengguna. Silakan merujuk ke sumber daya migrasi kami untuk panduan tentang transisi ke modul Az.
Sintaks
New-AzureRmVirtualHubVnetConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmVirtualHubVnetConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-RemoteVirtualNetworkId <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmVirtualHubVnetConnection
-ParentObject <PSVirtualHub>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmVirtualHubVnetConnection
-ParentObject <PSVirtualHub>
-Name <String>
-RemoteVirtualNetworkId <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmVirtualHubVnetConnection
-ParentResourceId <String>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmVirtualHubVnetConnection
-ParentResourceId <String>
-Name <String>
-RemoteVirtualNetworkId <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet New-AzureRmVirtualHubVnetConnection membuat sumber daya HubVirtualNetworkConnection yang mengintip Virtual Network ke Azure Virtual Hub.
Contoh
Contoh 1
PS C:\> New-AzureRmResourceGroup -Location "West US" -Name "testRG"
PS C:\> $frontendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24"
PS C:\> $backendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24"
PS C:\> $remoteVirtualNetwork = New-AzureRmVirtualNetwork -Name "MyVirtualNetwork" -ResourceGroupName "testRG" -Location "West US" -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet
PS C:\> $virtualWan = New-AzureRmVirtualWan -ResourceGroupName "testRG" -Name "myVirtualWAN" -Location "West US"
PS C:\> New-AzureRmVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.1.0/24"
PS C:\> New-AzureRmVirtualHubVnetConnection -ResourceGroupName "testRG" -VirtualHubName "westushub" -Name "testvnetconnection" -RemoteVirtualNetwork $remoteVirtualNetwork
Name : testvnetconnection
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub/hubVirtualNetworkConnections/testvnetconnection
RemoteVirtualNetwork : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork
ProvisioningState : Succeeded
Di atas akan membuat grup sumber daya, Virtual WAN, Virtual Network, Hub Virtual di AS Tengah dalam grup sumber daya tersebut di Azure. Koneksi Virtual Network akan dibuat setelahnya yang akan mengintip Virtual Network ke Hub Virtual.
Parameter
-AsJob
Jalankan cmdlet di latar belakang
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Confirm
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
Jenis: | SwitchParameter |
Alias: | cf |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.
Jenis: | IAzureContextContainer |
Alias: | AzureRmContext, AzureCredential |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Name
Nama sumber daya.
Jenis: | String |
Alias: | ResourceName, HubVirtualNetworkConnectionName |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-ParentObject
Sumber daya induk.
Jenis: | PSVirtualHub |
Alias: | VirtualHub, ParentVirtualHub |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ParentResourceId
Sumber daya induk.
Jenis: | String |
Alias: | VirtualHubId, ParentVirtualHubId |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ParentResourceName
Nama grup sumber daya.
Jenis: | String |
Alias: | VirtualHubName, ParentVirtualHubName |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-RemoteVirtualNetwork
Jaringan virtual jarak jauh tempat koneksi jaringan virtual hub ini tersambung.
Jenis: | PSVirtualNetwork |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-RemoteVirtualNetworkId
Jaringan virtual jarak jauh tempat koneksi jaringan virtual hub ini tersambung.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-ResourceGroupName
Nama grup sumber daya.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-WhatIf
Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.
Jenis: | SwitchParameter |
Alias: | wi |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |