Não há como visualizar os registros diretamente, mas podemos fazer o download dos Logs de diagnóstico do gateway da VPN. Para armazenar os logs, você deve adicionar uma conta de armazenamento e um contêiner de armazenamento no mesmo grupo de recursos do gateway VPN. Aqui um exemplo (ARM) para usar o PowerShell para configurar os Logs de Diagnóstico para o Gateway VPN:
# VNET Resource Group and Name
$rgName = ‘your resource name’
$vnetGwName = "your GW name"
$timestamp = get-date -uFormat "%d%m%y@%H%M%S"
# Details of existing Storage Account that will be used to collect the logs
$storageAccountName = "storage account name"
$storageAccountKey = ‘storage account key’
$captureDuration = 60
$storageContainer = "vpnlogs"
$logDownloadPath = "D:\vpnlogs (create the folder first)"
$Logfilename = "VPNDiagLog_" + $vnetGwName + "_" + $timestamp + ".txt"
# Set Storage Context and VNET Gateway ID
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
# NOTE: This is an Azure Service Manager cmdlet and so no AzureRM on this one. AzureRM will not work as we don’t get the gatewayID with it.
$vnetGws = Get-AzureVirtualNetworkGateway
# Added check for only provisioned gateways as older deleted gateways of same name can also appear in results and capture will fail
$vnetGwId = ($vnetGws | ? GatewayName -eq $vnetGwName | ? state -EQ "provisioned").GatewayID
# Start Azure VNET Gateway logging
Start-AzureVirtualNetworkGatewayDiagnostics '
-GatewayId $vnetGwId '
-CaptureDurationInSeconds $captureDuration '
-StorageContext $storageContext '
-ContainerName $storageContainer
# Optional – Test VNET gateway connection to another server across the tunnel
# Only use this if you are connected to the local network you are connecting to FROM Azure. Otherwise create some traffic across the link from on prem.
# Test-NetConnection -ComputerName 10.0.0.4 -CommonTCPPort RDP
# Wait for diagnostics capturing to complete
Sleep -Seconds $captureDuration
# Step 6 – Download VNET gateway diagnostics log
$logUrl = ( Get-AzureVirtualNetworkGatewayDiagnostics -GatewayId $vnetGwId).DiagnosticsUrl
$logContent = (Invoke-WebRequest -Uri $logUrl).RawContent
$logContent | Out-File -FilePath $logDownloadPath\$Logfilename
Este script precisa ser executado um por um. Mais informações sobre os Logs de diagnóstico, consulte o link .