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

Invoke-GeneralDeployment.ps1:76 #12

Open
FallenHoot opened this issue Oct 5, 2020 · 2 comments
Open

Invoke-GeneralDeployment.ps1:76 #12

FallenHoot opened this issue Oct 5, 2020 · 2 comments

Comments

@FallenHoot
Copy link

When running Empty Subscription it fails 100% at this step.

Issue:
Performing the operation "Creating Deployment" on target "WVDDEMO".
New-AzResourceGroupDeployment: �[0m/home/vsts/work/1/s/SharedDeploymentFunctions/Invoke-GeneralDeployment.ps1:76
Line 76 | New-AzResourceGroupDeployment @DeploymentInputs -Resource
Error: Code=InvalidTemplateDeployment; Message=The template deployment failed with error: 'Authorization failed for template resource 'profiles1005t101022z/default/wvdprofiles/Microsoft.Authorization/65d15962-70b1-5e79-9a0d-47e9cad494fa' of type 'Microsoft.Storage/storageAccounts/fileServices/fileshares/providers/roleAssignments'. The client 'SERVICEACCOUNT' with object id 'SERVICEACCOUNT' does not have permission to perform action 'Microsoft.Authorization/roleAssignments/write' at scope '/subscriptions/WVDSUBSCRIPTION/resourceGroups/WVDDEMO/providers/Microsoft.Storage/storageAccounts/profiles1005t101022z/fileServices/default/fileshares/wvdprofiles/providers/Microsoft.Authorization/roleAssignments/65d15962-70b1-5e79-9a0d-47e9cad494fa'.'.
[error]PowerShell exited with code '1'.
Script Execution Complete

Fix:
Remove anything that has to do with New-AzManagementGroupDeployment or ManagementGroupID. It is not created and if it was created, it should have a parameter. As it will fail each time.

@justin-shiah
Copy link
Collaborator

@FallenHoot Thanks for listing the fix, I will file a bug for this. Was the fix able to resolve all the issues you were facing?

@stgeorgi
Copy link
Owner

I think this error happens only if you rerun the arm template but we do not clean up the existing service principal prior to redoployng. My test so far (6+) on empty subs have no such probem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants