diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3cf431c..ec2eeb6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,6 +3,7 @@ "tasks": [ { "type": "func", + "label": "func: host start", "command": "host start", "problemMatcher": "$func-python-watch", "isBackground": true, diff --git a/README.md b/README.md index 6b9120b..16bd1b4 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Clone or download [this sample's repository](https://github.com/Azure-Samples/fa The code in the sample folder has already been updated to support use of the FastAPI. Let's walk through the changed files. -The `requirements.txt` file has an additional dependency of the `fastapi` and `nest_asyncio` modules: +The `requirements.txt` file has an additional dependency of the `fastapi` module: ``` azure-functions @@ -111,7 +111,7 @@ async def main(req: func.HttpRequest, context: func.Context) -> func.HttpRespons First run the command below to install the necessary requirements. ```log -pip3 install -r requirements.txt +python3 -m pip install -r requirements.txt ``` If you are using VS Code for development, follow [the instructions for running a function locally](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-python#run-the-function-locally). Otherwise, follow [these instructions for using Core Tools commands directly to run the function locally](https://docs.microsoft.com/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Cpython%2Cportal%2Cbash#start). @@ -130,9 +130,15 @@ http://localhost:7071/sample http://localhost:7071/hello/YourName ``` -### Testing in Azure +### Deploying to Azure + +There are three main ways to deploy this to Azure: -If you are using VS Code for development, follow [these instructions for using the extension to create resources and deploying to Azure](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python#publish-the-project-to-azure). Otherwise, follow [these instructions for using the Azure CLI to create resources and deploy to Azure](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=azure-cli%2Cbash%2Cbrowser#create-supporting-azure-resources-for-your-function). +* [Deploy with the VS Code Azure Functions extension](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python#publish-the-project-to-azure). +* [Deploy with the Azure CLI](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=azure-cli%2Cbash%2Cbrowser#create-supporting-azure-resources-for-your-function). +* Deploy with the Azure Developer CLI: After [installing the `azd` tool](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=localinstall%2Cwindows%2Cbrew), run `azd up` in the root of the project. You can also run `azd pipeline config` to set up a CI/CD pipeline for deployment. + +### Testing in Azure Once deployed, test different paths on the deployed URL, using either a browser or a tool like Postman.