Hi @YogiBear
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
it is possible to export an Azure Policy configuration code for use in a Terraform pipeline. The Azure Export Tool that you mentioned can be used to export Azure Policy definitions and assignments to Terraform configuration files.
The Azure Export Tool generates Terraform configuration files that can be used to create and manage Azure Policy definitions and assignments. The generated files include the necessary Terraform code to create and manage the Azure Policy resources, including the policy definitions, policy assignments, and policy initiatives.
To use the Azure Export Tool, you need to have the Azure CLI installed on your machine. Once you have installed the Azure CLI, you can run the following command to export the Azure Policy configuration to Terraform:
az policy export --type terraform --output-directory <output_directory>
Replace <output_directory> with the path to the directory where you want to save the Terraform configuration files.
After running this command, the Azure Export Tool will generate the Terraform configuration files in the specified directory. You can then use these files in your Terraform pipeline to create and manage Azure Policy resources.
If you have any further queries, do let us know
If the answer is helpful, please click "Accept Answer" and "Upvote it"