Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
490 stars 319 forks source link

Should portal migration work between Developer SKU and StandardV2 Sku? #2682

Open lantern-sam opened 1 month ago

lantern-sam commented 1 month ago

Bug description

I am unable to import the developer portal content from an APIM service of Developer Sku to one of Standardv2 sku.

The help article here: https://learn.microsoft.com/en-us/azure/api-management/automate-portal-deployments Suggests that StandardV2 is a supported Sku.

If I run the migrate v3 script between two developer skus I get:

api-management-developer-portal\scripts.v3> node ./migrate --sourceSubscriptionId "xxx" --sourceResourceGroupName "xxx" --sourceServiceName "xxx" --destSubscriptionId "yyy" --destResourceGroupName "yyy" --destServiceName "yyy"
Exporting...
Cleaning up...
Importing...
DONE

When running between Developer Sku -> StandardV2 Sku I get:

api-management-developer-portal\scripts.v3> node ./migrate --sourceSubscriptionId "xxx" --sourceResourceGroupName "xxx" --sourceServiceName "xxx" --destSubscriptionId "yyy" --destResourceGroupName "yyy" --destServiceName "yyy"
Exporting...
Cleaning up...
Unable to complete migration. Unable to complete cleanup. Unable to delete media files. Could not complete request to https://management.azure.com/subscriptions/yyy/resourceGroups/yyy/providers/Microsoft.ApiManagement/service/yyy/portalSettings/mediaContent/listSecrets?api-version=2021-08-01. Status: 400 Bad Request

Reproduction steps

Create a Developer Sku APIM instance Create a StandardV2 Instance run migrate v3 from one to the other

Expected behavior

I would expect this to work or a message on the help page to say that this isn't supported.

Is self-hosted portal?

No

API Management service name

lantern-test-apim

thomasvdb commented 1 month ago

Seems I'm hitting a similar issue. Getting the following error when running the command: Unable to complete export. Unable to download media files. Could not complete request to https://management.azure.com/subscriptions/../Microsoft.ApiManagement/service/../portalSettings/mediaContent/listSecrets?api-version=2021-08-01. Status: 400 Bad Request

It's not showing any additional details but when monitoring the network traffic and intercepting the API call, the following response is returned:

{
  "error": {
    "code": "MethodNotAllowedInPricingTier",
    "message": "Method not allowed in StandardV2 pricing tier",
    "details": null
  }
}

It's happening on the following API call: https://management.azure.com/subscriptions../resourceGroups/../providers/Microsoft.ApiManagement/service/../portalSettings/mediaContent/listSecrets?api-version=2021-08-01

ygrik commented 1 month ago

Hi @lantern-sam Unfortunately, the portal migration between V1 and V2 Skus is not supported for now.

lantern-sam commented 1 month ago

Hi @ygrik Is it supported V2->V2?

ygrik commented 1 month ago

Hi @lantern-sam V2-> V2 migration is partially supported. You can migrate contentTypes, contentItems, except media and custom items. To migrate Media items, we need to reimplement the import/export.