You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-arc/data/upload-logs.md
+55-8Lines changed: 55 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ description: Upload logs for Azure Arc-enabled data services to Azure Monitor
4
4
services: azure-arc
5
5
ms.service: azure-arc
6
6
ms.subservice: azure-arc-data
7
-
author: twright-msft
8
-
ms.author: twright
7
+
author: dnethi
8
+
ms.author: dinethi
9
9
ms.reviewer: mikeray
10
-
ms.date: 11/03/2021
10
+
ms.date: 05/27/2022
11
11
ms.topic: how-to
12
12
---
13
13
@@ -149,9 +149,9 @@ echo $WORKSPACE_SHARED_KEY
149
149
150
150
With the environment variables set, you can upload logs to the log workspace.
151
151
152
-
## Upload logs to Azure Log Analytics Workspace in direct mode
152
+
## Configure automatic upload of logs to Azure Log Analytics Workspace in direct mode using `az` CLI
153
153
154
-
In the **direct** connected mode, Logs upload can only be setup in **automatic** mode. This automatic upload of metrics can be setup either during deployment or post deployment of Azure Arc data controller.
154
+
In the **direct** connected mode, Logs upload can only be set up in **automatic** mode. This automatic upload of metrics can be set up either during deployment or post deployment of Azure Arc data controller.
155
155
156
156
### Enable automatic upload of logs to Azure Log Analytics Workspace
157
157
@@ -163,7 +163,7 @@ az arcdata dc update --name <name of datacontroller> --resource-group <resource
163
163
az arcdata dc update --name arcdc --resource-group <myresourcegroup> --auto-upload-logs true
164
164
```
165
165
166
-
### Disable automatic upload of logs to Azure Log Analytics Workspace
166
+
### Enable automatic upload of logs to Azure Log Analytics Workspace
167
167
168
168
If the automatic upload of logs was enabled during Azure Arc data controller deployment, run the below command to disable automatic upload of logs.
169
169
```
@@ -172,7 +172,54 @@ az arcdata dc update --name <name of datacontroller> --resource-group <resource
172
172
az arcdata dc update --name arcdc --resource-group <myresourcegroup> --auto-upload-logs false
173
173
```
174
174
175
-
## Upload logs to Azure Monitor in indirect mode
175
+
## Configure automatic upload of logs to Azure Log Analytics Workspace in **direct** mode using `kubectl` CLI
176
+
177
+
### Enable automatic upload of logs to Azure Log Analytics Workspace
178
+
179
+
To configure automatic upload of logs using ```kubectl```:
180
+
181
+
- ensure the Log Analytics Workspace is created as described in the earlier section
182
+
- create a Kubernetes secret for the Log Analytics workspace using the ```WorkspaceID``` and `SharedAccessKey` as follows:
183
+
184
+
```
185
+
apiVersion: v1
186
+
data:
187
+
primaryKey: <base64 encoding of Azure Log Analytics workspace primary key>
188
+
workspaceId: <base64 encoding of Azure Log Analytics workspace Id>
- update the autoUploadLogs property to `"false"`, and save the file
221
+
222
+
## Upload logs to Azure Monitor in **indirect** mode
176
223
177
224
To upload logs for your Azure Arc-enabled SQL managed instances and Azure Arc-enabled PostgreSQL Hyperscale server groups run the following CLI commands-
178
225
@@ -210,7 +257,7 @@ Once your logs are uploaded, you should be able to query them using the log quer
210
257
211
258
If you want to upload metrics and logs on a scheduled basis, you can create a script and run it on a timer every few minutes. Below is an example of automating the uploads using a Linux shell script.
212
259
213
-
In your favorite text/code editor, add the following script to the file and save as a script executable file such as .sh (Linux/Mac) or .cmd, .bat, .ps1.
260
+
In your favorite text/code editor, add the following script to the file and save as a script executable file - such as .sh for Linux/Mac, or .cmd, .bat, or .ps1 for Windows.
214
261
215
262
```azurecli
216
263
az arcdata dc export --type logs --path logs.json --force --k8s-namespace arc
0 commit comments