Azure / Azure/azure-cli

az bot authsetting create throws AuthorizationFailed Error

Open
#17,265 1 comment 0 reactions 1 assignee Claimed by @munozemilio View on GitHub
act-codegen-extensibility-squad Bot Services Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

When running the following command in the azure CLI:

```
az bot authsetting create `
--resource-group $resourceGroupName `
--name $botRegistration.name `
--service Aadv2 `
--setting-name $_.name `
--client-id $_.clientId `
--client-secret $_.clientSecret `
--provider-scope-string $_.scopes `
--parameters clientId=$($_.clientId) clientSecret=$($_.clientSecret) tenantId=$tenantId tokenExchangeUrl=api://botid-$($_.clientId)
```

It throws the error:
The client 'xxx-xxx-xx' with object id 'xxx-xxx-xx' does not have authorization to perform action 'Microsoft.BotService/listAuthServiceProviders/action' over scope '/subscriptions/xxx-xxx-xx' or the scope is invalid. If access was recently granted, please refresh your credentials.

This does not seem to make any sense, as doing the same with an ARM template has no problems. The Account running the command has Contributor rights on the resource group level.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.