GithubHelp home page GithubHelp logo

armexamples's People

Contributors

ravbhatnagar avatar

Watchers

 avatar  avatar

armexamples's Issues

ARM templete issue

Hi @ravbhatnagar , i created VM creation script but every time it promoting for input , like hostname , virtual network
this is my azuredeployed.jsom
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.2",
"parameters": {
"hostnames": {
"type": "string"
},
"location": {
"type": "string",
"allowedValues": [
"North Europe",
"West Europe"
],
"metadata": {
"description": "Location for the VM"
}
},
"virtualNetwork": {
"type": "string",
"metadata": {
"description": "Virtual Network"
}
},
"virtualNetworkResourceGroup": {
"type": "string",
"metadata": {
"description": "Resource group where to virtual network is found"
}
},
"subnet": {
"type": "string",
"metadata": {
"description": "Subnet"
}
},
"storageAccount": {
"type": "string",
"metadata": {
"description": "Storage account for VM"
}
},
"sizeOfInstance": {
"type": "string",
"allowedValues": [
"Standard_A0",
"Standard_A1",
"Standard_A2",
"Standard_A3",
"Standard_A4"
],
"defaultValue": "Standard_A3",
"metadata": {
"description": "Size for all deployed vms"
}
},
"diskSize": {
"type": "int",
"defaultValue": 300,
"metadata": {
"description": "Size for Datadisk0"
}
},
"sshUser": {
"type": "string",
"metadata": {
"description": "Admin SSH user"
}
},
"sshPassword": {
"type": "secureString",
"metadata": {
"description": "Password for SSH access"
}
},
"chefRunlist": {
"type": "string",
"defaultValue": "recipe[eon_base]",
"metadata": {
"description": "Chef runlist"
}
},
"chefServerUrl": {
"type": "string",
"metadata": {
"description": "Chef server url"
}
},
"chefValidationClientName": {
"type": "string",
"metadata": {
"description": "Chef Client validation name"
}
},
"chefValidationKey": {
"type": "secureString",
"metadata": {
"description": "Chef Client Validation.PEM as single line"
}
},
"chefEnvironment": {
"type": "string",
"metadata": {
"description": "Chef Environment"
}
},
"chefEncryptedDataBagSecret": {
"type": "secureString",
"metadata": {
"description": "Chef Encrypted Data Bag Secret"
}
},
"customScriptStorageAccount": {
"type": "string",
"metadata": {
"description": "Storage Account where your script is stored"
}
},
"customScriptStorageAccountKey": {
"type": "secureString",
"metadata": {
"description": "Access key for storage account where your script is stored"
}
},
"customScriptCommand": {
"type": "string",
"metadata": {
"description": "Command to execute with your custom script .. bash whatever.sh"
}
},
"customScriptFileUri": {
"type": "string",
"metadata": {
"description": "Uri where to find the custom script"
}
}
},
"variables": {
"subnet": "[parameters('subnet')]",
"imagePublisher": "OpenLogic",
"imageOffer": "CentOS",
"imageSKU": "7.1",
"vmName": "[parameters('hostnames')]",
"virtualNetworkName": "[parameters('virtualNetwork')]",
"vnetRg": "[parameters('virtualNetworkResourceGroup')]",
"vnetID": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/', variables('subnet'))]"
},
"resources": [{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageAccount')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"properties": {
"accountType": "Standard_LRS"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"names": "[concat('nic', parameters('hostnames'))]",
"location": "[parameters('location')]",
"properties": {
"ipConfigurations": [{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"names": "[parameters('hostnames')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', 'nic', parameters('hostnames'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('sizeOfInstance')]"
},
"osProfile": {
"computerName": "[parameters('hostnames')]",
"adminUsername": "[parameters('sshUser')]",
"adminPassword": "[parameters('sshPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[variables('imageSKU')]",
"version": "latest"
},
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/','osdisk', parameters('hostnames'), '.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [{
"name": "datadisk0",
"diskSizeGB": "[parameters('diskSize')]",
"lun": 0,
"vhd": {
"uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/','datadisk', parameters('hostnames'), '-data0','.vhd')]"
},
"createOption": "Empty"
},
{
"name": "datadisk1",
"diskSizeGB": "[parameters('diskSize')]",
"lun": 1,
"vhd": {
"uri": "[concat('http://',parameters('storageAccount'),'.blob.core.windows.net/vhds/','datadisk', parameters('hostnames'), '-data1','.vhd')]"
},
"createOption": "Empty"
}
]
},
"networkProfile": {
"networkInterfaces": [{
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat('nic', parameters('hostnames')))]"
}]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'),'/installcustomscript')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.4",
"settings": {
"fileUris": ["[parameters('customScriptFileUri')]"],
"commandToExecute": "[parameters('customScriptCommand')]"
},
"protectedSettings": {
"storageAccountName": "[parameters('customScriptStorageAccount')]",
"storageAccountKey": "[parameters('customScriptStorageAccountKey')]"
}
}
}
]
}

this is my azure.parameter.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostnames": {
"value": "test"
},
"location": {
"value": ""
},
"virtualNetwork": {
"value": ""
},
"virtualNetworkResourceGroup": {
"value": ""
},
"subnet": {
"value": ""
},
"storageAccount": {
"value": "test"
},
"sizeOfInstance": {
"value": "Standard_A1"
},
"diskSize": {
"value": 500
},
"sshUser": {
"value": ""
},
"sshPassword": {
"value": ""
},
"chefRunlist": {
"value": ""
},
"chefServerUrl": {
"value": ""
},
"chefValidationClientName": {
"value": ""
"
},
"chefValidationKey": {
"value": ""
},
"chefEnvironment": {
"value": "_default"
},
"chefEncryptedDataBagSecret" : {
"value": ""
},
"customScriptStorageAccount": {
"value": ""
},
"customScriptStorageAccountKey": {
"value": ""
},
"customScriptCommand": {
"value": ""
},
"customScriptFileUri": {
"value": ""
}
}
}

this is my power shell script

LOGIN

#Login-AzureRmAccount

SET SUBSCRIPTION

Set-AzureRmContext -SubscriptionId ""

SET LOCATION

$LOCATION = "West Europe"

SET A NICE NAME FOR YOUR DEPLOYMENT

$DEPLOYMENT_NAME = ""

SET RESOURCE GROUP

$RESOURCE_GROUP = ""

SET PATH TO YOUR TEMPLATES

$TEMPLATE_FILE = ""
$PARAMETER_FILE = ""

New-AzureRmResourceGroup -Name $RESOURCE_GROUP -Location $LOCATION
New-AzureRmResourceGroupDeployment -Name $DEPLOYMENT_NAME -ResourceGroupName $RESOURCE_GROUP -TemplateFile $TEMPLATE_FILE -TemplateParameterFile $PARAMETER_FILE -Force

please help me on that , thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.