0

I'm using the HTTP connector to connect to MSGraph. The authentication part differs from environments. In nonprod I'll like to use ActiveDirectoryOAuth because I'm target a Test tenant, but in prod I'll to use Managed Identity.

I have tried to do a condition in my ARM template, but that crashes the HTTP component because the "type" value it not valid... This means that the Logic app can't be saved in the designer nor can it be enable.

                        "HTTP_POST_-_Create_AAD_user": {
                            "inputs": {
                                "authentication": {
                                    "audience": "https://graph.microsoft.com/",
                                    "clientId": "@{if(equals(parameters('environment'), 'prd'), '', parameters('test_tenant_sp_client_id'))}",
                                    "secret": "@{if(equals(parameters('environment'), 'prd'), '', body('Get_secret_-_test_tenant_SP_client_secret')?['value'])}",
                                    "tenant": "@if(equals(parameters('environment'), 'prd'), '', parameters('test_tenant_id'))}",
                                    "type": "@{if(equals(parameters('environment'), 'prd'), 'ManagedServiceIdentity','ActiveDirectoryOAuth')}"
                                },
                                "body": "@outputs('Payload_AAD')",
                                "headers": {
                                    "Content-Type": "application/json"
                                },
                                "method": "POST",
                                "uri": "https://graph.microsoft.com/v1.0/users"
                            }
Loc Dai Le
  • 1,661
  • 4
  • 35
  • 70

0 Answers0