This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
This article describes how to create and manage formulas in Azure DevTest Labs. A formula in DevTest Labs is a list of default property values that are used to create a virtual machine (VM). When you create a VM from a formula, the default values can be used as-is, or modified.
Formulas are similar tocustom images andMarketplace images, as they provide a mechanism for fast VM provisioning. Similar to custom images, formulas enable you to create a base image from a virtual hard disk (VHD) file. The base image can then be used to provision a new VM. To help decide which approach is right for your particular environment, seeComparing custom images and formulas in DevTest Labs.
You needOwner permissions in DevTest Labs to create, modify, and delete formulas for a lab.
There are two ways to create formulas:
Anyone with DevTest LabsUsers permissions can create VMs by using a formula as a base.
For more information about adding users and permissions, seeAdd owners and users in Azure DevTest Labs.
You can create a formula by selecting a base image in DevTest Labs. The base image can be any Marketplace image or an image from a shared image gallery attached to your lab.
Note
Depending on your base selection for the formula, theBasic orAdvanced configuration settings might be different from the values described in this section. If your base is an image from a shared image gallery, you might not be able to change certainBasic > Authentication settings like theUser name andPassword. Settings that can't be changed are either not visible on the configuration page or the field isn't available for editing. You might also see extra settings, such as theAdvanced > Image version field.
Follow these steps to create a formula from a base image:
In theAzure portal, go to your DevTest Labs resource where you want to create the formula.
On your labOverview page, expand theSettings section in the left menu, and selectConfiguration and policies.
On theConfiguration and policies screen, expand theVirtual machine bases section in the left menu, and selectFormulas (reusable bases).
On theFormulas (reusable bases) page, selectAdd:
On theChoose a base page, select the base (custom image, Marketplace image, or a shared image gallery image) that you want to use to create the formula.
On theBasic Settings tab of theCreate formula page, configure the following values for the new formula:
Formula name: Enter a name for your formula. This value displays in the list of base images when lab users create a VM. The formula name is validated as you type. A message indicates the requirements for a valid name. As an option, you can provide aDescription for the formula.
User Name: Enter the name for a user with administrator privileges for the lab.
Authentication type (Marketplace and custom bases only): Select the type of authentication to apply to VMs created from the formula, and then configure the security settings. If your base selection for the formula is from a shared image gallery, these options aren't visible on the configuration page.
ForPassword authentication, provide aPassword for the user with administrator privileges.
ForSSH Public Key authentication, provide anSSH Public Key for the user with administrator privileges.
Use a saved secret: You can also save secrets in your Azure key vault first and then use the secrets when you create formulas and other resources in your lab. To use a password or SSH public key stored in your key vault, selectUse a saved secret, and then specify a key value that corresponds to your stored secret (password or SSH public key). For more information, seeStore secrets in a key vault.
Virtual machine size: A common size is prefilled according to the base image you selected for the formula. The size specifies the processor cores, RAM size, and hard drive size of the VM to create from the formula. To use a different size, selectChange size and choose from a list of available sizes and support options.
OS disk type: The selected base image for the formula determines your options for the disk type. Depending on the base, you can choose from the following options:
Artifacts: Zero or more artifacts are added by default according to the selected base image for the formula. You can also selectAdd or Remove Artifacts to change the artifacts for the formula.
Important
If you're new to DevTest Labs or configuring artifacts, review the guidance inAdd artifacts to DevTest Labs VMs andCreate custom artifacts for your Azure DevTest Labs VM before you set up the artifacts for the formula.
On theAdvanced settings tab, configure the following settings:
Virtual network: The virtual network for your lab or the selected base is prefilled in the text field. Use the dropdown list to select from available networks.
Subnet Selector: The subnet for the selected virtual network for your lab or the selected base is prefilled in the text field. Use the dropdown list to select from available subnets.
IP address: Specify the type of IP address for VMs created from the formula:Public,Private, orShared. For more information about shared IP addresses, seeUnderstand shared IP addresses in Azure DevTest Labs.
Expiration date: To automatically delete the VM, specify theexpiration date andexpiration time.
Expiration date and time: This setting field isn't available for editing when creating a formula. The default setting isWill not expire.
Make this machine claimable: When you make a machineclaimable, a VM created from the formula isn't assigned ownership at the time of creation. Instead, lab users can take ownership ("claim") the machine as needed from theClaimable virtual machines list for the lab.
Image version (Shared image gallery only): If your base selection for the formula is from a shared image gallery, you see this field. Use this setting to specify the version of the image to use for VMs created from the formula.
SelectSubmit to create the formula.
After DevTest Labs creates the formula, it's visible in the list on theFormulas (reusable bases) page:
You can also create a formula by using an existing VM in your lab as the base.
Note
The creation date for the existing VM must be later than March 30, 2016.
Follow these steps to create a formula from an existing VM in your lab:
In theAzure portal, go to your DevTest Labs resource where you want to create the formula.
On your labOverview page, select the VM to use as the base for the formula:
On theOverview page for the VM, expand theOperations section in the left menu, and selectCreate formula (reusable base):
On theCreate formula pane, enter aName and optionalDescription for your new formula.

SelectOK to create the formula.
After DevTest Labs creates the formula from the VM, it's visible in the list on theFormulas (reusable bases) page for the lab.
To modify any formula in your lab, follow these steps:
In theAzure portal, go to theFormulas (reusable bases) page for your DevTest Labs lab resource.
In the list of formulas, select the formula you want to modify.
On theUpdate formula page, modify the configuration settings for the formula. The settings are similar to the options on theCreate formula page.
Follow the instructions inCreate formula from base image and update the formula configuration as needed.
SelectUpdate Formula.
DevTest Labs updates the formula with your configuration changes and returns to theFormulas (reusable bases) page for the lab.
To delete any formula in your lab, follow these steps:
In theAzure portal, go to theFormulas (reusable bases) page for your DevTest Labs lab resource.
In the list of formulas, locate the formula you want to remove.
SelectMore options (...) for the formula, and then selectDelete:

In the confirmation popup dialog, selectYes to confirm the deletion.
DevTest Labs deletes the formula and removes it from the list on theFormulas (reusable bases) page for the lab.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?