Skip to content

Commit ba4720a

Browse files
authored
Merge pull request #18 from sophia-ramsey/m-hietala/readme_update_to_relocate_local_dev_server
readme update to relocate local development server
2 parents de671f3 + 082ae99 commit ba4720a

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ or [customize the models](docs/deploy_customization.md#customizing-model-deploym
171171
```
172172
Check for any errors during the deployment, since updated app code will not get deployed if errors occur.
173173

174+
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
175+
either by deleting the resource group in the Portal or running `azd down`.
176+
174177
## Tracing and Monitoring
175178
176179
You can view console logs in Azure portal. You can get the link to the resource group with the azd tool:
@@ -192,7 +195,53 @@ You can view the App Insights tracing in Azure AI Foundry. Select your project o
192195
193196
## Development Options
194197
195-
As an alternative to local development environment, the following development environment options can be used.
198+
In addition to the development setup documented above, the following development environment options can be used.
199+
200+
<details>
201+
<summary><b>Local Development Server</b></summary>
202+
203+
#### Local Development Server
204+
205+
You can optionally use a local development server to test app changes locally. Make sure you first [deployed the app](#deployment) to Azure before running the development server.
206+
207+
1. Create a [Python virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments) and activate it.
208+
209+
On Windows:
210+
211+
```shell
212+
python -m venv .venv
213+
.venv\scripts\activate
214+
```
215+
216+
On Linux:
217+
218+
```shell
219+
python3 -m venv .venv
220+
source .venv/bin/activate
221+
```
222+
223+
2. Navigate to the `src` directory:
224+
225+
```shell
226+
cd src
227+
```
228+
229+
3. Install required Python packages:
230+
231+
```shell
232+
python -m pip install -r requirements.txt
233+
```
234+
235+
4. Run the local server:
236+
237+
```shell
238+
python -m uvicorn "api.main:create_app" --factory --reload
239+
```
240+
241+
5. Click 'http://127.0.0.1:8000' in the terminal, which should open a new tab in the browser.
242+
243+
6. Enter your message in the box.
244+
</details>
196245
197246
<details>
198247
<summary><b>GitHub Codespaces</b></summary>

0 commit comments

Comments
 (0)