1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. apimanagement
  6. ApiTag

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages the Assignment of an API Management API Tag to an API.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleService = Azure.ApiManagement.GetService.Invoke(new Azure.ApiManagement.GetServiceInvokeArgs
            {
                Name = "example-apim",
                ResourceGroupName = exampleResourceGroup.Name,
            });
            var exampleApi = new Azure.ApiManagement.Api("exampleApi", new Azure.ApiManagement.ApiArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                ApiManagementName = azurerm_api_management.Example.Name,
                Revision = "1",
            });
            var exampleTag = new Azure.ApiManagement.Tag("exampleTag", new Azure.ApiManagement.TagArgs
            {
                ApiManagementId = exampleService.Apply(exampleService => exampleService.Id),
            });
            var exampleApiTag = new Azure.ApiManagement.ApiTag("exampleApiTag", new Azure.ApiManagement.ApiTagArgs
            {
                ApiId = exampleApi.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleService := apimanagement.LookupServiceOutput(ctx, apimanagement.GetServiceOutputArgs{
    			Name:              pulumi.String("example-apim"),
    			ResourceGroupName: exampleResourceGroup.Name,
    		}, nil)
    		exampleApi, err := apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			ApiManagementName: pulumi.Any(azurerm_api_management.Example.Name),
    			Revision:          pulumi.String("1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewTag(ctx, "exampleTag", &apimanagement.TagArgs{
    			ApiManagementId: exampleService.ApplyT(func(exampleService apimanagement.GetServiceResult) (string, error) {
    				return exampleService.Id, nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewApiTag(ctx, "exampleApiTag", &apimanagement.ApiTagArgs{
    			ApiId: exampleApi.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleService = azure.apimanagement.getServiceOutput({
        name: "example-apim",
        resourceGroupName: exampleResourceGroup.name,
    });
    const exampleApi = new azure.apimanagement.Api("exampleApi", {
        resourceGroupName: exampleResourceGroup.name,
        apiManagementName: azurerm_api_management.example.name,
        revision: "1",
    });
    const exampleTag = new azure.apimanagement.Tag("exampleTag", {apiManagementId: exampleService.apply(exampleService => exampleService.id)});
    const exampleApiTag = new azure.apimanagement.ApiTag("exampleApiTag", {apiId: exampleApi.id});
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_service = azure.apimanagement.get_service_output(name="example-apim",
        resource_group_name=example_resource_group.name)
    example_api = azure.apimanagement.Api("exampleApi",
        resource_group_name=example_resource_group.name,
        api_management_name=azurerm_api_management["example"]["name"],
        revision="1")
    example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id)
    example_api_tag = azure.apimanagement.ApiTag("exampleApiTag", api_id=example_api.id)
    

    Example coming soon!

    Create ApiTag Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApiTag(name: string, args: ApiTagArgs, opts?: CustomResourceOptions);
    @overload
    def ApiTag(resource_name: str,
               args: ApiTagArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiTag(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               api_id: Optional[str] = None,
               name: Optional[str] = None)
    func NewApiTag(ctx *Context, name string, args ApiTagArgs, opts ...ResourceOption) (*ApiTag, error)
    public ApiTag(string name, ApiTagArgs args, CustomResourceOptions? opts = null)
    public ApiTag(String name, ApiTagArgs args)
    public ApiTag(String name, ApiTagArgs args, CustomResourceOptions options)
    
    type: azure:apimanagement:ApiTag
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ApiTagArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ApiTagArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ApiTagArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiTagArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiTagArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var apiTagResource = new Azure.ApiManagement.ApiTag("apiTagResource", new()
    {
        ApiId = "string",
        Name = "string",
    });
    
    example, err := apimanagement.NewApiTag(ctx, "apiTagResource", &apimanagement.ApiTagArgs{
    	ApiId: pulumi.String("string"),
    	Name:  pulumi.String("string"),
    })
    
    var apiTagResource = new ApiTag("apiTagResource", ApiTagArgs.builder()
        .apiId("string")
        .name("string")
        .build());
    
    api_tag_resource = azure.apimanagement.ApiTag("apiTagResource",
        api_id="string",
        name="string")
    
    const apiTagResource = new azure.apimanagement.ApiTag("apiTagResource", {
        apiId: "string",
        name: "string",
    });
    
    type: azure:apimanagement:ApiTag
    properties:
        apiId: string
        name: string
    

    ApiTag Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ApiTag resource accepts the following input properties:

    ApiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    Name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    ApiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    Name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId String
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name String
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    api_id str
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name str
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId String
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name String
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApiTag resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApiTag Resource

    Get an existing ApiTag resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ApiTagState, opts?: CustomResourceOptions): ApiTag
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_id: Optional[str] = None,
            name: Optional[str] = None) -> ApiTag
    func GetApiTag(ctx *Context, name string, id IDInput, state *ApiTagState, opts ...ResourceOption) (*ApiTag, error)
    public static ApiTag Get(string name, Input<string> id, ApiTagState? state, CustomResourceOptions? opts = null)
    public static ApiTag get(String name, Output<String> id, ApiTagState state, CustomResourceOptions options)
    resources:  _:    type: azure:apimanagement:ApiTag    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    Name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    ApiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    Name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId String
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name String
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId string
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name string
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    api_id str
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name str
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
    apiId String
    The ID of the API Management API. Changing this forces a new API Management API Tag to be created.
    name String
    The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.

    Import

    API Management API Tags can be imported using the resource id, e.g.

     $ pulumi import azure:apimanagement/apiTag:ApiTag example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/apis/api1/tags/tag1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.