What is the `azapi` provider and when do you use it?
IntermediateConceptAzure DevOps, Bicep and Terraform
Answer
azapi is a thin Terraform provider over the ARM REST API. azapi_resource takes the resource type with API version and a body that mirrors the ARM schema:
resource "azapi_resource" "example" {
type = "Microsoft.ContainerService/managedClusters/maintenanceConfigurations@2024-09-01"
name = "aksManagedAutoUpgradeSchedule"
parent_id = azurerm_kubernetes_cluster.aks.id
body = { properties = { maintenanceWindow = { schedule = { weekly = { dayOfWeek = "Sunday", intervalWeeks = 1 } }, durationHours = 4, startTime = "01:00", utcOffset = "+05:30" } } }
}
Use it for features or API versions azurerm doesn't support yet, or azapi_update_resource to patch a property. It coexists with azurerm in the same configuration.
More on Azure DevOps, Bicep and Terraform
What services make up Azure DevOps?BeginnerWhat are branch policies in Azure Repos?BeginnerExplain the YAML pipeline structure in Azure Pipelines.BeginnerWhat are service connections and how should they authenticate?IntermediateWhat are environments in Azure Pipelines?IntermediateWhat deployment strategies do deployment jobs support?Intermediate