Azure API Management User

This page shows how to write Terraform and Azure Resource Manager for API Management User and write them securely.

azurerm_api_management_user (Terraform)

The User in API Management can be configured in Terraform with the resource name azurerm_api_management_user. The following sections describe 6 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_api_management_user" "user" {

  user_id             = var.user_id
  api_management_name = var.apim_name
  resource_group_name = var.resource_group_name
  first_name          = var.first_name
main.tf#L1
resource "azurerm_api_management_user" "user" {

  user_id             = var.service_settings.user_id
  api_management_name = var.service_settings.endpoint_name
  resource_group_name = var.context.resource_group_name
  first_name          = var.service_settings.first_name
main.tf#L2
resource "azurerm_api_management_user" "user" {

  user_id             = var.user_id
  api_management_name = var.apim_name
  resource_group_name = var.resource_group_name
  first_name          = var.first_name
portal-users.tf#L1
resource "azurerm_api_management_user" "user" {
  for_each = { for apim_users in var.apim_users : apim_users.user_id => apim_users }
  api_management_name = var.apim_name
  resource_group_name = var.apim_resource_group
  user_id             = each.value.user_id
  first_name          = each.value.first_name
main.tf#L7
resource "azurerm_api_management_user" "this" {
  api_management_name = var.api_management_name
  confirmation        = var.confirmation
  email               = var.email
  first_name          = var.first_name
  last_name           = var.last_name
main.tf#L7
resource "azurerm_api_management_user" "this" {
  api_management_name = var.api_management_name
  confirmation        = var.confirmation
  email               = var.email
  first_name          = var.first_name
  last_name           = var.last_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an API Management User.

Microsoft.ApiManagement/service/users (Azure Resource Manager)

The service/users in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/users. 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 - string
  • name required - string

    User identifier. Must be unique in the current API Management service instance.

  • properties required
      • appType optional - string

        Determines the type of application which send the create user request. Default is legacy portal.

      • confirmation optional - string

        Determines the type of confirmation e-mail that will be sent to the newly created user.

      • email required - string

        Email address. Must not be empty and must be unique within the service instance.

      • firstName required - string

        First name.

      • identities optional array
          • id optional - string

            Identifier value within provider.

          • provider optional - string

            Identity provider name.

      • lastName required - string

        Last name.

      • note optional - string

        Optional note about a user set by the administrator.

      • password optional - string

        User Password. If no value is provided, a default password is generated.

      • state optional - string

        Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.

  • type required - string

Frequently asked questions

What is Azure API Management User?

Azure API Management User 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 User?

For Terraform, the aadi555/azurerm, persistentsystems/terraform-azurerm and markti/terraform-azure source code examples are useful. See the Terraform Example section for further details.