Policy - Not Allowed Resource Types
The Not Allowed Resources Policy prevents resources to be created according to the scope and exclusion list.
Setup
terraform init
terraform apply -auto-approve
Execute
location='brazilsouth'
# This is allowed
az sql server create -l $location -g 'ContosoRG1' -n 'sql-awsomeaz104-testserver1' -u 'testAdmin' -p 'T3st4dminPazz!999'
# This is NOT allowed
az sql server create -l $location -g 'ContosoRG2' -n 'sql-awsomeaz104-testserver2' -u 'testAdmin' -p 'T3st4dminPazz!999'
Clean up after use:
az sql server delete -g 'ContosoRG1' -n 'sql-awsomeaz104-testserver1' -y
az sql server delete -g 'ContosoRG2' -n 'sql-awsomeaz104-testserver2' -y
terraform destroy -auto-approve