Skip to content

Update monitor-nat-gateway.md #126397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged

Conversation

ryujiiwasa
Copy link
Contributor

@ryujiiwasa ryujiiwasa commented Apr 7, 2025

Deleted "Create a diagnostic setting to collect and route resource log data" portion as we can confirm that diagnostics setting isn't supported for NATGateway (For both Portal and Powershell. Please see below notes.)

Tested in Portal, ARM Templates, PowerShell

◇Portal
image
image

-> Cannot select NATGateway from the dropdown

Create diagnostic settings in Azure Monitor
image

◇ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"scope": {
"type": "string"
},
"workspaceId": {
"type": "string"
},
"settingName": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Insights/diagnosticSettings",
"apiVersion": "2021-05-01-preview",
"scope": "[parameters('scope')]",
"name": "[parameters('settingName')]",
"properties": {
"workspaceId": "[parameters('workspaceId')]",
"logs": [
{
"category": null,
"categoryGroup": "audit",
"enabled": true
}
]
}
}
]
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"settingName": {
"value": "audit3"
},
"workspaceId": {
"value": "/XXXXXXXX/resourceGroups/LogAnalyticsWorkspace/providers/Microsoft.OperationalInsights/workspaces/LAWSTest01EUS"
},
"scope": {
"value": "/subscriptions/XXXXXXXX/resourceGroups/NATGW/providers/Microsoft.Network/natGateways/NATGW"
}
}
}

image

image

The resource type 'microsoft.network/natgateways' does not support diagnostic settings => NATGW does not support Diagnostics settings

◇PowerShell
$NATGW = Get-AzNatGateway -ResourceGroupName "NATGW" -Name "NATGW" $Law = Get-AzOperationalInsightsWorkspace -ResourceGroupName "loganalyticsworkspace" -Name "LAWSTest01EUS" $metric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category AllMetrics # For all available logs, use:
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -CategoryGroup allLogs # or, for audit logs, use:
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -CategoryGroup audit New-AzDiagnosticSetting -Name 'NATGW-Diagnostics' -ResourceId "/subscriptions/XXXXXXXX/resourceGroups/NATGW/providers/Microsoft.Network/natGateways/NATGW" -WorkspaceId $Law.ResourceId -Log $log -Metric $metric -Verbose

image
=> NATGW does not support Diagnostics settings

Deleted "[Create a diagnostic setting](/azure/azure-monitor/essentials/create-diagnostic-settings) to collect and route resource log data" portion as we can confirm that diagnostics setting isn't supported for NATGateway (For both Portal and Powershell. Please see below notes.)

Tried in Portal, ARM Templates, PowerShell

◇Portal




-> Cannot select NATGateway from the dropdown

◇PowerShell 
Create diagnostic settings in Azure Monitor
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/create-diagnostic-settings?tabs=powershell


◇ARM template
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "scope": {
        "type": "string"
    },
    "workspaceId": {
        "type": "string"
    },
    "settingName": {
        "type": "string"
    }
},
  "resources": [
    {
      "type": "Microsoft.Insights/diagnosticSettings",
      "apiVersion": "2021-05-01-preview",
      "scope": "[parameters('scope')]",
      "name": "[parameters('settingName')]",
      "properties": {
       "workspaceId": "[parameters('workspaceId')]",
      "logs": [
             {
            "category": null,
            "categoryGroup": "audit",
            "enabled": true
          }
        ]
      }
    }
  ]
  }
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "settingName": {
        "value": "audit3"
    },
    "workspaceId": {
      "value": "/XXXXXXXX/resourceGroups/LogAnalyticsWorkspace/providers/Microsoft.OperationalInsights/workspaces/LAWSTest01EUS"
    },
    "scope": {
      "value": "/subscriptions/XXXXXXXX/resourceGroups/NATGW/providers/Microsoft.Network/natGateways/NATGW"
    }
  }
}





The resource type 'microsoft.network/natgateways' does not support diagnostic settings
=> NATGW does not support Diagnostics settings

◇PowerShell
$NATGW = Get-AzNatGateway -ResourceGroupName "NATGW" -Name "NATGW"
$Law = Get-AzOperationalInsightsWorkspace -ResourceGroupName "loganalyticsworkspace" -Name "LAWSTest01EUS"
$metric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category AllMetrics
# For all available logs, use:
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -CategoryGroup allLogs  
# or, for audit logs, use:
$log = New-AzDiagnosticSettingLogSettingsObject -Enabled $true -CategoryGroup audit    
New-AzDiagnosticSetting -Name 'NATGW-Diagnostics' -ResourceId "/subscriptions/XXXXXXXX/resourceGroups/NATGW/providers/Microsoft.Network/natGateways/NATGW" -WorkspaceId $Law.ResourceId -Log $log -Metric $metric -Verbose



=> NATGW does not support Diagnostics settings
Copy link
Contributor

@ryujiiwasa : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

@ryujiiwasa : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit 8662586:

✅ Validation status: passed

File Status Preview URL Details
articles/nat-gateway/monitor-nat-gateway.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@v-dirichards
Copy link
Contributor

@asudbring
Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged tracking label for the PR review team label Apr 7, 2025
@v-dirichards
Copy link
Contributor

@asudbring

Can you review this old PR and determine whether it needs to be closed or merged?

@MicrosoftDocs/public-repo-pr-review-team

@asudbring
Copy link
Contributor

#sign-off

@v-dirichards v-dirichards merged commit e497020 into MicrosoftDocs:main May 21, 2025
2 checks passed
mayoneka added a commit to mayoneka/azure-docs that referenced this pull request Jun 27, 2025
… is not supported

As discuss discussed on MicrosoftDocs#126397, resource log should not be supported for Nat GW.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants