An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi @curious7 ,
Thanks for reaching out to MicrosoftmQ&A.
Unfortunately, the built-in APIM backup/restore mechanism is “all-or-nothing” when it comes to runtime data such as products, subscriptions and their keys. There isn’t a flag or parameter today that lets you omit subscription keys from the backup.
Here’s what you can do instead:
- Use ARM templates (or the Git-based config feature)
- Export only the API, product and policy definitions you need.
- Deploy that to your target environment without copying over subscriptions or keys.
- Rotate or regenerate subscription keys after restore
- If you’re doing a full backup/restore (e.g. for DR), run a script (PowerShell/CLI/REST) post-restore to regenerate all subscription keys.
- You can automate key rotations via the REST API or PowerShell cmdlets (e.g. Set-AzApiManagementSubscription).
- Script out subscriptions only when needed
- If you need subscription objects but want blank keys, export subscription metadata (customer, product assignment) and then create new subscriptions in the target with fresh keys.
Hope that helps!
References:
- Backup/restore overview
- What isn’t backed up (for completeness)
- Subscriptions management & key rotation
Hope this helps!
If the resolution was helpful, kindly take a moment to click on and click on Yes for was this answer helpful. And, if you have any further query do let us know.