Properties missing from REST API ProviderResourceType list endpoint

Paul Riviera 20 Reputation points
2023-02-13T11:17:23.5166667+00:00

I am trying to pull the available properties for a resource provider type, which seems like it should be possible based on the following documentation https://learn.microsoft.com/en-us/rest/api/resources/provider-resource-types/list?tabs=HTTP (which outlines a "Properties" field) under the ProviderResourceType definition.

Based on the documentation of the '$expand' query parameter I am able to get the aliases with the following 'resourceTypes/aliases' but then logically I should be able to also get the properties with 'resourceTypes/properties' however this fails.

$SUBSCRIPTION_ID = az account show `
    --query id `
    --output tsv

$RESOURCE_PROVIDER_NAMESPACE = "Microsoft.ApiManagement"
$EXPANDED = "resourceTypes/aliases,resourceTypes/properties"

$URL = "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/${RESOURCE_PROVIDER_NAMESPACE}/resourceTypes?" + "$" + "expand=${EXPANDED}&api-version=2021-04-01"

touch ./providers.json

az rest `
    --headers "Content-Type=application/json" `
    --method GET `
    --uri $URL | Out-File -FilePath ./providers.json

Is this an issue with the API or my request? am I using the $expand field incorrectly?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,327 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,416 Reputation points
    2023-02-15T15:40:06.19+00:00

    Paul Riviera Thanks for posting your question in Microsoft Q&A. I assume when you say it failed, it never returned properties in the response. Please correct me if it is incorrect.
    We have generic model schema with properties field defined for ProviderResourceType (reference: ProviderResourceType.cs) and it is up to each resource provider to adapt the properties. However, checking multiple resource providers I don't see this field returned in the response. Also, properties are actually returned only at resources level like Resources - Get By Id not even in Resources - List operation (or Provider Resource Types - List).

    I think the documentation needs to be updated for Rest API and opened new issue/feedback to our product team via https://github.com/Azure/azure-rest-api-specs/issues/22635. Please track this documentation issue in GH thread.

    I hope this helps your question and feel free to add a comment for any other questions. Please accept as "Yes" if the answer is helpful so that it can help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.