Redigera

Dela via


Import-AzWebAppKeyVaultCertificate

Import an SSL certificate to a web app from Key Vault.

Syntax

Import-AzWebAppKeyVaultCertificate
      [-KeyVaultName] <String>
      [-CertName] <String>
      [-ResourceGroupName] <String>
      [-WebAppName] <String>
      [-Slot <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-AzWebAppKeyVaultCertificate cmdlet imports an SSL certificate to a web app from Key Vault.

Examples

Example 1

Import-AzWebAppKeyVaultCertificate -ResourceGroupName "Default-Web-WestUS" -WebAppName "ContosoWebApp" `
-KeyVaultName "ContosoKeyVault" -CertName "ContosoCertname"

This command imports an SSL certificate to a web app from Key Vault.

Example 2

Import-AzWebAppKeyVaultCertificate -ResourceGroupName "Default-Web-WestUS" -WebAppName "ContosoWebApp" `
-KeyVaultName  '/subscriptions/[sub id]/resourceGroups/[rg]/providers/Microsoft.KeyVault/vaults/[vault name]' `
-CertName "ContosoCertname"

This command Import an SSL certificate to a web app from Key Vault using resource id (typically if Key Vault is in another subscription).

Parameters

-CertName

KeyVaultCertName of the certificate created in keyvault

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyVaultName

The name of the keyvault or Id of the KeyVault.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the webapp resource group.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Slot

The name of the webapp slot.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WebAppName

The name of the webapp.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.WebApps.Models.WebApp.PSCertificate