Open matthchr opened 3 years ago
@anthony-c-martin curious as to your thoughts on this
@anthony-c-martin curious as to your thoughts on this
I agree - the vast majority of schemas are being automatically generated today; this generation process will pick up base resource properties as well. Generally if tags are supported by a resource type, they should be declared in the swagger, which is used to drive this generation. I don't see a huge amount of value in a shared base class which may not always be accurate in certain cases.
Is there an easy path to changing this in the specs today (at least for autogenerated resources?)
Implementation notes - need to collapse the allOf
in the following places:
https://github.com/Azure/azure-resource-manager-schemas/blob/6cbf2a9e2485a6eca89ca7801daa5f7aafe5c390/schemas/common/autogeneratedResources.json#L8-L10 https://github.com/Azure/azure-resource-manager-schemas/blob/6cbf2a9e2485a6eca89ca7801daa5f7aafe5c390/schemas/2018-05-01/subscriptionDeploymentTemplate.json#L498-L500 https://github.com/Azure/azure-resource-manager-schemas/blob/6cbf2a9e2485a6eca89ca7801daa5f7aafe5c390/schemas/2019-08-01/managementGroupDeploymentTemplate.json#L498-L500 https://github.com/Azure/azure-resource-manager-schemas/blob/6cbf2a9e2485a6eca89ca7801daa5f7aafe5c390/schemas/2019-08-01/tenantDeploymentTemplate.json#L500-L502
Currently, all resources are joined with
ResourceBase
, see for example the beginning of the autogenerated spec:This assumes that every resource supports every property defined in
ResourceBase
. That has always seemed like a reasonable assumption to me, but I recently learned that it isn't correct.For example, according to ARM tracked vs proxy resources, proxy resources do not support
tags
. YetResourceBase
definestags
. There are Proxy resources in the list of resources, for example:https://schema.management.azure.com/schemas/2018-12-01/Microsoft.Batch.json#/resourceDefinitions/batchAccounts_pools
is a proxy resource that doesn't support tags. Same forhttps://schema.management.azure.com/schemas/2020-12-01/Microsoft.ContainerService.json#/resourceDefinitions/managedClusters_agentPools
The result is that these resources look like they support tags, but it's either rejected or ignored.
Should
ResourceBase
only include fields that are guaranteed to be on all resources (which doesn't includetags
?)