Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions samples/fan_in_fan_out/E2_CopyFileToBlob/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pathlib
from azure.storage.blob import BlobServiceClient
from azure.core.exceptions import ResourceExistsError

Expand All @@ -18,9 +19,11 @@ def main(filePath: str) -> str:
pass

# Create a blob client using the local file name as the name for the blob
blob_client = blob_service_client.get_blob_client(container=container_name, blob=filePath)
parent_dir, fname = pathlib.Path(filePath).parts[-2:] # Get last two path components
blob_name = parent_dir + "_" + fname
blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)

# Count bytes i nfile
# Count bytes in file
byte_count = os.path.getsize(filePath)

# Upload the created file
Expand Down
16 changes: 10 additions & 6 deletions samples/fan_in_fan_out/E2_GetFileList/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import os
from os.path import dirname
from typing import List

def main(rootDirectory: str) -> List[str]:

all_file_paths = []
# We walk the file system, looking for all files
# below "rootDirectory"
# We walk the file system
for path, _, files in os.walk(rootDirectory):
# For each file, we add their full-path to the list
for name in files:
file_path = os.path.join(path, name)
all_file_paths.append(file_path)
# We copy the code for activities and orchestrators
if "E2_" in path:
# For each file, we add their full-path to the list
for name in files:
if name == "__init__.py" or name == "function.json":
file_path = os.path.join(path, name)
all_file_paths.append(file_path)

return all_file_paths
4 changes: 2 additions & 2 deletions samples/fan_in_fan_out/HttpStart/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import logging

import json
import azure.functions as func
import azure.durable_functions as df


async def main(req: func.HttpRequest, starter: str) -> func.HttpResponse:
client = df.DurableOrchestrationClient(starter)
payload = req.get_body()
payload: str = json.loads(req.get_body().decode()) # Load JSON post request data
instance_id = await client.start_new(req.route_params["functionName"], client_input=payload)

logging.info(f"Started orchestration with ID = '{instance_id}'.")
Expand Down
2 changes: 1 addition & 1 deletion samples/fan_in_fan_out/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Fan-Out Fan-In

This directory contains a executable version of [this](TODO) tutorial. Please review the link above for instructions on how to run it.
This directory contains a executable version of [this](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-cloud-backup?tabs=python) tutorial. Please review the link above for instructions on how to run it.
2 changes: 1 addition & 1 deletion samples/function_chaining/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Function Chaining

This directory contains a executable version of [this](TODO) tutorial. Please review the link above for instructions on how to run it.
This directory contains a executable version of [this](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-sequence?tabs=python) tutorial. Please review the link above for instructions on how to run it.
2 changes: 1 addition & 1 deletion samples/human_interaction/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Human Interaction

This directory contains a executable version of [this](TODO) tutorial. Please review the link above for instructions on how to run it.
This directory contains a executable version of [this](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-phone-verification?tabs=python) tutorial. Please review the link above for instructions on how to run it.
2 changes: 1 addition & 1 deletion samples/monitor/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Human Interaction

This directory contains a executable version of [this](TODO) tutorial. Please review the link above for instructions on how to run it.
This directory contains a executable version of [this](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-monitor-python) tutorial. Please review the link above for instructions on how to run it.