Importing a credential (key+secret) into Apigee, using Powershell

Hey everyone, I built a Powershell cmdlet that creates a new app and attaches an explicitly-specified credential (key + secret pair) to it.

I thought you might be interested.

Here is the gist.

The Apigee Edge entity model requires that a credential be attached to a "Developer App". And the developer app obviously must belong to a specific developer. The credential should also be authorized to use a specific set of one or more API Products.

Keeping all of that in mind, here is the way this cmdlet works:

  • verifies that the specified developer exists. (If it doesn't you can create one with the Create-EdgeDeveloper cmdlet)
  • verifies that the specified API Product exists. (Similarly - you can create one with a different cmdlet)
  • creates a new app for that developer; this will implicitly generate a random credential
  • attaches the explicitly-specified Key + secret to that new app
  • modifies the product list for that key + secret to include the specified product
  • removes the implicitly-generated credential

This is a cmdlet you might want to use if you were migrating from a different API management gateway system to Apigee Edge, and you had existing API keys out there, and you wanted to continue to use them without modifying clients.

If you have suggestions on this cmdlet, or requests for others, let me know!

Version history
Last update:
‎05-12-2017 01:41 PM
Updated by: