From 8d8eba5af4b5cd286a6f1a145a948da0d3abad92 Mon Sep 17 00:00:00 2001 From: pepepaco Date: Mon, 23 Nov 2020 21:13:07 -0600 Subject: [PATCH] Create AzureBedrockServer.ps1 (#107) --- examples/AzureBedrockServer.ps1 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/AzureBedrockServer.ps1 diff --git a/examples/AzureBedrockServer.ps1 b/examples/AzureBedrockServer.ps1 new file mode 100644 index 0000000..9f339e5 --- /dev/null +++ b/examples/AzureBedrockServer.ps1 @@ -0,0 +1,29 @@ +#you need the Azure cli https://docs.microsoft.com/es-es/cli/azure/ + +#Login to Azure portal +az login + +#defaults to southcentralus but you can change it to one of the following list locations +#az account list-locations --query "[].{Region:name}" --out table + +#create a new resource group "mineResGroup" +az group create --name mineResGroup --location southcentralus + +#put the storage account "acismineacc" into that group +az storage account create --resource-group mineResGroup --name acismineacc --location southcentralus --sku Standard_LRS --kind StorageV2 + +#create the volume share "acismineshare" into the storage account +az storage share create --name acismineshare --account-name acismineacc + +#obtain the key from the account "acismineacc" in the resource group "mineResGroup" +$STORAGE_KEY=$(az storage account keys list --resource-group mineResGroup --account-name acismineacc --query "[0].value" --output tsv) +echo $STORAGE_KEY + +#to actually create the minecraft server int the dns name "minesvrbedrock" +#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" port "19132", this take some time be patient. +az container create --resource-group mineResGroup --name minecotainer --image itzg/minecraft-bedrock-server --dns-name-label minesvrbedrock --ports 19132 19133 --protocol udp --restart-policy OnFailure --environment-variables EULA=TRUE --azure-file-volume-account-name acismineacc --azure-file-volume-account-key $STORAGE_KEY --azure-file-volume-share-name acismineshare --azure-file-volume-mount-path /data + +#connect to fileshare drive "M" to edit server.properties and everything else +#you need to restart the container after each change. +cmd.exe /C "cmdkey /add:`"acismineacc.file.core.windows.net`" /user:`"Azure\acismineacc`" /pass:`"$STORAGE_KEY`"" +New-PSDrive -Name M -PSProvider FileSystem -Root "\\acismineacc.file.core.windows.net\acismineshare" -Persist