Playbook / Auth. and Mail problems

%3CLINGO-SUB%20id%3D%22lingo-sub-2932199%22%20slang%3D%22en-US%22%3EPlaybook%20%2F%20Auth.%20and%20Mail%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2932199%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHello%20community!%3C%2FP%3E%3CP%3EI%20have%20two%20challenges%20in%20a%20logic%20app%20%2F%20playbook.%20I%20have%20created%20an%20app%20registration%20to%20use%20it%20as%20a%20service%20principle.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EProblem%201%3A%3C%2FP%3E%3CP%3EPart%20-%20Run%20query%20and%20visualize%20results%3C%2FP%3E%3CP%3ESo%20my%20understanding%20is%2C%20that%20we%20have%20to%20grant%20the%20Role%20%22Monitoring%20Reader%22%20or%20%22LogAnalytics%20Reader%22%20the%20App%20Registration.%20But%20we%20got%20the%20same%20error%20message..%20Whats%20the%20right%20way%3F%3C%2FP%3E%3CP%3ERaw%20output%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3Ebody%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22ResultStatus%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Forbidden%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Content%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22error%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22code%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22AuthorizationFailed%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22message%22%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22The%26nbsp%3Bclient%26nbsp%3B'APP%20REG%20ID'%26nbsp%3Bwith%26nbsp%3Bobject%26nbsp%3Bid%26nbsp%3B'xxxxxxxxxxx'%26nbsp%3Bdoes%26nbsp%3Bnot%26nbsp%3Bhave%26nbsp%3Bauthorization%26nbsp%3Bto%26nbsp%3Bperform%26nbsp%3Baction%26nbsp%3B'Microsoft.OperationalInsights%2Fworkspaces%2Fread'%26nbsp%3Bover%26nbsp%3Bscope%26nbsp%3B'%2Fsubscriptions%2FXXXXX%2Fresourcegroups%2FXXXXXX%2Fproviders%2FMicrosoft.OperationalInsights%2Fworkspaces%2FA2-Sentinel01'%26nbsp%3Bor%26nbsp%3Bthe%26nbsp%3Bscope%26nbsp%3Bis%26nbsp%3Binvalid.%26nbsp%3BIf%26nbsp%3Baccess%26nbsp%3Bwas%26nbsp%3Brecently%26nbsp%3Bgranted%2C%26nbsp%3Bplease%26nbsp%3Brefresh%26nbsp%3Byour%26nbsp%3Bcredentials.%22%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23008000%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EProblem%202%3A%3C%2FP%3E%3CP%3ESend%20Mail%20with%20a%20MFA%20enabled%20account%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20second%20challenge%20is%20to%20send%20a%20mail%20with%20active%20MFA.%20I%20read%20about%20APP%20Registration%20with%20OAuth.%20I%20couldn%C2%B4t%20find%20any%20tutorials%20but%20i%20think%20we%20are%20not%20the%20first%20customer%20with%20that%20challange%20%3A)%3C%2Fimg%3E%20Any%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GarfieldP_0-1636131473429.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F324603i1BE249719A3425EE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22GarfieldP_0-1636131473429.png%22%20alt%3D%22GarfieldP_0-1636131473429.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2934633%22%20slang%3D%22en-US%22%3ERe%3A%20Playbook%20%2F%20Auth.%20and%20Mail%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2934633%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F415069%22%20target%3D%22_blank%22%3E%40Garfield-P%3C%2FA%3E%26nbsp%3BNot%20sure%20about%20question%202%2C%20but%20for%20question%201%20it%20appears%20that%20you%20need%20to%20give%20you%20app%20the%20rights%20on%20the%20resource%20directly.%26nbsp%3B%20It%20looks%20like%20it%20has%20no%20rights%20to%20the%20workspace%20so%20it%20cannot%20read%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

 

Hello community!

I have two challenges in a logic app / playbook. I have created an app registration to use it as a service principle.

 

Problem 1:

Part - Run query and visualize results

So my understanding is, that we have to grant the Role "Monitoring Reader" or "LogAnalytics Reader" the App Registration. But we got the same error message.. Whats the right way?

Raw output:

 

body": {
        "ResultStatus": "Forbidden",
        "Content": {
            "error": {
                "code": "AuthorizationFailed",
                "message": "The client 'APP REG ID' with object id 'xxxxxxxxxxx' does not have authorization to perform action 'Microsoft.OperationalInsights/workspaces/read' over scope '/subscriptions/XXXXX/resourcegroups/XXXXXX/providers/Microsoft.OperationalInsights/workspaces/A2-Sentinel01' or the scope is invalid. If access was recently granted, please refresh your credentials."
            }

 

 

Problem 2:

Send Mail with a MFA enabled account

 

The second challenge is to send a mail with active MFA. I read about APP Registration with OAuth. I couldn´t find any tutorials but i think we are not the first customer with that challange :) Any ideas?

 

Thank you!

 

GarfieldP_0-1636131473429.png

 

 

 

 

 

2 Replies

@Garfield-P Not sure about question 2, but for question 1 it appears that you need to give you app the rights on the resource directly.  It looks like it has no rights to the workspace so it cannot read it.

@Garfield-PIt seems like the first issue is likely due to insufficient app permissions. Many of the permissions sometimes looks very similar in the first look but you need to make sure you have provided the right one if the error is persistent.
The second issue should not be much of a problem as 'OAuth' can absolutely be used as a authentication parameter in playbooks. Can you please elaborate more on what's the issue there?