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

CLI commands are not working #1

Open
kalmax opened this issue Oct 5, 2022 · 2 comments
Open

CLI commands are not working #1

kalmax opened this issue Oct 5, 2022 · 2 comments

Comments

@kalmax
Copy link

kalmax commented Oct 5, 2022

Error
az role assignment create --role "Key Vault Secrets Officer"
--scope $KEYVAULT_ID
--assignee-object-id $USER_ID
This command or command group has been migrated to Microsoft Graph API. Please carefully review all breaking changes introduced during this migration: https://docs.microsoft.com/cli/azure/microsoft-graph-migration
argument --assignee-object-id: expected one argument

Error on AzureCLI task using Pipeline

image

@triple-it
Copy link

For example, the most outstanding change is that the objectId property in the output JSON of a Graph object is replaced by id.

Maybe the following will work?

# assign RBAC role to the current user to manage secrets
#USER_ID=$(az ad signed-in-user show --query objectId -o tsv)
USER_ID=$(az ad signed-in-user show --query id -o tsv)

and..

#SPN_ID=$(az ad sp list --display-name "spn-keyvault-devops" --query [0].objectId --out tsv)
SPN_ID=$(az ad sp list --display-name "spn-keyvault-devops" --query [0].id --out tsv)

@triple-it
Copy link

Hi!
Not to disappoint you, but I have done a checkout, applied above patched, and did a re-run.

Downloading secrets using: https://keyvault021.vault.azure.net/secrets?maxresults=25&api-version=2016-10-01.
##[error]Get secrets failed. Error: Caller is not authorized to perform action on resource.

(Even with automatic SP and manual SP configuration in azure devops)

So this issue is not resolved for you yet... I suppose...
Did not investigate what could be the problem then

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

2 participants