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_namerequired - string -
api_namerequired - string -
descriptionoptional - string -
display_namerequired - string -
idoptional computed - string -
methodrequired - string -
operation_idrequired - string -
resource_group_namerequired - string -
url_templaterequired - string -
requestlist block-
descriptionoptional - string -
headerlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
query_parameterlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
representationlist block-
content_typerequired - string -
sampleoptional - string -
schema_idoptional - string -
type_nameoptional - string -
form_parameterlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
-
-
responselist block-
descriptionoptional - string -
status_coderequired - number -
headerlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
representationlist block-
content_typerequired - string -
sampleoptional - string -
schema_idoptional - string -
type_nameoptional - string -
form_parameterlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
-
-
template_parameterlist block-
default_valueoptional - string -
descriptionoptional - string -
namerequired - string -
requiredrequired - bool -
typerequired - string -
valuesoptional - set of string
-
-
timeoutssingle 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
apiVersionrequired - stringnamerequired - stringOperation identifier within an API. Must be unique in the current API Management service instance.
propertiesrequireddescriptionoptional - stringDescription of the operation. May include HTML formatting tags.
displayNamerequired - stringOperation Name.
methodrequired - stringA Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
policiesoptional - stringOperation Policies
requestoptionaldescriptionoptional - stringOperation request description.
headersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
queryParametersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
representationsoptional arraycontentTyperequired - stringSpecifies a registered or custom content type for this representation, e.g. application/xml.
examplesoptional - undefinedParameter examples.
formParametersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
schemaIdoptional - stringSchema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
typeNameoptional - stringType name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
responsesoptional arraydescriptionoptional - stringOperation response description.
headersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
representationsoptional arraycontentTyperequired - stringSpecifies a registered or custom content type for this representation, e.g. application/xml.
examplesoptional - undefinedParameter examples.
formParametersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
schemaIdoptional - stringSchema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
typeNameoptional - stringType name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
statusCoderequired - integerOperation response HTTP status code.
templateParametersoptional arraydefaultValueoptional - stringDefault parameter value.
descriptionoptional - stringParameter description.
examplesoptional - undefinedParameter examples.
namerequired - stringParameter name.
requiredoptional - booleanSpecifies whether parameter is required or not.
schemaIdoptional - stringSchema identifier.
typerequired - stringParameter type.
typeNameoptional - stringType name defined by the schema.
valuesoptional - arrayParameter values.
urlTemplaterequired - stringRelative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
typerequired - 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.