A. Self-Guided Setup¶
Welcome to the Self-Guided Lab Track! ยท Want the In-Venue Skillable Track instead? Go here
1. Review Pre-Requisites¶
You need a valid Azure subscription, GitHub account, and access to relevant Azure OpenAI models, to complete this lab on your own. You'll need to provision the infrastructure yourself, as described below. Review the Pre-Requisites section if you need more details.
2. Launch GitHub Codespaces¶
Our development environment uses a Visual Studio Code editor with a Python runtime. The Contoso Chat sample repository is instrumented with a dev container which specifies all required tools and dependencies. At the end of this step you should have:
- Launched GitHub Codespaces to get the pre-built dev environment.
- Fork the sample repo to your personal GitHub profile.
2.1 Navigate to GitHub & Login¶
- Open a browser tab (T1) and navigate to the link below.
1
https://aka.ms/contoso-chat/prebuild
- You will be prompted to log into GitHub. Login now with your GitHub profile.
2.2 Setup GitHub Codespaces¶
-
You will see a page titled "Create codespace for Azure-Samples/contoso-chat"
- Check that the Branch is
msignite-LAB401
- Click dropdown for 2-core and verify it is
Prebuild ready
Using the pre-build makes the GitHub Codespaces load up faster.
- Check that the Branch is
-
Click the green "Create codespace" button
- You should see a new browser tab open to a link ending in
*.github.dev
- You should see a Visual Studio Code editor view loading (takes a few mins)
- When ready, you should see the README for the "Contoso Chat" repository
Do NOT Follow those README instructions. Continue with this workshop guide!
- You should see a new browser tab open to a link ending in
2.3 Fork Repo To Your Profile¶
The Codespaces is running on the original Azure Samples repo. Let's create a fork from Codespaces, so we have a personal copy to modify. For convenience, we'll follow this process which streamlines the process once you make any edit.
-
Lets create an empty file from the VS Code Terminal.
1
touch .workshop-notes.md
-
This triggers a notification (blue "1") in Source Control icon on sidebar
- Click the notification to start the Commit workflow
- Enter a commit message ("Forking Contoso Chat") and click "Commit"
- You will now be prompted to "Publish Branch"
- You should see 2 options (remote = original repo, origin = your fork)
- Select the
origin
option (verify that the URL is to your profile)
- This will create a fork of the repository in your profile
- It also updates the GitHub Codespaces to use your fork for commits
- You are now ready to move to the next step!
2.4 Verify Dependencies¶
Use the following commands in the VS Code terminal to verify these tools are installed.
Bash | |
---|---|
1 |
|
Bash | |
---|---|
1 |
|
Bash | |
---|---|
1 |
|
Bash | |
---|---|
1 |
|
Bash | |
---|---|
1 |
|
You are now ready to connect your VS Code environment to Azure.
3. Authenticate With Azure¶
To access our Azure resources, we need to be authenticated from VS Code. Return to the GitHub Codespaces tab, and open up a VS Code terminal. Then, complete these two steps:
Step 1: Authenticate with az
for post-provisioning tasks
-
Log into the Azure CLI
az
using the command below.Text Only 1
az login --use-device-code
-
Copy the 8-character code shown to your clipboard, then control-click the link to visit https://microsoft.com/devicelogin in a new browser tab.
-
Select the account with the Username shown in the Skillable Lab window. Click "Continue" at the
are you sure?
prompt, and then close the tab -
Back in the Terminal, press Enter to select the default presented subscription and tenant.
Step 2: Authenticate with azd
for provisioning & managing resources
-
Log into the Azure Developer CLI using the command below.
Text Only 1
azd auth login --use-device-code
-
Follow the same process as before - copy code, paste it when prompted, select account.
- Note: you won't need to enter the password again. Just select the Skillable lab account.
4. Provision & Deploy App¶
This project is an azd-template
! It defines infrastructure-as-code assets that are used by the Azure Developer CLI to provision and manage your solution infrastructure resources.
-
Provision & deploy the solution with one command:
azd up
-
You will be prompted for various inputs:
- Subscription - specify your own active Azure subscription ID
- Environment name for resource group - we recommend using
AITOUR
-
Location for deployment - we recommend using
francecentral
Refer to Region Availability guidance and pick the option with desired models and quota available.
-
Wait for the process to complete. It may take 15-20 minutes or more.
- On successful completion you will see a
SUCCESS: ...
message on the console.