Skip to content

[IntelliJ][ReportedByUser]Shown errors when use Service Principal to sign in to Azure #3643

@v-lanjli

Description

@v-lanjli

IntelliJ build version: 2019.2.3 IC-192.6817.14
OS: Windows 10
JDK: JetBrains s.r.o 11.0.4
Plugin version: 3.27.0-2019.2
Additional Info: None
Repro Steps:

  1. Keep Azure in a state of Not signed in.
  2. Click on Sign in icon.
  3. Choose the Service Principal.
  4. Click on New button.
  5. Click on Copy&Open button in Azure Device Login dialog.
  6. Paste the code and click on Next button.
  7. Choose the subscription name in Create Authentication File dialog, and click on Start button.
  8. When the create service principal complete, check the red exclamation mark in the lower right corner.

Parent component:

com.intellij.openapi.wm.impl.IdeRootPane[,8,0,1384x812,layout=com.intellij.openapi.wm.impl.IdeRootPane$MyRootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=]

Error message:

IdeaLoggingEve
run@ActionRunner@SrvPriCreationStatusDialog

com.microsoft.azure.CloudException: Status code 403, {"error":{"code":"AuthorizationFailed","message":"The client '65ceabbd-5c3f-4ba1-93e2-09b670375c27' with object id '65ceabbd-5c3f-4ba1-93e2-09b670375c27' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/bd62906c-0a81-43c3-a2f8-126e4cf66ada' or the scope is invalid. If access was recently granted, please refresh your credentials."}}: The client '65ceabbd-5c3f-4ba1-93e2-09b670375c27' with object id '65ceabbd-5c3f-4ba1-93e2-09b670375c27' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/bd62906c-0a81-43c3-a2f8-126e4cf66ada' or the scope is invalid. If access was recently granted, please refresh your credentials.
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.microsoft.rest.ServiceResponseBuilder.build(ServiceResponseBuilder.java:122)
	at com.microsoft.azure.AzureResponseBuilder.build(AzureResponseBuilder.java:56)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsInner.listDelegate(ResourceGroupsInner.java:894)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsInner.access$600(ResourceGroupsInner.java:45)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsInner$28.call(ResourceGroupsInner.java:771)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsInner$28.call(ResourceGroupsInner.java:767)
	at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
	at retrofit2.adapter.rxjava.CallArbiter.deliverResponse(CallArbiter.java:120)
	at retrofit2.adapter.rxjava.CallArbiter.emitResponse(CallArbiter.java:102)
	at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:46)
	at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)
	at rx.Observable.unsafeSubscribe(Observable.java:10327)
	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.Observable.subscribe(Observable.java:10423)
	at rx.Observable.subscribe(Observable.java:10390)
	at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443)
	at rx.observables.BlockingObservable.single(BlockingObservable.java:340)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsInner.list(ResourceGroupsInner.java:687)
	at com.microsoft.azure.management.resources.implementation.ResourceGroupsImpl.list(ResourceGroupsImpl.java:41)
	at com.microsoft.azuretools.authmanage.srvpri.SrvPriManager.checkArtifact(SrvPriManager.java:241)
	at com.microsoft.azuretools.authmanage.srvpri.SrvPriManager.createSp(SrvPriManager.java:146)
	at com.microsoft.azuretools.ijidea.ui.SrvPriCreationStatusDialog$ActionRunner.run(SrvPriCreationStatusDialog.java:182)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:894)
	at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:447)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$9(ApplicationImpl.java:552)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions