Skip to content

Commit e495404

Browse files
committed
Some minor tweaks
1 parent 642308a commit e495404

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

articles/storage/blobs/data-lake-storage-events.md

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: normesta
77
ms.subservice: data-lake-storage-gen2
88
ms.service: storage
99
ms.topic: tutorial
10-
ms.date: 03/02/2023
10+
ms.date: 03/07/2023
1111
ms.author: normesta
1212
ms.reviewer: sumameh
1313
ms.devlang: csharp, python
@@ -53,18 +53,18 @@ First, create a csv file that describes a sales order, and then upload that file
5353
> [!div class="mx-imgBorder"]
5454
> ![Screenshot of creating a folder in storage browser](./media/data-lake-storage-events/data-container.png)
5555
56-
2. In the **data** container, create a directory named **input**.
56+
3. In the **data** container, create a directory named **input**.
5757

58-
3. Paste the following text into a text editor.
58+
4. Paste the following text into a text editor.
5959

6060
```
6161
InvoiceNo,StockCode,Description,Quantity,InvoiceDate,UnitPrice,CustomerID,Country
6262
536365,85123A,WHITE HANGING HEART T-LIGHT HOLDER,6,12/1/2010 8:26,2.55,17850,United Kingdom
6363
```
6464

65-
4. Save this file to your local computer and give it the name **data.csv**.
65+
5. Save this file to your local computer and give it the name **data.csv**.
6666

67-
5. In storage browser, upload this file to the **input** folder.
67+
6. In storage browser, upload this file to the **input** folder.
6868

6969
## Create a job in Azure Databricks
7070

@@ -160,7 +160,7 @@ In this section, you create an Azure Databricks workspace using the Azure portal
160160

161161
This code inserts data into a temporary table view by using data from a csv file. The path to that csv file comes from the input widget that you created in an earlier step.
162162

163-
2. Add the following code to merge the contents of the temporary table view with the Databricks Delta table.
163+
2. Copy and paste the following code block into a different cell. This code merges the contents of the temporary table view with the Databricks Delta table.
164164

165165
```
166166
%sql
@@ -207,20 +207,19 @@ Create an Azure Function that runs the Job.
207207

208208
3. Copy the token that appears, and then click **Done**.
209209

210-
1. In the upper corner of the Databricks workspace, choose the people icon, and then choose **User settings**.
210+
4. In the upper corner of the Databricks workspace, choose the people icon, and then choose **User settings**.
211211

212212
![Manage account](./media/data-lake-storage-events/generate-token.png "User settings")
213213

214-
2. Select the **Generate new token** button, and then select the **Generate** button.
214+
5. Select the **Generate new token** button, and then select the **Generate** button.
215215

216216
Make sure to copy the token to safe place. Your Azure Function needs this token to authenticate with Databricks so that it can run the Job.
217217

218-
***
219-
3. From the Azure portal menu or the **Home** page, select **Create a resource**.
218+
6. From the Azure portal menu or the **Home** page, select **Create a resource**.
220219

221-
4. In the **New** page, select **Compute** > **Function App**.
220+
7. In the **New** page, select **Compute** > **Function App**.
222221

223-
5. In the **Basics** tab of the **Create Function App** page, choose a resource group, and then change or verify the following settings:
222+
8. In the **Basics** tab of the **Create Function App** page, choose a resource group, and then change or verify the following settings:
224223

225224
| Setting | Value |
226225
|---------|-------|
@@ -230,23 +229,23 @@ Create an Azure Function that runs the Job.
230229
| Operating System | Windows |
231230
| Plan type | Consumption (Serverless) |
232231

233-
6. Select **Review + create**, and then select **Create**.
232+
9. Select **Review + create**, and then select **Create**.
234233

235234
When the deployment is complete, select **Go to resource** to open the overview page of the Function App.
236235

237-
7. In the **Settings** group, select **Configuration**.
236+
10. In the **Settings** group, select **Configuration**.
238237

239-
8. In the **Application Settings** page, choose the **New application setting** button to add each setting.
238+
11. In the **Application Settings** page, choose the **New application setting** button to add each setting.
240239

241-
![Add configuration setting](./media/data-lake-storage-events/add-application-setting.png "Add configuration setting")
240+
![Add configuration setting](./media/data-lake-storage-events/add-application-setting.png "Add configuration setting")
242241

243-
Add the following settings:
242+
Add the following settings:
244243

245-
|Setting name | Value |
246-
|----|----|
247-
|**DBX_INSTANCE**| The region of your databricks workspace. For example: `westus2.azuredatabricks.net`|
248-
|**DBX_PAT**| The personal access token that you generated earlier. |
249-
|**DBX_JOB_ID**|The identifier of the running job. |
244+
|Setting name | Value |
245+
|----|----|
246+
|**DBX_INSTANCE**| The region of your databricks workspace. For example: `westus2.azuredatabricks.net`|
247+
|**DBX_PAT**| The personal access token that you generated earlier. |
248+
|**DBX_JOB_ID**|The identifier of the running job. |
250249

251250
9. Select **Save** to commit these settings.
252251

@@ -258,9 +257,9 @@ Create an Azure Function that runs the Job.
258257

259258
The **New Function** pane appears.
260259

261-
9. In the **New Function** pane, name the function **UpsertOrder**, and then select the **Create** button.
260+
12. In the **New Function** pane, name the function **UpsertOrder**, and then select the **Create** button.
262261

263-
10. Replace the contents of the code file with this code, and then select the **Save** button:
262+
13. Replace the contents of the code file with this code, and then select the **Save** button:
264263

265264
```csharp
266265
#r "Azure.Messaging.EventGrid"
@@ -330,7 +329,7 @@ In this section, you'll create an Event Grid subscription that calls the Azure F
330329
| System topic name | <create any name> |
331330
| Filter to Event Types | Blob Created, and Blob Deleted |
332331

333-
5. Select the **Create** button.
332+
4. Select the **Create** button.
334333

335334
## Test the Event Grid subscription
336335

@@ -345,17 +344,9 @@ In this section, you'll create an Event Grid subscription that calls the Azure F
345344
346345
Uploading a file raises the **Microsoft.Storage.BlobCreated** event. Event Grid notifies all subscribers to that event. In our case, the Azure Function is the only subscriber. The Azure Function parses the event parameters to determine which event occurred. It then passes the URL of the file to the Databricks Job. The Databricks Job reads the file, and adds a row to the Databricks Delta table that is located your storage account.
347346
348-
3. To check if the job succeeded, open your databricks workspace, select the **Jobs** button, and then open your job.
347+
3. To check if the job succeeded, view the runs for your job. You'll see a completion status. For more information about how to view runs for a job, see [View runs for a job](/azure/databricks/workflows/jobs/jobs#--view-runs-for-a-job)
349348
350-
4. Select the job to open the job page.
351-
352-
![Spark job](./media/data-lake-storage-events/spark-job.png "Spark job")
353-
354-
When the job completes, you'll see a completion status.
355-
356-
![Successfully completed job](./media/data-lake-storage-events/spark-job-completed.png "Successfully completed job")
357-
358-
5. In a new workbook cell, run this query in a cell to see the updated delta table.
349+
4. In a new workbook cell, run this query in a cell to see the updated delta table.
359350
360351
```
361352
%sql select * from customer_data
@@ -365,7 +356,7 @@ In this section, you'll create an Event Grid subscription that calls the Azure F
365356
366357
![Latest record appears in table](./media/data-lake-storage-events/final_query.png "Latest record appears in table")
367358
368-
6. To update this record, create a file named `customer-order-update.csv`, paste the following information into that file, and save it to your local computer.
359+
5. To update this record, create a file named `customer-order-update.csv`, paste the following information into that file, and save it to your local computer.
369360
370361
```
371362
InvoiceNo,StockCode,Description,Quantity,InvoiceDate,UnitPrice,CustomerID,Country
@@ -374,9 +365,9 @@ In this section, you'll create an Event Grid subscription that calls the Azure F
374365
375366
This csv file is almost identical to the previous one except the quantity of the order is changed from `228` to `22`.
376367
377-
7. In Storage Explorer, upload this file to the **input** folder of your storage account.
368+
6. In Storage Explorer, upload this file to the **input** folder of your storage account.
378369
379-
8. Run the `select` query again to see the updated delta table.
370+
7. Run the `select` query again to see the updated delta table.
380371
381372
```
382373
%sql select * from customer_data

0 commit comments

Comments
 (0)