зеркало из
1
0
Форкнуть 0
0 VM Extensions (v1)
Peter Taylor редактировал(а) эту страницу 2017-04-25 15:02:19 -07:00

Use the virtualMachine-extensions building block template to deploy one or more virtual machine extensions to an Azure virtual machine.

Extensions can also be configured when using the multi-vm-n-nic-m-storage building block template. Both building block templates use the same extensions parameter structure.

Parameters

The virtualMachine-extensions building block template contains one parameter named virtualMachinesExtensionSettings.

virtualMachinesExtensionSettings

The virtualMachinesExtensionSettings parameter specifies the extensions to be installed on VMs. It contains the following properties:

  • vms
    Array of values. Required.
    Specifies an array of names of pre-existing VMs that the extensions will be installed on.
  • extensions
    Array of objects. Required.
    Specifies one or more extension definitions. Each extension definition is specified using the following object:
    • name
      Value. Required.
      Defines the display name of this extension.
    • publisher
      Value. Required.
      Extension publisher name.
    • type
      Value. Required.
      Extension type.
    • typeHandlerVersion
      Value. Required.
      Version of extension to use.
    • autoUpgradeMinorVersion
      Value. Required.
      Valid values: true | false
      Set to true if the extension can upgrade automatically. Otherwise false.
    • settingsConfigMapperUri
      Value. Required.
      Valid value: https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/templates/resources/Microsoft.Compute/virtualMachines/extensions/vm-extension-passthrough-settings-mapper.json
      URL of template used during deployment process.
    • settingsConfig
      Object. Required.
      Specifies extension specific settings. Set to an empty object for no extension specific settings.
    • protectedSettingsConfig
      Object. Required.
      Specifies extension specific settings that are encrypted during deployment. Set to an empty object for no extension specific settings.

Deployment

You can deploy a building block using Azure portal, PowerShell, or Azure CLI.

Azure portal

Note that this building block deployment process requires a parameter file stored in a location with a publicly available URI.

  1. Right-click the button below and select either "open link in new tab" or "open link in new window":
  2. Wait for the Azure Portal to open.
  3. In the Basics section:
  • Select your Subscription from the drop-down list.
  • For the Resource group, you can either create a new resource group or use an existing resource group.
  • Select the region where you'd like to deploy the VNet in the Location drop-down list.
  1. In the Settings section, enter a URI to a valid parameter file. There are several example parameter files in Github. Note that if you want to use one of these parameter files the URI must be the path to the raw file in Github. These parameter files require pre-existing VNets and subnets and the deployment will fail if they do not exist. You will need to inspect the parameters to determine these requirements.
  2. Review the terms and conditions, then click the I agree to the terms and conditions stated above checkbox.
  3. Click the Purchase button.
  4. Wait for the deployment to complete.

PowerShell

To deploy the building block template using a parameter file hosted at a publicly available URI, follow these steps:

  1. Upload your parameter file to a location with a publicly available URI.
  2. Log in to Azure using your selected subscription:
Login-AzureRmAccount -SubscriptionId <your subscription ID>
  1. If you do not have an existing resource group, run the New-AzureRmResourceGroup cmdlet to create one as shown below:
New-AzureRmResourceGroup -Location <Target Azure Region> -Name <Resource Group Name> 
  1. Deploy a VNet. For more information see the vnet-n-subnet building block template.
  2. Run the New-AzureRmResourceGroupDeployment cmdlet as shown below.
New-AzureRmResourceGroupDeployment -ResourceGroupName <Resource Group Name> -TemplateUri https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/azuredeploy.json -templateParameterUriFromTemplate <URI of parameter file>

Example
The cmdlet below deploys the multiple-extensions-multiple-vms parameter file from the scenarios folder in Github.

Note that this deployment requires two existing VMs, one named bb-dev-biz-vm1 and one named bb-dev-biz-vm2.

New-AzureRmResourceGroupDeployment -ResourceGroupName bb-dev-rg -TemplateUri https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/azuredeploy.json -templateParameterUriFromTemplate https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/parameters/multiple-extensions-multiple-vms.parameters.json

Azure CLI

Before you begin, install the latest version of the Azure CLI.

To deploy the building block template using a parameter file hosted at a publicly available URI, follow these steps:

  1. Upload your parameter file to a location with a publicly available URI.
  2. Log in to Azure using your selected subscripton:
az login
  1. Set your selected subscription:
az account set --subscription <your subscripton ID>
  1. If you do not have an existing resource group, create a new one using the following command:
az group create -l <Target Azure Region> -n <Resource Group Name> 
  1. Deploy a VNet. For more information see the vnet-n-subnet building block template.
  2. Run the command shown below:
az group deployment create -g <Resource Group Name> --template-uri https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/azuredeploy.json --parameters "{\"templateParameterUri\":{\"value\":\"<parameter file public URI>\"}}"

Example

The command below deploys the multiple-extensions-multiple-vms.parameters parameter file from the scenarios folder in Github.

Note that this deployment requires two existing VMs, one named bb-dev-biz-vm1 and one named bb-dev-biz-vm2.

az login
az group deployment create -g bb-dev-rg --template-uri https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/azuredeploy.json --parameters "{\"templateParameterUri\":{\"value\":\"https://raw.githubusercontent.com/mspnp/template-building-blocks/v1.0.0/scenarios/virtualMachine-extensions/parameters/multiple-extensions-multiple-vms.parameters.json\"}}"