1. Packages
  2. Azure Native v2
  3. API Docs
  4. apimanagement
  5. AuthorizationProvider
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.AuthorizationProvider

Explore with Pulumi AI

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

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

Example Usage

ApiManagementCreateAuthorizationProviderAADAuthCode

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

return await Deployment.RunAsync(() => 
{
    var authorizationProvider = new AzureNative.ApiManagement.AuthorizationProvider("authorizationProvider", new()
    {
        AuthorizationProviderId = "aadwithauthcode",
        DisplayName = "aadwithauthcode",
        IdentityProvider = "aad",
        Oauth2 = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2SettingsArgs
        {
            GrantTypes = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypesArgs
            {
                AuthorizationCode = 
                {
                    { "clientId", "59790825-fdd3-4b10-bc7a-4c3aaf25801d" },
                    { "clientSecret", "xxxxxxxxxxxxxxxxxxxxxxxx" },
                    { "resourceUri", "https://graph.microsoft.com" },
                    { "scopes", "User.Read.All Group.Read.All" },
                },
            },
            RedirectUrl = "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
        },
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
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.NewAuthorizationProvider(ctx, "authorizationProvider", &apimanagement.AuthorizationProviderArgs{
			AuthorizationProviderId: pulumi.String("aadwithauthcode"),
			DisplayName:             pulumi.String("aadwithauthcode"),
			IdentityProvider:        pulumi.String("aad"),
			Oauth2: &apimanagement.AuthorizationProviderOAuth2SettingsArgs{
				GrantTypes: &apimanagement.AuthorizationProviderOAuth2GrantTypesArgs{
					AuthorizationCode: pulumi.StringMap{
						"clientId":     pulumi.String("59790825-fdd3-4b10-bc7a-4c3aaf25801d"),
						"clientSecret": pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxx"),
						"resourceUri":  pulumi.String("https://graph.microsoft.com"),
						"scopes":       pulumi.String("User.Read.All Group.Read.All"),
					},
				},
				RedirectUrl: pulumi.String("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"),
			},
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		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.AuthorizationProvider;
import com.pulumi.azurenative.apimanagement.AuthorizationProviderArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2SettingsArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2GrantTypesArgs;
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 authorizationProvider = new AuthorizationProvider("authorizationProvider", AuthorizationProviderArgs.builder()
            .authorizationProviderId("aadwithauthcode")
            .displayName("aadwithauthcode")
            .identityProvider("aad")
            .oauth2(AuthorizationProviderOAuth2SettingsArgs.builder()
                .grantTypes(AuthorizationProviderOAuth2GrantTypesArgs.builder()
                    .authorizationCode(Map.ofEntries(
                        Map.entry("clientId", "59790825-fdd3-4b10-bc7a-4c3aaf25801d"),
                        Map.entry("clientSecret", "xxxxxxxxxxxxxxxxxxxxxxxx"),
                        Map.entry("resourceUri", "https://graph.microsoft.com"),
                        Map.entry("scopes", "User.Read.All Group.Read.All")
                    ))
                    .build())
                .redirectUrl("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1")
                .build())
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

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

const authorizationProvider = new azure_native.apimanagement.AuthorizationProvider("authorizationProvider", {
    authorizationProviderId: "aadwithauthcode",
    displayName: "aadwithauthcode",
    identityProvider: "aad",
    oauth2: {
        grantTypes: {
            authorizationCode: {
                clientId: "59790825-fdd3-4b10-bc7a-4c3aaf25801d",
                clientSecret: "xxxxxxxxxxxxxxxxxxxxxxxx",
                resourceUri: "https://graph.microsoft.com",
                scopes: "User.Read.All Group.Read.All",
            },
        },
        redirectUrl: "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

authorization_provider = azure_native.apimanagement.AuthorizationProvider("authorizationProvider",
    authorization_provider_id="aadwithauthcode",
    display_name="aadwithauthcode",
    identity_provider="aad",
    oauth2={
        "grant_types": {
            "authorization_code": {
                "clientId": "59790825-fdd3-4b10-bc7a-4c3aaf25801d",
                "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxx",
                "resourceUri": "https://graph.microsoft.com",
                "scopes": "User.Read.All Group.Read.All",
            },
        },
        "redirect_url": "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  authorizationProvider:
    type: azure-native:apimanagement:AuthorizationProvider
    properties:
      authorizationProviderId: aadwithauthcode
      displayName: aadwithauthcode
      identityProvider: aad
      oauth2:
        grantTypes:
          authorizationCode:
            clientId: 59790825-fdd3-4b10-bc7a-4c3aaf25801d
            clientSecret: xxxxxxxxxxxxxxxxxxxxxxxx
            resourceUri: https://graph.microsoft.com
            scopes: User.Read.All Group.Read.All
        redirectUrl: https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1
      resourceGroupName: rg1
      serviceName: apimService1
Copy

ApiManagementCreateAuthorizationProviderAADClientCred

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

return await Deployment.RunAsync(() => 
{
    var authorizationProvider = new AzureNative.ApiManagement.AuthorizationProvider("authorizationProvider", new()
    {
        AuthorizationProviderId = "aadwithclientcred",
        DisplayName = "aadwithclientcred",
        IdentityProvider = "aad",
        Oauth2 = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2SettingsArgs
        {
            GrantTypes = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypesArgs
            {
                AuthorizationCode = 
                {
                    { "resourceUri", "https://graph.microsoft.com" },
                    { "scopes", "User.Read.All Group.Read.All" },
                },
            },
            RedirectUrl = "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
        },
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
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.NewAuthorizationProvider(ctx, "authorizationProvider", &apimanagement.AuthorizationProviderArgs{
			AuthorizationProviderId: pulumi.String("aadwithclientcred"),
			DisplayName:             pulumi.String("aadwithclientcred"),
			IdentityProvider:        pulumi.String("aad"),
			Oauth2: &apimanagement.AuthorizationProviderOAuth2SettingsArgs{
				GrantTypes: &apimanagement.AuthorizationProviderOAuth2GrantTypesArgs{
					AuthorizationCode: pulumi.StringMap{
						"resourceUri": pulumi.String("https://graph.microsoft.com"),
						"scopes":      pulumi.String("User.Read.All Group.Read.All"),
					},
				},
				RedirectUrl: pulumi.String("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"),
			},
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		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.AuthorizationProvider;
import com.pulumi.azurenative.apimanagement.AuthorizationProviderArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2SettingsArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2GrantTypesArgs;
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 authorizationProvider = new AuthorizationProvider("authorizationProvider", AuthorizationProviderArgs.builder()
            .authorizationProviderId("aadwithclientcred")
            .displayName("aadwithclientcred")
            .identityProvider("aad")
            .oauth2(AuthorizationProviderOAuth2SettingsArgs.builder()
                .grantTypes(AuthorizationProviderOAuth2GrantTypesArgs.builder()
                    .authorizationCode(Map.ofEntries(
                        Map.entry("resourceUri", "https://graph.microsoft.com"),
                        Map.entry("scopes", "User.Read.All Group.Read.All")
                    ))
                    .build())
                .redirectUrl("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1")
                .build())
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

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

const authorizationProvider = new azure_native.apimanagement.AuthorizationProvider("authorizationProvider", {
    authorizationProviderId: "aadwithclientcred",
    displayName: "aadwithclientcred",
    identityProvider: "aad",
    oauth2: {
        grantTypes: {
            authorizationCode: {
                resourceUri: "https://graph.microsoft.com",
                scopes: "User.Read.All Group.Read.All",
            },
        },
        redirectUrl: "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

authorization_provider = azure_native.apimanagement.AuthorizationProvider("authorizationProvider",
    authorization_provider_id="aadwithclientcred",
    display_name="aadwithclientcred",
    identity_provider="aad",
    oauth2={
        "grant_types": {
            "authorization_code": {
                "resourceUri": "https://graph.microsoft.com",
                "scopes": "User.Read.All Group.Read.All",
            },
        },
        "redirect_url": "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  authorizationProvider:
    type: azure-native:apimanagement:AuthorizationProvider
    properties:
      authorizationProviderId: aadwithclientcred
      displayName: aadwithclientcred
      identityProvider: aad
      oauth2:
        grantTypes:
          authorizationCode:
            resourceUri: https://graph.microsoft.com
            scopes: User.Read.All Group.Read.All
        redirectUrl: https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1
      resourceGroupName: rg1
      serviceName: apimService1
Copy

ApiManagementCreateAuthorizationProviderGenericOAuth2

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

return await Deployment.RunAsync(() => 
{
    var authorizationProvider = new AzureNative.ApiManagement.AuthorizationProvider("authorizationProvider", new()
    {
        AuthorizationProviderId = "eventbrite",
        DisplayName = "eventbrite",
        IdentityProvider = "oauth2",
        Oauth2 = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2SettingsArgs
        {
            GrantTypes = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypesArgs
            {
                AuthorizationCode = 
                {
                    { "authorizationUrl", "https://www.eventbrite.com/oauth/authorize" },
                    { "clientId", "genericClientId" },
                    { "clientSecret", "xxxxxxxxxxxxxxxxxxxxxxxx" },
                    { "refreshUrl", "https://www.eventbrite.com/oauth/token" },
                    { "scopes", "" },
                    { "tokenUrl", "https://www.eventbrite.com/oauth/token" },
                },
            },
            RedirectUrl = "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
        },
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
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.NewAuthorizationProvider(ctx, "authorizationProvider", &apimanagement.AuthorizationProviderArgs{
			AuthorizationProviderId: pulumi.String("eventbrite"),
			DisplayName:             pulumi.String("eventbrite"),
			IdentityProvider:        pulumi.String("oauth2"),
			Oauth2: &apimanagement.AuthorizationProviderOAuth2SettingsArgs{
				GrantTypes: &apimanagement.AuthorizationProviderOAuth2GrantTypesArgs{
					AuthorizationCode: pulumi.StringMap{
						"authorizationUrl": pulumi.String("https://www.eventbrite.com/oauth/authorize"),
						"clientId":         pulumi.String("genericClientId"),
						"clientSecret":     pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxx"),
						"refreshUrl":       pulumi.String("https://www.eventbrite.com/oauth/token"),
						"scopes":           pulumi.String(""),
						"tokenUrl":         pulumi.String("https://www.eventbrite.com/oauth/token"),
					},
				},
				RedirectUrl: pulumi.String("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"),
			},
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		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.AuthorizationProvider;
import com.pulumi.azurenative.apimanagement.AuthorizationProviderArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2SettingsArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2GrantTypesArgs;
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 authorizationProvider = new AuthorizationProvider("authorizationProvider", AuthorizationProviderArgs.builder()
            .authorizationProviderId("eventbrite")
            .displayName("eventbrite")
            .identityProvider("oauth2")
            .oauth2(AuthorizationProviderOAuth2SettingsArgs.builder()
                .grantTypes(AuthorizationProviderOAuth2GrantTypesArgs.builder()
                    .authorizationCode(Map.ofEntries(
                        Map.entry("authorizationUrl", "https://www.eventbrite.com/oauth/authorize"),
                        Map.entry("clientId", "genericClientId"),
                        Map.entry("clientSecret", "xxxxxxxxxxxxxxxxxxxxxxxx"),
                        Map.entry("refreshUrl", "https://www.eventbrite.com/oauth/token"),
                        Map.entry("scopes", ""),
                        Map.entry("tokenUrl", "https://www.eventbrite.com/oauth/token")
                    ))
                    .build())
                .redirectUrl("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1")
                .build())
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

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

const authorizationProvider = new azure_native.apimanagement.AuthorizationProvider("authorizationProvider", {
    authorizationProviderId: "eventbrite",
    displayName: "eventbrite",
    identityProvider: "oauth2",
    oauth2: {
        grantTypes: {
            authorizationCode: {
                authorizationUrl: "https://www.eventbrite.com/oauth/authorize",
                clientId: "genericClientId",
                clientSecret: "xxxxxxxxxxxxxxxxxxxxxxxx",
                refreshUrl: "https://www.eventbrite.com/oauth/token",
                scopes: "",
                tokenUrl: "https://www.eventbrite.com/oauth/token",
            },
        },
        redirectUrl: "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

authorization_provider = azure_native.apimanagement.AuthorizationProvider("authorizationProvider",
    authorization_provider_id="eventbrite",
    display_name="eventbrite",
    identity_provider="oauth2",
    oauth2={
        "grant_types": {
            "authorization_code": {
                "authorizationUrl": "https://www.eventbrite.com/oauth/authorize",
                "clientId": "genericClientId",
                "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxx",
                "refreshUrl": "https://www.eventbrite.com/oauth/token",
                "scopes": "",
                "tokenUrl": "https://www.eventbrite.com/oauth/token",
            },
        },
        "redirect_url": "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  authorizationProvider:
    type: azure-native:apimanagement:AuthorizationProvider
    properties:
      authorizationProviderId: eventbrite
      displayName: eventbrite
      identityProvider: oauth2
      oauth2:
        grantTypes:
          authorizationCode:
            authorizationUrl: https://www.eventbrite.com/oauth/authorize
            clientId: genericClientId
            clientSecret: xxxxxxxxxxxxxxxxxxxxxxxx
            refreshUrl: https://www.eventbrite.com/oauth/token
            scopes: ""
            tokenUrl: https://www.eventbrite.com/oauth/token
        redirectUrl: https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1
      resourceGroupName: rg1
      serviceName: apimService1
Copy

ApiManagementCreateAuthorizationProviderOOBGoogle

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

return await Deployment.RunAsync(() => 
{
    var authorizationProvider = new AzureNative.ApiManagement.AuthorizationProvider("authorizationProvider", new()
    {
        AuthorizationProviderId = "google",
        DisplayName = "google",
        IdentityProvider = "google",
        Oauth2 = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2SettingsArgs
        {
            GrantTypes = new AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypesArgs
            {
                AuthorizationCode = 
                {
                    { "clientId", "99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com" },
                    { "clientSecret", "XXXXXXXXXXXXXXXXXXXX" },
                    { "scopes", "openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email" },
                },
            },
            RedirectUrl = "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
        },
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
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.NewAuthorizationProvider(ctx, "authorizationProvider", &apimanagement.AuthorizationProviderArgs{
			AuthorizationProviderId: pulumi.String("google"),
			DisplayName:             pulumi.String("google"),
			IdentityProvider:        pulumi.String("google"),
			Oauth2: &apimanagement.AuthorizationProviderOAuth2SettingsArgs{
				GrantTypes: &apimanagement.AuthorizationProviderOAuth2GrantTypesArgs{
					AuthorizationCode: pulumi.StringMap{
						"clientId":     pulumi.String("99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"),
						"clientSecret": pulumi.String("XXXXXXXXXXXXXXXXXXXX"),
						"scopes":       pulumi.String("openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"),
					},
				},
				RedirectUrl: pulumi.String("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"),
			},
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		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.AuthorizationProvider;
import com.pulumi.azurenative.apimanagement.AuthorizationProviderArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2SettingsArgs;
import com.pulumi.azurenative.apimanagement.inputs.AuthorizationProviderOAuth2GrantTypesArgs;
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 authorizationProvider = new AuthorizationProvider("authorizationProvider", AuthorizationProviderArgs.builder()
            .authorizationProviderId("google")
            .displayName("google")
            .identityProvider("google")
            .oauth2(AuthorizationProviderOAuth2SettingsArgs.builder()
                .grantTypes(AuthorizationProviderOAuth2GrantTypesArgs.builder()
                    .authorizationCode(Map.ofEntries(
                        Map.entry("clientId", "99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"),
                        Map.entry("clientSecret", "XXXXXXXXXXXXXXXXXXXX"),
                        Map.entry("scopes", "openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email")
                    ))
                    .build())
                .redirectUrl("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1")
                .build())
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

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

const authorizationProvider = new azure_native.apimanagement.AuthorizationProvider("authorizationProvider", {
    authorizationProviderId: "google",
    displayName: "google",
    identityProvider: "google",
    oauth2: {
        grantTypes: {
            authorizationCode: {
                clientId: "99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
                clientSecret: "XXXXXXXXXXXXXXXXXXXX",
                scopes: "openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
            },
        },
        redirectUrl: "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

authorization_provider = azure_native.apimanagement.AuthorizationProvider("authorizationProvider",
    authorization_provider_id="google",
    display_name="google",
    identity_provider="google",
    oauth2={
        "grant_types": {
            "authorization_code": {
                "clientId": "99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
                "clientSecret": "XXXXXXXXXXXXXXXXXXXX",
                "scopes": "openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
            },
        },
        "redirect_url": "https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1",
    },
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  authorizationProvider:
    type: azure-native:apimanagement:AuthorizationProvider
    properties:
      authorizationProviderId: google
      displayName: google
      identityProvider: google
      oauth2:
        grantTypes:
          authorizationCode:
            clientId: 99999999-xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
            clientSecret: XXXXXXXXXXXXXXXXXXXX
            scopes: openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
        redirectUrl: https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1
      resourceGroupName: rg1
      serviceName: apimService1
Copy

Create AuthorizationProvider Resource

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

Constructor syntax

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

@overload
def AuthorizationProvider(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          resource_group_name: Optional[str] = None,
                          service_name: Optional[str] = None,
                          authorization_provider_id: Optional[str] = None,
                          display_name: Optional[str] = None,
                          identity_provider: Optional[str] = None,
                          oauth2: Optional[AuthorizationProviderOAuth2SettingsArgs] = None)
func NewAuthorizationProvider(ctx *Context, name string, args AuthorizationProviderArgs, opts ...ResourceOption) (*AuthorizationProvider, error)
public AuthorizationProvider(string name, AuthorizationProviderArgs args, CustomResourceOptions? opts = null)
public AuthorizationProvider(String name, AuthorizationProviderArgs args)
public AuthorizationProvider(String name, AuthorizationProviderArgs args, CustomResourceOptions options)
type: azure-native:apimanagement:AuthorizationProvider
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. AuthorizationProviderArgs
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. AuthorizationProviderArgs
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. AuthorizationProviderArgs
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. AuthorizationProviderArgs
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. AuthorizationProviderArgs
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 authorizationProviderResource = new AzureNative.Apimanagement.AuthorizationProvider("authorizationProviderResource", new()
{
    ResourceGroupName = "string",
    ServiceName = "string",
    AuthorizationProviderId = "string",
    DisplayName = "string",
    IdentityProvider = "string",
    Oauth2 = 
    {
        { "grantTypes", 
        {
            { "authorizationCode", 
            {
                { "string", "string" },
            } },
            { "clientCredentials", 
            {
                { "string", "string" },
            } },
        } },
        { "redirectUrl", "string" },
    },
});
Copy
example, err := apimanagement.NewAuthorizationProvider(ctx, "authorizationProviderResource", &apimanagement.AuthorizationProviderArgs{
	ResourceGroupName:       "string",
	ServiceName:             "string",
	AuthorizationProviderId: "string",
	DisplayName:             "string",
	IdentityProvider:        "string",
	Oauth2: map[string]interface{}{
		"grantTypes": map[string]interface{}{
			"authorizationCode": map[string]interface{}{
				"string": "string",
			},
			"clientCredentials": map[string]interface{}{
				"string": "string",
			},
		},
		"redirectUrl": "string",
	},
})
Copy
var authorizationProviderResource = new AuthorizationProvider("authorizationProviderResource", AuthorizationProviderArgs.builder()
    .resourceGroupName("string")
    .serviceName("string")
    .authorizationProviderId("string")
    .displayName("string")
    .identityProvider("string")
    .oauth2(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
authorization_provider_resource = azure_native.apimanagement.AuthorizationProvider("authorizationProviderResource",
    resource_group_name=string,
    service_name=string,
    authorization_provider_id=string,
    display_name=string,
    identity_provider=string,
    oauth2={
        grantTypes: {
            authorizationCode: {
                string: string,
            },
            clientCredentials: {
                string: string,
            },
        },
        redirectUrl: string,
    })
Copy
const authorizationProviderResource = new azure_native.apimanagement.AuthorizationProvider("authorizationProviderResource", {
    resourceGroupName: "string",
    serviceName: "string",
    authorizationProviderId: "string",
    displayName: "string",
    identityProvider: "string",
    oauth2: {
        grantTypes: {
            authorizationCode: {
                string: "string",
            },
            clientCredentials: {
                string: "string",
            },
        },
        redirectUrl: "string",
    },
});
Copy
type: azure-native:apimanagement:AuthorizationProvider
properties:
    authorizationProviderId: string
    displayName: string
    identityProvider: string
    oauth2:
        grantTypes:
            authorizationCode:
                string: string
            clientCredentials:
                string: string
        redirectUrl: string
    resourceGroupName: string
    serviceName: string
Copy

AuthorizationProvider 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 AuthorizationProvider 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.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
AuthorizationProviderId Changes to this property will trigger replacement. string
Identifier of the authorization provider.
DisplayName string
Authorization Provider name. Must be 1 to 300 characters long.
IdentityProvider string
Identity provider name. Must be 1 to 300 characters long.
Oauth2 Pulumi.AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2Settings
OAuth2 settings
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
AuthorizationProviderId Changes to this property will trigger replacement. string
Identifier of the authorization provider.
DisplayName string
Authorization Provider name. Must be 1 to 300 characters long.
IdentityProvider string
Identity provider name. Must be 1 to 300 characters long.
Oauth2 AuthorizationProviderOAuth2SettingsArgs
OAuth2 settings
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
authorizationProviderId Changes to this property will trigger replacement. String
Identifier of the authorization provider.
displayName String
Authorization Provider name. Must be 1 to 300 characters long.
identityProvider String
Identity provider name. Must be 1 to 300 characters long.
oauth2 AuthorizationProviderOAuth2Settings
OAuth2 settings
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
authorizationProviderId Changes to this property will trigger replacement. string
Identifier of the authorization provider.
displayName string
Authorization Provider name. Must be 1 to 300 characters long.
identityProvider string
Identity provider name. Must be 1 to 300 characters long.
oauth2 AuthorizationProviderOAuth2Settings
OAuth2 settings
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.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the API Management service.
authorization_provider_id Changes to this property will trigger replacement. str
Identifier of the authorization provider.
display_name str
Authorization Provider name. Must be 1 to 300 characters long.
identity_provider str
Identity provider name. Must be 1 to 300 characters long.
oauth2 AuthorizationProviderOAuth2SettingsArgs
OAuth2 settings
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
authorizationProviderId Changes to this property will trigger replacement. String
Identifier of the authorization provider.
displayName String
Authorization Provider name. Must be 1 to 300 characters long.
identityProvider String
Identity provider name. Must be 1 to 300 characters long.
oauth2 Property Map
OAuth2 settings

Outputs

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

AuthorizationProviderOAuth2GrantTypes
, AuthorizationProviderOAuth2GrantTypesArgs

AuthorizationCode Dictionary<string, string>
OAuth2 authorization code grant parameters
ClientCredentials Dictionary<string, string>
OAuth2 client credential grant parameters
AuthorizationCode map[string]string
OAuth2 authorization code grant parameters
ClientCredentials map[string]string
OAuth2 client credential grant parameters
authorizationCode Map<String,String>
OAuth2 authorization code grant parameters
clientCredentials Map<String,String>
OAuth2 client credential grant parameters
authorizationCode {[key: string]: string}
OAuth2 authorization code grant parameters
clientCredentials {[key: string]: string}
OAuth2 client credential grant parameters
authorization_code Mapping[str, str]
OAuth2 authorization code grant parameters
client_credentials Mapping[str, str]
OAuth2 client credential grant parameters
authorizationCode Map<String>
OAuth2 authorization code grant parameters
clientCredentials Map<String>
OAuth2 client credential grant parameters

AuthorizationProviderOAuth2GrantTypesResponse
, AuthorizationProviderOAuth2GrantTypesResponseArgs

AuthorizationCode Dictionary<string, string>
OAuth2 authorization code grant parameters
ClientCredentials Dictionary<string, string>
OAuth2 client credential grant parameters
AuthorizationCode map[string]string
OAuth2 authorization code grant parameters
ClientCredentials map[string]string
OAuth2 client credential grant parameters
authorizationCode Map<String,String>
OAuth2 authorization code grant parameters
clientCredentials Map<String,String>
OAuth2 client credential grant parameters
authorizationCode {[key: string]: string}
OAuth2 authorization code grant parameters
clientCredentials {[key: string]: string}
OAuth2 client credential grant parameters
authorization_code Mapping[str, str]
OAuth2 authorization code grant parameters
client_credentials Mapping[str, str]
OAuth2 client credential grant parameters
authorizationCode Map<String>
OAuth2 authorization code grant parameters
clientCredentials Map<String>
OAuth2 client credential grant parameters

AuthorizationProviderOAuth2Settings
, AuthorizationProviderOAuth2SettingsArgs

GrantTypes Pulumi.AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypes
OAuth2 settings
RedirectUrl string
Redirect URL to be set in the OAuth application.
GrantTypes AuthorizationProviderOAuth2GrantTypes
OAuth2 settings
RedirectUrl string
Redirect URL to be set in the OAuth application.
grantTypes AuthorizationProviderOAuth2GrantTypes
OAuth2 settings
redirectUrl String
Redirect URL to be set in the OAuth application.
grantTypes AuthorizationProviderOAuth2GrantTypes
OAuth2 settings
redirectUrl string
Redirect URL to be set in the OAuth application.
grant_types AuthorizationProviderOAuth2GrantTypes
OAuth2 settings
redirect_url str
Redirect URL to be set in the OAuth application.
grantTypes Property Map
OAuth2 settings
redirectUrl String
Redirect URL to be set in the OAuth application.

AuthorizationProviderOAuth2SettingsResponse
, AuthorizationProviderOAuth2SettingsResponseArgs

GrantTypes Pulumi.AzureNative.ApiManagement.Inputs.AuthorizationProviderOAuth2GrantTypesResponse
OAuth2 settings
RedirectUrl string
Redirect URL to be set in the OAuth application.
GrantTypes AuthorizationProviderOAuth2GrantTypesResponse
OAuth2 settings
RedirectUrl string
Redirect URL to be set in the OAuth application.
grantTypes AuthorizationProviderOAuth2GrantTypesResponse
OAuth2 settings
redirectUrl String
Redirect URL to be set in the OAuth application.
grantTypes AuthorizationProviderOAuth2GrantTypesResponse
OAuth2 settings
redirectUrl string
Redirect URL to be set in the OAuth application.
grant_types AuthorizationProviderOAuth2GrantTypesResponse
OAuth2 settings
redirect_url str
Redirect URL to be set in the OAuth application.
grantTypes Property Map
OAuth2 settings
redirectUrl String
Redirect URL to be set in the OAuth application.

Import

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

$ pulumi import azure-native:apimanagement:AuthorizationProvider google /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId} 
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