It would be nice if the naming tool provided an API to confirm whether a provided resource name (eg. api-sud-spa-prd-ac-1) was valid based on the provided resource type (eg ApiManagement/service/apis).
With a simple API like that, I could use IaC static code analysis tools to validate resource names before deployment. For example, chekov can use custom policies written in Python. It would be simple to call the validation API to check all the resource names to ensure compliance.
Right now, it's useful, but there's no way to enforce usage. Even if Azure Policy had support for regexs, the naming pattens can vary by resource types (like storage accounts) so a creating policy would be extremely complicated, not to mention the maintenance.
It would be nice if the naming tool provided an API to confirm whether a provided resource name (eg.
api-sud-spa-prd-ac-1
) was valid based on the provided resource type (egApiManagement/service/apis
).With a simple API like that, I could use IaC static code analysis tools to validate resource names before deployment. For example, chekov can use custom policies written in Python. It would be simple to call the validation API to check all the resource names to ensure compliance.
Right now, it's useful, but there's no way to enforce usage. Even if Azure Policy had support for regexs, the naming pattens can vary by resource types (like storage accounts) so a creating policy would be extremely complicated, not to mention the maintenance.