如何导出Azure API Management开发者门户自定义UI变更并导入至其他环境?
Exporting and Importing UI-Only Customizations Between Azure APIM Developer Portals
Absolutely, you can transfer your UI customizations from one Azure API Management (APIM) developer portal to another—here are the official, straightforward methods tailored for your scenario (since all your changes are interface-only):
1. Using the APIM Developer Portal UI (Great for Visual Workflows)
Exporting Your UI Customizations
- Open the developer portal for your source APIM instance and switch to Management Mode (click the "Manage" button in the top-right corner).
- Navigate to Portal Customization > Export in the left sidebar.
- Select UI Customizations as the export scope (since you don't need to include API or backend configs), then click "Export". Your browser will download a ZIP file containing all your UI tweaks—custom CSS, JS, page layouts, component settings, and any media assets you uploaded via the portal's media library.
Importing to the Target Portal
- Go to the developer portal of your target APIM instance, also switch to Management Mode.
- Head to Portal Customization > Import in the left sidebar.
- Upload the ZIP file you exported earlier, make sure to select Import only UI customizations to avoid overwriting any existing API or portal configurations in the target instance. Once the import finishes, refresh the portal—your custom UI should be fully applied.
2. Using Azure CLI (Ideal for Automation/CI/CD)
If you need to automate this process or handle multiple instances, Azure CLI commands work perfectly:
Export Command
az apim portal custom-domain export --resource-group <your-source-resource-group> --service-name <your-source-apim-name> --ui-customization --output-path ./apim-ui-customizations.zip
- The
--ui-customizationflag ensures only UI-related changes are exported, which aligns exactly with your needs. --output-pathlets you specify where the ZIP file is saved locally.
Import Command
az apim portal custom-domain import --resource-group <your-target-resource-group> --service-name <your-target-apim-name> --ui-customization --input-path ./apim-ui-customizations.zip
Run this command, and the target portal will adopt all your imported UI customizations automatically.
Key Things to Keep in Mind
- Match Portal Versions: Make sure both the source and target APIM developer portals are on the same version. Version mismatches can cause styling or layout glitches after import.
- Backup First: Before importing, export the target portal's existing UI config as a backup—just in case you need to revert changes.
- External Resources: If your customizations use external assets (like custom fonts hosted outside APIM), ensure those resources are accessible in the target environment. Any media you uploaded directly to the source portal's media library will be included in the export ZIP, so those won't be an issue.
内容的提问来源于stack exchange,提问作者gaurav kandpal
相关产品推荐
相关产品推荐

