2.1 Self-Guided Setup¶
This is the start of the self-guided workshop track using your own Azure subscription.
ARE YOU CURRENTLY AT AN AITOUR SESSION? → JUMP TO SKILLABLE-BASED SETUP instead
1. Review Pre-Requisites¶
Need a refresher on the pre-requisites for the workshop? Review them here.
3. Launch GitHub Codespaces¶
The Contoso Chat sample repository has a dev container defined. We can activate this in GitHub Codespaces to get a prebuilt development environment with all required tools and depenencies installed. Let's do that now.
On completing this step, you should have the following:
- Launched GitHub Codespaces to get the pre-built dev environment.
- Forked the sample repo to your personal GitHub profile.
TIP: Use Copy to clipboard
feature to copy commands and reduce errors
In the following sections, you will encounter codeblocks that have commands you will need to run in the VS Code terminal. Hover over the codeblock to get a Copy to clipboard icon for quick copy-paste operations.
3.1 Navigate to GitHub & Login¶
-
Open a new browser tab. Navigate to the link below.
1
https://aka.ms/contoso-chat/prebuild
-
You will be prompted to log into GitHub. Login with your GitHub profile.
3.2 Setup GitHub Codespaces¶
-
You see a page titled "Create codespace for Azure-Samples/contoso-chat"
- Check branch is
contoso-chat-v4
-
Click dropdown for 2-core and verify it is
Prebuild ready
Using the pre-build option makes your GitHub Codespaces load up faster.
- Check 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
CLOSE THE README TAB. We will not be using those instructions today.
- You should see a new browser tab open to a link ending in
3.3 Fork Repo To Your Profile¶
Your GitHub Codespaces is running on the original Azure Samples repo for this sample. Let's fork this now, so we have a personal copy to modify and reviist. We will use the GitHub CLI to complete this in just a few quick steps!
-
Open VS Code Terminal. Run this command to verify GitHub CLI is installed.
1
gh --version
-
Then run this command to authenticate with GitHub, with scope to allow forks.
1
GITHUB_TOKEN="" gh auth login --hostname github.com --git-protocol https --web --scopes workflow
-
Follow the prompts to complete auth flow in three steps (screenshots below).
STEP 1 - Complete Device Activation flow (expand for screenshot)
- Say "Yes" when prompted to authenticate with GitHub credentials
- Copy the one-time code provided in the console
- Press "Enter" to open the Device Activation window
-
Copy the code into that window as shown below
Here is an example of what that looks like:
STEP 2 - Confirm GitHub authorization scope (expand for screenshot)
- You should see this authorization dialog on activation
- Click the green "Authorize github" button to continue
-
This gives the GitHub CLI (this session) permission to do the fork
STEP 3 - Verify you are Logged in.
-
The console log should show you are logged in successfully
-
Next, run this command to fork the repo.
1
GITHUB_TOKEN="" gh repo fork --remote
CONGRATULATIONS. You have a personal fork of the repo in your profile!
4. Authenticate with Azure¶
To access the provisioned Azure resources, we need to be authenticated from our development environment. We will do this in two steps.
STEP ONE: Authenticate with az
for post-provisioning tasks
-
Log into the Azure CLI
az
using the command below.1
az login --use-device-code
- Copy the 8-character code shown to your clipboard.
- Visit https://microsoft.com/devicelogin in a new tab and paste code.
- Select account with Username shown in your Skillable Lab panel.
- Click Continue and complete flow. Close the tab when prompted.
- Return to GitHub Codespaces tab and view the VS Code terminal.
- Press Enter to select the default presented subscription and tenant.
- This completes the az login workflow
2. STEP TWO: Authenticate with azd
for managing application deployment
-
Log into the Azure Developer CLI using the command below.
1
azd auth login --use-device-code
- Follow the same process as before to complete the authentication workflow.
- Note: Now you will just select the Skillable login from options (no password needed)
CONGRATULATIONS. You are logged in from Azure CLI and Azure Developer CLI
5. Provision & Deploy App¶
This repository is an AI Application Template that can be provisioned and deployed using the Azure Developer CLI tool with a single command. Let's see how this works.
-
Open the Visual Studio Code terminal and type this command:
1
azd up
-
You will be prompted for the following 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.
CONGRATULATIONS. You've completed the SELF-GUIDED Setup!
NEXT STEPS:VALIDATE YOUR SETUP AND CHECK YOUR DEPLOYMENT1