Azure API Management API Operation
This page shows how to write Terraform and Azure Resource Manager for API Management API Operation and write them securely.
azurerm_api_management_api_operation (Terraform)
The API Operation in API Management can be configured in Terraform with the resource name azurerm_api_management_api_operation
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_api_operation" "Configurations-post" {
method = "POST"
url_template = "/*"
// ... other properties
api_management_name = azurerm_api_management.demo-apim.name
api_name = azurerm_api_management_api.demo-users-api.name
resource "azurerm_api_management_api_operation" "commerce_get" {
operation_id = "commerce-get"
api_name = azurerm_api_management_api.commerce.name
api_management_name = azurerm_api_management.this.name
resource_group_name = azurerm_resource_group.this.name
resource "azurerm_api_management_api_operation" "api_operation" {
count = length(var.res_api_operation)
operation_id = var.res_api_operation[count.index].operationid
api_name = var.res_api_name
api_management_name = var.res_apim_name
resource_group_name = var.res_rg_name
resource "azurerm_api_management_api_operation" "operation1" {
operation_id = "user-get"
api_name = azurerm_api_management_api.composite-api.name
api_management_name = azurerm_api_management.apim.name
resource_group_name = azurerm_resource_group.rg.name
display_name = "Get User Operation"
resource "azurerm_api_management_api_operation" "apim_api_operation" {
operation_id = var.operation_id == "" ? random_string.random.result : var.operation_id
api_name = var.api_mgmt_api_name
api_management_name = var.api_mgmt_name
resource_group_name = var.api_mgmt_rg
resource "azurerm_api_management_api_operation" "GetHouseholdAsync" {
operation_id = "gethouseholdasync"
api_name = azurerm_api_management_api.usersapiv1.name
api_management_name = azurerm_api_management_api.usersapiv1.api_management_name
resource_group_name = azurerm_api_management_api.usersapiv1.resource_group_name
display_name = "GetHouseholdAsync(Guid householdId)"
resource "azurerm_api_management_api_operation" "apim" {
operation_id = "liveness-check"
api_name = azurerm_api_management_api.apim.name
api_management_name = data.azurerm_api_management.apim.name
resource_group_name = var.virtual_network_resource_group
display_name = "Liveness check"
resource "azurerm_api_management_api_operation" "api_operation" {
operation_id = var.operation_id
api_name = var.apima_name
api_management_name = var.apim_name
resource_group_name = var.resource_group_name
display_name = var.display_name
resource "azurerm_api_management_api_operation" "op" {
operation_id = var.operation_id
api_name = var.api_name
api_management_name = var.apim_name
resource_group_name = var.resource_group_name
display_name = var.display_name
resource "azurerm_api_management_api_operation" "commerce_auth_post" {
operation_id = "commerce-auth-post"
api_name = azurerm_api_management_api.commerce_auth.name
api_management_name = azurerm_api_management.this.name
resource_group_name = azurerm_resource_group.this.name
Parameters
-
api_management_name
required - string -
api_name
required - string -
description
optional - string -
display_name
required - string -
id
optional computed - string -
method
required - string -
operation_id
required - string -
resource_group_name
required - string -
url_template
required - string -
request
list block-
description
optional - string -
header
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
query_parameter
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
representation
list block-
content_type
required - string -
sample
optional - string -
schema_id
optional - string -
type_name
optional - string -
form_parameter
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
-
-
response
list block-
description
optional - string -
status_code
required - number -
header
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
representation
list block-
content_type
required - string -
sample
optional - string -
schema_id
optional - string -
type_name
optional - string -
form_parameter
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
-
-
template_parameter
list block-
default_value
optional - string -
description
optional - string -
name
required - string -
required
required - bool -
type
required - string -
values
optional - set of string
-
-
timeouts
single block
Explanation in Terraform Registry
Manages an API Operation within an API Management Service.
Microsoft.ApiManagement/service/apis/operations (Azure Resource Manager)
The service/apis/operations in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/apis/operations
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringname
required - stringOperation identifier within an API. Must be unique in the current API Management service instance.
properties
requireddescription
optional - stringDescription of the operation. May include HTML formatting tags.
displayName
required - stringOperation Name.
method
required - stringA Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
policies
optional - stringOperation Policies
request
optionaldescription
optional - stringOperation request description.
headers
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
queryParameters
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
representations
optional arraycontentType
required - stringSpecifies a registered or custom content type for this representation, e.g. application/xml.
examples
optional - undefinedParameter examples.
formParameters
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
schemaId
optional - stringSchema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
typeName
optional - stringType name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
responses
optional arraydescription
optional - stringOperation response description.
headers
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
representations
optional arraycontentType
required - stringSpecifies a registered or custom content type for this representation, e.g. application/xml.
examples
optional - undefinedParameter examples.
formParameters
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
schemaId
optional - stringSchema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
typeName
optional - stringType name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
statusCode
required - integerOperation response HTTP status code.
templateParameters
optional arraydefaultValue
optional - stringDefault parameter value.
description
optional - stringParameter description.
examples
optional - undefinedParameter examples.
name
required - stringParameter name.
required
optional - booleanSpecifies whether parameter is required or not.
schemaId
optional - stringSchema identifier.
type
required - stringParameter type.
typeName
optional - stringType name defined by the schema.
values
optional - arrayParameter values.
urlTemplate
required - stringRelative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
type
required - string
Frequently asked questions
What is Azure API Management API Operation?
Azure API Management API Operation is a resource for API Management of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure API Management API Operation?
For Terraform, the ElAouaneHamza/Private-endpoint-conf, madsstorm/terraform-commercetools-azure-sample and avishekansible/AzureLandingZone source code examples are useful. See the Terraform Example section for further details.