Network Watchers - Get Network Configuration Diagnostic

Ruft Netzwerkkonfigurationsdiagnosedaten ab, die Kunden dabei helfen, das Netzwerkverhalten zu verstehen und zu debuggen. Sie enthält detaillierte Informationen dazu, welche Sicherheitsregeln auf einen angegebenen Datenverkehrsfluss angewendet wurden, und das Ergebnis der Auswertung dieser Regeln. Kunden müssen Details zu einem Flow angeben, z. B. Quelle, Ziel, Protokoll usw. Die API gibt zurück, ob Datenverkehr zugelassen oder verweigert wurde, die Für den angegebenen Flow ausgewerteten Regeln und die Auswertungsergebnisse.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic?api-version=2023-09-01

URI-Parameter

Name In Erforderlich Typ Beschreibung
networkWatcherName
path True

string

Der Name des Network Watchers.

resourceGroupName
path True

string

Der Name der Ressourcengruppe.

subscriptionId
path True

string

Die Abonnementanmeldeinformationen, die das Microsoft Azure-Abonnement eindeutig identifizieren. Die Abonnement-ID ist Teil des URI für jeden Dienstaufruf.

api-version
query True

string

Client-API-Version.

Anforderungstext

Name Erforderlich Typ Beschreibung
profiles True

NetworkConfigurationDiagnosticProfile[]

Liste der Diagnoseprofile für die Netzwerkkonfiguration.

targetResourceId True

string

Die ID der Zielressource zum Ausführen der Netzwerkkonfigurationsdiagnose. Gültige Optionen sind VM, NetworkInterface, VMSS/NetworkInterface und Application Gateway.

verbosityLevel

VerbosityLevel

Ausführlichkeitsgrad.

Antworten

Name Typ Beschreibung
200 OK

NetworkConfigurationDiagnosticResponse

Anforderung erfolgreich. Der Vorgang gibt das Ergebnis der Netzwerkkonfigurationsdiagnose zurück.

202 Accepted

NetworkConfigurationDiagnosticResponse

Akzeptiert, und der Vorgang wird asynchron abgeschlossen.

Other Status Codes

ErrorResponse

Fehlerantwort mit Beschreibung des Grunds für den Fehler.

Sicherheit

azure_auth

Azure Active Directory OAuth2-Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Beschreibung
user_impersonation Identitätswechsel Ihres Benutzerkontos

Beispiele

Network configuration diagnostic

Sample Request

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/networkConfigurationDiagnostic?api-version=2023-09-01

{
  "targetResourceId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1",
  "profiles": [
    {
      "direction": "Inbound",
      "protocol": "TCP",
      "source": "10.1.0.4",
      "destination": "12.11.12.14",
      "destinationPort": "12100"
    }
  ]
}

Sample Response

{
  "results": [
    {
      "profile": {
        "direction": "Inbound",
        "protocol": "TCP",
        "source": "10.1.0.4",
        "destination": "12.11.12.14",
        "destinationPort": "12100"
      },
      "networkSecurityGroupResult": {
        "securityRuleAccessResult": "Allow",
        "evaluatedNetworkSecurityGroups": [
          {
            "networkSecurityGroupId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1",
            "appliedTo": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AppSubnet",
            "matchedRule": {
              "ruleName": "UserRule_fe_rule",
              "action": "Allow"
            },
            "rulesEvaluationResult": [
              {
                "name": "UserRule_Cleanuptool-Allow-100",
                "protocolMatched": true,
                "sourceMatched": false,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Allow-101",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Allow-102",
                "protocolMatched": true,
                "sourceMatched": false,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Deny-103",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_fe_rule",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": true
              }
            ]
          },
          {
            "networkSecurityGroupId": "/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG",
            "appliedTo": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/networkInterfaces/nic",
            "matchedRule": {
              "ruleName": "UserRule_fe_rule",
              "action": "Allow"
            },
            "rulesEvaluationResult": [
              {
                "name": "UserRule_fe_rule",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": true
              }
            ]
          }
        ]
      }
    }
  ]
}
Location: https:/management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/networkConfigurationDiagnostic?api-version=2023-09-01
{
  "results": [
    {
      "profile": {
        "direction": "Inbound",
        "protocol": "TCP",
        "source": "10.1.0.4",
        "destination": "12.11.12.14",
        "destinationPort": "12100"
      },
      "networkSecurityGroupResult": {
        "securityRuleAccessResult": "Allow",
        "evaluatedNetworkSecurityGroups": [
          {
            "networkSecurityGroupId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1",
            "appliedTo": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AppSubnet",
            "matchedRule": {
              "ruleName": "UserRule_fe_rule",
              "action": "Allow"
            },
            "rulesEvaluationResult": [
              {
                "name": "UserRule_Cleanuptool-Allow-100",
                "protocolMatched": true,
                "sourceMatched": false,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Allow-101",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Allow-102",
                "protocolMatched": true,
                "sourceMatched": false,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_Cleanuptool-Deny-103",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": false
              },
              {
                "name": "UserRule_fe_rule",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": true
              }
            ]
          },
          {
            "networkSecurityGroupId": "/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG",
            "appliedTo": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/networkInterfaces/nic",
            "matchedRule": {
              "ruleName": "UserRule_fe_rule",
              "action": "Allow"
            },
            "rulesEvaluationResult": [
              {
                "name": "UserRule_fe_rule",
                "protocolMatched": true,
                "sourceMatched": true,
                "sourcePortMatched": true,
                "destinationMatched": true,
                "destinationPortMatched": true
              }
            ]
          }
        ]
      }
    }
  ]
}

Definitionen

Name Beschreibung
Direction

Die Richtung des Datenverkehrs.

ErrorDetails

Allgemeine Darstellung von Fehlerdetails.

ErrorResponse

Das Fehlerobjekt.

EvaluatedNetworkSecurityGroup

Ergebnisse der Auswertung von Netzwerksicherheitsgruppen.

MatchedRule

Übereinstimmungsregel.

NetworkConfigurationDiagnosticParameters

Parameter zum Abrufen der Netzwerkkonfigurationsdiagnose.

NetworkConfigurationDiagnosticProfile

Parameter, die mit der Netzwerkkonfiguration verglichen werden sollen.

NetworkConfigurationDiagnosticResponse

Ergebnisse der Netzwerkkonfigurationsdiagnose für die Zielressource.

NetworkConfigurationDiagnosticResult

Das Diagnoseergebnis der Netzwerkkonfiguration entsprach der bereitgestellten Datenverkehrsabfrage.

NetworkSecurityGroupResult

Das Diagnoseergebnis der Netzwerkkonfiguration entspricht der bereitgestellten Datenverkehrsabfrage.

NetworkSecurityRulesEvaluationResult

Auswertungsergebnis für Netzwerksicherheitsregeln.

SecurityRuleAccess

Gibt an, ob Netzwerkdatenverkehr zugelassen oder verweigert wird.

VerbosityLevel

Ausführlichkeitsgrad.

Direction

Die Richtung des Datenverkehrs.

Name Typ Beschreibung
Inbound

string

Outbound

string

ErrorDetails

Allgemeine Darstellung von Fehlerdetails.

Name Typ Beschreibung
code

string

Fehlercode

message

string

Fehlermeldung.

target

string

Fehlerziel.

ErrorResponse

Das Fehlerobjekt.

Name Typ Beschreibung
error

ErrorDetails

Fehler
Das Fehlerdetails-Objekt.

EvaluatedNetworkSecurityGroup

Ergebnisse der Auswertung von Netzwerksicherheitsgruppen.

Name Typ Beschreibung
appliedTo

string

Ressourcen-ID der Nic oder des Subnetzes, auf die die Netzwerksicherheitsgruppe angewendet wird.

matchedRule

MatchedRule

Die entsprechende Netzwerksicherheitsregel.

networkSecurityGroupId

string

Die ID der Netzwerksicherheitsgruppe.

rulesEvaluationResult

NetworkSecurityRulesEvaluationResult[]

Die Liste mit den Auswertungsergebnissen für Netzwerksicherheitsregeln.

MatchedRule

Übereinstimmungsregel.

Name Typ Beschreibung
action

string

Der Netzwerkdatenverkehr wird zugelassen oder verweigert. Mögliche Werte sind "Allow" und "Deny".

ruleName

string

Der Name der entsprechenden Netzwerksicherheitsregel.

NetworkConfigurationDiagnosticParameters

Parameter zum Abrufen der Netzwerkkonfigurationsdiagnose.

Name Typ Beschreibung
profiles

NetworkConfigurationDiagnosticProfile[]

Liste der Diagnoseprofile für die Netzwerkkonfiguration.

targetResourceId

string

Die ID der Zielressource zum Ausführen der Netzwerkkonfigurationsdiagnose. Gültige Optionen sind VM, NetworkInterface, VMSS/NetworkInterface und Application Gateway.

verbosityLevel

VerbosityLevel

Ausführlichkeitsgrad.

NetworkConfigurationDiagnosticProfile

Parameter, die mit der Netzwerkkonfiguration verglichen werden sollen.

Name Typ Beschreibung
destination

string

Das Ziel für den Datenverkehr. Akzeptierte Werte sind: '*', IP-Adresse/CIDR, Diensttag.

destinationPort

string

Der Zielport für den Datenverkehr. Akzeptierte Werte sind "*" und ein einzelner Port im Bereich (0 bis 65535).

direction

Direction

Die Richtung des Datenverkehrs.

protocol

string

Zu überprüfende Protokoll. Akzeptierte Werte sind "*", TCP, UDP.

source

string

Die Datenverkehrsquelle. Akzeptierte Werte sind "*", IP-Adresse/CIDR, Diensttag.

NetworkConfigurationDiagnosticResponse

Ergebnisse der Netzwerkkonfigurationsdiagnose für die Zielressource.

Name Typ Beschreibung
results

NetworkConfigurationDiagnosticResult[]

Liste der Diagnoseergebnisse der Netzwerkkonfiguration.

NetworkConfigurationDiagnosticResult

Das Diagnoseergebnis der Netzwerkkonfiguration entsprach der bereitgestellten Datenverkehrsabfrage.

Name Typ Beschreibung
networkSecurityGroupResult

NetworkSecurityGroupResult

Das Ergebnis für Netzwerksicherheitsgruppen.

profile

NetworkConfigurationDiagnosticProfile

Das Profil der Netzwerkkonfigurationsdiagnose.

NetworkSecurityGroupResult

Das Diagnoseergebnis der Netzwerkkonfiguration entspricht der bereitgestellten Datenverkehrsabfrage.

Name Typ Beschreibung
evaluatedNetworkSecurityGroups

EvaluatedNetworkSecurityGroup[]

Die Liste der Diagnoseergebnisse für Netzwerksicherheitsgruppen.

securityRuleAccessResult

SecurityRuleAccess

Der Netzwerkdatenverkehr wird zugelassen oder verweigert.

NetworkSecurityRulesEvaluationResult

Auswertungsergebnis für Netzwerksicherheitsregeln.

Name Typ Beschreibung
destinationMatched

boolean

Wert, der angibt, ob das Ziel abgeglichen wird.

destinationPortMatched

boolean

Wert, der angibt, ob der Zielport abgeglichen wird.

name

string

Der Name der Netzwerksicherheitsregel.

protocolMatched

boolean

Wert, der angibt, ob das Protokoll übereinstimmt.

sourceMatched

boolean

Wert, der angibt, ob die Quelle übereinstimmt.

sourcePortMatched

boolean

Wert, der angibt, ob der Quellport übereinstimmt.

SecurityRuleAccess

Gibt an, ob Netzwerkdatenverkehr zugelassen oder verweigert wird.

Name Typ Beschreibung
Allow

string

Deny

string

VerbosityLevel

Ausführlichkeitsgrad.

Name Typ Beschreibung
Full

string

Minimum

string

Normal

string