forked from Azure/azureml-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-github.sh
101 lines (48 loc) · 2.19 KB
/
azure-github.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
echo "Setting variables..."
# <set_variables>
GROUP="azureml-examples"
LOCATION="eastus"
WORKSPACE="main"
# </set_variables>
# additional variables
SUBSCRIPTION=$(az account show --query id -o tsv)
SECRET_NAME="AZ_CREDS"
echo "Installing Azure CLI extension for Azure Machine Learning..."
# <az_ml_install>
az extension add -n ml -y
# </az_ml_install>
echo "Creating resource group..."
# <az_group_create>
az group create -n $GROUP -l $LOCATION
# </az_group_create>
echo "Creating service principal and setting repository secret..."
# <set_repo_secret>
az ad sp create-for-rbac --name $GROUP --role owner --scopes /subscriptions/$SUBSCRIPTION/resourceGroups/$GROUP --sdk-auth | gh secret set $SECRET_NAME
# </set_repo_secret>
echo "Creating Azure Machine Learning workspace..."
# <az_ml_workspace_create>
az ml workspace create -n $WORKSPACE -g $GROUP -l $LOCATION
# </az_ml_workspace_create>
echo "Configuring Azure CLI defaults..."
# <az_configure_defaults>
az configure --defaults group=$GROUP workspace=$WORKSPACE location=$LOCATION
# </az_configure_defaults>
echo "Setting up workspace..."
bash -x setup-workspace.sh
echo "Setting up managed vnet workspace"
# Managed online endpoint vnet setup: Create via bicep: vnet, workspace, storage, acr, kv, nsg, PEs + UAI
# <managed_vnet_workspace_suffix>
# SUFFIX will be used as resource name suffix in created workspace and related resources
export SUFFIX="<UNIQUE_SUFFIX>"
# </managed_vnet_workspace_suffix>
export SUFFIX="mevnet"
# <managed_vnet_workspace_create>
az deployment group create --template-file endpoints/online/managed/vnet/setup_ws/main.bicep --parameters suffix=$SUFFIX
# Note: if you get an error that appinsights is not available in your current location, use optional parameter to the above script: appinsightsLocation=<location> (e.g. westus2)
# </managed_vnet_workspace_create>
# create the user assigned identity used in the vnet egress testing
az deployment group create --template-file endpoints/online/managed/vnet/setup_ws/uai.bicep --parameters suffix=$SUFFIX
echo "Setting up internal workspaces..."
bash -x create-workspace-internal.sh
echo "Setting up extra workspaces..."
bash -x create-workspace-extras.sh