1. Packages
  2. Azure Native v2
  3. API Docs
  4. apimanagement
  5. WorkspaceGlobalSchema
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.apimanagement.WorkspaceGlobalSchema

Explore with Pulumi AI

Global Schema Contract details. Azure REST API version: 2022-09-01-preview.

Other available API versions: 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01, 2024-06-01-preview.

Example Usage

ApiManagementCreateWorkspaceSchema

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var workspaceGlobalSchema = new AzureNative.ApiManagement.WorkspaceGlobalSchema("workspaceGlobalSchema", new()
    {
        Description = "sample schema description",
        ResourceGroupName = "rg1",
        SchemaId = "schema1",
        SchemaType = AzureNative.ApiManagement.SchemaType.Xml,
        ServiceName = "apimService1",
        Value = @"<xsd:schema xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
           xmlns:tns=""http://tempuri.org/PurchaseOrderSchema.xsd""
           targetNamespace=""http://tempuri.org/PurchaseOrderSchema.xsd""
           elementFormDefault=""qualified"">
 <xsd:element name=""PurchaseOrder"" type=""tns:PurchaseOrderType""/>
 <xsd:complexType name=""PurchaseOrderType"">
  <xsd:sequence>
   <xsd:element name=""ShipTo"" type=""tns:USAddress"" maxOccurs=""2""/>
   <xsd:element name=""BillTo"" type=""tns:USAddress""/>
  </xsd:sequence>
  <xsd:attribute name=""OrderDate"" type=""xsd:date""/>
 </xsd:complexType>

 <xsd:complexType name=""USAddress"">
  <xsd:sequence>
   <xsd:element name=""name""   type=""xsd:string""/>
   <xsd:element name=""street"" type=""xsd:string""/>
   <xsd:element name=""city""   type=""xsd:string""/>
   <xsd:element name=""state""  type=""xsd:string""/>
   <xsd:element name=""zip""    type=""xsd:integer""/>
  </xsd:sequence>
  <xsd:attribute name=""country"" type=""xsd:NMTOKEN"" fixed=""US""/>
 </xsd:complexType>
</xsd:schema>",
        WorkspaceId = "wks1",
    });

});
Copy
package main

import (
	apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apimanagement.NewWorkspaceGlobalSchema(ctx, "workspaceGlobalSchema", &apimanagement.WorkspaceGlobalSchemaArgs{
			Description:       pulumi.String("sample schema description"),
			ResourceGroupName: pulumi.String("rg1"),
			SchemaId:          pulumi.String("schema1"),
			SchemaType:        pulumi.String(apimanagement.SchemaTypeXml),
			ServiceName:       pulumi.String("apimService1"),
			Value: pulumi.Any(`<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"
           targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"
           elementFormDefault="qualified">
 <xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>
 <xsd:complexType name="PurchaseOrderType">
  <xsd:sequence>
   <xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>
   <xsd:element name="BillTo" type="tns:USAddress"/>
  </xsd:sequence>
  <xsd:attribute name="OrderDate" type="xsd:date"/>
 </xsd:complexType>

 <xsd:complexType name="USAddress">
  <xsd:sequence>
   <xsd:element name="name"   type="xsd:string"/>
   <xsd:element name="street" type="xsd:string"/>
   <xsd:element name="city"   type="xsd:string"/>
   <xsd:element name="state"  type="xsd:string"/>
   <xsd:element name="zip"    type="xsd:integer"/>
  </xsd:sequence>
  <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
 </xsd:complexType>
</xsd:schema>`),
			WorkspaceId: pulumi.String("wks1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.WorkspaceGlobalSchema;
import com.pulumi.azurenative.apimanagement.WorkspaceGlobalSchemaArgs;
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 workspaceGlobalSchema = new WorkspaceGlobalSchema("workspaceGlobalSchema", WorkspaceGlobalSchemaArgs.builder()
            .description("sample schema description")
            .resourceGroupName("rg1")
            .schemaId("schema1")
            .schemaType("xml")
            .serviceName("apimService1")
            .value("""
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"
           targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"
           elementFormDefault="qualified">
 <xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>
 <xsd:complexType name="PurchaseOrderType">
  <xsd:sequence>
   <xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>
   <xsd:element name="BillTo" type="tns:USAddress"/>
  </xsd:sequence>
  <xsd:attribute name="OrderDate" type="xsd:date"/>
 </xsd:complexType>

 <xsd:complexType name="USAddress">
  <xsd:sequence>
   <xsd:element name="name"   type="xsd:string"/>
   <xsd:element name="street" type="xsd:string"/>
   <xsd:element name="city"   type="xsd:string"/>
   <xsd:element name="state"  type="xsd:string"/>
   <xsd:element name="zip"    type="xsd:integer"/>
  </xsd:sequence>
  <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
 </xsd:complexType>
</xsd:schema>            """)
            .workspaceId("wks1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const workspaceGlobalSchema = new azure_native.apimanagement.WorkspaceGlobalSchema("workspaceGlobalSchema", {
    description: "sample schema description",
    resourceGroupName: "rg1",
    schemaId: "schema1",
    schemaType: azure_native.apimanagement.SchemaType.Xml,
    serviceName: "apimService1",
    value: `<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"\x0d
           xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"\x0d
           targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"\x0d
           elementFormDefault="qualified">\x0d
 <xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>\x0d
 <xsd:complexType name="PurchaseOrderType">\x0d
  <xsd:sequence>\x0d
   <xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>\x0d
   <xsd:element name="BillTo" type="tns:USAddress"/>\x0d
  </xsd:sequence>\x0d
  <xsd:attribute name="OrderDate" type="xsd:date"/>\x0d
 </xsd:complexType>\x0d
\x0d
 <xsd:complexType name="USAddress">\x0d
  <xsd:sequence>\x0d
   <xsd:element name="name"   type="xsd:string"/>\x0d
   <xsd:element name="street" type="xsd:string"/>\x0d
   <xsd:element name="city"   type="xsd:string"/>\x0d
   <xsd:element name="state"  type="xsd:string"/>\x0d
   <xsd:element name="zip"    type="xsd:integer"/>\x0d
  </xsd:sequence>\x0d
  <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>\x0d
 </xsd:complexType>\x0d
</xsd:schema>`,
    workspaceId: "wks1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

workspace_global_schema = azure_native.apimanagement.WorkspaceGlobalSchema("workspaceGlobalSchema",
    description="sample schema description",
    resource_group_name="rg1",
    schema_id="schema1",
    schema_type=azure_native.apimanagement.SchemaType.XML,
    service_name="apimService1",
    value="""<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"\x0d
           xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"\x0d
           targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"\x0d
           elementFormDefault="qualified">\x0d
 <xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>\x0d
 <xsd:complexType name="PurchaseOrderType">\x0d
  <xsd:sequence>\x0d
   <xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>\x0d
   <xsd:element name="BillTo" type="tns:USAddress"/>\x0d
  </xsd:sequence>\x0d
  <xsd:attribute name="OrderDate" type="xsd:date"/>\x0d
 </xsd:complexType>\x0d
\x0d
 <xsd:complexType name="USAddress">\x0d
  <xsd:sequence>\x0d
   <xsd:element name="name"   type="xsd:string"/>\x0d
   <xsd:element name="street" type="xsd:string"/>\x0d
   <xsd:element name="city"   type="xsd:string"/>\x0d
   <xsd:element name="state"  type="xsd:string"/>\x0d
   <xsd:element name="zip"    type="xsd:integer"/>\x0d
  </xsd:sequence>\x0d
  <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>\x0d
 </xsd:complexType>\x0d
</xsd:schema>""",
    workspace_id="wks1")
Copy
resources:
  workspaceGlobalSchema:
    type: azure-native:apimanagement:WorkspaceGlobalSchema
    properties:
      description: sample schema description
      resourceGroupName: rg1
      schemaId: schema1
      schemaType: xml
      serviceName: apimService1
      value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>"
      workspaceId: wks1
Copy

Create WorkspaceGlobalSchema Resource

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

Constructor syntax

new WorkspaceGlobalSchema(name: string, args: WorkspaceGlobalSchemaArgs, opts?: CustomResourceOptions);
@overload
def WorkspaceGlobalSchema(resource_name: str,
                          args: WorkspaceGlobalSchemaArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def WorkspaceGlobalSchema(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          resource_group_name: Optional[str] = None,
                          schema_type: Optional[Union[str, SchemaType]] = None,
                          service_name: Optional[str] = None,
                          workspace_id: Optional[str] = None,
                          description: Optional[str] = None,
                          schema_id: Optional[str] = None,
                          value: Optional[Any] = None)
func NewWorkspaceGlobalSchema(ctx *Context, name string, args WorkspaceGlobalSchemaArgs, opts ...ResourceOption) (*WorkspaceGlobalSchema, error)
public WorkspaceGlobalSchema(string name, WorkspaceGlobalSchemaArgs args, CustomResourceOptions? opts = null)
public WorkspaceGlobalSchema(String name, WorkspaceGlobalSchemaArgs args)
public WorkspaceGlobalSchema(String name, WorkspaceGlobalSchemaArgs args, CustomResourceOptions options)
type: azure-native:apimanagement:WorkspaceGlobalSchema
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WorkspaceGlobalSchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WorkspaceGlobalSchemaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WorkspaceGlobalSchemaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WorkspaceGlobalSchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WorkspaceGlobalSchemaArgs
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 workspaceGlobalSchemaResource = new AzureNative.Apimanagement.WorkspaceGlobalSchema("workspaceGlobalSchemaResource", new()
{
    ResourceGroupName = "string",
    SchemaType = "string",
    ServiceName = "string",
    WorkspaceId = "string",
    Description = "string",
    SchemaId = "string",
    Value = "any",
});
Copy
example, err := apimanagement.NewWorkspaceGlobalSchema(ctx, "workspaceGlobalSchemaResource", &apimanagement.WorkspaceGlobalSchemaArgs{
	ResourceGroupName: "string",
	SchemaType:        "string",
	ServiceName:       "string",
	WorkspaceId:       "string",
	Description:       "string",
	SchemaId:          "string",
	Value:             "any",
})
Copy
var workspaceGlobalSchemaResource = new WorkspaceGlobalSchema("workspaceGlobalSchemaResource", WorkspaceGlobalSchemaArgs.builder()
    .resourceGroupName("string")
    .schemaType("string")
    .serviceName("string")
    .workspaceId("string")
    .description("string")
    .schemaId("string")
    .value("any")
    .build());
Copy
workspace_global_schema_resource = azure_native.apimanagement.WorkspaceGlobalSchema("workspaceGlobalSchemaResource",
    resource_group_name=string,
    schema_type=string,
    service_name=string,
    workspace_id=string,
    description=string,
    schema_id=string,
    value=any)
Copy
const workspaceGlobalSchemaResource = new azure_native.apimanagement.WorkspaceGlobalSchema("workspaceGlobalSchemaResource", {
    resourceGroupName: "string",
    schemaType: "string",
    serviceName: "string",
    workspaceId: "string",
    description: "string",
    schemaId: "string",
    value: "any",
});
Copy
type: azure-native:apimanagement:WorkspaceGlobalSchema
properties:
    description: string
    resourceGroupName: string
    schemaId: string
    schemaType: string
    serviceName: string
    value: any
    workspaceId: string
Copy

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

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
SchemaType This property is required. string | Pulumi.AzureNative.ApiManagement.SchemaType
Schema Type. Immutable.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
WorkspaceId
This property is required.
Changes to this property will trigger replacement.
string
Workspace identifier. Must be unique in the current API Management service instance.
Description string
Free-form schema entity description.
SchemaId Changes to this property will trigger replacement. string
Schema id identifier. Must be unique in the current API Management service instance.
Value object
Json-encoded string for non json-based schema.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
SchemaType This property is required. string | SchemaType
Schema Type. Immutable.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
WorkspaceId
This property is required.
Changes to this property will trigger replacement.
string
Workspace identifier. Must be unique in the current API Management service instance.
Description string
Free-form schema entity description.
SchemaId Changes to this property will trigger replacement. string
Schema id identifier. Must be unique in the current API Management service instance.
Value interface{}
Json-encoded string for non json-based schema.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
schemaType This property is required. String | SchemaType
Schema Type. Immutable.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
workspaceId
This property is required.
Changes to this property will trigger replacement.
String
Workspace identifier. Must be unique in the current API Management service instance.
description String
Free-form schema entity description.
schemaId Changes to this property will trigger replacement. String
Schema id identifier. Must be unique in the current API Management service instance.
value Object
Json-encoded string for non json-based schema.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
schemaType This property is required. string | SchemaType
Schema Type. Immutable.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
workspaceId
This property is required.
Changes to this property will trigger replacement.
string
Workspace identifier. Must be unique in the current API Management service instance.
description string
Free-form schema entity description.
schemaId Changes to this property will trigger replacement. string
Schema id identifier. Must be unique in the current API Management service instance.
value any
Json-encoded string for non json-based schema.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
schema_type This property is required. str | SchemaType
Schema Type. Immutable.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the API Management service.
workspace_id
This property is required.
Changes to this property will trigger replacement.
str
Workspace identifier. Must be unique in the current API Management service instance.
description str
Free-form schema entity description.
schema_id Changes to this property will trigger replacement. str
Schema id identifier. Must be unique in the current API Management service instance.
value Any
Json-encoded string for non json-based schema.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
schemaType This property is required. String | "xml" | "json"
Schema Type. Immutable.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
workspaceId
This property is required.
Changes to this property will trigger replacement.
String
Workspace identifier. Must be unique in the current API Management service instance.
description String
Free-form schema entity description.
schemaId Changes to this property will trigger replacement. String
Schema id identifier. Must be unique in the current API Management service instance.
value Any
Json-encoded string for non json-based schema.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

SchemaType
, SchemaTypeArgs

Xml
xmlXML schema type.
Json
jsonJson schema type.
SchemaTypeXml
xmlXML schema type.
SchemaTypeJson
jsonJson schema type.
Xml
xmlXML schema type.
Json
jsonJson schema type.
Xml
xmlXML schema type.
Json
jsonJson schema type.
XML
xmlXML schema type.
JSON
jsonJson schema type.
"xml"
xmlXML schema type.
"json"
jsonJson schema type.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apimanagement:WorkspaceGlobalSchema schema1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId} 
Copy

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

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0