What are the pre-requisites for this workshop?
- Azure Subscription (if you don’t have one, you can create a free account here)
- Azure CLI (if you don’t have one, you can install it here)
- Github Account (if you don’t have one, you can create one here
- Github Codespaces - Github Codespaces is a feature of Github that allows you to develop in a cloud-hosted, container-based development environment. To learn more about Github Codespaces, you can check out the documentation.
- Azure OpenAI API resource and deployment of
text-davinci-003model (see instructions for setting these up here)
What infrastructure will be deployed for this workshop?
For this workshop, we will be using GitHub Actions using OpenID Connect and Infrastructure-as-Code (IaC) using Bicep to deploy the AKS cluster, to derive following benefits:
- Infrastructure-as-Code (IaC) - Infrastructure is defined as code, and can be version controlled and reviewed.
- OpenID Connect - OpenID Connect is an authentication protocol that allows you to connect securely to Azure resources using your GitHub account.
- GitHub Actions - GitHub Actions is a feature of GitHub that allows you to automate your software development workflows.
How do I get started with the workshop?
To get started with the workshop, we will perform the following tasks:
- Forking this repository into your GitHub account
- Creating Github Codespace for this repository
- Creating an Azure Resource Group
- Configuring OpenID Connect in Azure.
- Setting Github Actions secrets
- Enabling the GitHub Actions workflow
Forking this repository into your GitHub account
- Fork this repository into your GitHub account by clicking on the “Fork” button at the top right of its page.
- Clone your newly forked repository to your local machine.
Creating Github Codespace for this repository
- Open your forked Github repository in Github and click on the
Codetab. - Click on the
Open with Codespacesbutton.
Creating an Azure Resource Group
az login
export resourceGroupName="openai-levelup-rg"
location="eastus"
az group create --name $resourceGroupName --location $location
[!NOTE] if you are using a non-Microsoft account, and if running CodeSpaces in the browser, you may receive an error with message
localhost refused to connectafter logging in. If so:
- Copy the URL.
- Run
curl '<pasted url>'(URL in quotes) in a new Visual Studio Code terminal.In the original terminal, the login should now succeed.
Configuring OpenID Connect in Azure
- execute aad-federated-cred.sh, passing your github username as the argument, as shown below:
chmod +x ./tools/deploy/module0/aad-federated-cred.sh
./tools/deploy/module0/aad-federated-cred.sh <github-username>
- note down the appId echoed by the running the above script for use in next step
Setting Github Actions secrets
- In your forked Github repository, click on the
Settingstab. - In the left-hand menu, expand
Secrets and variables, and click onActions. - Click on the
New repository secretbutton for each of the following secrets:AZURE_SUBSCRIPTION_ID(runaz account show --query id -o tsvto get the value)AZURE_TENANT_ID(runaz account show --query tenantId --output tsvto get the value)AZURE_CLIENT_ID(this is theappIdfrom running the previous step)AZURE_RESOURCE_GROUP(this is theresourceGroupNamefrom earlier step, which isopenai-levelup-rg)
Enable GitHub Actions workflow
- Enable GitHub Actions for your repository by clicking on the Actions tab, and clicking on the
I understand my workflows, go ahead and enable thembutton.