You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,29 +23,35 @@ which makes it easier to develop apps locally, deploy them to Azure, and monitor
23
23
24
24
### Local development
25
25
26
-
This project has devcontainer support, so you can open it in Github Codespaces or local VS Code with the Dev Containers extension.
26
+
This project has Dev Container support, so you can open it in Github Codespaces or local VS Code with the Dev Containers extension.
27
27
28
28
🎥 [Watch a screencast of running the app in Github Codespaces.](https://www.youtube.com/watch?v=r6Hnp9RXUpY)
29
29
30
30
Steps for running the server:
31
31
32
-
1. (Optional) If you're unable to open the devcontainer, [create a Python virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) and activate that.
32
+
1. (Optional) If you're unable to open the Dev Container, [create a Python virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) and activate that.
33
33
34
34
2. Install the requirements:
35
35
36
36
```shell
37
37
python3 -m pip install -r requirements.txt
38
38
```
39
39
40
-
3. Create an `.env` file using `.env.sample` as a guide. Set the value of `DBNAME` to the name of an existing database in your local PostgreSQL instance. Set the values of `DBHOST`, `DBUSER`, and `DBPASS` as appropriate foryour local PostgreSQL instance. If you'rein the devcontainer, copy the values from `.env.sample.devcontainer`.
40
+
3. Create an `.env` file using `.env.sample` as a guide. Set the value of `DBNAME` to the name of an existing database in your local PostgreSQL instance. Set the values of `DBHOST`, `DBUSER`, and `DBPASS` as appropriate foryour local PostgreSQL instance. If you'rein the Dev Container, copy the values from `.env.sample.devcontainer`.
41
41
42
-
4. Run the migrations:
42
+
4. In the `.env` file, fill in a secret value for`SECRET_KEY`. You can use this command to generate an appropriate value:
5. Run the local server: (or use VS Code "Run" button and select"Run server")
54
+
6. Run the local server: (or use VS Code "Run" button and select"Run server")
49
55
50
56
```shell
51
57
python3 -m flask run
@@ -60,20 +66,28 @@ This repo is set up for deployment on Azure App Service (w/PostGreSQL server) us
60
66
Steps for deployment:
61
67
62
68
1. Sign up for a [free Azure account](https://azure.microsoft.com/free/)
63
-
2. Install the [Azure Dev CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd). (If you opened this repository in a devcontainer, that part will be done for you.)
64
-
3. Provision and deploy all the resources:
69
+
2. Install the [Azure Dev CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd). (If you opened this repository in a Dev Container, that part will be done for you.)
70
+
3. Initialize a new `azd` environment:
71
+
72
+
```shell
73
+
azd init
74
+
```
75
+
76
+
It will prompt you to provide a name (like "flask-app") that will later be used in the name of the deployed resources.
77
+
78
+
4. Provision and deploy all the resources:
65
79
66
80
```shell
67
81
azd up
68
82
```
69
83
70
-
It will prompt you to login and to provide a name (like "flask-app") and location (like "eastus"). Then it will provision the resources in your account and deploy the latest code. If you get an error with deployment, changing the location (like to "centralus") can help, as there are availability constraints for some of the resources.
84
+
It will prompt you to login, pick a subscription, and provide a location (like "eastus"). Then it will provision the resources in your account and deploy the latest code. If you get an error with deployment, changing the location (like to "centralus") can help, as there may be availability constraints for some of the resources.
71
85
72
-
4. When `azd` has finished deploying, you'll see an endpoint URI in the command output. Visit that URI, and you should see the front page of the restaurant review app! 🎉 If you see an error, open the Azure Portal from the URL in the command output, navigate to the App Service, select Logstream, and check the logs for any errors.
86
+
5. When `azd` has finished deploying, you'll see an endpoint URI in the command output. Visit that URI, and you should see the front page of the restaurant review app! 🎉 If you see an error, open the Azure Portal from the URL in the command output, navigate to the App Service, select Logstream, and check the logs for any errors.
73
87
74
88

75
89
76
-
5. When you've made any changes to the app code, you can just run:
90
+
6. When you've made any changes to the app code, you can just run:
0 commit comments