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

Issues using built in role Cosmos DB Built-in Data Reader #3638

Closed
auslavs opened this issue Jan 10, 2023 · 2 comments
Closed

Issues using built in role Cosmos DB Built-in Data Reader #3638

auslavs opened this issue Jan 10, 2023 · 2 comments

Comments

@auslavs
Copy link

auslavs commented Jan 10, 2023

Describe the bug

When assigning the Cosmos DB Built-in Data Reader role with the scope at the container level, our ChangeFeedHandler fails.
There is no issue when the scope is changes to be at the database level.

The error we receive when assigning a scope of the container:

Microsoft.Azure.Cosmos.CosmosException :
Response status code does not indicate success: Forbidden (403); Substatus: 5301; 
Request is blocked because principal [<MyTenant>] does not have the required RBAC permissions to perform action [Microsoft.DocumentDB\/databaseAccounts\/readMetadata] with OperationType [2] and ResourceType [0] on resource [dbs\/<MyDatabase>]
  • Is is expected that a changeFeedHandler looking at one particular container require permissions to read metadata of the database?
  • Is there a way to restrict the scope to just the container?

To Reproduce
Assign the data read role with a scope of the container that the ChangeFeedHandler is watching.

Expected behavior
Have a ability to assign a data reader role to just a container.

Actual behavior
Provide a description of the actual behavior observed.
App service crashes with error described above.

Environment summary
SDK Version: 3.31.2
OS Version (e.g. Windows, Linux, MacOSX) AppService (Windows)

@ealsur
Copy link
Member

ealsur commented Jan 10, 2023

The Change Feed Processor on the current released version, performs a Database Read operation to obtain certain information. This is expected and by design on the current released version.

#3566 removed this Database Read call to enabled a different scenario (Resource Tokens), so it would resolve this Issue once released.

@ealsur ealsur closed this as completed Jan 10, 2023
@auslavs
Copy link
Author

auslavs commented Jan 10, 2023

Thanks @ealsur! That is great news

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