deploy/azure/az/createresources.sh

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#!/bin/bash

CreateGroup()
{
	echo Creating resource group $resource_group in '$location'
	az group create --name $resource_group --location $location
}   # end of CreateGroup()



deployresources()
{
	echo Deploying ARM template '$path_and_filename.json' in resource group $resource_group
	az group deployment create --resource-group $resource_group --parameters @$path_and_filename.parameters.json --template-file $path_and_filename.json
}   # end of deployresources

Error_Usage()
{
	echo ""
	echo Usage: 
	echo create-resources arm-file resource-group-name [-c location]
	echo arm-file: Path to ARM template WITHOUT .json extension. An parameter file with same name plus '.parameters' MUST exist in same folder
	echo resource-grop-name: Name of the resource group to use or create
	echo -c: If appears means that resource group must be created. If -c is specified, must use enter location
	echo ""
	echo Examples:
	echo "1 create-resources path_and_filename testgroup (Deploys path_and_filename.json with parameters specified in path_and_filename.parameters.json file)."
	echo "2 create-resources path_and_filename newgroup -c westus (Deploys path_and_filename.json (with parameters specified in path_and_filename.parameters.json file) in a NEW resource group named newgroup in the westus location)"
}



if [ $# -le 1 ]; then
	Error_Usage
	exit 1
fi
if [ "$1" == "" ]; then
    echo "path_and_filename is empty"
	Error_Usage
	exit 1
fi

if [ "$2" == "" ]; then
    echo "Resource Group is empty"
	Error_Usage
	exit 1
fi

if [ ! -f "$1.json" ]; then
	echo "$1.json doesn't exist"
	exit 1
fi

if [ ! -f "$1.parameters.json" ]; then
	echo "$1.parameters.json doesn't exist"
	exit 1
fi


path_and_filename=$1
后面还有 18 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。