-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terraform destroy authorization fails on Deploy VM Agents #495
Comments
Can you share a log of what |
This is as expected since Terraform or Bicep doesn't deploy this resource group, it is created when enabling Network Watcher which is global (regional). We can modify the this to use one we create but that is not normal. |
Part of the log is from bicep deployment after TF destroy in same subscription.... i am not sure this is related to NetworkWatcher. Sunscription and client IDs are redacted. Deployment failed with multiple errors: 'Authorization failed for template resource 'Deploy VMSS Agents cicdbicep-hub' of type 'Microsoft.Authorization/policyAssignments'. The client 'xxxxxx' with object id 'xxxxxx' does not have permission to perform action 'Microsoft.Authorization/policyAssignments/write' at scope '/subscriptions/xxxxxxxxx/resourceGroups/cicdbicep-hub/providers/Microsoft.Authorization/policyAssignments/Deploy VMSS Agents cicdbicep-hub'.:Authorization failed for template resource 'Deploy VM Agents cicdbicep-hub' of type 'Microsoft.Authorization/policyAssignments'. |
Have you recreated service principles? This appears to be related to the user(SP) doing the deployment not having correct permissions to write to policyAssignments. |
Example of was done in the earlier script version of MLZ when we created SP's on the fly. 'Resource Policy Contributor' is required and not default as part of contributor.
|
yes and and the same is working for TF and gov cloud. it was working last week i merged my branch with upstream branch main |
Does running the |
nope...:( checking on couple of things |
Initial assumption seems to be a resource not exists error that stems from naming collisions with not-existing but not-yet-deprovisioned resources: #498 Gonna close for now @vidyambala -- but happy to re-open or reference in another Issue if @shawngib is able to track down a root cause. |
Description
Resource group NetworkwatcherRG is not getting deleted by Terraform Destroy which resulted in Policy conflict when reapplying the Terraform
Steps to Reproduce
Terraform Apply
Terraform destroy
Steps to reproduce the behavior:
1.
2.
Expected behavior
Actual behavior
Screenshots
Additional context
Operating System:
Terraform Version:
Cloud (public, Azure Government, etc.):
The text was updated successfully, but these errors were encountered: