@sachithaPDF
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSPYTHON-60
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Additionally, could you provide instructions on how to run the Azure Durable Function in Docker?
unfortunately, I am not an Azure expert. Here is what ChatGPT suggests:
Running an Azure Durable Function in a Docker container involves the following steps:
1. Install Prerequisites
Ensure the following are installed on your machine:
2. Create an Azure Durable Function
If you don’t already have a Durable Function, create one:
- Use the Azure Functions Core Tools:
func init MyDurableFunctionApp --docker
cd MyDurableFunctionApp
func new --template "Durable Functions Orchestration" --name MyDurableFunction
3. Add a Dockerfile
If you selected the --docker
option during project initialization, a Dockerfile
will already be present. If not, create a Dockerfile
based on your runtime. Below is an example for Python and Node.js:
For Python:
FROM mcr.microsoft.com/azure-functions/python:4-python3.10
COPY . /home/site/wwwroot
RUN pip install --no-cache-dir -r /home/site/wwwroot/requirements.txt
For Node.js:
FROM mcr.microsoft.com/azure-functions/node:4-node18
COPY . /home/site/wwwroot
For .NET:
FROM mcr.microsoft.com/azure-functions/dotnet:4
COPY . /home/site/wwwroot
4. Build and Run Locally with Docker
- Build the Docker image:
docker build -t my-durable-function .
- Run the Docker container:
docker run -p 8080:80 my-durable-function
- Access the function at
http://localhost:8080
.
5. Configure for Durable Functions
Durable Functions require a storage account for their state management. For local development:
- Set the
AzureWebJobsStorage
environment variable in the Docker container to point to an Azure Storage Emulator (like Azurite) or a real Azure Storage Account.Example local.settings.json
file:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "python"
}
}
- Copy this configuration into your Docker container by adding:
ENV AzureWebJobsStorage="UseDevelopmentStorage=true"
ENV FUNCTIONS_WORKER_RUNTIME="python"
6. Push the Image to a Container Registry
Push the image to a container registry like Azure Container Registry or Docker Hub:
docker tag my-durable-function <registry-name>/<image-name>
docker push <registry-name>/<image-name>
7. Deploy to Azure
- Create an Azure Function App configured for Docker containers:
az functionapp create --name MyFunctionApp \
--storage-account <storage_account_name> \
--resource-group <resource_group_name> \
--plan <app_service_plan_name> \
--deployment-container-image-name <registry-name>/<image-name>
- Configure the app with necessary environment variables (
AzureWebJobsStorage
, etc.) using the Azure portal or CLI.