microsoft / Partner-Center-DotNet-Samples

Contains sample code on how to use the Partner Center .NET SDK
MIT License
97 stars 118 forks source link

Assigning licenses to a user throws an error "License assignment cannot be done for user with invalid usage location." #131

Open djmrky opened 11 months ago

djmrky commented 11 months ago

Hi,

I've started getting the strange issue when using the standard assign licenses call from the Partner Center SDK: _partnerOperations.Customers.ById(this._tenantId).Users.ById(userId).LicenseUpdates.Create(updateLicense);

The error returned is "License assignment cannot be done for user with invalid usage location."

But the user clearly has the usageLocation set which is visible in both Entra ID and Partner Center

This happens only for certain customers in the same Partner Center and using the same API.

This API has been working correctly for a long time and now suddenly, it causes issues

What else could be the issue here?

Any help would be appreciated

UPDATE: When using the Partner Center REST API (which is recommended), I get the same exact error !!