Introduction
Microsoft Azure services in the Preview stage may not be immediately available in the stable Azure API and SDK, which the Terraform AzureRM provider depends on. However, you can still use Terraform to deploy these services.
For example, the userAssigned identity feature for the azurerm_search_serviceresource is not yet available in the azurerm provider because it is currently in Azure Preview status. Since the provider primarily supports the stable Azure API, the service must reach General Availability (GA) status and be added to the API by Microsoft before it can be fully supported in the provider.
This article explains how to use Terraform to provision a resource that is not yet available in the azurerm provider.
Prerequisites
- Before proceeding, you must accept the Supplemental Terms of Use for Microsoft Azure Previews in your Azure account.
Procedure
You can deploy an Azure Preview service by using its equivalent Azure ARM template within a resource group. The azurerm provider offers the azurerm_resource_group_template_deployment resource for this purpose. This resource also ensures that any additional resources created by the template are tracked and removed during a terraform destroy operation.
Continuing with the azurerm_search_service example, you can find the equivalent Azure ARM template in the Azure documentation. You can then use this template with the azurerm_resource_group_template_deployment resource to deploy the service.
Additional Information
Other tools such as Microsoft Bicep or the community-supported AzAPI provider can also deploy Azure Preview services. This article focuses on the method using the official azurerm provider.