-
Notifications
You must be signed in to change notification settings - Fork 2
Debugging Locally
hallvictoria edited this page Apr 2, 2024
·
2 revisions
- Follow the steps listed in the Debug Python Worker with Azure Functions Host Wiki to set up your local environment.
- Install the azure-functions-extension-blob library:
pip install azure-functions-extension-blob
- In the Python Worker repo, checkout to the branch
git checkout hallvictoria/sdk-bindings
- Set the
AzureWebJobsScriptRoot
variable in launchSettings.json in Visual Studio to the directory of the function app you want to test.
"AzureWebJobsScriptRoot": "...\\azure-functions-python-extensions\\azure-functions-extension-blob\\samples\\blob_samples_blobclient"
- Set the
AzureWebJobsStorage
variable in launchSettings.json in Visual Studio to the connection string of the storage account you want to connect to.
"AzureWebJobsStorage": "..."
- Set the
path
parameter of the Blob Trigger and Blob Input bindings in function_app.py to the path to your blob.
@app.blob_trigger(arg_name="client", path="test-input/test.txt", connection="AzureWebJobsStorage")
@app.blob_input(arg_name="client", path="test-input/test.txt", connection="AzureWebJobsStorage")
-
Start the Functions Host process in Visual Studio.
-
Execute the function by uploading a blob to the storage account or sending an HTTP request to the endpoint provided.