Create a resource block for Microsoft Azure Cloud

task australia Updated Sep 10, 2026 3 min read create-resource-block-azure-terraform.md
Raw file servicenow.com

Resource blocks are the building blocks of cloud catalog items. Create a resource block for the Microsoft Azure Cloud Platform provider, based on a CI type from the CMDB.

Before you begin

Role required: sn_cmp.cmp_root_admin

Procedure

  1. In the Cloud Admin Portal, navigate to Design > Resource Blocks.

  2. Click New to open the Create Resource Block dialog box and then fill in the form.

    For a detailed description of each field, see Create a custom resource block.

    Field Description
    Name Enter a name (Azure Datacenter) for the resource block.
    Description Enter a valid description
    Layer Select the type of resource block (Logical Datacenter).
    CI Type Select the CI type (Azure Datacenter) that the resource block represents.
    Guest Interface Select a default guest interface (Compute Interface) to use when you add a resource block to a template.
  3. Click Submit.

    The resource block information appears.

  4. Click the Resource Script sub tab and then click New.

Field

Description

Name

Enter a name (For example, Create_AzureTF_Stack_Response_Processor) for the resource script.

Type

Select a type (Response Processor) for the script.

Script Resource Script for Create

Enter the following script: ``` function processResponse (response, cloudServiceAccountId, ldc, correlationId, step, requestorContext, stackId) { var responseObject = global.JSON.parse(response); var tfState = global.JSON.parse(responseObject.terraform.state); var processor = new sn_cmp_terraform.TerraformResponseProcessor(); var processedResponses = processor.processResponse(tfState, cloudServiceAccountId, ldc, correlationId, step, requestorContext, stackId); return global.JSON.stringify(processedResponses); }

Text
</td></tr><tr><td>
Script Resource Script for Delete
</td><td>
Enter the following script: ```function processResponse (response, cloudServiceAccountId, ldc,						  correlationId, step, requestorContext, stackId) {	var responseObject = global.JSON.parse(response);	var tfState = global.JSON.parse(responseObject.terraform.state);	var processor = new sn_cmp_terraform.TerraformResponseProcessor();	var processedResponses = processor.processResponse(tfState, cloudServiceAccountId,  ldc,							   correlationId, step, requestorContext, stackId);	return global.JSON.stringify(processedResponses);}
5. Click **Submit**.
  1. Click the Operations sub tab and then click Steps.

  2. Select CreateStack from the Operations list.

  3. Click the Add a Step plus icon to open the Add Operation Steps dialog box and then fill in the form.

Field

Description

Operation Type

Select the type of operation.

Invoke Cloud API: Select this option to select a provider, interface, and method from CAPI.

API Provider[Operation Type = Invoke Cloud API]

Select the API that provides the interfaces you need. The providers are part of the Cloud API (CAPI).

For example, CAPI supplies the Terraform OpenSourceprovider, which provides the Configuration Orchestration Interface.

This value appears if you select the Invoke Cloud API operation type.

API Interface[Operation Type = Invoke Cloud API]

Select the interface that has the methods you want to use. For this example, the Configuration Orchestration Interface provides multiple interfaces or methods, which the system uses during provisioning.

API Method[Operation Type = Invoke Cloud API]

Select the method to perform the operation. In this example, ExecuteCommand is required to provision terraform templates.

CAPI Version[Operation Type = Invoke Cloud API]

Enter the version of the CAPI API.

Condition

Enter an optional condition that must be met before the system uses this step.

9. Click **Submit**.
  1. Click Response Processor and then click the plus icon.

    The Add Response Processor dialog box appears.

  2. Select Create_AzureTF_Stack_Response_Processor from the Script Name list and click Submit.

  3. Move the state of the resource block from Draft to Published.

    The Azure Datacenter resource block moves from the draft to the published state and no further changes can be made to the resource block. Changes to a resource block can be made only if the status is set to Draft.

Parent Topic:Resource blocks in Cloud Provisioning and Governance

Search documentation
Search document titles and file paths on the australia branch