Skip to content

Commit 2045541

Browse files
committed
Merge remote-tracking branch 'bigmorty/main'
2 parents 3be836e + 7f2cbb7 commit 2045541

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

README.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,51 @@ git clone https://github.com/Azure-Samples/functions-quickstart-python-azd.git
4545
```
4646

4747
### Create a virtual environment
48-
1) Open the terminal, navigate to the project folder, and run the following commands:
48+
Open the terminal, navigate to the project folder, and run the following commands:
4949

50+
#### bash
5051
```bash
5152
python -m venv .venv
5253
source .venv/bin/activate
5354
```
5455

56+
#### PowerShell
57+
```powershell
58+
py -m venv .venv
59+
.venv/scripts/activate
60+
```
61+
62+
#### Cmd
63+
```cmd
64+
py -m venv .venv
65+
.venv/scripts/activate
66+
```
67+
5568
### Using Functions CLI
69+
5670
1) Open this folder in a new terminal and run the following commands:
5771

58-
```bash
59-
pip install -r requirements.txt
60-
func start
61-
```
72+
```bash
73+
pip install -r requirements.txt
74+
func start
75+
```
6276

63-
2) Test the HTTP GET trigger using the browser to open [http://localhost:7071/api/http_get](http://localhost:7071/api/http_get)
77+
2) Test the HTTP GET trigger using the browser to open http://localhost:7071/api/httpget
6478

65-
3) Test the HTTP POST trigger in a new terminal window:
66-
```bash
67-
curl -i -X POST http://localhost:7071/api/http_post -H "Content-Type: text/json" -d '{"name":"yourname"}'
68-
```
79+
3) Test the HTTP POST trigger using your favorite REST client (e.g. [RestClient in VS Code](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)). `test.http` has been provided to run this quickly.
80+
Or in a new terminal run the following:
81+
82+
```bash
83+
curl -i -X POST http://localhost:7071/api/httppost -H "Content-Type: text/json" -d "{\"name\": \"Awesome Developer\", \"age\": \"25\"}"
84+
```
6985

7086
### Using Visual Studio Code
87+
7188
1) Open this folder in a new terminal
7289
2) Open VS Code by entering `code .` in the terminal
73-
3) Press Run/Debug (F5) to run in the debugger (select "Debug anyway" if prompted about local emulater not running)
74-
4) Insure your favorite REST clientextension is installed (e.g. [RestClient in VS Code](https://marketplace.visualstudio.com/items?itemName=humao.rest-client), PostMan, etc.)
75-
5) Open the file src/functions/test/ which contains a GET and POST test
76-
6) Click the "Send Request" link for each and see the results in the right-hand pane that opens
90+
3) Make sure the [Azure Functions extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) is installed
91+
4) Press Run/Debug (F5) to run in the debugger (select "Debug anyway" if prompted about local emulater not running)
92+
5) Use same approach above to test using an HTTP REST client
7793

7894
## Source Code
7995

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name: functions-quickstart-python-azd
44
metadata:
5-
template: functions-quickstart-python-azd@0.0.2-beta
5+
template: functions-quickstart-python-azd@1.0.0
66
services:
77
processor:
88
project: .

test.http

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
GET http://localhost:7071/api/httpget?name=World HTTP/1.1
1+
GET http://localhost:7071/api/httpget HTTP/1.1
2+
3+
###
4+
5+
GET http://localhost:7071/api/httpget?name=Awesome%20Developer HTTP/1.1
26

37
###
48

0 commit comments

Comments
 (0)