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

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
azure logo

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi

    Manages an API Version Set within an API Management Workspace.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleService = new azure.apimanagement.Service("example", {
        name: "example-apim",
        location: example.location,
        resourceGroupName: example.name,
        publisherName: "Example Publisher",
        publisherEmail: "publisher@example.com",
        skuName: "Premium_1",
    });
    const exampleWorkspace = new azure.apimanagement.Workspace("example", {
        name: "example-workspace",
        apiManagementId: exampleService.id,
        displayName: "Example Workspace",
        description: "Example workspace for development",
    });
    const exampleWorkspaceApiVersionSet = new azure.apimanagement.WorkspaceApiVersionSet("example", {
        name: "example-version-set",
        apiManagementWorkspaceId: exampleWorkspace.id,
        displayName: "Example API Version Set",
        versioningScheme: "Segment",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_service = azure.apimanagement.Service("example",
        name="example-apim",
        location=example.location,
        resource_group_name=example.name,
        publisher_name="Example Publisher",
        publisher_email="publisher@example.com",
        sku_name="Premium_1")
    example_workspace = azure.apimanagement.Workspace("example",
        name="example-workspace",
        api_management_id=example_service.id,
        display_name="Example Workspace",
        description="Example workspace for development")
    example_workspace_api_version_set = azure.apimanagement.WorkspaceApiVersionSet("example",
        name="example-version-set",
        api_management_workspace_id=example_workspace.id,
        display_name="Example API Version Set",
        versioning_scheme="Segment")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
    			Name:              pulumi.String("example-apim"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			PublisherName:     pulumi.String("Example Publisher"),
    			PublisherEmail:    pulumi.String("publisher@example.com"),
    			SkuName:           pulumi.String("Premium_1"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleWorkspace, err := apimanagement.NewWorkspace(ctx, "example", &apimanagement.WorkspaceArgs{
    			Name:            pulumi.String("example-workspace"),
    			ApiManagementId: exampleService.ID(),
    			DisplayName:     pulumi.String("Example Workspace"),
    			Description:     pulumi.String("Example workspace for development"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewWorkspaceApiVersionSet(ctx, "example", &apimanagement.WorkspaceApiVersionSetArgs{
    			Name:                     pulumi.String("example-version-set"),
    			ApiManagementWorkspaceId: exampleWorkspace.ID(),
    			DisplayName:              pulumi.String("Example API Version Set"),
    			VersioningScheme:         pulumi.String("Segment"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleService = new Azure.ApiManagement.Service("example", new()
        {
            Name = "example-apim",
            Location = example.Location,
            ResourceGroupName = example.Name,
            PublisherName = "Example Publisher",
            PublisherEmail = "publisher@example.com",
            SkuName = "Premium_1",
        });
    
        var exampleWorkspace = new Azure.ApiManagement.Workspace("example", new()
        {
            Name = "example-workspace",
            ApiManagementId = exampleService.Id,
            DisplayName = "Example Workspace",
            Description = "Example workspace for development",
        });
    
        var exampleWorkspaceApiVersionSet = new Azure.ApiManagement.WorkspaceApiVersionSet("example", new()
        {
            Name = "example-version-set",
            ApiManagementWorkspaceId = exampleWorkspace.Id,
            DisplayName = "Example API Version Set",
            VersioningScheme = "Segment",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.apimanagement.Service;
    import com.pulumi.azure.apimanagement.ServiceArgs;
    import com.pulumi.azure.apimanagement.Workspace;
    import com.pulumi.azure.apimanagement.WorkspaceArgs;
    import com.pulumi.azure.apimanagement.WorkspaceApiVersionSet;
    import com.pulumi.azure.apimanagement.WorkspaceApiVersionSetArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example-apim")
                .location(example.location())
                .resourceGroupName(example.name())
                .publisherName("Example Publisher")
                .publisherEmail("publisher@example.com")
                .skuName("Premium_1")
                .build());
    
            var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
                .name("example-workspace")
                .apiManagementId(exampleService.id())
                .displayName("Example Workspace")
                .description("Example workspace for development")
                .build());
    
            var exampleWorkspaceApiVersionSet = new WorkspaceApiVersionSet("exampleWorkspaceApiVersionSet", WorkspaceApiVersionSetArgs.builder()
                .name("example-version-set")
                .apiManagementWorkspaceId(exampleWorkspace.id())
                .displayName("Example API Version Set")
                .versioningScheme("Segment")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleService:
        type: azure:apimanagement:Service
        name: example
        properties:
          name: example-apim
          location: ${example.location}
          resourceGroupName: ${example.name}
          publisherName: Example Publisher
          publisherEmail: publisher@example.com
          skuName: Premium_1
      exampleWorkspace:
        type: azure:apimanagement:Workspace
        name: example
        properties:
          name: example-workspace
          apiManagementId: ${exampleService.id}
          displayName: Example Workspace
          description: Example workspace for development
      exampleWorkspaceApiVersionSet:
        type: azure:apimanagement:WorkspaceApiVersionSet
        name: example
        properties:
          name: example-version-set
          apiManagementWorkspaceId: ${exampleWorkspace.id}
          displayName: Example API Version Set
          versioningScheme: Segment
    

    API Providers

    This resource uses the following Azure API Providers:

    • Microsoft.ApiManagement - 2024-05-01

    Create WorkspaceApiVersionSet Resource

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

    Constructor syntax

    new WorkspaceApiVersionSet(name: string, args: WorkspaceApiVersionSetArgs, opts?: CustomResourceOptions);
    @overload
    def WorkspaceApiVersionSet(resource_name: str,
                               args: WorkspaceApiVersionSetArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkspaceApiVersionSet(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               api_management_workspace_id: Optional[str] = None,
                               display_name: Optional[str] = None,
                               versioning_scheme: Optional[str] = None,
                               description: Optional[str] = None,
                               name: Optional[str] = None,
                               version_header_name: Optional[str] = None,
                               version_query_name: Optional[str] = None)
    func NewWorkspaceApiVersionSet(ctx *Context, name string, args WorkspaceApiVersionSetArgs, opts ...ResourceOption) (*WorkspaceApiVersionSet, error)
    public WorkspaceApiVersionSet(string name, WorkspaceApiVersionSetArgs args, CustomResourceOptions? opts = null)
    public WorkspaceApiVersionSet(String name, WorkspaceApiVersionSetArgs args)
    public WorkspaceApiVersionSet(String name, WorkspaceApiVersionSetArgs args, CustomResourceOptions options)
    
    type: azure:apimanagement:WorkspaceApiVersionSet
    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 WorkspaceApiVersionSetArgs
    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 WorkspaceApiVersionSetArgs
    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 WorkspaceApiVersionSetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkspaceApiVersionSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkspaceApiVersionSetArgs
    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 workspaceApiVersionSetResource = new Azure.ApiManagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource", new()
    {
        ApiManagementWorkspaceId = "string",
        DisplayName = "string",
        VersioningScheme = "string",
        Description = "string",
        Name = "string",
        VersionHeaderName = "string",
        VersionQueryName = "string",
    });
    
    example, err := apimanagement.NewWorkspaceApiVersionSet(ctx, "workspaceApiVersionSetResource", &apimanagement.WorkspaceApiVersionSetArgs{
    	ApiManagementWorkspaceId: pulumi.String("string"),
    	DisplayName:              pulumi.String("string"),
    	VersioningScheme:         pulumi.String("string"),
    	Description:              pulumi.String("string"),
    	Name:                     pulumi.String("string"),
    	VersionHeaderName:        pulumi.String("string"),
    	VersionQueryName:         pulumi.String("string"),
    })
    
    var workspaceApiVersionSetResource = new WorkspaceApiVersionSet("workspaceApiVersionSetResource", WorkspaceApiVersionSetArgs.builder()
        .apiManagementWorkspaceId("string")
        .displayName("string")
        .versioningScheme("string")
        .description("string")
        .name("string")
        .versionHeaderName("string")
        .versionQueryName("string")
        .build());
    
    workspace_api_version_set_resource = azure.apimanagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource",
        api_management_workspace_id="string",
        display_name="string",
        versioning_scheme="string",
        description="string",
        name="string",
        version_header_name="string",
        version_query_name="string")
    
    const workspaceApiVersionSetResource = new azure.apimanagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource", {
        apiManagementWorkspaceId: "string",
        displayName: "string",
        versioningScheme: "string",
        description: "string",
        name: "string",
        versionHeaderName: "string",
        versionQueryName: "string",
    });
    
    type: azure:apimanagement:WorkspaceApiVersionSet
    properties:
        apiManagementWorkspaceId: string
        description: string
        displayName: string
        name: string
        versionHeaderName: string
        versionQueryName: string
        versioningScheme: string
    

    WorkspaceApiVersionSet 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 WorkspaceApiVersionSet resource accepts the following input properties:

    ApiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    DisplayName string
    Specifies the display name of the API Management Workspace API Version Set.
    VersioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    Description string
    Specifies the description of the API Management Workspace API Version Set.
    Name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    VersionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    VersionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    ApiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    DisplayName string
    Specifies the display name of the API Management Workspace API Version Set.
    VersioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    Description string
    Specifies the description of the API Management Workspace API Version Set.
    Name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    VersionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    VersionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    apiManagementWorkspaceId String
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    displayName String
    Specifies the display name of the API Management Workspace API Version Set.
    versioningScheme String
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    description String
    Specifies the description of the API Management Workspace API Version Set.
    name String
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName String
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName String
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    apiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    displayName string
    Specifies the display name of the API Management Workspace API Version Set.
    versioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    description string
    Specifies the description of the API Management Workspace API Version Set.
    name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    api_management_workspace_id str
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    display_name str
    Specifies the display name of the API Management Workspace API Version Set.
    versioning_scheme str
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    description str
    Specifies the description of the API Management Workspace API Version Set.
    name str
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    version_header_name str
    Specifies the name of the header to read from inbound requests to determine the API version.
    version_query_name str
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    apiManagementWorkspaceId String
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    displayName String
    Specifies the display name of the API Management Workspace API Version Set.
    versioningScheme String
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    description String
    Specifies the description of the API Management Workspace API Version Set.
    name String
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName String
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName String
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WorkspaceApiVersionSet 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 WorkspaceApiVersionSet Resource

    Get an existing WorkspaceApiVersionSet 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?: WorkspaceApiVersionSetState, opts?: CustomResourceOptions): WorkspaceApiVersionSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_management_workspace_id: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            name: Optional[str] = None,
            version_header_name: Optional[str] = None,
            version_query_name: Optional[str] = None,
            versioning_scheme: Optional[str] = None) -> WorkspaceApiVersionSet
    func GetWorkspaceApiVersionSet(ctx *Context, name string, id IDInput, state *WorkspaceApiVersionSetState, opts ...ResourceOption) (*WorkspaceApiVersionSet, error)
    public static WorkspaceApiVersionSet Get(string name, Input<string> id, WorkspaceApiVersionSetState? state, CustomResourceOptions? opts = null)
    public static WorkspaceApiVersionSet get(String name, Output<String> id, WorkspaceApiVersionSetState state, CustomResourceOptions options)
    resources:  _:    type: azure:apimanagement:WorkspaceApiVersionSet    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:
    ApiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    Description string
    Specifies the description of the API Management Workspace API Version Set.
    DisplayName string
    Specifies the display name of the API Management Workspace API Version Set.
    Name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    VersionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    VersionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    VersioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    ApiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    Description string
    Specifies the description of the API Management Workspace API Version Set.
    DisplayName string
    Specifies the display name of the API Management Workspace API Version Set.
    Name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    VersionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    VersionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    VersioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    apiManagementWorkspaceId String
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    description String
    Specifies the description of the API Management Workspace API Version Set.
    displayName String
    Specifies the display name of the API Management Workspace API Version Set.
    name String
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName String
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName String
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    versioningScheme String
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    apiManagementWorkspaceId string
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    description string
    Specifies the description of the API Management Workspace API Version Set.
    displayName string
    Specifies the display name of the API Management Workspace API Version Set.
    name string
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName string
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName string
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    versioningScheme string
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    api_management_workspace_id str
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    description str
    Specifies the description of the API Management Workspace API Version Set.
    display_name str
    Specifies the display name of the API Management Workspace API Version Set.
    name str
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    version_header_name str
    Specifies the name of the header to read from inbound requests to determine the API version.
    version_query_name str
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    versioning_scheme str
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.
    apiManagementWorkspaceId String
    Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
    description String
    Specifies the description of the API Management Workspace API Version Set.
    displayName String
    Specifies the display name of the API Management Workspace API Version Set.
    name String
    Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
    versionHeaderName String
    Specifies the name of the header to read from inbound requests to determine the API version.
    versionQueryName String
    Specifies the name of the query string parameter to read from inbound requests to determine the API version.
    versioningScheme String
    Specifies where in a request that the API Version should be read from. Possible values are Header, Query and Segment.

    Import

    API Management Workspace API Version Sets can be imported using the resource id, e.g.

    $ pulumi import azure:apimanagement/workspaceApiVersionSet:WorkspaceApiVersionSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/workspaces/workspace1/apiVersionSets/set1
    

    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.

    Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate