-
Notifications
You must be signed in to change notification settings - Fork 10
/
MinecraftBedrockAzure.sh
66 lines (55 loc) · 1.81 KB
/
MinecraftBedrockAzure.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
#For creating a minecraft server that runs on an ACI Instance
SUB="PseudoProd"
RG="MinecraftBedrock"
LOC="uksouth"
STOR="minecaftbedrock555"
SHARE="bworldu"
CONT="bworldu"
WORLD="byers-ultimate-world"
VERSION="1.19.40.02"
ACRNAME="gbpseudoprod"
az account set -s $SUB
az group create --name $RG --location $LOC
az storage account create \
--resource-group $RG \
--name $STOR \
--kind StorageV2 \
--sku Standard_ZRS \
--enable-large-file-share \
--output none
KEY=$(az storage account keys list -g $RG -n $STOR --query [0].value -o tsv)
az storage share create \
--account-name $STOR \
--name $SHARE \
--account-key $KEY \
--quota 1024 \
--output none
ACRPW=$(az acr credential show -n $ACRNAME --query "passwords[0].value" -o tsv)
ACRSERVER=$(az acr show -n $ACRNAME -g $RG --query loginServer -o tsv)
az acr import -n $ACRNAME --source docker.io/itzg/minecraft-bedrock-server:latest --image itzg/minecraft-bedrock-server:latest
az container create \
--resource-group $RG \
--name $CONT \
--image $ACRSERVER/itzg/minecraft-bedrock-server:latest \
--registry-username $ACRNAME \
--registry-password $ACRPW \
--cpu 2 --memory 2 \
--dns-name-label $WORLD \
--ports 19132 \
--protocol UDP \
--azure-file-volume-account-name $STOR \
--azure-file-volume-account-key $KEY \
--azure-file-volume-share-name $SHARE \
--azure-file-volume-mount-path /data \
--environment-variables \
'EULA'='TRUE' \
'DEBUG'='TRUE' \
'VERSION'=$VERSION \
'GAMEMODE'='survival' \
'LEVEL_NAME'=$WORLD \
'LEVEL_SEED'='8486214866965744170' \
'TICK_DISTANCE'='4' \
'DIFFICULTY'='easy'
FQDN=$(az container show -n $CONT -g $RG --query ipAddress.fqdn -o tsv)
echo $FQDN
az container logs -g $RG -n $CONT --follow