question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Forbidden Azure.AccessManagement.ActiveDirectoryApplications.GetByName

See original GitHub issue

When i call above function I got a Forbidden exception. The ad client application has the following rights:

image

Access to other resources is fine (e.g. Vault, AppService,…)

Exception or Stack Trace

“Operation returned an invalid status code ‘Forbidden’”

at Microsoft.Azure.Management.Graph.RBAC.Fluent.ApplicationsOperations.<ListWithHttpMessagesAsync>d__6.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Management.Graph.RBAC.Fluent.ApplicationsOperationsExtensions.<ListAsync>d__1.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Azure.Management.Graph.RBAC.Fluent.ActiveDirectoryApplicationsImpl.<GetByNameAsync>d__3.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Azure.Management.ResourceManager.Fluent.Core.Extensions.Synchronize[TResult](Func1 function) at Microsoft.Azure.Management.Graph.RBAC.Fluent.ActiveDirectoryApplicationsImpl.GetByName(String spn)

Code Snippet var credentials = AzureCliCredentials.Create();

var azure = Azure .Configure() .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic) .Authenticate(credentials) .WithSubscription(subscritptionId);

azure.AccessManagement.ActiveDirectoryApplications.GetByName(“[application name as registererd in AAD]”);

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nickzhumscommented, Jan 29, 2021

@BartNetJS thanks for the detailed explanation! 😃

Yes definitely we are seeing more and more people have now turned to the SDK to manage the resources

When the new libraries come out, feel free to try them and provide us with suggestions

0reactions
BartNetJScommented, Jan 29, 2021

I’m using it in azure pipeline together with Cake (see above). We found that using ARM templates and yaml pipelines was very error prone and difficult to debug. In the current implementation we can just debug regular C# code in Visual Studio for the azure pipelines on our local development machine. It is very verbose and productive.

We are also providing an API platform (together with APIM) for internal API providers and are looking to provide CI/CD as a service to those API providers. The Cake Frosting (C# implementation) together with azure resource sdk’s is a good starting point for us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting 403 error in Azure portal - Microsoft Q&A
Hello, In Azure portal, i keep getting this No access error when i click on Users or Roles or Active Directory. Would you...
Read more >
Error code 403, You do not have access (Azure Active ...
This error typically means the admin of the tenant has not given the permission to access the "Admin Portal" with a non-administrator account....
Read more >
Request throttling problems and HTTP 403 - Forbidden ...
Provides troubleshooting steps to an issue in which GetPosts operation throws HTTP 403 - Forbidden error.
Read more >
Can't access this Corporate Application error with Azure ...
This article helps you troubleshoot common issues for the "This corporate app can't be accessed" error on an Azure AD Application Proxy ...
Read more >
Azure AD - AWS IAM Identity Center (successor to AWS Single ...
For Name, enter AccessControl: AttributeName . Replace AttributeName with the name of the attribute you are expecting in IAM Identity Center. For example, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found