Skip to content

Remove the Key/KeyType parameters from all Data Plane functions and only use Context #481

@PlagueHO

Description

@PlagueHO

Allowing the Key and KeyType parameters to be passed to every data plane function directly (e.g., Get-CosmosDbCollection -Key ...) encourages users to use master keys for authentication rather than the more secure Entra ID authentication or resource authentication.

Both resource and Entra ID authentication must be performed by creating a context with New-CosmosDBContext and passing that to the functions.

Once Entra ID authentication is available via #479 then the Key and KeyType parameters should be phased out.

Phase 1 will just be putting in warnings when Key based authentication is being used, but still allow it.
Phase 2 will be to remove the parameters Key/KeyType from all functions (except New-CosmosDbContext and some internal util functions).

Important: It will still be possible to authenticate with master keys but will need to be performed via creation of a context and passing that through and we can include warnings about the lower security of using this method.

I'll leave this open for comment for a few weeks/months before making this change.

It will be a breaking change and result in a new major version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThe issue is a discussion.enhancementThe issue is an enhancement request.on holdThe issue or pull request has been put on hold by a maintainer.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions