-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Update monitor-nat-gateway.md #126397
Conversation
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
@ryujiiwasa : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
@ryujiiwasa : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Learn Build status updates of commit 8662586: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
@asudbring Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
Can you review this old PR and determine whether it needs to be closed or merged? @MicrosoftDocs/public-repo-pr-review-team |
#sign-off |
… is not supported As discuss discussed on MicrosoftDocs#126397, resource log should not be supported for Nat GW.
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


-> Cannot select NATGateway from the dropdown
Create diagnostic settings in Azure Monitor

◇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