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.8.0 published on Monday, Sep 18, 2023 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.8.0 published on Monday, Sep 18, 2023 by Pulumi

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

    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 = "OAuth2",
            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("OAuth2"),
    			OAuth2GrantType:         pulumi.String("AuthorizationCode"),
    			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="OAuth2",
        o_auth2_grant_type="AuthorizationCode",
        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: "OAuth2",
        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 = "OAuth2",
            OAuth2GrantType = "AuthorizationCode",
            Parameters = 
            {
                { "clientId", "53790925-fdd3-4b80-bc7a-4c3aaf25801d" },
                { "clientSecret", "FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8" },
            },
            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("OAuth2"),
    			OAuth2GrantType:         pulumi.String("AuthorizationCode"),
    			Parameters: pulumi.StringMap{
    				"clientId":     pulumi.String("53790925-fdd3-4b80-bc7a-4c3aaf25801d"),
    				"clientSecret": pulumi.String("FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8"),
    			},
    			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", "FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8")
                ))
                .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="OAuth2",
        o_auth2_grant_type="AuthorizationCode",
        parameters={
            "clientId": "53790925-fdd3-4b80-bc7a-4c3aaf25801d",
            "clientSecret": "FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8",
        },
        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: "OAuth2",
        oAuth2GrantType: "AuthorizationCode",
        parameters: {
            clientId: "53790925-fdd3-4b80-bc7a-4c3aaf25801d",
            clientSecret: "FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8",
        },
        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: FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8
          resourceGroupName: rg1
          serviceName: apimService1
    

    Create Authorization Resource

    new Authorization(name: string, args: AuthorizationArgs, opts?: CustomResourceOptions);
    @overload
    def Authorization(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      authorization_id: Optional[str] = None,
                      authorization_provider_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,
                      resource_group_name: Optional[str] = None,
                      service_name: Optional[str] = None,
                      status: Optional[str] = None)
    @overload
    def Authorization(resource_name: str,
                      args: AuthorizationArgs,
                      opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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
    OAuth2

    OAuth2 authorization type

    AuthorizationTypeOAuth2
    OAuth2

    OAuth2 authorization type

    OAuth2
    OAuth2

    OAuth2 authorization type

    OAuth2
    OAuth2

    OAuth2 authorization type

    O_AUTH2
    OAuth2

    OAuth2 authorization type

    "OAuth2"
    OAuth2

    OAuth2 authorization type

    OAuth2GrantType, OAuth2GrantTypeArgs

    AuthorizationCode
    AuthorizationCode

    Authorization Code grant

    ClientCredentials
    ClientCredentials

    Client Credential grant

    OAuth2GrantTypeAuthorizationCode
    AuthorizationCode

    Authorization Code grant

    OAuth2GrantTypeClientCredentials
    ClientCredentials

    Client Credential grant

    AuthorizationCode
    AuthorizationCode

    Authorization Code grant

    ClientCredentials
    ClientCredentials

    Client Credential grant

    AuthorizationCode
    AuthorizationCode

    Authorization Code grant

    ClientCredentials
    ClientCredentials

    Client Credential grant

    AUTHORIZATION_CODE
    AuthorizationCode

    Authorization Code grant

    CLIENT_CREDENTIALS
    ClientCredentials

    Client Credential grant

    "AuthorizationCode"
    AuthorizationCode

    Authorization Code grant

    "ClientCredentials"
    ClientCredentials

    Client 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} 
    

    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.8.0 published on Monday, Sep 18, 2023 by Pulumi