Comments (2)
Ran a debug on the code, and userAssignedIdentities is a hashtable, but gets treated as a PSCustomObject.
In Export-AzPolicyResources on 698:
if ($identityType -eq "UserAssigned") {
$userAssignedIdentities = $policyAssignment.identity.userAssignedIdentities
$identityProperty = $userAssignedIdentities.psobject.Properties
$identity = $identityProperty.Name
$identityEntry = @{
userAssigned = $identity
location = $location
}
}
Adding following code fixes export:
if ($identityType -eq "UserAssigned") {
$userAssignedIdentities = $policyAssignment.identity.userAssignedIdentities
# $identityProperty = $userAssignedIdentities.psobject.Properties
$identity = $userAssignedIdentities.GetEnumerator().Name
if($identity.Count -gt 1) {
$identityEntry = $identity | ForEach-Object {
@{
userAssigned = $PSItem
location = $location
}
}
}
else {
$identityEntry = @{
userAssigned = $identity
location = $location
}
}
}
from enterprise-azure-policy-as-code.
@mortenlerudjordet - thanks works great - should release tomorrow.
from enterprise-azure-policy-as-code.
Related Issues (20)
- Get Existing AzureChinaCloud Exemptions not Returning Non-Management Group Scoped Exemptions HOT 7
- Export-AzPolicyResources Failing for AzureChinaCloud Tenants HOT 3
- Handle role assignments when managed identity is a member of a group HOT 1
- EPAC Plan Taking 15min to run HOT 1
- Duplicate exemption Id HOT 6
- Error building exemptions with Build-DeploymentPlans HOT 4
- Document All Assignments Option
- Failed exemption deployments do not throw errors HOT 3
- "Deprecated" in policy description for Custom policies will Disable the policy HOT 2
- [Enable Azure Monitor for VMs & VMss] Role assignment when using your own User Assigned Identity located in the caf "management" Management Group HOT 1
- Policy Set with single parameter used across multiple definitions causes error in Build-DeploymentPlans HOT 1
- ADO pipeline is constantly resulting with write-error "Assignment JSON file './Definitions/global-settings.jsonc' is not valid." HOT 11
- Failed deployments in the Activity log HOT 3
- Why the need of the same assignment "DenyAction-DeleteUAMIAMA" twice?
- Counts for Expired & Orphaned Exemptions are not incrementing
- PacSelector on Install-HydrationEpac HOT 5
- Schema for global settings - VSCode says "Property `$schema` is not allowed"
- `Set-AzPolicySetDefinitionRestMethod`: Say what file errored
- Unable to set the scope for Assignments and Exemptions on a subnets
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 enterprise-azure-policy-as-code.