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

ERROR: Usage error: To create role assignments, specify both --role and --scopes. #3

Open
A-J-A opened this issue Sep 14, 2022 · 0 comments

Comments

@A-J-A
Copy link

A-J-A commented Sep 14, 2022

Hi,
I'm trying to follow the youtube series,
I can this error when running CreateDevopsSP.ps1 in Azure Cloud Shell

ERROR: Usage error: To create role assignments, specify both --role and --scopes.

Select a region to deploy to by number: 10
Selecting region 10. uksouth
PS /home/alex>
PS /home/alex> #adjust the vars to your needs!
PS /home/alex> $SPName = 'myDevopsSP' #your value here!
PS /home/alex> $keyvaultnamePrefix = 'kv-avdPoc' #leave this as is - (otherwhise you would need to change this in the pipeline variable file consistently)
PS /home/alex> $rgForSharedResources = 'rg-avdPoC-shared' #leave this as is - (otherwhise you would need to change this in the pipeline variable file consistently)
PS /home/alex>
PS /home/alex>
PS /home/alex> # create Service Principal (it needs to be owner to set permissions on azure artefacts - especially the application group users)
PS /home/alex> $sp = az ad sp create-for-rbac -n "$SPName" --role 'owner'
ERROR: Usage error: To create role assignments, specify both --role and --scopes.
PS /home/alex>
PS /home/alex> # this role is needed for the service principal to upload files to an azure storage account using azure devops.
PS /home/alex> az role assignment create --assignee "$($($sp | ConvertFrom-Json).appId)" --role 'Storage Blob Data Contributor'
argument --assignee: expected one argument

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

1 participant