https://learn.microsoft.com/ja-jp/azure/virtual-network/quick-create-template
-- 1. リソースグループ作成
az group create \
--name rg01 \
--location japaneast
az group list
-- 2. ARMデプロイ開始
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.6.18.56646",
"templateHash": "10806234693722113459"
}
},
"parameters": {
"vnetName": {
"type": "string",
"defaultValue": "vnet01",
"metadata": {
"description": "vnet01"
}
},
"vnetPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "vnet01 prefix"
}
},
"subnet1Name": {
"type": "string",
"defaultValue": "subnet01",
"metadata": {
"description": "subnet01"
}
},
"subnet1Prefix": {
"type": "string",
"defaultValue": "10.0.1.0/24",
"metadata": {
"description": "subnet01 prefix"
}
},
"subnet2Name": {
"type": "string",
"defaultValue": "subnet02",
"metadata": {
"description": "subnet02"
}
}, "subnet2Prefix": {
"type": "string",
"defaultValue": "10.0.2.0/24",
"metadata": {
"description": "subnet02 prefix"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2021-08-01",
"name": "[parameters('vnetName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('vnetPrefix')]"
]
},
"subnets": [
{
"name": "[parameters('subnet1Name')]",
"properties": {
"addressPrefix": "[parameters('subnet1Prefix')]"
}
},
{
"name": "[parameters('subnet2Name')]",
"properties": {
"addressPrefix": "[parameters('subnet2Prefix')]"
}
}
]
}
}
]
}
az group deployment create \
--resource-group rg01 \
--name arm01 \
--template-file a.json
az group deployment list \
--resource-group rg01
az group deployment show \
--resource-group rg01 \
--name arm01
-- 3. リソースグループ削除
az group delete \
--name rg01 \
--yes