Skip to content
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

Not using mode when redeploying #10

Open
atpcln opened this issue Sep 29, 2019 · 5 comments
Open

Not using mode when redeploying #10

atpcln opened this issue Sep 29, 2019 · 5 comments
Assignees
Labels
Azure Policy task Everything related to the policy task enhancement New feature or request help wanted Extra attention is needed

Comments

@atpcln
Copy link

atpcln commented Sep 29, 2019

Describe the bug
When re-deploying policies spliited deployment, mode is not used.
When policy initially is deployed mode is set to all, this setting is not used when redeployed.

In the DeploySplittedPolicyDefinition.ps1 i found the following contruct:
if($policy){
Write-Output "Policy '$Name' exists and will be updated."
$policy = Set-AzureRmPolicyDefinition @scope @policyParameter

}else{
Write-Output "Policy '$Name' does not exist and will be created."
$policyParameter.Mode = $Mode
$policy = New-AzureRmPolicyDefinition @scope @policyParameter

}

I think mode is not set, when policy exists?

@atpcln atpcln added the bug Something isn't working label Sep 29, 2019
@SebastianSchuetze
Copy link
Member

They. Thanks for posting.

The reason it is not set on redeployment is, because the cmdlet Set-AzureRmPolicyDefinition does not support the parameter "Mode" in version 5.7.0 for AzureRM. And at the time of writing the agents did not support a newer Version.

I need to check, how I can improve this.

@SebastianSchuetze SebastianSchuetze added Azure Policy task Everything related to the policy task enhancement New feature or request help wanted Extra attention is needed and removed bug Something isn't working labels Sep 30, 2019
@atpcln
Copy link
Author

atpcln commented Sep 30, 2019 via email

@SebastianSchuetze
Copy link
Member

Thanks! Maybe you can give it a rating if you like it. :-D
But I will check if I can convert it to the Az module for the next version.

Do you have any improvement ideas that you would like to have?

@atpcln
Copy link
Author

atpcln commented Oct 3, 2019 via email

@SebastianSchuetze
Copy link
Member

Currently updating(PR: #12) the extension to support the Az module instead of AzureRM. Also splitting up definitions and initiatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Policy task Everything related to the policy task enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants