File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
scenarios/AksOpenAiTerraform Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ ms.custom: innovation-engine, linux-related-content
11
11
## Provision Resources with Terraform (~ 5 minutes)
12
12
Run terraform to provision all the Azure resources required to setup your new OpenAI website.
13
13
``` bash
14
+ # Authenticate
15
+ export ARM_SUBSCRIPTION_ID=$SUBSCRIPTION_ID
16
+ az ad sp create-for-rbac --name " ExecutableDocs" --role=" Contributor" --scopes=" /subscriptions/$ARM_SUBSCRIPTION_ID "
17
+ export ARM_CLIENT_ID=$( jq .appId <<< " $SP" )
18
+ export ARM_CLIENT_SECRET=$( jq .password <<< " $SP" )
19
+ export ARM_TENANT_ID=$( jq .tenant <<< " $SP" )
20
+
14
21
# Terraform parses TF_VAR_* as vars (Ex: TF_VAR_name -> name)
15
- export TF_VAR_location=" westus3 "
22
+ export TF_VAR_location=$REGION
16
23
export TF_VAR_kubernetes_version=" 1.30.9"
17
24
export TF_VAR_model_name=" gpt-4o-mini"
18
25
export TF_VAR_model_version=" 2024-07-18"
19
- # Terraform consumes sub id as $ARM_SUBSCRIPTION_ID
20
- export ARM_SUBSCRIPTION_ID=$SUBSCRIPTION_ID
21
26
# Run Terraform
22
27
terraform -chdir=terraform init
23
28
terraform -chdir=terraform apply -auto-approve
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ resource "azurerm_resource_group" "main" {
47
47
# Kubernetes
48
48
# ##############################################################################
49
49
resource "azurerm_kubernetes_cluster" "main" {
50
- name = " AksCluster"
50
+ name = " AksCluster- ${ local . random_id } "
51
51
location = var. location
52
52
resource_group_name = azurerm_resource_group. main . name
53
53
You can’t perform that action at this time.
0 commit comments