Skip to content

Commit 587abcd

Browse files
committed
Applied changes per review comments
1 parent 2ef83ed commit 587abcd

File tree

2 files changed

+79
-85
lines changed

2 files changed

+79
-85
lines changed

articles/azure-monitor/logs/logs-export-logic-app.md

Lines changed: 78 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -56,138 +56,132 @@ Use the procedure in [Create a container](../../storage/blobs/storage-quickstart
5656

5757
## Create Logic App
5858

59-
Go to **Logic Apps** in the Azure portal and click **Add**. Select a **Subscription**, **Resource group**, and **Region** to store the new Logic App and then give it a unique name. You can turn on **Log Analytics** setting to collect information about runtime data and events as described in [Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps](../../logic-apps/monitor-logic-apps-log-analytics.md). This setting isn't required for using the Azure Monitor Logs connector.
59+
1. Go to **Logic Apps** in the Azure portal and click **Add**. Select a **Subscription**, **Resource group**, and **Region** to store the new Logic App and then give it a unique name. You can turn on **Log Analytics** setting to collect information about runtime data and events as described in [Set up Azure Monitor logs and collect diagnostics data for Azure Logic Apps](../../logic-apps/monitor-logic-apps-log-analytics.md). This setting isn't required for using the Azure Monitor Logs connector.
6060

61-
[![Create Logic App](media/logs-export-logic-app/create-logic-app.png)](media/logs-export-logic-app/create-logic-app.png#lightbox)
61+
[![Create Logic App](media/logs-export-logic-app/create-logic-app.png)](media/logs-export-logic-app/create-logic-app.png#lightbox)
6262

6363

64-
Click **Review + create** and then **Create**. When the deployment is complete, click **Go to resource** to open the **Logic Apps Designer**.
64+
2. Click **Review + create** and then **Create**. When the deployment is complete, click **Go to resource** to open the **Logic Apps Designer**.
6565

6666
## Create a trigger for the Logic App
67-
Under **Start with a common trigger**, select **Recurrence**. This creates a Logic App that automatically runs at a regular interval. In the **Frequency** box of the action, select **Day** and in the **Interval** box, enter **1** to run the workflow once per day.
67+
3. Under **Start with a common trigger**, select **Recurrence**. This creates a Logic App that automatically runs at a regular interval. In the **Frequency** box of the action, select **Day** and in the **Interval** box, enter **1** to run the workflow once per day.
6868

69-
[![Recurrence action](media/logs-export-logic-app/recurrence-action.png)](media/logs-export-logic-app/recurrence-action.png#lightbox)
69+
[![Recurrence action](media/logs-export-logic-app/recurrence-action.png)](media/logs-export-logic-app/recurrence-action.png#lightbox)
7070

7171

7272
### Add Azure Monitor Logs action
73-
Click **+ New step** to add an action that runs after the recurrence action. Under **Choose an action**, type **azure monitor** and then select **Azure Monitor Logs**.
73+
4. Click **+ New step** to add an action that runs after the recurrence action. Under **Choose an action**, type **azure monitor** and then select **Azure Monitor Logs**.
7474

75-
[![Azure Monitor Logs action](media/logs-export-logic-app/select-azure-monitor-connector.png)](media/logs-export-logic-app/select-azure-monitor-connector.png#lightbox)
75+
[![Azure Monitor Logs action](media/logs-export-logic-app/select-azure-monitor-connector.png)](media/logs-export-logic-app/select-azure-monitor-connector.png#lightbox)
7676

77-
Click **Azure Log Analytics – Run query and list results**.
77+
5. Click **Azure Log Analytics – Run query and list results**.
7878

79-
[![Screenshot of a new action being added to a step in the Logic App Designer. Azure Monitor Logs is highlighted under Choose an action.](media/logs-export-logic-app/select-query-action-list.png)](media/logs-export-logic-app/select-query-action-list.png#lightbox)
80-
81-
You will be prompted to select a tenant to grant access to the Log Analytics workspace with the account that the workflow will use to run the query.
79+
[![Screenshot of a new action being added to a step in the Logic App Designer. Azure Monitor Logs is highlighted under Choose an action.](media/logs-export-logic-app/select-query-action-list.png)](media/logs-export-logic-app/select-query-action-list.png#lightbox)
8280

81+
You will be prompted to select a tenant to grant access to the Log Analytics workspace with the account that the workflow will use to run the query.
8382

8483
## Add Azure Monitor Logs action
85-
The Azure Monitor Logs action lets you specify the query to run. The log query used in this example is optimized for hourly recurrence and collects the data ingested for the particular execution time. For example, if the workflow runs at 4:35, the time range would be 3:00 to 4:00. If you change the Logic App to run at a different frequency, you need the change the query as well. For example, if you set the recurrence to run daily, you would set startTime in the query to startofday(make_datetime(year,month,day,0,0)).
86-
87-
Select the **Subscription** and **Resource Group** for your Log Analytics workspace. Select *Log Analytics Workspace* for the **Resource Type** and then select the workspace's name under **Resource Name**.
88-
89-
Add the following log query to the **Query** window.
90-
91-
```Kusto
92-
let dt = now();
93-
let year = datetime_part('year', dt);
94-
let month = datetime_part('month', dt);
95-
let day = datetime_part('day', dt);
96-
let hour = datetime_part('hour', dt);
97-
let startTime = make_datetime(year,month,day,hour,0)-1h;
98-
let endTime = startTime + 1h - 1tick;
99-
AzureActivity
100-
| where ingestion_time() between(startTime .. endTime)
101-
| project
102-
TimeGenerated,
103-
BlobTime = startTime,
104-
OperationName ,
105-
OperationNameValue ,
106-
Level ,
107-
ActivityStatus ,
108-
ResourceGroup ,
109-
SubscriptionId ,
110-
Category ,
111-
EventSubmissionTimestamp ,
112-
ClientIpAddress = parse_json(HTTPRequest).clientIpAddress ,
113-
ResourceId = _ResourceId
114-
```
115-
116-
The **Time Range** specifies the records that will be included in the query based on the **TimeGenerated** column. This should be set to a value greater than the time range selected in the query. Since this query isn't using the **TimeGenerated** column, then **Set in query** option isn't available. See [Query scope](./scope.md) for more details about the time range.
117-
118-
Select **Last 4 hours** for the **Time Range**. This will ensure that any records with a ingestion time larger than **TimeGenerated** will be included in the results.
84+
6. The Azure Monitor Logs action lets you specify the query to run. The log query used in this example is optimized for hourly recurrence and collects the data ingested for the particular execution time. For example, if the workflow runs at 4:35, the time range would be 3:00 to 4:00. If you change the Logic App to run at a different frequency, you need the change the query as well. For example, if you set the recurrence to run daily, you would set startTime in the query to startofday(make_datetime(year,month,day,0,0)).
85+
86+
7. Select the **Subscription** and **Resource Group** for your Log Analytics workspace. Select *Log Analytics Workspace* for the **Resource Type** and then select the workspace's name under **Resource Name**.
87+
88+
8. Add the following log query to the **Query** window.
89+
90+
```Kusto
91+
let dt = now();
92+
let year = datetime_part('year', dt);
93+
let month = datetime_part('month', dt);
94+
let day = datetime_part('day', dt);
95+
let hour = datetime_part('hour', dt);
96+
let startTime = make_datetime(year,month,day,hour,0)-1h;
97+
let endTime = startTime + 1h - 1tick;
98+
AzureActivity
99+
| where ingestion_time() between(startTime .. endTime)
100+
| project
101+
TimeGenerated,
102+
BlobTime = startTime,
103+
OperationName ,
104+
OperationNameValue ,
105+
Level ,
106+
ActivityStatus ,
107+
ResourceGroup ,
108+
SubscriptionId ,
109+
Category ,
110+
EventSubmissionTimestamp ,
111+
ClientIpAddress = parse_json(HTTPRequest).clientIpAddress ,
112+
ResourceId = _ResourceId
113+
```
114+
115+
9. The **Time Range** specifies the records that will be included in the query based on the **TimeGenerated** column. This should be set to a value greater than the time range selected in the query. Since this query isn't using the **TimeGenerated** column, then **Set in query** option isn't available. See [Query scope](./scope.md) for more details about the time range. Select **Last 4 hours** for the **Time Range**. This will ensure that any records with an ingestion time larger than **TimeGenerated** will be included in the results.
119116
120-
[![Screenshot of the settings for the new Azure Monitor Logs action named Run query and visualize results.](media/logs-export-logic-app/run-query-list-action.png)](media/logs-export-logic-app/run-query-list-action.png#lightbox)
121-
117+
[![Screenshot of the settings for the new Azure Monitor Logs action named Run query and visualize results.](media/logs-export-logic-app/run-query-list-action.png)](media/logs-export-logic-app/run-query-list-action.png#lightbox)
122118
123119
### Add Parse JSON activity (optional)
124120
The output from the **Run query and list results** action is formatted in JSON. You can parse this data and manipulate it as part of the preparation for **Compose** action.
125121
126122
You can provide a JSON schema that describes the payload you expect to receive. The designer parses JSON content by using this schema and generates user-friendly tokens that represent the properties in your JSON content. You can then easily reference and use those properties throughout your Logic App's workflow.
127123
128124
129-
Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **json** and then select **Parse JSON**.
125+
11. Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **json** and then select **Parse JSON**.
130126
131-
[![Select Parse JSON activity](media/logs-export-logic-app/select-parse-json.png)](media/logs-export-logic-app/select-parse-json.png#lightbox)
127+
[![Select Parse JSON activity](media/logs-export-logic-app/select-parse-json.png)](media/logs-export-logic-app/select-parse-json.png#lightbox)
132128
133-
Click in the **Content** box to display a list of values from previous activities. Select **Body** from the **Run query and list results** action. This is the output from the log query.
129+
12. Click in the **Content** box to display a list of values from previous activities. Select **Body** from the **Run query and list results** action. This is the output from the log query.
134130
135-
[![Select Body](media/logs-export-logic-app/select-body.png)](media/logs-export-logic-app/select-body.png#lightbox)
131+
[![Select Body](media/logs-export-logic-app/select-body.png)](media/logs-export-logic-app/select-body.png#lightbox)
136132
137-
5. Click **Use sample payload to generate schema**. Run the log query and copy the output to use for the sample payload. For the sample query here, you can use the following output:
133+
13. Click **Use sample payload to generate schema**. Run the log query and copy the output to use for the sample payload. For the sample query here, you can use the following output:
138134
139135
140-
```json
141-
{
142-
"TimeGenerated": "2020-09-29T23:11:02.578Z",
143-
"BlobTime": "2020-09-29T23:00:00Z",
144-
"OperationName": "Returns Storage Account SAS Token",
145-
"OperationNameValue": "MICROSOFT.RESOURCES/DEPLOYMENTS/WRITE",
146-
"Level": "Informational",
147-
"ActivityStatus": "Started",
148-
"ResourceGroup": "monitoring",
149-
"SubscriptionId": "00000000-0000-0000-0000-000000000000",
150-
"Category": "Administrative",
151-
"EventSubmissionTimestamp": "2020-09-29T23:11:02Z",
152-
"ClientIpAddress": "192.168.1.100",
153-
"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/monitoring/providers/microsoft.storage/storageaccounts/my-storage-account"
154-
}
155-
```
136+
```json
137+
{
138+
"TimeGenerated": "2020-09-29T23:11:02.578Z",
139+
"BlobTime": "2020-09-29T23:00:00Z",
140+
"OperationName": "Returns Storage Account SAS Token",
141+
"OperationNameValue": "MICROSOFT.RESOURCES/DEPLOYMENTS/WRITE",
142+
"Level": "Informational",
143+
"ActivityStatus": "Started",
144+
"ResourceGroup": "monitoring",
145+
"SubscriptionId": "00000000-0000-0000-0000-000000000000",
146+
"Category": "Administrative",
147+
"EventSubmissionTimestamp": "2020-09-29T23:11:02Z",
148+
"ClientIpAddress": "192.168.1.100",
149+
"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/monitoring/providers/microsoft.storage/storageaccounts/my-storage-account"
150+
}
151+
```
156152
157-
[![Parse JSON payload](media/logs-export-logic-app/parse-json-payload.png)](media/logs-export-logic-app/parse-json-payload.png#lightbox)
153+
[![Parse JSON payload](media/logs-export-logic-app/parse-json-payload.png)](media/logs-export-logic-app/parse-json-payload.png#lightbox)
158154
159155
## Add the Compose action
160156
The **Compose** action takes the parsed JSON output and creates the object that you need to store in the blob.
161157
162-
Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **compose** and then select the **Compose** action.
163-
164-
[![Select Compose action](media/logs-export-logic-app/select-compose.png)](media/logs-export-logic-app/select-compose.png#lightbox)
158+
14. Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **compose** and then select the **Compose** action.
165159
160+
[![Select Compose action](media/logs-export-logic-app/select-compose.png)](media/logs-export-logic-app/select-compose.png#lightbox)
166161
167-
Click the **Inputs** box display a list of values from previous activities. Select **Body** from the **Parse JSON** action. This is the parsed output from the log query.
168162
169-
[![Select body for Compose action](media/logs-export-logic-app/select-body-compose.png)](media/logs-export-logic-app/select-body-compose.png#lightbox)
163+
15. Click the **Inputs** box display a list of values from previous activities. Select **Body** from the **Parse JSON** action. This is the parsed output from the log query.
170164
165+
[![Select body for Compose action](media/logs-export-logic-app/select-body-compose.png)](media/logs-export-logic-app/select-body-compose.png#lightbox)
171166
172167
## Add the Create Blob action
173168
The Create Blob action writes the composed JSON to storage.
174169
175-
Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **blob** and then select the **Create Blob** action.
176-
177-
![Select Create blob](media/logs-export-logic-app/select-create-blob.png)
170+
16. Click **+ New step**, and then click **+ Add an action**. Under **Choose an action**, type **blob** and then select the **Create Blob** action.
178171
179-
Type a name for the connection to your Storage Account in **Connection Name** and then click the folder icon in the **Folder path** box to select the container in your Storage Account. Click the **Blob name** to see a list of values from previous activities. Click **Expression** and enter an expression that matches your time interval. For this query which is run hourly, the following expression sets the blob name per previous hour:
172+
[![Select Create blob](media/logs-export-logic-app/select-create-blob.png)](media/logs-export-logic-app/select-create-blob.png#lightbox)
180173
181-
```json
182-
subtractFromTime(formatDateTime(utcNow(),'yyyy-MM-ddTHH:00:00'), 1,'Hour')
183-
```
174+
17. Type a name for the connection to your Storage Account in **Connection Name** and then click the folder icon in the **Folder path** box to select the container in your Storage Account. Click the **Blob name** to see a list of values from previous activities. Click **Expression** and enter an expression that matches your time interval. For this query which is run hourly, the following expression sets the blob name per previous hour:
184175
185-
[![Blob expression](media/logs-export-logic-app/blob-expression.png)](media/logs-export-logic-app/blob-expression.png#lightbox)
176+
```json
177+
subtractFromTime(formatDateTime(utcNow(),'yyyy-MM-ddTHH:00:00'), 1,'Hour')
178+
```
186179
187-
Click the **Blob content** box to display a list of values from previous activities and then select **Outputs** in the **Compose** section.
180+
[![Blob expression](media/logs-export-logic-app/blob-expression.png)](media/logs-export-logic-app/blob-expression.png#lightbox)
188181
182+
18. Click the **Blob content** box to display a list of values from previous activities and then select **Outputs** in the **Compose** section.
189183
190-
[![Create blob expression](media/logs-export-logic-app/create-blob.png)](media/logs-export-logic-app/create-blob.png#lightbox)
184+
[![Create blob expression](media/logs-export-logic-app/create-blob.png)](media/logs-export-logic-app/create-blob.png#lightbox)
191185
192186
193187
## Test the Logic App

articles/azure-monitor/logs/move-workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The workspace source and destination subscriptions must exist within the same Az
2828
## Workspace move considerations
2929
- Managed solutions that are installed in the workspace will be moved in this operation.
3030
- Workspace keys (both primary and secondary) are re-generated with workspace move operation. If you keep a copy of your workspace keys in key vault, update them with the new keys generated after the workspace move.
31-
- Connected [MMA agents](../agents/log-analytics-agent.md) will remain connected and keep send data to the workspace after the move. [AMA agents](../agents/azure-monitor-agent-overview.md) via DCR will be disconnected during the move and should be reconfigured after the move.
31+
- Connected [MMA agents](../agents/log-analytics-agent.md) will remain connected and keep sending data to the workspace after the move. [AMA agents](../agents/azure-monitor-agent-overview.md) via DCR will be disconnected during the move and should be reconfigured after the move.
3232
- Since the move operation requires that there are no Linked Services from the workspace, solutions that rely on that link must be removed to allow the workspace move. Solutions that must be removed before you can unlink your automation account:
3333
- Update Management
3434
- Change Tracking

0 commit comments

Comments
 (0)