Skip to content

Commit

Permalink
Split out task
Browse files Browse the repository at this point in the history
  • Loading branch information
feaselkl committed Nov 21, 2024
1 parent a3c6245 commit 942432b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions docs/02_implement_function_calls/02_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,27 +138,29 @@ app.MapGet("/Hotels/{hotelId}/Bookings/{min_date}", async (int hotelId, DateTime

### 05: Test Web API service

1. Build and run the Web API service locally. Connect to the URL provided in the **"Now listening on:"** line and navigate to the `/Hotels` endpoint. For example, if your host is localhost and on port 5292, navigate to `http://localhost:5292/Hotels`. You should see a list of four hotels. Test the other two endpoints as well.
Build and run the Web API service locally. Connect to the URL provided in the **"Now listening on:"** line and navigate to the `/Hotels` endpoint. For example, if your host is localhost and on port 5292, navigate to `http://localhost:5292/Hotels`. You should see a list of four hotels. Test the other two endpoints as well.

{: .note }
> If you are using GitHub Codespaces, select the **Open in Browser** button when you receive an informational message that "Your application running on port 5292 is available." From there, you can navigate to the `/Hotels` endpoint in your browser.
{: .note }
> If you are using GitHub Codespaces, select the **Open in Browser** button when you receive an informational message that "Your application running on port 5292 is available." From there, you can navigate to the `/Hotels` endpoint in your browser.
<details markdown="block">
<summary><strong>Expand this section to view the solution</strong></summary>
<details markdown="block">
<summary><strong>Expand this section to view the solution</strong></summary>

To run the .NET Web API application, navigate to the `src/ContosoSuitesWebAPI/` folder in your terminal. This terminal should have access to the `SQLAZURECONNSTR_ContosoSuites` environment variable. Then, run the following commands to restore NuGet packages, build the project, and run the project.
To run the .NET Web API application, navigate to the `src/ContosoSuitesWebAPI/` folder in your terminal. This terminal should have access to the `SQLAZURECONNSTR_ContosoSuites` environment variable. Then, run the following commands to restore NuGet packages, build the project, and run the project.

```csharp
dotnet restore
dotnet build
dotnet run
```
```csharp
dotnet restore
dotnet build
dotnet run
```

</details>

</details>
### 06: View API Integration page

2. Open the Streamlit application and navigate to the **API Integration** page. You should see a drop-down list asking you to select a hotel, followed by a table of bookings for that hotel.
Open the Streamlit application and navigate to the **API Integration** page. You should see a drop-down list asking you to select a hotel, followed by a table of bookings for that hotel.

### 06: Deploy Web API service
### 07: Deploy Web API service

Deploy your App Service code changes and ensure they propagate to Azure App Services. Then, add a new connection string to the App Service's environment variables called `ContosoSuites`. The Value should be the value of your connection string and the Type should be **SQLAzure**. Azure App Services will automatically add the `SQLAZURECONNSTR_` to the beginning of your environment variable, so you should not add it yourself when creating this variable.

Expand All @@ -179,7 +181,7 @@ After saving your changes, select the **Apply** button to finish saving the new

</details>

### 07: Test dashboard application
### 08: Test dashboard application

Test your deployed Streamlit application and ensure that it is able to load the hotels drop-down list and bookings table as expected.

Expand Down

0 comments on commit 942432b

Please sign in to comment.