Bicep sample (DSVM:Data Science Virtual Machine (Ubunt + Windows Server) + Bastion)
- Install az cli
https://docs.microsoft.com/ja-jp/cli/azure/install-azure-cli
- bicep install
https://github.com/Azure/bicep/blob/main/docs/installing.md#windows-installer
- Edit parameter File
- azuredeploy.parameters.dev.json
- require
xxx.xxx.xxx.xxx -> Your IP Address.
xxx(vmpassword)(At least 12 characters (uppercase, lowercase, and numbers))
xxxx (sshPublicKey)
- option
vmuser -> Your choice Virtual Machine User ID.
Standard_NC6s_v3 -> Your choice Virtual Machine Size.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ipaddress": {
"value": "xxx.xxx.xxx.xxx"
},
"dsvmLinuxSize": {
"value": "Standard_NC6s_v3"
},
"dsvmWindowsSize": {
"value": "Standard_NC6s_v3"
},
"vmuser": {
"value": "adminuser"
},
"vmpassword": {
"value" : "xxx"
},
"sshPublicKey": {
"value": "xxxx"
}
}
}
- Execute PowerShell Prompt
- Set Parameter(x)
set-variable -name TENANT_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -option constant
set-variable -name SUBSCRIPTOIN_GUID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -option constant
set-variable -name BICEP_FILE "main.bicep" -option constant
set-variable -name PARAMETER_FILE "azuredeploy.parameters.dev.json" -option constant
$resourceGroupName = "xxxxx"
$location = "xxxxx"
- Go to STEP2 (Azure CLI or PowerShell)
- Azure Login
az login -t ${TENANT_ID} --verbose
- Set Subscription
az account set --subscription ${SUBSCRIPTOIN_GUID} --verbose
- Create Resource Group
az group create --name ${resourceGroupName} --location ${location} --verbose
- Deployment Create
az deployment group create --resource-group ${resourceGroupName} --template-file ${BICEP_FILE} --parameters ${PARAMETER_FILE} --verbose
- Azure Login
Connect-AzAccount -Tenant ${TENANT_ID} -Subscription ${SUBSCRIPTOIN_GUID}
- Create Resource Group
New-AzResourceGroup -Name ${resourceGroupName} -Location ${location} -Verbose
- Deployment Create
New-AzResourceGroupDeployment `
-Name devenvironment `
-ResourceGroupName ${resourceGroupName} `
-TemplateFile ${BICEP_FILE} `
-TemplateParameterFile ${PARAMETER_FILE} `
-Verbose