Skip to content

Commit fe187ad

Browse files
committed
Tab review code section + suggestEdits
1 parent bb20aa5 commit fe187ad

2 files changed

Lines changed: 61 additions & 23 deletions

File tree

articles/azure-functions/durable/tutorial-durable-text-analysis-azure-files.md

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Tutorial: Durable text analysis with a mounted Azure Files share in Azur
33
description: Learn how to deploy a Python Azure Functions app that uses Durable Functions to orchestrate parallel text file analysis by using a mounted Azure Files share on a Flex Consumption plan.
44
ms.service: azure-functions
55
ms.topic: tutorial
6-
ms.date: 03/11/2026
6+
ms.date: 03/24/2026
77
ms.custom:
88
- devx-track-azurecli
99
- devx-track-azdevcli
@@ -18,7 +18,7 @@ In this tutorial, you deploy a Python Azure Functions app that uses [Durable Fun
1818
In this tutorial, you:
1919

2020
> [!div class="checklist"]
21-
> * Deploy a Durable Functions app in a Flex Consumption plan with a mounted Azure Files share by using Azure Developer CLI
21+
> * Use Azure Developer CLI to deploy a Durable Functions app in a Flex Consumption plan with a mounted Azure Files share
2222
> * Trigger an orchestration to process sample text files in parallel
2323
> * Verify the aggregated analysis results
2424
@@ -34,17 +34,17 @@ The CLI examples in this tutorial use Bash syntax and have been tested in [Azure
3434

3535
## Initialize the sample project
3636

37-
The sample code for this tutorial is in the [Azure Functions Flex Consumption with Azure Files OS Mount Samples](https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples) GitHub repository. The `durable-text-analysis` folder contains the function app code, a Bicep template that provisions the required Azure resources, and a post-deployment script that uploads sample text files.
37+
You can find the sample code for this tutorial in the [Azure Functions Flex Consumption with Azure Files OS Mount Samples](https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples) GitHub repository. The `durable-text-analysis` folder contains the function app code, a Bicep template that provisions the required Azure resources, and a post-deployment script that uploads sample text files.
3838

39-
1. Open a terminal and navigate to the directory where you want to clone the repository.
39+
1. Open a terminal and go to the directory where you want to clone the repository.
4040

4141
1. Clone the repository:
4242

4343
```bash
4444
git clone https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples.git
4545
```
4646

47-
1. Navigate to the project folder:
47+
1. Go to the project folder:
4848

4949
```bash
5050
cd Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples/durable-text-analysis
@@ -56,11 +56,47 @@ The sample code for this tutorial is in the [Azure Functions Flex Consumption wi
5656
azd init
5757
```
5858

59-
## Deploy with Azure Developer CLI
59+
## Review the code
60+
61+
The three key pieces that make this sample work are the infrastructure that creates the mount, the script that uploads sample files, and the function code that orchestrates the analysis.
62+
63+
### [Mount configuration (Bicep)](#tab/mount-config)
64+
65+
The `mounts.bicep` module configures an Azure Files SMB mount on the function app. The `mountPath` value determines the local path where files appear at runtime. You pass the storage account access key as a parameter, and the platform resolves it at runtime through a Key Vault reference:
66+
67+
:::code language="bicep" source="~/functions-flex-azure-files-samples/durable-text-analysis/infra/app/mounts.bicep" :::
68+
69+
Because Azure Files SMB mounts don't yet support managed identity authentication, you need a storage account key. As a best practice, store this key in Azure Key Vault and use a [Key Vault reference](/azure/app-service/app-service-key-vault-references) in an app setting. The mount configuration references that app setting by using `@AppSettingRef()`, so the key never appears in your Bicep templates. The `keyvault.bicep` module creates the vault, stores the key, and grants RBAC roles:
70+
71+
:::code language="bicep" source="~/functions-flex-azure-files-samples/durable-text-analysis/infra/app/keyvault.bicep" :::
72+
73+
The `main.bicep` file invokes the mount and Key Vault modules:
74+
75+
:::code language="bicep" source="~/functions-flex-azure-files-samples/durable-text-analysis/infra/main.bicep" range="173-206" :::
76+
77+
### [Post-deployment script](#tab/post-deploy-script)
78+
79+
After `azd up` deploys the infrastructure and code, a post-deployment script creates sample text files, uploads them to the Azure Files share, and runs a health check:
80+
81+
:::code language="bash" source="~/functions-flex-azure-files-samples/durable-text-analysis/scripts/post-up.sh" range="33-88" :::
82+
83+
### [Function code](#tab/function-code)
84+
85+
The HTTP starter in `function_app.py` starts a Durable Functions orchestration. The orchestrator in `orchestrator.py` lists all `.txt` files on the mount, fans out to analyze each file in parallel, and aggregates the results:
86+
87+
:::code language="python" source="~/functions-flex-azure-files-samples/durable-text-analysis/src/orchestrator.py" :::
88+
89+
Each activity function reads directly from the mounted share by using standard file I/O. It doesn't need any SDK or network calls:
90+
91+
:::code language="python" source="~/functions-flex-azure-files-samples/durable-text-analysis/src/activities.py" range="30-51" :::
92+
93+
---
94+
95+
## Deploy by using Azure Developer CLI
6096

6197
This sample is an [Azure Developer CLI (azd)](/azure/developer/azure-developer-cli/overview) template. A single `azd up` command provisions infrastructure, deploys the function code, and uploads sample text files to the Azure Files share.
6298

63-
1. Sign in to Azure. The post-deployment script uses Azure CLI commands, so you need to authenticate with both tools:
99+
1. Sign in to Azure. The post-deployment script uses Azure CLI commands, so you need to authenticate by using both tools:
64100

65101
```bash
66102
azd auth login
@@ -81,7 +117,7 @@ This sample is an [Azure Developer CLI (azd)](/azure/developer/azure-developer-c
81117
- Runs a health check
82118

83119
> [!NOTE]
84-
> Because Azure Files SMB mounts don't yet support managed identity authentication, a storage account key is required. As a best practice, the deployment stores this key in [Azure Key Vault](/azure/key-vault/general/overview) and uses a [Key Vault reference](/azure/app-service/app-service-key-vault-references) so the key is never exposed in app settings. This approach provides centralized secret management, auditing, and support for key rotation.
120+
> Because Azure Files SMB mounts don't yet support managed identity authentication, you need a storage account key. As a best practice, the deployment stores this key in [Azure Key Vault](/azure/key-vault/general/overview) and uses a [Key Vault reference](/azure/app-service/app-service-key-vault-references) so the key is never exposed in app settings. This approach provides centralized secret management, auditing, and support for key rotation.
85121
86122
The deployment takes a few minutes. When it completes, you see a summary of the created resources.
87123
@@ -168,7 +204,7 @@ This sample is an [Azure Developer CLI (azd)](/azure/developer/azure-developer-c
168204
```
169205
170206
> [!TIP]
171-
> Your function app accessed all three files in parallel through the storage mount. The app didn't need any per-request network calls. The function read them directly from the mounted share by using standard file I/O. This approach demonstrates the power of storage mounts combined with Durable Functions.
207+
> Your function app accesses all three files in parallel through the storage mount. The app doesn't need any per-request network calls. The function reads them directly from the mounted share by using standard file I/O. This approach demonstrates the power of storage mounts combined with Durable Functions.
172208

173209
## Clean up resources
174210

articles/azure-functions/tutorial-ffmpeg-processing-azure-files.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Tutorial: Process images by using FFmpeg on a mounted Azure Files share in Azure Functions"
33
description: Learn how to deploy a Python Azure Functions app that uses an ffmpeg binary hosted on a mounted Azure Files share to process images on a Flex Consumption plan.
44
ms.topic: tutorial
5-
ms.date: 03/11/2026
5+
ms.date: 03/24/2026
66
ms.custom:
77
- devx-track-azurecli
88
- devx-track-azdevcli
@@ -25,25 +25,25 @@ In this tutorial, you:
2525

2626
## Prerequisites
2727

28-
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn)
28+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
2929
- [Azure Developer CLI (azd)](/azure/developer/azure-developer-cli/install-azd) version 1.9.0 or later
3030
- [Git](https://git-scm.com/)
3131

32-
The CLI examples in this tutorial use Bash syntax and have been tested in [Azure Cloud Shell](/azure/cloud-shell/overview) (Bash) and Linux/macOS terminals.
32+
The CLI examples in this tutorial use Bash syntax and are tested in [Azure Cloud Shell](/azure/cloud-shell/overview) (Bash) and Linux/macOS terminals.
3333

3434
## Initialize the sample project
3535

3636
The sample code for this tutorial is in the [Azure Functions Flex Consumption with Azure Files OS Mount Samples](https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples) GitHub repository. The `ffmpeg-image-processing` folder contains the function app code, a Bicep template that provisions the required Azure resources, and a post-deployment script that uploads the ffmpeg binary.
3737

38-
1. Open a terminal and navigate to the directory where you want to clone the repository.
38+
1. Open a terminal and go to the directory where you want to clone the repository.
3939

4040
1. Clone the repository:
4141

4242
```bash
4343
git clone https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples.git
4444
```
4545

46-
1. Navigate to the project folder:
46+
1. Go to the project folder:
4747

4848
```bash
4949
cd Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples/ffmpeg-image-processing
@@ -59,37 +59,39 @@ The sample code for this tutorial is in the [Azure Functions Flex Consumption wi
5959

6060
The three key pieces that make OS mount–based processing work are the infrastructure that creates the mount, the script that uploads the binary, and the function code that calls it.
6161

62-
### Mount configuration (Bicep)
62+
### [Mount configuration (Bicep)](#tab/mount-config)
6363

64-
The `mounts.bicep` module configures an Azure Files SMB mount on the function app. The `mountPath` value determines the local path where files appear at runtime. The storage account access key is passed in as a parameter that the platform resolves at runtime via a Key Vault reference:
64+
The `mounts.bicep` module configures an Azure Files SMB mount on the function app. The `mountPath` value determines the local path where files appear at runtime. You pass the storage account access key as a parameter, and the platform resolves it at runtime through a Key Vault reference:
6565

6666
:::code language="bicep" source="~/functions-flex-azure-files-samples/ffmpeg-image-processing/infra/app/mounts.bicep" :::
6767

68-
Because Azure Files SMB mounts don't yet support managed identity authentication, a storage account key is required. As a best practice, the deployment stores this key in Azure Key Vault and uses a [Key Vault reference](/azure/app-service/app-service-key-vault-references) in an app setting. The mount configuration references that app setting with `@AppSettingRef()`, so the key is never exposed in your Bicep templates. The `keyvault.bicep` module creates the vault, stores the key, and grants RBAC roles:
68+
Because Azure Files SMB mounts don't yet support managed identity authentication, you need a storage account key. As a best practice, store this key in Azure Key Vault and use a [Key Vault reference](/azure/app-service/app-service-key-vault-references) in an app setting. The mount configuration references that app setting by using `@AppSettingRef()`, so the key never appears in your Bicep templates. The `keyvault.bicep` module creates the vault, stores the key, and grants RBAC roles:
6969
7070
:::code language="bicep" source="~/functions-flex-azure-files-samples/ffmpeg-image-processing/infra/app/keyvault.bicep" :::
7171
72-
The mount and Key Vault modules are invoked from `main.bicep`:
72+
The `main.bicep` file invokes the mount and Key Vault modules:
7373
7474
:::code language="bicep" source="~/functions-flex-azure-files-samples/ffmpeg-image-processing/infra/main.bicep" range="195-229" :::
7575
76-
### Post-deployment script
76+
### [Post-deployment script](#tab/post-deploy-script)
7777
7878
After `azd up` deploys the infrastructure and code, a post-deployment script downloads the FFmpeg static binary and uploads it to the Azure Files share. It also creates the Event Grid subscription and runs a health check:
7979
8080
:::code language="bash" source="~/functions-flex-azure-files-samples/ffmpeg-image-processing/scripts/post-up.sh" range="33-65" :::
8181
82-
### Function code
82+
### [Function code](#tab/function-code)
8383
84-
The function reads the mount path from an environment variable (`FFMPEG_PATH`) that's set in the Bicep template. It calls `process_with_ffmpeg`, which runs the binary as a subprocess against the input image bytes:
84+
The function reads the mount path from an environment variable (`FFMPEG_PATH`) set in the Bicep template. It calls `process_with_ffmpeg`, which runs the binary as a subprocess against the input image bytes:
8585
8686
:::code language="python" source="~/functions-flex-azure-files-samples/ffmpeg-image-processing/src/function_app.py" range="19-54" :::
8787
88-
## Deploy with Azure Developer CLI
88+
---
89+
90+
## Deploy by using Azure Developer CLI
8991
9092
This sample is an [Azure Developer CLI (azd)](/azure/developer/azure-developer-cli/overview) template. A single `azd up` command provisions infrastructure, deploys the function code, uploads the ffmpeg binary to Azure Files, and creates the EventGrid subscription for blob triggers.
9193
92-
1. Sign in to Azure. The post-deployment script uses Azure CLI commands, so you need to authenticate with both tools:
94+
1. Sign in to Azure. The post-deployment script uses Azure CLI commands, so you need to authenticate by using both tools:
9395
9496
```bash
9597
azd auth login

0 commit comments

Comments
 (0)