Skip to content

Commit 6b8d022

Browse files
authored
Merge pull request #226424 from damendo/main
Adding ARM template
2 parents 8a143e3 + 5ff06c5 commit 6b8d022

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

articles/azure-monitor/containers/container-insights-syslog.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Container Insights offers the ability to collect Syslog events from Linux nodes
2525

2626
Use the following command in Azure CLI to enable syslog collection when you create a new AKS cluster.
2727

28+
### Using Azure CLI commands
29+
2830
```azurecli
2931
az aks create -g syslog-rg -n new-cluster --enable-managed-identity --node-count 1 --enable-addons monitoring --enable-msi-auth-for-monitoring --enable-syslog --generate-ssh-key
3032
```
@@ -35,6 +37,56 @@ Use the following command in Azure CLI to enable syslog collection on an existin
3537
az aks enable-addons -a monitoring --enable-msi-auth-for-monitoring --enable-syslog -g syslog-rg -n existing-cluster
3638
```
3739

40+
### Using ARM templates
41+
42+
You can also use ARM templates for enabling syslog collection
43+
44+
1. Download the template in the [GitHub content file](https://aka.ms/aks-enable-monitoring-msi-onboarding-template-file) and save it as **existingClusterOnboarding.json**.
45+
46+
1. Download the parameter file in the [GitHub content file](https://aka.ms/aks-enable-monitoring-msi-onboarding-template-parameter-file) and save it as **existingClusterParam.json**.
47+
48+
1. Edit the values in the parameter file:
49+
50+
- `aksResourceId`: Use the values on the **AKS Overview** page for the AKS cluster.
51+
- `aksResourceLocation`: Use the values on the **AKS Overview** page for the AKS cluster.
52+
- `workspaceResourceId`: Use the resource ID of your Log Analytics workspace.
53+
- `resourceTagValues`: Match the existing tag values specified for the existing Container insights extension data collection rule (DCR) of the cluster and the name of the DCR. The name will be *MSCI-\<clusterName\>-\<clusterRegion\>* and this resource created in an AKS clusters resource group. If this is the first time onboarding, you can set the arbitrary tag values.
54+
- `enableSyslog`: Set to true
55+
- `syslogLevels`: Array of syslog levels to collect. Default collects all levels.
56+
- `syslogFacilities`: Array of syslog facilities to collect. Default collects all facilities
57+
58+
> [!NOTE]
59+
> Syslog level and facilities customization is currently only available via ARM templates.
60+
61+
### Deploy the template
62+
63+
Deploy the template with the parameter file by using any valid method for deploying Resource Manager templates. For examples of different methods, see [Deploy the sample templates](../resource-manager-samples.md#deploy-the-sample-templates).
64+
65+
#### Deploy with Azure PowerShell
66+
67+
```powershell
68+
New-AzResourceGroupDeployment -Name OnboardCluster -ResourceGroupName <ResourceGroupName> -TemplateFile .\existingClusterOnboarding.json -TemplateParameterFile .\existingClusterParam.json
69+
```
70+
71+
The configuration change can take a few minutes to complete. When it's finished, a message similar to the following example includes this result:
72+
73+
```output
74+
provisioningState : Succeeded
75+
```
76+
77+
#### Deploy with Azure CLI
78+
79+
```azurecli
80+
az login
81+
az account set --subscription "Subscription Name"
82+
az deployment group create --resource-group <ResourceGroupName> --template-file ./existingClusterOnboarding.json --parameters @./existingClusterParam.json
83+
```
84+
85+
The configuration change can take a few minutes to complete. When it's finished, a message similar to the following example includes this result:
86+
87+
```output
88+
provisioningState : Succeeded
89+
```
3890

3991
## How to access Syslog data
4092

@@ -85,4 +137,3 @@ Select the minimum log level for each facility that you want to collect.
85137

86138
- Read more about [Syslog record properties](/azure/azure-monitor/reference/tables/syslog)
87139

88-

0 commit comments

Comments
 (0)