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

IdentityGovernance.EntitlementManagement.Catalogs[catalogId] generates incorrect URL #2527

Closed
alvicode opened this issue May 31, 2024 · 9 comments

Comments

@alvicode
Copy link

Describe the bug

A call to IdentityGovernance.EntitlementManagement.Catalogs[catalogId] generates the following URL:

https://.......u.p.azurewebsites.net/api/v1/catalogs('458538bc-bfcd-4654-83e8-0d837baa833c')/accessPackages

image

Expected behavior

The correct url should be

https://.......u.p.azurewebsites.net/api/v1/identityGovernance/entitlementManagement/catalogs('458538bc-bfcd-4654-83e8-0d837baa833c')/accessPackages

How to reproduce

Authenticate and execute the call GraphClient
.IdentityGovernance
.EntitlementManagement
.Catalogs[catalogId]
.AccessPackages
.GetAsync()

SDK Version

5.55.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@alvicode alvicode added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels May 31, 2024
@andrueastman
Copy link
Member

Thanks for raising this @alvicode

Any chance you can confirm if the error occurs on the first request when fetching the reponse variable? Or does this occur while the SDK is paging through the data? According to this, the URL template looks to be okay.

public AccessPackagesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/identityGovernance/entitlementManagement/catalogs/{accessPackageCatalog%2Did}/accessPackages{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters)

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jun 3, 2024
@alvicode
Copy link
Author

alvicode commented Jun 3, 2024

the error happens when fetching the response variable.

image

@andrueastman
Copy link
Member

Thanks for the info @alvicode

Any chance you can also share details on how you are setting/changing the baseUrl of the graphClient?

From my end, I get the correct url when I try to check it as below as https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/catalogId/accessPackages

            var requestInfo = graphClient.IdentityGovernance
                                    .EntitlementManagement
                                    .Catalogs["catalogId"]
                                    .AccessPackages
                                    .ToGetRequestInformation();

            Console.WriteLine(requestInfo.URI.OriginalString);// 

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 4, 2024
@alvicode
Copy link
Author

alvicode commented Jun 4, 2024

Hi

For information, some requests work just fine. Some dont.
For example, the following code to read all Catalogs works fine.

image

For completeness, here is how the graph client is created:

image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 4, 2024
@alvicode
Copy link
Author

alvicode commented Jun 4, 2024

Thanks for the info @alvicode

Any chance you can also share details on how you are setting/changing the baseUrl of the graphClient?

From my end, I get the correct url when I try to check it as below as https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/catalogId/accessPackages

            var requestInfo = graphClient.IdentityGovernance
                                    .EntitlementManagement
                                    .Catalogs["catalogId"]
                                    .AccessPackages
                                    .ToGetRequestInformation();

            Console.WriteLine(requestInfo.URI.OriginalString);// 

I tested this and the value of requestInfo.URI.OriginalString is correct.
I get https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/458538bc-bfcd-4654-xxxx-xxxxxxxxxxxx/accessPackages

@andrueastman
Copy link
Member

Are you able to identify the differences when the call fails vs when its successful? The original error seems to suggest that a baseUrl with azurewebsites.net is used somewhere. Is this a scenario you are currently working with?

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Jun 4, 2024
@alvicode
Copy link
Author

alvicode commented Jun 4, 2024

So I got some further information.
Reading all the catalogs works fine and we get the catalog id. I also checked in Entra ID that the catalogs exist and the id's are correct. It all looks good.
I also did some further debugging and I can see that the SDK does generate the correct URL and that the request going out is correct.

It's whatever happens on the Graph API side that seems to be the problem.
The catalog does exists and the Id is correct. We can see it in Entra.

See below the Graph Explorer.

image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 4, 2024
@andrueastman
Copy link
Member

Thanks for the extra information here.

Just to confirm again.
Does this happen on all requests or specific catalogs. Are you able to create a support ticket for this at with you substcription/tenant info using instruction at https://developer.microsoft.com/en-us/graph/support? (As this team is mainly intended for SDK related issues, we may not be best placed to help with API related issues)

@andrueastman andrueastman added Service issue status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Jun 5, 2024
@alvicode
Copy link
Author

alvicode commented Jun 5, 2024

This happens for all requests to
https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/{catalogId}/accessPackages

We did find a workaround though:

        var result = await GraphClient
            .IdentityGovernance
            .EntitlementManagement
            .Catalogs[catalogId]
            .GetAsync(requestConfiguration =>
            {
                    requestConfiguration.QueryParameters.Expand = ["accessPackages"];
            });

this works.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 5, 2024
@alvicode alvicode closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants