AZURE HEROES
  • Home-Updates
  • Blog
    • Azure Blog
    • Azure Heroes Events >
      • Azure Heroes Sessions #1
      • Azure Heroes Sessions #2
      • Azure Heroes Sessions #3
      • Azure Heroes Sessions #4
      • Azure Heroes Sessions #5
      • Azure Heroes Sessions #6
      • Azure Heroes Sessions #7
  • Who We Are!
  • eBooks
  • Azure All In One!
    • Azure Disk & Storage
    • Azure Network
    • Azure VPN
    • Azure VMs
  • Free Azure Support!
  • Contact Us
  • Events
    • Beginners Event
    • Developers Event
    • Special Event
    • Azure Workshop #4
    • Azure Workshop #5
    • Azure Workshop #6
    • Azure Workshop #7
    • Azure Workshop #8
    • Upcoming Events
  • Registration Form
  • Privacy Policy
  • Home-Updates
  • Blog
    • Azure Blog
    • Azure Heroes Events >
      • Azure Heroes Sessions #1
      • Azure Heroes Sessions #2
      • Azure Heroes Sessions #3
      • Azure Heroes Sessions #4
      • Azure Heroes Sessions #5
      • Azure Heroes Sessions #6
      • Azure Heroes Sessions #7
  • Who We Are!
  • eBooks
  • Azure All In One!
    • Azure Disk & Storage
    • Azure Network
    • Azure VPN
    • Azure VMs
  • Free Azure Support!
  • Contact Us
  • Events
    • Beginners Event
    • Developers Event
    • Special Event
    • Azure Workshop #4
    • Azure Workshop #5
    • Azure Workshop #6
    • Azure Workshop #7
    • Azure Workshop #8
    • Upcoming Events
  • Registration Form
  • Privacy Policy

Terraform resource azapi_update_resource

11/5/2022

0 Comments

 
The AzAPI Terraform Provider simplifies the deployment and management of Microsoft Azure resources by providing a streamlined solution built on top of Azure ARM REST APIs. This provider enables the management of any Azure resource, regardless of the Azure ARM API version being used. Its primary advantage is the ability to deploy and manage new Azure resources and properties that may not be supported by the azurerm Terraform Provider, making it a versatile tool for Azure resource management.

The AzAPI Terraform Provider streamlines the management of Microsoft Azure Preview Resources and Properties not yet supported by the azurerm Terraform Provider. This provider focuses on offering management capabilities for a limited set of Azure resources and properties, making it simple yet powerful.
The provider consists of two Terraform resources:
1. azapi_resource – For managing Azure Resources not supported by the azurerm Terraform Provider.
2. azapi_update_resource – For managing Preview Properties of Azure Resources not supported by the azurerm Terraform Provider.
3. azapi_resource_action - This resource can perform any Azure resource manager resource action. It's recommended to use it to perform actions which change a resource's state, please use azapi_resource_action data source, if user wants to perform readonly action, such as start/stop a virtual machine
In general, when managing Azure Resources through Terraform Infrastructure as Code, it's recommended to use the azurerm Terraform Provider. However, when encountering unsupported resources or properties, the AzAPI Terraform Provider steps in to provide the necessary management capabilities.
Built as a thin layer on top of Azure ARM REST APIs, the AzAPI Terraform Provider is able to manage any Azure Resource by specifying the Resource Type symbolic name and API Version. This versatility makes the AzAPI Terraform Provider a valuable tool for managing Azure Preview Resources and Properties from Terraform.

azapi_resource

The azapi_resource definition is a solution for managing Azure resources that are not supported by the azurerm Terraform Provider. It requires the "type" attribute to be set to the desired Azure ARM resource type and API version within the Azure REST API.
As an example, the following code manages the Azure Custom IP Prefixes resource (Microsoft.Network/customIpPrefixes) using the 2021-03-01 API version:

Picture
In this example, several attributes are configured in addition to the type:
  • name is the name of the Azure resource.
  • parent_id is the Azure resource ID for the parent of the resource.
  • location is the Azure region/location where the resource will be provisioned.
  • body is a JSON encoding of the required properties for the resource, which is set using the jsonencode() Terraform function.
Picture

azapi_update_resource

The azapi_update_resource is a tool for managing preview properties of Azure resources that have not yet been supported by the azurerm Terraform provider. This resource utilizes the Azure ARM (Azure Resource Manager) REST APIs to manage these properties, by setting the type attribute to the desired Azure Resource Type name and API version.
As an example, consider the scenario where you need to set the anonymousPullEnabled Preview Feature for the Azure Container Registry resource (Microsoft.ContainerRegistry/registries) using the 2020-11-01-preview API Version. The code would look like this:

Picture
In this example, the properties attribute is used to define the preview feature that you want to set. The name attribute sets the name of the Azure resource, and the parent_id attribute sets the ID of the parent resource group for the registry.
The azapi_update_resource resource is a convenient way to manage preview features of Azure resources when those features are not yet supported by the azurerm Terraform provider.

azapi_resource_actio
Picture
Remember to select the right resource from the AzAPI provider to complete actions correctly.

0 Comments



Leave a Reply.

    Author

    Mohammad Al Rousan is a Microsoft MVP (Azure), Microsoft Certified Solution Expert (MCSE) in Cloud Platform & Azure DevOps & Infrastructure, An active community blogger and speaker. Al Rousan has over 8 years of professional experience in IT Infrastructure and very passionate about Microsoft technologies and products.

    Picture
    Picture
    Top 10 Microsoft Azure Blogs

    Archives

    November 2022
    October 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    May 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    June 2020
    April 2020
    January 2020
    July 2019
    June 2019
    May 2019
    February 2019
    January 2019

    Categories

    All
    AKS
    Azure
    Beginner
    CDN
    DevOps
    End Of Support
    Fundamentals
    Guide
    Hybrid
    License
    Migration
    Network
    Security
    SQL
    Storage
    Virtual Machines
    WAF

    RSS Feed

    Follow
    Free counters!
Powered by Create your own unique website with customizable templates.