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

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.apimanagement.Certificate

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Manages an Certificate within an API Management Service.

    Example Usage

    With Base64 Certificate)

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as std from "@pulumi/std";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleService = new azure.apimanagement.Service("example", {
        name: "example-apim",
        location: example.location,
        resourceGroupName: example.name,
        publisherName: "My Company",
        publisherEmail: "company@exmaple.com",
        skuName: "Developer_1",
    });
    const exampleCertificate = new azure.apimanagement.Certificate("example", {
        name: "example-cert",
        apiManagementName: exampleService.name,
        resourceGroupName: example.name,
        data: std.filebase64({
            input: "example.pfx",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_azure as azure
    import pulumi_std as std
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_service = azure.apimanagement.Service("example",
        name="example-apim",
        location=example.location,
        resource_group_name=example.name,
        publisher_name="My Company",
        publisher_email="company@exmaple.com",
        sku_name="Developer_1")
    example_certificate = azure.apimanagement.Certificate("example",
        name="example-cert",
        api_management_name=example_service.name,
        resource_group_name=example.name,
        data=std.filebase64(input="example.pfx").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
    			Name:              pulumi.String("example-apim"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			PublisherName:     pulumi.String("My Company"),
    			PublisherEmail:    pulumi.String("company@exmaple.com"),
    			SkuName:           pulumi.String("Developer_1"),
    		})
    		if err != nil {
    			return err
    		}
    		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
    			Input: "example.pfx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewCertificate(ctx, "example", &apimanagement.CertificateArgs{
    			Name:              pulumi.String("example-cert"),
    			ApiManagementName: exampleService.Name,
    			ResourceGroupName: example.Name,
    			Data:              invokeFilebase64.Result,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleService = new Azure.ApiManagement.Service("example", new()
        {
            Name = "example-apim",
            Location = example.Location,
            ResourceGroupName = example.Name,
            PublisherName = "My Company",
            PublisherEmail = "company@exmaple.com",
            SkuName = "Developer_1",
        });
    
        var exampleCertificate = new Azure.ApiManagement.Certificate("example", new()
        {
            Name = "example-cert",
            ApiManagementName = exampleService.Name,
            ResourceGroupName = example.Name,
            Data = Std.Filebase64.Invoke(new()
            {
                Input = "example.pfx",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.apimanagement.Service;
    import com.pulumi.azure.apimanagement.ServiceArgs;
    import com.pulumi.azure.apimanagement.Certificate;
    import com.pulumi.azure.apimanagement.CertificateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example-apim")
                .location(example.location())
                .resourceGroupName(example.name())
                .publisherName("My Company")
                .publisherEmail("company@exmaple.com")
                .skuName("Developer_1")
                .build());
    
            var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
                .name("example-cert")
                .apiManagementName(exampleService.name())
                .resourceGroupName(example.name())
                .data(StdFunctions.filebase64(Filebase64Args.builder()
                    .input("example.pfx")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleService:
        type: azure:apimanagement:Service
        name: example
        properties:
          name: example-apim
          location: ${example.location}
          resourceGroupName: ${example.name}
          publisherName: My Company
          publisherEmail: company@exmaple.com
          skuName: Developer_1
      exampleCertificate:
        type: azure:apimanagement:Certificate
        name: example
        properties:
          name: example-cert
          apiManagementName: ${exampleService.name}
          resourceGroupName: ${example.name}
          data:
            fn::invoke:
              Function: std:filebase64
              Arguments:
                input: example.pfx
              Return: result
    

    With Key Vault Certificate)

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as std from "@pulumi/std";
    
    const current = azure.core.getClientConfig({});
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleService = new azure.apimanagement.Service("example", {
        name: "example-apim",
        location: example.location,
        resourceGroupName: example.name,
        publisherName: "My Company",
        publisherEmail: "company@terraform.io",
        skuName: "Developer_1",
        identity: {
            type: "SystemAssigned",
        },
    });
    const exampleKeyVault = new azure.keyvault.KeyVault("example", {
        name: "examplekeyvault",
        location: example.location,
        resourceGroupName: example.name,
        tenantId: current.then(current => current.tenantId),
        skuName: "standard",
    });
    const exampleAccessPolicy = new azure.keyvault.AccessPolicy("example", {
        keyVaultId: exampleKeyVault.id,
        tenantId: exampleService.identity.apply(identity => identity?.tenantId),
        objectId: exampleService.identity.apply(identity => identity?.principalId),
        secretPermissions: ["Get"],
        certificatePermissions: ["Get"],
    });
    const exampleCertificate = new azure.keyvault.Certificate("example", {
        name: "example-cert",
        keyVaultId: exampleKeyVault.id,
        certificate: {
            contents: std.filebase64({
                input: "example_cert.pfx",
            }).then(invoke => invoke.result),
            password: "terraform",
        },
        certificatePolicy: {
            issuerParameters: {
                name: "Self",
            },
            keyProperties: {
                exportable: true,
                keySize: 2048,
                keyType: "RSA",
                reuseKey: false,
            },
            secretProperties: {
                contentType: "application/x-pkcs12",
            },
        },
    });
    const exampleCertificate2 = new azure.apimanagement.Certificate("example", {
        name: "example-cert",
        apiManagementName: exampleService.name,
        resourceGroupName: example.name,
        keyVaultSecretId: exampleCertificate.secretId,
    });
    
    import pulumi
    import pulumi_azure as azure
    import pulumi_std as std
    
    current = azure.core.get_client_config()
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_service = azure.apimanagement.Service("example",
        name="example-apim",
        location=example.location,
        resource_group_name=example.name,
        publisher_name="My Company",
        publisher_email="company@terraform.io",
        sku_name="Developer_1",
        identity=azure.apimanagement.ServiceIdentityArgs(
            type="SystemAssigned",
        ))
    example_key_vault = azure.keyvault.KeyVault("example",
        name="examplekeyvault",
        location=example.location,
        resource_group_name=example.name,
        tenant_id=current.tenant_id,
        sku_name="standard")
    example_access_policy = azure.keyvault.AccessPolicy("example",
        key_vault_id=example_key_vault.id,
        tenant_id=example_service.identity.tenant_id,
        object_id=example_service.identity.principal_id,
        secret_permissions=["Get"],
        certificate_permissions=["Get"])
    example_certificate = azure.keyvault.Certificate("example",
        name="example-cert",
        key_vault_id=example_key_vault.id,
        certificate=azure.keyvault.CertificateCertificateArgs(
            contents=std.filebase64(input="example_cert.pfx").result,
            password="terraform",
        ),
        certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs(
            issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs(
                name="Self",
            ),
            key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs(
                exportable=True,
                key_size=2048,
                key_type="RSA",
                reuse_key=False,
            ),
            secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs(
                content_type="application/x-pkcs12",
            ),
        ))
    example_certificate2 = azure.apimanagement.Certificate("example",
        name="example-cert",
        api_management_name=example_service.name,
        resource_group_name=example.name,
        key_vault_secret_id=example_certificate.secret_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := core.GetClientConfig(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
    			Name:              pulumi.String("example-apim"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			PublisherName:     pulumi.String("My Company"),
    			PublisherEmail:    pulumi.String("company@terraform.io"),
    			SkuName:           pulumi.String("Developer_1"),
    			Identity: &apimanagement.ServiceIdentityArgs{
    				Type: pulumi.String("SystemAssigned"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
    			Name:              pulumi.String("examplekeyvault"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			TenantId:          pulumi.String(current.TenantId),
    			SkuName:           pulumi.String("standard"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = keyvault.NewAccessPolicy(ctx, "example", &keyvault.AccessPolicyArgs{
    			KeyVaultId: exampleKeyVault.ID(),
    			TenantId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) {
    				return &identity.TenantId, nil
    			}).(pulumi.StringPtrOutput),
    			ObjectId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) {
    				return &identity.PrincipalId, nil
    			}).(pulumi.StringPtrOutput),
    			SecretPermissions: pulumi.StringArray{
    				pulumi.String("Get"),
    			},
    			CertificatePermissions: pulumi.StringArray{
    				pulumi.String("Get"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
    			Input: "example_cert.pfx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleCertificate, err := keyvault.NewCertificate(ctx, "example", &keyvault.CertificateArgs{
    			Name:       pulumi.String("example-cert"),
    			KeyVaultId: exampleKeyVault.ID(),
    			Certificate: &keyvault.CertificateCertificateArgs{
    				Contents: invokeFilebase64.Result,
    				Password: pulumi.String("terraform"),
    			},
    			CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{
    				IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{
    					Name: pulumi.String("Self"),
    				},
    				KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{
    					Exportable: pulumi.Bool(true),
    					KeySize:    pulumi.Int(2048),
    					KeyType:    pulumi.String("RSA"),
    					ReuseKey:   pulumi.Bool(false),
    				},
    				SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{
    					ContentType: pulumi.String("application/x-pkcs12"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewCertificate(ctx, "example", &apimanagement.CertificateArgs{
    			Name:              pulumi.String("example-cert"),
    			ApiManagementName: exampleService.Name,
    			ResourceGroupName: example.Name,
    			KeyVaultSecretId:  exampleCertificate.SecretId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Azure.Core.GetClientConfig.Invoke();
    
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleService = new Azure.ApiManagement.Service("example", new()
        {
            Name = "example-apim",
            Location = example.Location,
            ResourceGroupName = example.Name,
            PublisherName = "My Company",
            PublisherEmail = "company@terraform.io",
            SkuName = "Developer_1",
            Identity = new Azure.ApiManagement.Inputs.ServiceIdentityArgs
            {
                Type = "SystemAssigned",
            },
        });
    
        var exampleKeyVault = new Azure.KeyVault.KeyVault("example", new()
        {
            Name = "examplekeyvault",
            Location = example.Location,
            ResourceGroupName = example.Name,
            TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
            SkuName = "standard",
        });
    
        var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("example", new()
        {
            KeyVaultId = exampleKeyVault.Id,
            TenantId = exampleService.Identity.Apply(identity => identity?.TenantId),
            ObjectId = exampleService.Identity.Apply(identity => identity?.PrincipalId),
            SecretPermissions = new[]
            {
                "Get",
            },
            CertificatePermissions = new[]
            {
                "Get",
            },
        });
    
        var exampleCertificate = new Azure.KeyVault.Certificate("example", new()
        {
            Name = "example-cert",
            KeyVaultId = exampleKeyVault.Id,
            KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs
            {
                Contents = Std.Filebase64.Invoke(new()
                {
                    Input = "example_cert.pfx",
                }).Apply(invoke => invoke.Result),
                Password = "terraform",
            },
            CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs
            {
                IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs
                {
                    Name = "Self",
                },
                KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs
                {
                    Exportable = true,
                    KeySize = 2048,
                    KeyType = "RSA",
                    ReuseKey = false,
                },
                SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs
                {
                    ContentType = "application/x-pkcs12",
                },
            },
        });
    
        var exampleCertificate2 = new Azure.ApiManagement.Certificate("example", new()
        {
            Name = "example-cert",
            ApiManagementName = exampleService.Name,
            ResourceGroupName = example.Name,
            KeyVaultSecretId = exampleCertificate.SecretId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.CoreFunctions;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.apimanagement.Service;
    import com.pulumi.azure.apimanagement.ServiceArgs;
    import com.pulumi.azure.apimanagement.inputs.ServiceIdentityArgs;
    import com.pulumi.azure.keyvault.KeyVault;
    import com.pulumi.azure.keyvault.KeyVaultArgs;
    import com.pulumi.azure.keyvault.AccessPolicy;
    import com.pulumi.azure.keyvault.AccessPolicyArgs;
    import com.pulumi.azure.keyvault.Certificate;
    import com.pulumi.azure.keyvault.CertificateArgs;
    import com.pulumi.azure.keyvault.inputs.CertificateCertificateArgs;
    import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyArgs;
    import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyIssuerParametersArgs;
    import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyKeyPropertiesArgs;
    import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicySecretPropertiesArgs;
    import com.pulumi.azure.apimanagement.Certificate;
    import com.pulumi.azure.apimanagement.CertificateArgs;
    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) {
            final var current = CoreFunctions.getClientConfig();
    
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example-apim")
                .location(example.location())
                .resourceGroupName(example.name())
                .publisherName("My Company")
                .publisherEmail("company@terraform.io")
                .skuName("Developer_1")
                .identity(ServiceIdentityArgs.builder()
                    .type("SystemAssigned")
                    .build())
                .build());
    
            var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
                .name("examplekeyvault")
                .location(example.location())
                .resourceGroupName(example.name())
                .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                .skuName("standard")
                .build());
    
            var exampleAccessPolicy = new AccessPolicy("exampleAccessPolicy", AccessPolicyArgs.builder()
                .keyVaultId(exampleKeyVault.id())
                .tenantId(exampleService.identity().applyValue(identity -> identity.tenantId()))
                .objectId(exampleService.identity().applyValue(identity -> identity.principalId()))
                .secretPermissions("Get")
                .certificatePermissions("Get")
                .build());
    
            var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
                .name("example-cert")
                .keyVaultId(exampleKeyVault.id())
                .certificate(CertificateCertificateArgs.builder()
                    .contents(StdFunctions.filebase64(Filebase64Args.builder()
                        .input("example_cert.pfx")
                        .build()).result())
                    .password("terraform")
                    .build())
                .certificatePolicy(CertificateCertificatePolicyArgs.builder()
                    .issuerParameters(CertificateCertificatePolicyIssuerParametersArgs.builder()
                        .name("Self")
                        .build())
                    .keyProperties(CertificateCertificatePolicyKeyPropertiesArgs.builder()
                        .exportable(true)
                        .keySize(2048)
                        .keyType("RSA")
                        .reuseKey(false)
                        .build())
                    .secretProperties(CertificateCertificatePolicySecretPropertiesArgs.builder()
                        .contentType("application/x-pkcs12")
                        .build())
                    .build())
                .build());
    
            var exampleCertificate2 = new Certificate("exampleCertificate2", CertificateArgs.builder()
                .name("example-cert")
                .apiManagementName(exampleService.name())
                .resourceGroupName(example.name())
                .keyVaultSecretId(exampleCertificate.secretId())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleService:
        type: azure:apimanagement:Service
        name: example
        properties:
          name: example-apim
          location: ${example.location}
          resourceGroupName: ${example.name}
          publisherName: My Company
          publisherEmail: company@terraform.io
          skuName: Developer_1
          identity:
            type: SystemAssigned
      exampleKeyVault:
        type: azure:keyvault:KeyVault
        name: example
        properties:
          name: examplekeyvault
          location: ${example.location}
          resourceGroupName: ${example.name}
          tenantId: ${current.tenantId}
          skuName: standard
      exampleAccessPolicy:
        type: azure:keyvault:AccessPolicy
        name: example
        properties:
          keyVaultId: ${exampleKeyVault.id}
          tenantId: ${exampleService.identity.tenantId}
          objectId: ${exampleService.identity.principalId}
          secretPermissions:
            - Get
          certificatePermissions:
            - Get
      exampleCertificate:
        type: azure:keyvault:Certificate
        name: example
        properties:
          name: example-cert
          keyVaultId: ${exampleKeyVault.id}
          certificate:
            contents:
              fn::invoke:
                Function: std:filebase64
                Arguments:
                  input: example_cert.pfx
                Return: result
            password: terraform
          certificatePolicy:
            issuerParameters:
              name: Self
            keyProperties:
              exportable: true
              keySize: 2048
              keyType: RSA
              reuseKey: false
            secretProperties:
              contentType: application/x-pkcs12
      exampleCertificate2:
        type: azure:apimanagement:Certificate
        name: example
        properties:
          name: example-cert
          apiManagementName: ${exampleService.name}
          resourceGroupName: ${example.name}
          keyVaultSecretId: ${exampleCertificate.secretId}
    variables:
      current:
        fn::invoke:
          Function: azure:core:getClientConfig
          Arguments: {}
    

    Create Certificate Resource

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

    Constructor syntax

    new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
    @overload
    def Certificate(resource_name: str,
                    args: CertificateArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Certificate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    api_management_name: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    data: Optional[str] = None,
                    key_vault_identity_client_id: Optional[str] = None,
                    key_vault_secret_id: Optional[str] = None,
                    name: Optional[str] = None,
                    password: Optional[str] = None)
    func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
    public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
    public Certificate(String name, CertificateArgs args)
    public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
    
    type: azure:apimanagement:Certificate
    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 CertificateArgs
    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 CertificateArgs
    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 CertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateArgs
    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 certificateResource = new Azure.ApiManagement.Certificate("certificateResource", new()
    {
        ApiManagementName = "string",
        ResourceGroupName = "string",
        Data = "string",
        KeyVaultIdentityClientId = "string",
        KeyVaultSecretId = "string",
        Name = "string",
        Password = "string",
    });
    
    example, err := apimanagement.NewCertificate(ctx, "certificateResource", &apimanagement.CertificateArgs{
    	ApiManagementName:        pulumi.String("string"),
    	ResourceGroupName:        pulumi.String("string"),
    	Data:                     pulumi.String("string"),
    	KeyVaultIdentityClientId: pulumi.String("string"),
    	KeyVaultSecretId:         pulumi.String("string"),
    	Name:                     pulumi.String("string"),
    	Password:                 pulumi.String("string"),
    })
    
    var certificateResource = new Certificate("certificateResource", CertificateArgs.builder()
        .apiManagementName("string")
        .resourceGroupName("string")
        .data("string")
        .keyVaultIdentityClientId("string")
        .keyVaultSecretId("string")
        .name("string")
        .password("string")
        .build());
    
    certificate_resource = azure.apimanagement.Certificate("certificateResource",
        api_management_name="string",
        resource_group_name="string",
        data="string",
        key_vault_identity_client_id="string",
        key_vault_secret_id="string",
        name="string",
        password="string")
    
    const certificateResource = new azure.apimanagement.Certificate("certificateResource", {
        apiManagementName: "string",
        resourceGroupName: "string",
        data: "string",
        keyVaultIdentityClientId: "string",
        keyVaultSecretId: "string",
        name: "string",
        password: "string",
    });
    
    type: azure:apimanagement:Certificate
    properties:
        apiManagementName: string
        data: string
        keyVaultIdentityClientId: string
        keyVaultSecretId: string
        name: string
        password: string
        resourceGroupName: string
    

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

    ApiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    ResourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    Data string
    The base-64 encoded certificate data, which must be a PFX file.
    KeyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    KeyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    Name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    Password string
    The password used for this certificate.
    ApiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    ResourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    Data string
    The base-64 encoded certificate data, which must be a PFX file.
    KeyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    KeyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    Name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    Password string
    The password used for this certificate.
    apiManagementName String
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    resourceGroupName String

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    data String
    The base-64 encoded certificate data, which must be a PFX file.
    keyVaultIdentityClientId String

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId String

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name String
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password String
    The password used for this certificate.
    apiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    resourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    data string
    The base-64 encoded certificate data, which must be a PFX file.
    keyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password string
    The password used for this certificate.
    api_management_name str
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    resource_group_name str

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    data str
    The base-64 encoded certificate data, which must be a PFX file.
    key_vault_identity_client_id str

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    key_vault_secret_id str

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name str
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password str
    The password used for this certificate.
    apiManagementName String
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    resourceGroupName String

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    data String
    The base-64 encoded certificate data, which must be a PFX file.
    keyVaultIdentityClientId String

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId String

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name String
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password String
    The password used for this certificate.

    Outputs

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

    Expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    Id string
    The provider-assigned unique ID for this managed resource.
    Subject string
    The Subject of this Certificate.
    Thumbprint string
    The Thumbprint of this Certificate.
    Expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    Id string
    The provider-assigned unique ID for this managed resource.
    Subject string
    The Subject of this Certificate.
    Thumbprint string
    The Thumbprint of this Certificate.
    expiration String
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    id String
    The provider-assigned unique ID for this managed resource.
    subject String
    The Subject of this Certificate.
    thumbprint String
    The Thumbprint of this Certificate.
    expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    id string
    The provider-assigned unique ID for this managed resource.
    subject string
    The Subject of this Certificate.
    thumbprint string
    The Thumbprint of this Certificate.
    expiration str
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    id str
    The provider-assigned unique ID for this managed resource.
    subject str
    The Subject of this Certificate.
    thumbprint str
    The Thumbprint of this Certificate.
    expiration String
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    id String
    The provider-assigned unique ID for this managed resource.
    subject String
    The Subject of this Certificate.
    thumbprint String
    The Thumbprint of this Certificate.

    Look up Existing Certificate Resource

    Get an existing Certificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CertificateState, opts?: CustomResourceOptions): Certificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_management_name: Optional[str] = None,
            data: Optional[str] = None,
            expiration: Optional[str] = None,
            key_vault_identity_client_id: Optional[str] = None,
            key_vault_secret_id: Optional[str] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            subject: Optional[str] = None,
            thumbprint: Optional[str] = None) -> Certificate
    func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
    public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
    public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    Data string
    The base-64 encoded certificate data, which must be a PFX file.
    Expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    KeyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    KeyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    Name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    Password string
    The password used for this certificate.
    ResourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    Subject string
    The Subject of this Certificate.
    Thumbprint string
    The Thumbprint of this Certificate.
    ApiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    Data string
    The base-64 encoded certificate data, which must be a PFX file.
    Expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    KeyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    KeyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    Name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    Password string
    The password used for this certificate.
    ResourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    Subject string
    The Subject of this Certificate.
    Thumbprint string
    The Thumbprint of this Certificate.
    apiManagementName String
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    data String
    The base-64 encoded certificate data, which must be a PFX file.
    expiration String
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    keyVaultIdentityClientId String

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId String

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name String
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password String
    The password used for this certificate.
    resourceGroupName String

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    subject String
    The Subject of this Certificate.
    thumbprint String
    The Thumbprint of this Certificate.
    apiManagementName string
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    data string
    The base-64 encoded certificate data, which must be a PFX file.
    expiration string
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    keyVaultIdentityClientId string

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId string

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name string
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password string
    The password used for this certificate.
    resourceGroupName string

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    subject string
    The Subject of this Certificate.
    thumbprint string
    The Thumbprint of this Certificate.
    api_management_name str
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    data str
    The base-64 encoded certificate data, which must be a PFX file.
    expiration str
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    key_vault_identity_client_id str

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    key_vault_secret_id str

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name str
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password str
    The password used for this certificate.
    resource_group_name str

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    subject str
    The Subject of this Certificate.
    thumbprint str
    The Thumbprint of this Certificate.
    apiManagementName String
    The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
    data String
    The base-64 encoded certificate data, which must be a PFX file.
    expiration String
    The Expiration Date of this Certificate, formatted as an RFC3339 string.
    keyVaultIdentityClientId String

    The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

    NOTE: If not specified, will use System Assigned identity of the API Management Service.

    keyVaultSecretId String

    The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

    NOTE: Setting this field requires the identity block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.

    name String
    The name of the API Management Certificate. Changing this forces a new resource to be created.
    password String
    The password used for this certificate.
    resourceGroupName String

    The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

    NOTE: Either data or key_vault_secret_id must be specified - but not both.

    subject String
    The Subject of this Certificate.
    thumbprint String
    The Thumbprint of this Certificate.

    Import

    API Management Certificates can be imported using the resource id, e.g.

    $ pulumi import azure:apimanagement/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/certificates/certificate1
    

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

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi