1. Packages
  2. Azure Native
  3. API Docs
  4. apimanagement
  5. Authorization
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.36.0 published on Monday, Apr 8, 2024 by Pulumi

azure-native.apimanagement.Authorization

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.36.0 published on Monday, Apr 8, 2024 by Pulumi

    Authorization contract. Azure REST API version: 2022-08-01.

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

    Example Usage

    ApiManagementCreateAuthorizationAADAuthCode

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var authorization = new AzureNative.ApiManagement.Authorization("authorization", new()
        {
            AuthorizationId = "authz2",
            AuthorizationProviderId = "aadwithauthcode",
            AuthorizationType = AzureNative.ApiManagement.AuthorizationType.OAuth2,
            OAuth2GrantType = AzureNative.ApiManagement.OAuth2GrantType.AuthorizationCode,
            ResourceGroupName = "rg1",
            ServiceName = "apimService1",
        });
    
    });
    
    package main
    
    import (
    	"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.NewAuthorization(ctx, "authorization", &apimanagement.AuthorizationArgs{
    			AuthorizationId:         pulumi.String("authz2"),
    			AuthorizationProviderId: pulumi.String("aadwithauthcode"),
    			AuthorizationType:       pulumi.String(apimanagement.AuthorizationTypeOAuth2),
    			OAuth2GrantType:         pulumi.String(apimanagement.OAuth2GrantTypeAuthorizationCode),
    			ResourceGroupName:       pulumi.String("rg1"),
    			ServiceName:             pulumi.String("apimService1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.apimanagement.Authorization;
    import com.pulumi.azurenative.apimanagement.AuthorizationArgs;
    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 authorization = new Authorization("authorization", AuthorizationArgs.builder()        
                .authorizationId("authz2")
                .authorizationProviderId("aadwithauthcode")
                .authorizationType("OAuth2")
                .oAuth2GrantType("AuthorizationCode")
                .resourceGroupName("rg1")
                .serviceName("apimService1")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    authorization = azure_native.apimanagement.Authorization("authorization",
        authorization_id="authz2",
        authorization_provider_id="aadwithauthcode",
        authorization_type=azure_native.apimanagement.AuthorizationType.O_AUTH2,
        o_auth2_grant_type=azure_native.apimanagement.OAuth2GrantType.AUTHORIZATION_CODE,
        resource_group_name="rg1",
        service_name="apimService1")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const authorization = new azure_native.apimanagement.Authorization("authorization", {
        authorizationId: "authz2",
        authorizationProviderId: "aadwithauthcode",
        authorizationType: azure_native.apimanagement.AuthorizationType.OAuth2,
        oAuth2GrantType: azure_native.apimanagement.OAuth2GrantType.AuthorizationCode,
        resourceGroupName: "rg1",
        serviceName: "apimService1",
    });
    
    resources:
      authorization:
        type: azure-native:apimanagement:Authorization
        properties:
          authorizationId: authz2
          authorizationProviderId: aadwithauthcode
          authorizationType: OAuth2
          oAuth2GrantType: AuthorizationCode
          resourceGroupName: rg1
          serviceName: apimService1
    

    ApiManagementCreateAuthorizationAADClientCred

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var authorization = new AzureNative.ApiManagement.Authorization("authorization", new()
        {
            AuthorizationId = "authz1",
            AuthorizationProviderId = "aadwithclientcred",
            AuthorizationType = AzureNative.ApiManagement.AuthorizationType.OAuth2,
            OAuth2GrantType = AzureNative.ApiManagement.OAuth2GrantType.AuthorizationCode,
            Parameters = 
            {
                { "clientId", "53790925-fdd3-4b80-bc7a-4c3aaf25801d" },
                { "clientSecret", "xxxxxxxxxxxxxxx~xxxxxxxxx" },
            },
            ResourceGroupName = "rg1",
            ServiceName = "apimService1",
        });
    
    });
    
    package main
    
    import (
    	"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.NewAuthorization(ctx, "authorization", &apimanagement.AuthorizationArgs{
    			AuthorizationId:         pulumi.String("authz1"),
    			AuthorizationProviderId: pulumi.String("aadwithclientcred"),
    			AuthorizationType:       pulumi.String(apimanagement.AuthorizationTypeOAuth2),
    			OAuth2GrantType:         pulumi.String(apimanagement.OAuth2GrantTypeAuthorizationCode),
    			Parameters: pulumi.StringMap{
    				"clientId":     pulumi.String("53790925-fdd3-4b80-bc7a-4c3aaf25801d"),
    				"clientSecret": pulumi.String("xxxxxxxxxxxxxxx~xxxxxxxxx"),
    			},
    			ResourceGroupName: pulumi.String("rg1"),
    			ServiceName:       pulumi.String("apimService1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.apimanagement.Authorization;
    import com.pulumi.azurenative.apimanagement.AuthorizationArgs;
    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 authorization = new Authorization("authorization", AuthorizationArgs.builder()        
                .authorizationId("authz1")
                .authorizationProviderId("aadwithclientcred")
                .authorizationType("OAuth2")
                .oAuth2GrantType("AuthorizationCode")
                .parameters(Map.ofEntries(
                    Map.entry("clientId", "53790925-fdd3-4b80-bc7a-4c3aaf25801d"),
                    Map.entry("clientSecret", "xxxxxxxxxxxxxxx~xxxxxxxxx")
                ))
                .resourceGroupName("rg1")
                .serviceName("apimService1")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    authorization = azure_native.apimanagement.Authorization("authorization",
        authorization_id="authz1",
        authorization_provider_id="aadwithclientcred",
        authorization_type=azure_native.apimanagement.AuthorizationType.O_AUTH2,
        o_auth2_grant_type=azure_native.apimanagement.OAuth2GrantType.AUTHORIZATION_CODE,
        parameters={
            "clientId": "53790925-fdd3-4b80-bc7a-4c3aaf25801d",
            "clientSecret": "xxxxxxxxxxxxxxx~xxxxxxxxx",
        },
        resource_group_name="rg1",
        service_name="apimService1")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const authorization = new azure_native.apimanagement.Authorization("authorization", {
        authorizationId: "authz1",
        authorizationProviderId: "aadwithclientcred",
        authorizationType: azure_native.apimanagement.AuthorizationType.OAuth2,
        oAuth2GrantType: azure_native.apimanagement.OAuth2GrantType.AuthorizationCode,
        parameters: {
            clientId: "53790925-fdd3-4b80-bc7a-4c3aaf25801d",
            clientSecret: "xxxxxxxxxxxxxxx~xxxxxxxxx",
        },
        resourceGroupName: "rg1",
        serviceName: "apimService1",
    });
    
    resources:
      authorization:
        type: azure-native:apimanagement:Authorization
        properties:
          authorizationId: authz1
          authorizationProviderId: aadwithclientcred
          authorizationType: OAuth2
          oAuth2GrantType: AuthorizationCode
          parameters:
            clientId: 53790925-fdd3-4b80-bc7a-4c3aaf25801d
            clientSecret: xxxxxxxxxxxxxxx~xxxxxxxxx
          resourceGroupName: rg1
          serviceName: apimService1
    

    Create Authorization Resource

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

    Constructor syntax

    new Authorization(name: string, args: AuthorizationArgs, opts?: CustomResourceOptions);
    @overload
    def Authorization(resource_name: str,
                      args: AuthorizationArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def Authorization(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      authorization_provider_id: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      service_name: Optional[str] = None,
                      authorization_id: Optional[str] = None,
                      authorization_type: Optional[Union[str, AuthorizationType]] = None,
                      error: Optional[AuthorizationErrorArgs] = None,
                      o_auth2_grant_type: Optional[Union[str, OAuth2GrantType]] = None,
                      parameters: Optional[Mapping[str, str]] = None,
                      status: Optional[str] = None)
    func NewAuthorization(ctx *Context, name string, args AuthorizationArgs, opts ...ResourceOption) (*Authorization, error)
    public Authorization(string name, AuthorizationArgs args, CustomResourceOptions? opts = null)
    public Authorization(String name, AuthorizationArgs args)
    public Authorization(String name, AuthorizationArgs args, CustomResourceOptions options)
    
    type: azure-native:apimanagement:Authorization
    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 AuthorizationArgs
    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 AuthorizationArgs
    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 AuthorizationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AuthorizationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AuthorizationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var authorizationResource = new AzureNative.ApiManagement.Authorization("authorizationResource", new()
    {
        AuthorizationProviderId = "string",
        ResourceGroupName = "string",
        ServiceName = "string",
        AuthorizationId = "string",
        AuthorizationType = "string",
        Error = new AzureNative.ApiManagement.Inputs.AuthorizationErrorArgs
        {
            Code = "string",
            Message = "string",
        },
        OAuth2GrantType = "string",
        Parameters = 
        {
            { "string", "string" },
        },
        Status = "string",
    });
    
    example, err := apimanagement.NewAuthorization(ctx, "authorizationResource", &apimanagement.AuthorizationArgs{
    AuthorizationProviderId: pulumi.String("string"),
    ResourceGroupName: pulumi.String("string"),
    ServiceName: pulumi.String("string"),
    AuthorizationId: pulumi.String("string"),
    AuthorizationType: pulumi.String("string"),
    Error: &apimanagement.AuthorizationErrorArgs{
    Code: pulumi.String("string"),
    Message: pulumi.String("string"),
    },
    OAuth2GrantType: pulumi.String("string"),
    Parameters: pulumi.StringMap{
    "string": pulumi.String("string"),
    },
    Status: pulumi.String("string"),
    })
    
    var authorizationResource = new Authorization("authorizationResource", AuthorizationArgs.builder()        
        .authorizationProviderId("string")
        .resourceGroupName("string")
        .serviceName("string")
        .authorizationId("string")
        .authorizationType("string")
        .error(AuthorizationErrorArgs.builder()
            .code("string")
            .message("string")
            .build())
        .oAuth2GrantType("string")
        .parameters(Map.of("string", "string"))
        .status("string")
        .build());
    
    authorization_resource = azure_native.apimanagement.Authorization("authorizationResource",
        authorization_provider_id="string",
        resource_group_name="string",
        service_name="string",
        authorization_id="string",
        authorization_type="string",
        error=azure_native.apimanagement.AuthorizationErrorArgs(
            code="string",
            message="string",
        ),
        o_auth2_grant_type="string",
        parameters={
            "string": "string",
        },
        status="string")
    
    const authorizationResource = new azure_native.apimanagement.Authorization("authorizationResource", {
        authorizationProviderId: "string",
        resourceGroupName: "string",
        serviceName: "string",
        authorizationId: "string",
        authorizationType: "string",
        error: {
            code: "string",
            message: "string",
        },
        oAuth2GrantType: "string",
        parameters: {
            string: "string",
        },
        status: "string",
    });
    
    type: azure-native:apimanagement:Authorization
    properties:
        authorizationId: string
        authorizationProviderId: string
        authorizationType: string
        error:
            code: string
            message: string
        oAuth2GrantType: string
        parameters:
            string: string
        resourceGroupName: string
        serviceName: string
        status: string
    

    Authorization Resource Properties

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

    Inputs

    The Authorization resource accepts the following input properties:

    AuthorizationProviderId string
    Identifier of the authorization provider.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    ServiceName string
    The name of the API Management service.
    AuthorizationId string
    Identifier of the authorization.
    AuthorizationType string | Pulumi.AzureNative.ApiManagement.AuthorizationType
    Authorization type options
    Error Pulumi.AzureNative.ApiManagement.Inputs.AuthorizationError
    Authorization error details.
    OAuth2GrantType string | Pulumi.AzureNative.ApiManagement.OAuth2GrantType
    OAuth2 grant type options
    Parameters Dictionary<string, string>
    Authorization parameters
    Status string
    Status of the Authorization
    AuthorizationProviderId string
    Identifier of the authorization provider.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    ServiceName string
    The name of the API Management service.
    AuthorizationId string
    Identifier of the authorization.
    AuthorizationType string | AuthorizationType
    Authorization type options
    Error AuthorizationErrorArgs
    Authorization error details.
    OAuth2GrantType string | OAuth2GrantType
    OAuth2 grant type options
    Parameters map[string]string
    Authorization parameters
    Status string
    Status of the Authorization
    authorizationProviderId String
    Identifier of the authorization provider.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    serviceName String
    The name of the API Management service.
    authorizationId String
    Identifier of the authorization.
    authorizationType String | AuthorizationType
    Authorization type options
    error AuthorizationError
    Authorization error details.
    oAuth2GrantType String | OAuth2GrantType
    OAuth2 grant type options
    parameters Map<String,String>
    Authorization parameters
    status String
    Status of the Authorization
    authorizationProviderId string
    Identifier of the authorization provider.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    serviceName string
    The name of the API Management service.
    authorizationId string
    Identifier of the authorization.
    authorizationType string | AuthorizationType
    Authorization type options
    error AuthorizationError
    Authorization error details.
    oAuth2GrantType string | OAuth2GrantType
    OAuth2 grant type options
    parameters {[key: string]: string}
    Authorization parameters
    status string
    Status of the Authorization
    authorization_provider_id str
    Identifier of the authorization provider.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    service_name str
    The name of the API Management service.
    authorization_id str
    Identifier of the authorization.
    authorization_type str | AuthorizationType
    Authorization type options
    error AuthorizationErrorArgs
    Authorization error details.
    o_auth2_grant_type str | OAuth2GrantType
    OAuth2 grant type options
    parameters Mapping[str, str]
    Authorization parameters
    status str
    Status of the Authorization
    authorizationProviderId String
    Identifier of the authorization provider.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    serviceName String
    The name of the API Management service.
    authorizationId String
    Identifier of the authorization.
    authorizationType String | "OAuth2"
    Authorization type options
    error Property Map
    Authorization error details.
    oAuth2GrantType String | "AuthorizationCode" | "ClientCredentials"
    OAuth2 grant type options
    parameters Map<String>
    Authorization parameters
    status String
    Status of the Authorization

    Outputs

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

    AuthorizationError, AuthorizationErrorArgs

    Code string
    Error code
    Message string
    Error message
    Code string
    Error code
    Message string
    Error message
    code String
    Error code
    message String
    Error message
    code string
    Error code
    message string
    Error message
    code str
    Error code
    message str
    Error message
    code String
    Error code
    message String
    Error message

    AuthorizationErrorResponse, AuthorizationErrorResponseArgs

    Code string
    Error code
    Message string
    Error message
    Code string
    Error code
    Message string
    Error message
    code String
    Error code
    message String
    Error message
    code string
    Error code
    message string
    Error message
    code str
    Error code
    message str
    Error message
    code String
    Error code
    message String
    Error message

    AuthorizationType, AuthorizationTypeArgs

    OAuth2
    OAuth2OAuth2 authorization type
    AuthorizationTypeOAuth2
    OAuth2OAuth2 authorization type
    OAuth2
    OAuth2OAuth2 authorization type
    OAuth2
    OAuth2OAuth2 authorization type
    O_AUTH2
    OAuth2OAuth2 authorization type
    "OAuth2"
    OAuth2OAuth2 authorization type

    OAuth2GrantType, OAuth2GrantTypeArgs

    AuthorizationCode
    AuthorizationCodeAuthorization Code grant
    ClientCredentials
    ClientCredentialsClient Credential grant
    OAuth2GrantTypeAuthorizationCode
    AuthorizationCodeAuthorization Code grant
    OAuth2GrantTypeClientCredentials
    ClientCredentialsClient Credential grant
    AuthorizationCode
    AuthorizationCodeAuthorization Code grant
    ClientCredentials
    ClientCredentialsClient Credential grant
    AuthorizationCode
    AuthorizationCodeAuthorization Code grant
    ClientCredentials
    ClientCredentialsClient Credential grant
    AUTHORIZATION_CODE
    AuthorizationCodeAuthorization Code grant
    CLIENT_CREDENTIALS
    ClientCredentialsClient Credential grant
    "AuthorizationCode"
    AuthorizationCodeAuthorization Code grant
    "ClientCredentials"
    ClientCredentialsClient Credential grant

    Import

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

    $ pulumi import azure-native:apimanagement:Authorization authz1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId} 
    

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

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.36.0 published on Monday, Apr 8, 2024 by Pulumi