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

Authorization token is incorrect for database names with uppercase letters #76

Closed
MWL88 opened this Issue Apr 4, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@MWL88
Copy link
Contributor

MWL88 commented Apr 4, 2018

Function New-CosmosDbAuthorizationToken incorrectly converts the ResourceLink (ResourceId variable) to lowercase here.

The MS documentation states

The ResourceLink portion of the string is the identity property of the resource that the request is directed at. ResourceLink must maintain its case for the id of the resource. Example, for a collection it will look like: "dbs/MyDatabase/colls/MyCollection"

  • [5.1] Version of PowerShell you're using
  • [Console host and VS Code] PowerShell host you're using (eg. Console Host, ISE, Visual Studio)
  • [Win10 x64] Operating system you're running
  • [2.0.7.342] Version of CosmosDB you're using (use Get-Module -Name CosmosDB)
@bpeav

This comment has been minimized.

Copy link

bpeav commented Apr 4, 2018

I'm having the same problem. I was getting 401 errors when I tried to add a new stored procedure to a collection with a camel cased name. I made a separate test collection with all lowercase letters for the ID and the script Posted the same stored procedures to that collection just fine.

Running PowerShell 6.0.2 on a Windows 10 x64 machine in the PowerShell console. I'm using CosmosDB 2.0.7.288, and also just for fun I got the same behavior to happen on a VSTS release definition with Azure PowerShell.

@PlagueHO

This comment has been minimized.

Copy link
Owner

PlagueHO commented Apr 4, 2018

Wow - not sure how I messed that up - but thanks for catching this, raising this issue and the PR. Really shows I need to get the integration tests story completed. I'll get this reviewed and out this evening for you. Thanks @MWL88 and @ThePeavstenator.

@PlagueHO

This comment has been minimized.

Copy link
Owner

PlagueHO commented Apr 5, 2018

This has now been released to the gallery - thank you again for raising and resolving this.

https://www.powershellgallery.com/packages/CosmosDB/2.0.8.350

@PlagueHO PlagueHO closed this Apr 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.