Skip to content

Commit 392bfc9

Browse files
authored
Merge pull request #119205 from sanray-ms/patch-3
Update container-instances-log-analytics.md
2 parents 4f50aba + 7ee199f commit 392bfc9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

articles/container-instances/container-instances-log-analytics.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,19 @@ ContainerInstanceLog_CL
195195
|_ResourceId|string|A unique identifier for the resource that the record is associated with|
196196
|_SubscriptionId|string|A unique identifier for the subscription that the record is associated with|
197197

198+
## Using Diagnostic Settings
199+
200+
Diagnostic Settings for container groups is a preview feature and it can be enabled through preview features options in Azure portal. Once this feature is enabled for a subscription, Diagnostic Settings can be applied to a container group. Applying Diagnostic Settings will cause a container group to restart.
201+
202+
For example, here is how we can use New-AzDiagnosticSetting command to apply a Diagnostic Settings object to a container group.
203+
204+
```azurepowershell
205+
$log = @()
206+
$log += New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category ContainerInstanceLog -RetentionPolicyDay 7 -RetentionPolicyEnabled $true
207+
208+
New-AzDiagnosticSetting -Name test-setting -ResourceId <container-group-resource-id> -WorkspaceId <log-analytics-workspace-id> -Log $log
209+
```
210+
198211
## Next steps
199212

200213
### Azure Monitor logs

0 commit comments

Comments
 (0)