Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APIM] az apim api import throws a LinkedInvalidPropertyId error #28370

Open
redmaniac1105 opened this issue Feb 14, 2024 · 4 comments
Open

[APIM] az apim api import throws a LinkedInvalidPropertyId error #28370

redmaniac1105 opened this issue Feb 14, 2024 · 4 comments
Labels
API Management az apim Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@redmaniac1105
Copy link

Describe the bug

I am running a script which initially runs
az apim api versionset create --> This command is successfully creating a version set in the required resource group

Then I am running a loop which iteratively runs
az apim api import --> Here along with many other arguments I also specify --api-version-set-id

The behavior of this is very erratic, upon running it sometimes either successfully runs for all versions or it fails for a few or all versions.
Example: For a first few versions from v1 to v4 the api is successfully imported from a swagger json file but from v5 onwards it throws the following error
ERROR: (LinkedInvalidPropertyId) Property id 'mypropertyid' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
Code: LinkedInvalidPropertyId

I have verified all the required paths and resources on their availability, and everything is correct.
Kindly assist me in resolving this issue ASAP.

Related command

az apim api import

Errors

ERROR: (LinkedInvalidPropertyId) Property id 'redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
Code: LinkedInvalidPropertyId

Issue script & Debug output

ERROR: (LinkedInvalidPropertyId) Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
2024-02-12T02:03:31.5830869Z Code: LinkedInvalidPropertyId
2024-02-12T02:03:31.5831326Z Message: Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
2024-02-12T02:03:31.5831599Z "redmaniac-api-"dev"-v6-id"
2024-02-12T02:03:33.7762796Z ERROR: (LinkedInvalidPropertyId) Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
2024-02-12T02:03:33.7764597Z Code: LinkedInvalidPropertyId
2024-02-12T02:03:33.7765368Z Message: Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
2024-02-12T02:03:33.9638160Z "redmaniac-api-"dev"-v7-id"
2024-02-12T02:03:35.4886748Z ERROR: (LinkedInvalidPropertyId) Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
2024-02-12T02:03:35.4887274Z Code: LinkedInvalidPropertyId
2024-02-12T02:03:35.4888039Z Message: Property id '/apiVersionSets/redmaniacVersionset-dev' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.

Expected behavior

It should succesfully create an api version in the specified apim and must return its details..

Environment Summary

azure-cli 2.55.0 *

core 2.55.0 *
telemetry 1.1.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Additional context

No response

@redmaniac1105 redmaniac1105 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 14, 2024
Copy link

Hi @redmaniac1105,

2.55.0 is not the latest Azure CLI(2.57.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Feb 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Service Attention This issue is responsible by Azure service team. API Management az apim labels Feb 14, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 14, 2024

Thank you for opening this issue, we will look into it.

@cbruce80
Copy link

cbruce80 commented Feb 15, 2024

I am running into the same issue, running az apim api import and specifying a --api-version-set-id and overwriting the specified version. This is breaking our CI/CD pipelines.

I have also tried using the qualified name as the error message suggests and still get an error.
az apim api import -g "<resource-group>" --service-name <apim-name> --path <my-path> --api-id <api-id> --api-version-set-id "subscriptions/<subid>/resourceGroups/<resource-group>/providers/Microsoft.ApiManagement/service/myApim/apiVersionSets/<version-set-id>" --service-url "<service-url>" --specification-format OpenApiJson --specification-path "./open-api-spec.json"

Message: Property id 'subscriptions//resourceGroups//providers/Microsoft.ApiManagement/service/myApim/apiVersionSets/' at path 'properties.apiVersionSetId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.

@hscheffert
Copy link

I started seeing the same issue last week and can't figure out why it works sometimes and not others!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Management az apim Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants