Remove-AzADAppCredential
Removes a credential from an application.
Syntax
ApplicationObjectIdWithKeyIdParameterSet (Default)
Remove-AzADAppCredential
-ObjectId <Guid>
[-KeyId <Guid>]
[-PassThru]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ApplicationIdWithKeyIdParameterSet
Remove-AzADAppCredential
-ApplicationId <Guid>
[-KeyId <Guid>]
[-PassThru]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ApplicationDisplayNameParameterSet
Remove-AzADAppCredential
-DisplayName <String>
[-PassThru]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ApplicationObjectWithKeyIdParameterSet
Remove-AzADAppCredential
-ApplicationObject <PSADApplication>
[-KeyId <Guid>]
[-PassThru]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzADAppCredential cmdlet can be used to remove a credential key from an application in the case of a compromise or as part of credential key rollover expiration.
The application is identified by supplying either the object ID or AppId.
The credential to be removed is identified by its key ID.
Examples
Example 1 - Remove a specific credential from an application
PS C:\> Remove-AzADAppCredential -ObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb -KeyId 9044423a-60a3-45ac-9ab1-09534157ebb
Removes the credential with key id '9044423a-60a3-45ac-9ab1-09534157ebb' from the application with object id 'ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0'.
Example 2 - Remove all credentials from an application
PS C:\> Remove-AzADAppCredential -ApplicationId 00001111-aaaa-2222-bbbb-3333cccc4444
Removes all credentials from the application with application id '00001111-aaaa-2222-bbbb-3333cccc4444'.
Example 3 - Remove all credentials using piping
PS C:\> Get-AzADApplication -ObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb | Remove-AzADAppCredential
Gets the application with object id 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' and pipes that to the Remove-AzADAppCredential cmdlet and removes all credentials from that application.
Parameters
-ApplicationId
The id of the application to remove the credentials from.
Parameter properties
Type: Guid
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ApplicationIdWithKeyIdParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ApplicationObject
The application object to remove the credentials from.
Parameter properties
Type: PSADApplication
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ApplicationObjectWithKeyIdParameterSet
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisplayName
The display name of the application.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ApplicationDisplayNameParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Force
Switch to delete credential without a confirmation.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyId
Specifies the credential key to be removed.
The key Ids for the application can be obtained using the Get-AzADAppCredential cmdlet.
Parameter properties
Type: Guid
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ApplicationObjectIdWithKeyIdParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ApplicationIdWithKeyIdParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ObjectId
The object id of the application to remove the credentials from.
Parameter properties
Type: Guid
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ApplicationObjectIdWithKeyIdParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PassThru
Specifying this will return true if the command was successful.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Parameters: ApplicationObject (ByValue)
Outputs