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

Acquire customer byId throws exception if Azure AD Graph (deprecated) permissions are removed #128

Open
dominicusmento opened this issue Aug 24, 2023 · 0 comments

Comments

@dominicusmento
Copy link

Steps to reproduce

Use appOnly context by using the PartnerCenter WebApp application registration
Backup Application Registration manifest.json from Azure Portal because that's the easiest way to return removed permissions
Replace Azure Active Directory Graph (as its deprecated long time ago) permissions for the application registration in Azure Portal with the equivalent Microsoft Graph permissions
(to be specific it is about Directory.Read.All)
After obtaining appOnly context in your c# code - call

Customer customer = await aggregatePartner.Customers.ById(tenantId).GetAsync();

Expected behavior

The SDK should return the details about the customer and fill the variable with the correct model data

Actual behavior

The PartnerException from sdk is invoked due to 403 response from the server. I assume that SDK is accessing some old endpoint/action because the same permissions are enough (Microsoft Graph - Directory.Read.All) if we are using REST api call equivalent with postman.

Diagnostic logs

Microsoft.Store.PartnerCenter.Exceptions.PartnerException
HResult=0x80131500
Message=The server returned error code '403' (Forbidden).
Source=Microsoft.Store.PartnerCenter
StackTrace:
at Microsoft.Store.PartnerCenter.Network.PartnerServiceProxy'2.d__70.MoveNext()
at Microsoft.Store.PartnerCenter.Network.PartnerServiceProxy'2.d__68.MoveNext()
at Microsoft.Store.PartnerCenter.Network.PartnerServiceProxy'2.d__58.MoveNext()
at Microsoft.Store.PartnerCenter.Customers.CustomerOperations.d__86.MoveNext()
at ....

Environment

.NET 6
Both Azure Functions and Windows11 - local development
All v3 versions of nuget, even the latest (3.4.0 at the moment)

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

1 participant