azureautomation / runbooks

Sample Automation runbooks
MIT License
156 stars 129 forks source link

Error in Create-RunAsAccount if Role Assignment Fails #81

Open jarrodmast opened 3 years ago

jarrodmast commented 3 years ago

Line 53 has the erroraction on the end of line, but should be moved left of the pipe for the new-azroleassignment, could even remove the write-verbose and pipe altogether. Otherwise the script error stops and fails to return application id.

In my case the system appears to automatically assign the role and that caused the first new-azroleassignment to return null due to the role already being assigned.