Comments (4)
If a resource modified by deployIfNotExists or modify is outside the scope of the policy assignment or the template accesses properties on resources outside the scope of the policy assignment, the assignment's managed identity must be manually granted access or the remediation deployment will fail.
@cbezenco
I have been meaning to take a look and see if AssignPermissions would solve this. I have it already leveraged for Event Hubs as a sink point. Given the scope is an RG and the LA Workspace is in another RG, using AssignPermissions should give the MI rights during the assignment process. Happy to take a PR on this if you can test and let me know.
https://docs.microsoft.com/en-us/azure/governance/policy/concepts/definition-structure#:~:text=assignPermissions%3A%20%28Optional%29%20Set%20as%20true%20to%20have%20Azure,in%20all%20of%20the%20policies%20in%20the%20initiative%29. See below as an example.
$JSONPARMS = @'
{
"profileName": {
"type": "String",
"metadata": {
"displayName": "Profile Name for Config",
"description": "The profile name Azure Diagnostics"
}
},
"eventHubName": {
"type": "String",
"metadata": {
"displayName": "EventHub Name",
"description": "The event hub for Azure Diagnostics",
"strongType": "Microsoft.EventHub/Namespaces/EventHubs",
"assignPermissions": true
}
},
from azurepolicy.
It looks like I must have being doing something wrong when generating the original scripts or there might have been some delay as I got remediation working this morning (still not sure what I did wrong).
from azurepolicy.
I should have read the documentation
https://docs.microsoft.com/en-us/azure/governance/policy/how-to/remediate-resources
If a resource modified by deployIfNotExists or modify is outside the scope of the policy assignment or the template accesses properties on resources outside the scope of the policy assignment, the assignment's managed identity must be manually granted access or the remediation deployment will fail.
from azurepolicy.
@cbezenco you can use this script to fix msi role assignments on :
https://automate.guru/fix-msi-role-assignment/
from azurepolicy.
Related Issues (14)
- Support ARM Templates generation for MG scope deployment HOT 3
- Add -IncludeAssignment switch HOT 6
- Policies generated via Create-AzDiagPolicy are showing Non-Compliant HOT 4
- Azure VM displays as compliant, but VM diagnostic settings blade still warns to enable diagnostics? HOT 2
- Azure Storage diagnostics only for storage account but not for blob/queue/table/file remediated HOT 4
- Update Trigger Evaluation script to make use of Invoke-AzRestMethod or Invoke-AzResourceAction HOT 1
- Support for Subscription level Diagnostic Settings HOT 1
- Trigger-PolicyInitiativeRemediation.ps1: Remediate "" Initiative? HOT 2
- Error with Static Websites HOT 4
- Question about Storage Diagnostics (Preview) HOT 3
- Improvement for Policy: Audit diagnostic setting HOT 2
- Is it an issue? HOT 2
- Policy being generated with extra parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azurepolicy.