Workshop Challenge: Changing the Logo in the App¶
One of the easiest and most fun changes you can make to the app is updating the logo! Follow these step-by-step instructions to replace the current logo with your own or use the provided ContosoImg logo.
Step 1: Prepare Your New Logo**¶
- Create or use a new logo (e.g contosoImg logo) in
src/app/src/Assets/
. - Save the logo as an image file (e.g.,
logo.png
). - Ensure the image has a reasonable size (e.g., 100x100 pixels) for better display.
- Place the logo file in the following folder:
src/app/src/Assets/
Step 2: Update the Logo Component¶
-
Open the
App.tsx
file located at:
Text Only 1
src/App/src/App.tsx
-
Comment out the original import on line 24:
TSX | |
---|---|
1 |
|
- Add a new import statement for your logo image:
TSX | |
---|---|
1 |
|
-
Locate the current logo implementation (around line 309):
tsx <AppLogo />
-
Comment out the existing logo component and replace it with the image tag:
TSX | |
---|---|
1 2 |
|
Step 3: Run the App¶
- Go to the Azure Portal.
- In the search bar, type the name of the Resource Group you created during Challenge 1.
- Within the resource group, look for the API App Service ending in -api.
- In the App Service, navigate to Settings > Environment variables.
- Locate the following environment variables:
AZURE_AI_SEARCH_API_KEY
AZURE_OPENAI_API_KEY
- Copy their values and paste them into your local
\workshop\docs\workshop\.env.sample
file:AZURE_AI_SEARCH_API_KEY=your-key-from-portal
AZURE_OPENAI_API_KEY=your-other-key-from-portal
- Rename the .env.sample file to .env
- Open a terminal or command prompt.
- Navigate to the project directory where
start.cmd
is located:
Bash | |
---|---|
1 |
|
- Start the application:
Bash | |
---|---|
1 |
|
Once the app starts, you should see your new logo!