Azure / AzOps

AzOps is a PowerShell module which deploys (Push) ARM Resource Templates & Bicep files at all Azure scope levels and exports (Pull) ARM resource hierarchy.
https://aka.ms/AzOps
MIT License
387 stars 164 forks source link

Add generator metadata for generated templates #363

Closed BernieWhite closed 3 years ago

BernieWhite commented 3 years ago

Describe the solution you'd like

Templates generated with AzOps don't follow best practises. However this is understandable given the context and how they are intended to be used.

It would be helpful though to add generator metadata so that these generated templates can be identified and excluded with CI processes that lint and enforce best practises. aka. PSRule for Azure.

For example Bicep and PSArm currently implement a generator metadata block.

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.3.539.46024",
      "templateHash": "871445258948351894"
    }
  },
  "resources": []
}

Something similar for AzOps would be helpful.

BernieWhite commented 3 years ago

@ljtill Thinking this through further. It may not be required to include AzOps version/ templateHash just name to reduce any potential template churn. What do you think?

ljtill commented 3 years ago

@BernieWhite We are planning to implement this construct into the generated templates. We've got a couple other work items which we are wrapping up and then we will get this added.