Add Your Azure VM Image for Deployment
Currently, this feature is behind the Feature Flag AZURE_VMSS
. Contact Harness Support to enable the feature. During an Azure virtual machine scale set (VMSS) deployment, Harness creates a new VMSS using a VM image definition from your Shared Image Gallery.
In a Harness Service of the Azure Virtual Machine Scale Set deployment type, you select the image definition for Harness to use.
In this topic:
Before You Begin
- Azure Virtual Machine Scale Set Deployments Overview
- Connect to Azure for VMSS Deployments
- Harness Delegate Overview
- Harness Key Concepts
Ensure you have connected Harness to your Azure subscription as described in Connect to Azure for VMSS Deployments.
Supported Platforms and Technologies
See Supported Platforms and Technologies.
Step 1: Ensure You Have an Image Definition
Azure image definitions are simple to create. For steps on setting one up for the first time, see Create an Azure Shared Image Gallery using the portal or Tutorial: Create a custom image of an Azure VM with the Azure CLI from Azure.
Open you Shared Image Gallery and note the following information:
- Subscription
- Resource group
- Image gallery name
- Image definition name
You can see this information in the Shared Image Gallery:
You can also see this information in the gallery Properties.
Step 2: Create the Harness VMSS Service
- In Harness, create or open an Application. See Create an Application.
- Select Services, and then click Add Service.
- In the Add Service settings, name your Service.
- In Deployment Type, select Azure Virtual Machine Scale Set.
- Click Submit.
The new Service is created.
The Service only requires the image definition you want to use when creating your new VMSS.
Step 3: Add the Image Definition Artifact Source
- In the Harness Service, click Add Artifact Source.
- In the Artifact Source settings, in Cloud Provider, select the Azure Cloud Provider you added in Connect to Your Azure VMSS.
- In Subscription, select the subscription used in your image definition.
- In Resource Group, select resource group using in your image definition.
- In Image Gallery, select the image gallery containing your image definition.
- In Image Definition, select the image definition to use when creating your new MVSS.
- Click Submit.
The image definition information is added.
At deployment runtime, Harness will use this image definition to create the VMs in the VMSS.
If Harness cannot obtain this information, verify that the Client ID used in the Azure Cloud Provider has permissions to read the image gallery.
If you delete an image it might still show up here until Harness cleans up deleted images. Harness cleans up deleted images every 2 hours.
Next Steps
See Also
See the following docs from Azure:
- Troubleshooting shared image galleries in Azure
- Shared Image Gallery overview
- Azure virtual machine scale sets FAQs
Configure As Code
To see how to configure the settings in this topic using YAML, configure the settings in the UI first, and then click the YAML editor button.