LMC
LMC

Reputation: 121

How can I add an App Registration key with PowerShell without breaking the Azure Portal?

I'm trying to automate the registration of Azure AD apps. However, it looks that managing Azure app registration keys with the Azure Portal and with the AzureAD PowerShell module is incompatible. Here is what I am doing:

The problem might be due to different encodings of the CustomKeyIdentifier used by Powershell and the Azure Portal:

Is there a way to manage keys with PowerShell without breaking the Azure Portal ?

Edit

Since it looks like a bug I've filed a suggestion in the Microsoft Azure feedback forums. Please upvote it if fixing this problem is important for you !

Upvotes: 1

Views: 1547

Answers (1)

Sa Yang
Sa Yang

Reputation: 9401

  1. If you just want to remove other keys which added from portal:

You can manage keys through Manifest.

Go to Azure portal > You Application > Manifest > Find and select the Key you want to remove > Delete it and save manifest.

Then you can success remove the Key. enter image description here

  1. If you want to add keys from portal after adding keys from Powershell:

As you considered, two different keys have different customKeyIdentifier format. So, you should not apply customKeyIdentifier in Powershell.

You can just use New-AzureADApplicationPasswordCredential -ObjectId 53f6e6ea-xxxx-4ebe-xxxx-8309dad5003d to add keys from powershell.

This key's customKeyIdentifier in Manifest is null. You can see the key in portal which has Description with Key description .

Then you can add or remove keys from portal or powershell without breaking.

The following picture shows that I had added keys from portal after adding a key from Powershell.

enter image description here

Upvotes: 1

Related Questions