forked from jsa2/CloudShellAadApps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote.sh
52 lines (31 loc) · 1.33 KB
/
remote.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
#
# curl -o- https://raw.githubusercontent.com/jsa2/CloudShellAadApps/public/remote.sh | bash
git clone 'https://github.com/jsa2/CloudShellAadApps.git'
cd CloudShellAadApps
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 14
nvm use 14
nvm alias default 14
npm install
rnd=$RANDOM
rg=queryStorage-$rnd
location=westeurope
# You can ignore the warning "command substitution: ignored null byte in input"
storageAcc=storage$(head /dev/urandom | tr -dc a-z | head -c10)
echo $storageAcc
# Create Resource Group
az group create -n $rg \
-l $location \
--tags="svc=scan"
# Create storageAcc Account
az storage account create -n $storageAcc -g $rg --kind storageV2 -l $location -t Account --sku Standard_LRS
az storage account show-connection-string -g $rg -n $storageAcc -o json > src/config.json
az storage account management-policy create --account-name $storageAcc -g $rg --policy @retention.json
node main.js
echo "navigate to kql/runtime.kql if code does not open up"
code kql/runtime.kql
echo "To later delete the deployment type:"
echo "az group delete -n $rg "
echo "az group delete -n $rg " > deleteDepl.sh