microsoft / CloudAdoptionFramework

Code samples and extended documentation to support the guidance provided in the Microsoft Cloud Adoption Framework
https://aka.ms/CAF
Creative Commons Attribution 4.0 International
854 stars 614 forks source link

Validate resource names #181

Closed carlo-quinonez closed 1 year ago

carlo-quinonez commented 1 year ago

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.

jamasten commented 1 year ago

Hi @carlo-quinonez. Thank you for the feedback! This capability will be included in our next release.