diff --git a/Microsoft.SCIM.LogicAppValidationTemplate/[Deprecated]SetupLogicApp.md b/Microsoft.SCIM.LogicAppValidationTemplate/[Deprecated]SetupLogicApp.md deleted file mode 100644 index 9779209..0000000 --- a/Microsoft.SCIM.LogicAppValidationTemplate/[Deprecated]SetupLogicApp.md +++ /dev/null @@ -1,981 +0,0 @@ -# Overview - -Welcome to the pilot for **self-service validation of your provisioning -integration with Azure Logic apps**! - -The Entra App Provisioning and Single Sign-On teams are currently -working on building a revamped onboarding experience where ISVs can -self-service onboard their provisioning or SSO integrations to the -Microsoft Entra app gallery. This will enable you to bring your -application into the Microsoft ecosystem faster and more efficiently -than ever before. - -The self-service onboarding experience will consist of multiple -components: - -1. A process to self-service validate that your provisioning - integration is ready to onboard to the Microsoft Entra app gallery - via a provided Azure Logic app template - -2. A process to self-service validate that your SSO integration is - ready to onboard to the Microsoft Entra app gallery via a browser - extension - -3. An intake form in the Entra portal where you can submit a publishing - request for your SSO and/or provisioning application - -This document walks you through **\#1**, the process of self-service -validating that your provisioning integration is ready to onboard to the -Microsoft Entra app gallery. We are seeking your feedback on the -validation experience, including what you enjoy and what we can improve. - -## Disclaimer - -This feature is currently in PREVIEW. This information relates to a -pre-release product that may be substantially modified before it's -released. Microsoft makes no warranties, expressed or implied, with -respect to the information provided here. - -## Support for preview - -Microsoft Premier support will not provide support during the pilot. If -you have questions or feedback to provide, you may reach out to the -feature team managing this pilot at . - -# Onboarding requirements - -*Technical requirements* - -For your application to be eligible to onboard to the Microsoft Entra -app gallery, your provisioning integration must meet the following -requirements: - -- Support a SCIM 2.0 user or group endpoint (only one is required, but - supporting both a user and group endpoint is recommended) - -- Support the OAuth 2.0 Client Credentials grant as your primary - authentication method - - - Note: Client Credentials is not required to participate in this - pilot (i.e. you need to use ***long lived* bearer token** to test - the Logic app). However, Client Credentials will be required to - onboard to the Microsoft Entra app gallery - - - Currently, Client Credentials is the only authentication method we - support for requests to onboard new provisioning integrations to the - Microsoft Entra app gallery - - - Requirements for Client Credentials: An admin portal where a - customer can generate a client ID and secret - - - Best practices: Support the ability to rotate secrets and delete old - secrets - -- Support updating multiple group memberships with a single PATCH - request - -- Support at least 25 requests per second per tenant to ensure that - users and groups can be provisioned and deprovisioned without delay - -- On querying for a nonexistent user with filter query, your server - should respond with success and empty results. (on contrast with bad - request as we see in some SCIM implementation) - -- Your SCIM endpoint does not require features that Microsoft does not - support today. Examples of features that the non-gallery SCIM app does - not currently support: - - - Verbose PATCH calls - - - Support for batching calls (i.e. including multiple add operations - in the same PATCH call) - - - Rate limiting - -*Validation requirements* - -This document provides you with instructions on how to self-service -validate your application, so that it is ready to onboard to the -Microsoft Entra app gallery. Once you complete the instructions in this -document, you will have completed the following pre-requisites: - -- You should have set up a non-gallery SCIM app with a successful sync. - This step requires: - - - A SCIM endpoint. If you need guidance on how to develop a SCIM - endpoint, you can refer to our public documentation: - - - - An Entra ID tenant. If you don’t already have one, you can follow - the instructions here to create one: - - - - You must have at least an **Application Administrator** role in the - Entra ID tenant. - - - If your app will support only group provisioning, an [Entra ID - Premium P1 - license](https://learn.microsoft.com/entra/fundamentals/licensing) - is required for group-only provisioning to function (a P1 license is - not required if “Provision all” is selected). A trial license will - work. *Note: If you have an [M365 E3 or E5 - license](https://www.microsoft.com/microsoft-365/enterprise/microsoft-365-plans-and-pricing), - Entra Premium is included as part of those license packages.* - -- You should complete a successful run of our Logic app validation - template, with no errors returned. This step requires: - - - In the same tenant where your non-gallery SCIM app is hosted, an - Azure subscription for Logic app testing. The Logic app template - functions on a [consumption - model](https://learn.microsoft.com/azure/logic-apps/single-tenant-overview-compare), - meaning that you will likely incur a small monetary cost as a result - of running the Logic app. This cost is expected to be small (less - than 10 USD per month on an [Azure pay-as-you-go - subscription](https://azure.microsoft.com/pricing/purchase-options/azure-account/search?icid=hybrid-cloud&ef_id=_k_CjwKCAiA8vXIBhAtEiwAf3B-gwGo45BSp9MkHu1_SsZHPGytGsYgUoGgKhwiVKvh4pCybuz62bqCnhoCYlgQAvD_BwE_k_&OCID=AIDcmm5edswduu_SEM__k_CjwKCAiA8vXIBhAtEiwAf3B-gwGo45BSp9MkHu1_SsZHPGytGsYgUoGgKhwiVKvh4pCybuz62bqCnhoCYlgQAvD_BwE_k_&gad_source=1&gad_campaignid=21496728177&gbraid=0AAAAADcJh_siQ5FaD4VnPUpZunMKSJ2sy&gclid=CjwKCAiA8vXIBhAtEiwAf3B-gwGo45BSp9MkHu1_SsZHPGytGsYgUoGgKhwiVKvh4pCybuz62bqCnhoCYlgQAvD_BwE)). - - - You must have permissions to create a Logic app under the - appropriate subscription and resource group. This will require at - least a [Logic app - contributor](https://learn.microsoft.com/azure/logic-apps/logic-apps-securing-a-logic-app?tabs=azure-portal) - role, but more permissions may be required depending on whether you - also need to create a subscription and resource group. - - - If the Get API call do not have any results, the SCIM server should - return 0 results but not a Bad Request. - -*Publishing requirements* - -While not required to participate in this pilot, the following is -required to complete the self-service publishing experience once it -becomes available for Private Preview in CY2026: - -- Your tenant must be registered as a partner in Microsoft Partner - Center and enrolled in the Microsoft AI Cloud Partner program. - -- You must have documentation for your SCIM endpoint ready to publish. - Once Private Preview starts, a documentation template will be - available for you to use. - - - End customers should be able to access documentation about your SCIM - endpoint on both your website and the Microsoft Learn website. - -- Please provide us with engineering and support contacts for us to - refer end customers to once your application is published to the - Microsoft Entra app gallery. - - - -# Pre-run: Setup - -## Set up your non-gallery SCIM app - -As mentioned in the [Requirements section](#_Requirements), before you -validate your provisioning integration, you must set up a non-gallery -SCIM app with your desired configuration and start a successful sync -with that app. This section describes how to do so. - -### Requirements - -In the [Onboarding requirements section](#onboarding-requirements), -review the *Validation requirements* list to ensure that you have -everything you need to set up a non-gallery SCIM app. - -### Instructions - -1. Sign in to the Entra portal at - [entra.microsoft.com](https://entra.microsoft.com). - -2. Select **Enterprise applications \> New application \> Create your - own application**. - - - - - -3. Enter the name of your app, integration options, and click - **Create**. - - - -4. Take note of the **Object ID** (this will be referred to as - servicePrincipalID in the logic App). - - - -5. Set **Provisioning Mode** to **Automatic**, enter your bearer token - details, and select **Test Connection**. - - - - - -6. Create a provisioning job by creating connection and set up schema - by navigating to **Provisioning \> Mappings \> Provision Users**. - For more details on how to customize schema, you can check out our - public documentation here: [Tutorial - Customize Microsoft Entra - attribute mappings in Application Provisioning - Microsoft Entra ID - \| Microsoft - Learn](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/customize-application-attributes). - - - -**Prune the schema** with only attributes/mappings required and -supported by the ISV. Select the checkbox **Show Advanced Options.** -Then the **Edit attribute list** link will be displayed. Select the link -and verify the attributes. Update/delete the attributes depending on the -schema supported by the ISV endpoint. - - - - - -The schema can be exported by selecting “Review your schema here”. Then -select “Download” from the open schema editor. - - - - - -7. In the **Overview** page, select **Start Provisioning** to start a - provisioning job. If the provisioning job commences without errors, - you are ready to move on to the next section. - - - -8. **Optional:** Once you’ve successfully started a provisioning job, - submit an allow list request for faster sync cycles via this form: - [Allow List for Self-Service Validation of Provisioning Integration - (Pilot) – Fill out - form](https://forms.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR1xPIYfdXw5FhHBIH8BxY9ZUQ0w0UEczQTdLT1gzUTIyVzVNOUFHTjNGQS4u). - The Entra App Provisioning team will then work on allow listing your - tenant and provisioning job. Once complete, you will have access to - sync cycles that run more frequently than the standard 40-minute - sync cycle, allowing you to test and iterate upon your provisioning - integration quickly. - -## Set up a Logic app for running automated tests - -Once you have set up a non-gallery SCIM app and started the sync, you -will use our provided Logic app template to validate your provisioning -integration and ensure that it is ready to publish to the Microsoft -Entra app gallery. Logic app runs user tests and group tests on ISVs -behalf by using the non-gallery SCIM app that you set up.  - -Once we release the full private preview for the full onboarding and -publishing experience, a successful run of the Logic app template will -allow you to submit a publishing request for your provisioning -integration, after which we will review and deploy your app. - -### Requirements - -In the [Onboarding requirements section](#onboarding-requirements), -review the *Validation requirements* list to ensure that you have -everything you need to set up a Logic app. - -### Instructions - -1. Sign in to the Azure portal at . You - should use the same tenant as the one where you set up your - non-gallery SCIM app. - -2. Use the searchbar to navigate to the **Subscriptions** blade. - - - -3. Select the appropriate Azure subscription and create a resource - group. This is the subscription and resource group that your Logic - app will be attached to. - - - - - -4. Use the searchbar to navigate to the **Logic app**s blade. - -5. Select **Add \> Multi-tenant (consumption)**. *Note: The Logic app - functioning on a consumption model means that you may be billed on - your Azure description depending on level of usage. The amount is - expected to be small—see the [Onboarding requirements - section](#onboarding-requirements) for more details, under* - Validation requirements*.* - - - - - -6. Configure the settings of your Logic app as desired. Once you are - done, click **Review + create**. - - - -7. Once the Logic app finishes deploying, open the Logic app. - - - -8. Download the **logicAppTemplate.json **file from - the** Microsoft.SCIM.LogicAppValidationTemplate** folder of our GitHub repository: https://github.com/AzureAD/SCIMReferenceCode/tree/master/Microsoft.SCIM.LogicAppValidationTemplate (copy/paste - this URL into your browser). *Note: The folder includes - a **README.md** file that lists out the various tests that the Logic - app will run. This may be helpful for your reference.* - -9. In the Logic app, select **Development Tools \> Logic app code - view**. Copy/paste the code from the template in the previous step - and click **Save**. The **Logic app designer** view should then - update with the various test cases that our template will - automatically run for you. - - - - - -10. Next, we will enable system-assigned managed identity for secure - resource access. Select **Settings \> Identity**. - - - -11. Set the **Status** in the **System assigned** tab to **On**. Select - **Yes** in the confirmation dialog that pops up. - - - -12. Select **Save**. - - - -13. Take note of the object ID of the managed identity. You will need - this object ID for the script that you will run in a few steps. - - - -14. Now let’s work on granting the owner role to the Logic app. Select - **Azure role assignments**. - -15. In the **Azure role assignments** page, click on **Add role - assignment** and select the **Owner** role. - - - - - - - -Once the owner role has been granted to the Logic app, you can now work -on assigning the proper permissions to the Logic app so that it can -invoke various Graph queries as part of the automated tests it will run -(the Logic app will create, update, and delete users and groups, query -provisioning logs, etc.). - -You may choose to use Azure CLI or PowerShell for the following steps. - -16. Go to the sample script provided in the - [appendix](#script-for-assigning-permissions-to-your-logic-app) of - this document. Copy the script for your records, and update the - value of the **\$logicAppManagedId** field with the object ID of - your Logic app’s managed identity. - -17. Run the script using the command-line interface of your choice. If - using a UI like Azure Cloud Shell that provides you with an option - to upload a file, you may opt to copy the script into a file, upload - the file, then run the script. - -*How to upload and run a script using Azure Cloud Shell* - - - - - - - - - - -Once the script successfully runs, you will have assigned all the -necessary roles to the managed identity of your Logic app. - -### Logic App Explanation: - -Logic App is divided into separate sections. - -The first section initializes the required steps to run the tests in -Logic App. - - - -The next section contains the tests. Tests are bundled into user and -group sections. All the User Tests are in ‘UserTests Scope’ and Group -tests in ‘GroupTests Scope’. - - - - - - - -Each test can be further drilldown by selecting the down arrow and to -get into details of stages and the actions. Each stage and action can be -drilled down till the inputs and outputs are displayed for each action. - - - - - -The last section is for post run results evaluation. - - - -# Run: Steps to Run Logic app - -Before we run your Logic app, let’s provide values for your Logic app’s -required run parameters. Save the Logic app after updating parameters -before Run. - -## Providing Values To Parameters: - -18. The **servicePrincipalId** is the **objectId** of the non-gallery - SCIM app you created in the [previous section](#_Set_up_your). - - - -19. Enter your SCIM endpoint. - - 1. **Note**: don’t include feature flags like aadOptscim062020 in - the scim endpoint here. Even if you have to configure your non - gallery app with feature flags. - - - -20. Enter your SCIM bearer token. - - - -21. Under **templateId**, enter **scim** as the **Default value**. - - - -22. Under **testUserDomain**, enter a verified domain that belongs to - your tenant. This domain will be used to create test users in Entra - ID and provision them to your SCIM endpoint as part of the automated - tests that the Logic app template will run. *Note: A Logic app - template that successfully completes all tests will clean up any - test users that were created during that run. If the Logic app - template does not complete a full, clean run, test users may not be - cleaned up. For example, stubs of the test user accounts will remain - in your tenant if the Logic app template fails the Delete User tests - or if you choose to interrupt the Logic app template before it has - the chance to complete delete operations.* - - - -23. Under defaultUserProperties give the different sets of user - Properties values to test. The Logic App takes one choose one set of - the defaultUserProperties to create User and another set for - updating User. Selection is random based on no. of sets. - - - - - -** ** - -24. **EnabledTests** can take one of the below values. We support - running all tests in parallel, running individual tests, or running - tests related to only users or only groups. ***Only one value should - be provided.*** - -**“All” -** All tests will run - -**“UserTests” -** All of the User Tests will run and Groups Tests are -skipped. - -**“GroupTests” –** All of the Group Tests will run and User Tests are -skipped. - -> "All", - -                    "UserTests", - -                    "GroupTests", - -                    "Create_User_Test", - -                    "Update_User_Test", - -                    "Delete_User_Test", - -                    "User_Disable_Test", - -                    "User_Update_Manager_Test", - -                    "Create_Group_Test", - -                    "Update_Group_Test", - -                    "Delete_Group_Test", - -                    "Group_Update_Add_Member_Test", - -                    "Group_Update_Remove_Member_Test" - - - -25. IsSoftDeleted can be ‘true’ or ‘false’. Set to true only if soft - deletion is supported and defined in your SCIM schema. This property - indicates that the user resource is marked for soft deletion—meaning - it is flagged for removal but not permanently deleted. - “Disable_User_Test’ and “Delete_User_Test” are dependent on the - correct value of this parameter. If ‘IsSoftDeleted’ is false, then - “Disable_User_Test” will be skipped. - - - -26. IsManagerAttributeSupported is set to ‘true’ or ‘false’. If the - manager attribute is present in the ISV schema, then this should be - set to true. Else ‘false’. If this variable is ‘false’ then - “User_Update_Manager_Test’ will be skipped. Setting the value and - skipping the tests will help in the tests to run successfully. - -> style="width:5.94875in;height:3.47965in" /> - -27. IsGroupSupported is set ‘true’ or ‘false’. Only if Group Sync is - supported set this parameter value to ‘true’. The Group Tests will - run only if this parameter is set to ‘true’ else they are skipped. - - - -## Run the Logic App: - -28. You’re now ready to run the Logic app! Navigate to **Development - Tools \> Logic app designer**, then select **Run**. - - - -# Post-Run: Verify the Runs and the next steps - -## Verify the Runs - -29. You can view logs of your runs in the **Runs history** blade. When - clicking on an entry in **Runs history**, you check the final - results of that entry, including the list of tests that were run, - alongside status and any errors that may have come up. - - - -## Debugging - -30. Debugging Logic App: - -Check the Final_TestResults action to learn about the tests and their -results. - - - -In Final_TestResults -\> Select 'Show raw Outputs’. - - - - - -For each test, “testResult” shows the success / failure / skipped. In -case of failure the phase and action name for the failure is displayed. -Search the action name and can debug and look furthermore for error -details. Tip section below shows how to debug further and search for -specific actions. Identify the failures from failed actions -inputs/outputs give further details about why that call is failed. -Verify if the schema is valid and all the parameters are set according -to the Schema. Fix the parameters or schema and run the logic app again. - -“provisioningErrorDetails” gives the glimpse of Error information in -case of failure. - -*Tip:* More details about the run can be found by drilling down to the -test definition and checking the input/output. Here’s a sample of how -the output may look like: - - - -*Another tip:* Go to the run you want to debug further. In the left you -can query for a specific stage / action on the magnifying glass icon. - - - -## Test Results - -31. Once you see the tests have passed and you are ready to move to - onboarding. Provide the test results for us to validate and onboard. - -Run the Powershell validation script and provide us with the generated -JSON file. - -> **Prerequisites** - -- **PowerShell Version 7.0+**: Install - from [https://aka.ms/powershell](vscode-file://vscode-app/c:/Users/v-mchittoory/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) or - PowerShell 5.1 with \`-SkipActionDetails\` flag - -- **Azure Role** - Reader or Logic App Operator on the Logic App - resource - -- **Azure CLI** - Install from  - -> **Note:** The script uses Azure CLI internally to obtain access tokens -> for Azure Resource Management (ARM) API calls. -> -> **31.1 Login to Azure** -> -> Open PowerShell and run: -> -> az login -> -> \# Set the subscription you want to use -> -> az account set --subscription "YOUR_SUBSCRIPTION_ID" -> -> **31.2 Run the Validation Script** -> -> Download the Validation script provided in the appendix. -> -> Navigate to the script directory and run: -> -> .\ValidateLogicAppRun.ps1 \` -> ->     -SubscriptionId "YOUR_SUBSCRIPTION_ID" \` -> ->     -ResourceGroup "YOUR_RESOURCE_GROUP" \` -> ->     -LogicAppName "YOUR_LOGIC_APP_NAME" \` -> ->     -RunId "YOUR_RUN_ID" -> -> **Where to find these values:** - -- Subscription ID: Azure Portal → Subscriptions → Your Subscription → - Copy the ID - -- Resource Group / Logic App Name: Azure Portal → Your Logic App → - Overview - -- Run ID: Azure Portal → Your Logic App → Run History → Copy the Run ID - -> **Optional Parameters:** -> -> -SkipActionDetails: Skip fetching action inputs/outputs (faster -> execution, works with PowerShell 5.1) -> -> **Note:** If copy-pasting the command, verify that hyphens (-) before -> parameters are correct, as some applications replace them with -> different dash characters. -> -> **Example** -> -> .\ValidateLogicAppRun.ps1 \` -> ->     -SubscriptionId "12345678-1234-1234-1234-123456789012" \` -> ->     -ResourceGroup "rg-provisioning-prod" \` -> ->     -LogicAppName "la-scim-validator" \` -> ->     -RunId "08584361051946613703020273411CU28" -> -> **31.3 Submit Results** -> -> Send us the generated JSON file: -> validation-result-{RunId}.json -> -> The script displays **VALIDATION PASSED** (green) or **VALIDATION -> FAILED** (red) in the console upon completion. -> -> **What Gets Validated** - -- Run completed successfully - -- No failed actions - -- All required provisioning stages executed (dynamically extracted from - template) - -- All template actions executed (no modifications) - -> **Troubleshooting the Validation Script** - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IssueSolution
"Authentication failed"Run az login and sign in again
"Cannot access Logic App"

Verify subscription ID, resource group, and Logic App name.

-

Check you have proper Azure permissions.

"No subscriptions found"Wait 5-10 minutes after role assignment, then run az account -clear and az login
Script execution policy errorRun: Set-ExecutionPolicy RemoteSigned -Scope -CurrentUser
"This script requires PowerShell 7.0 or later for parallel -processing."Install PowerShell 7+ or run -with -SkipActionDetails flag
- -> **Understanding Results** - -- **VALIDATION PASSED** - Run succeeded with valid template - -- **VALIDATION FAILED** - Check the JSON report for: - - - -- **validationErrors** - High-level issues - -- **failedActions** - Specific errors with details - -- **templateValidation.requiredStages** - Stage execution status - -- **actionComparison** - Missing or modified actions detected - -When we release the full self-service onboarding experience for -provisioning integrations, you will provide us with a **Run ID** -associated with a successful run of your Logic app (alongside details -such as the subscription and resource group that your Logic app is -associated with). Run IDs will be valid for a finite number of days, -during which we will review your submission and work on deploying your -provisioning integration to the Microsoft Entra app gallery. You will be -given access to this experience when it releases to Private Preview in -CY2026. - -## Next Steps after successful run: - -Provide us the following information. - -1. Generated Logic App test results as described in [Test - Results](#test-results) section. - -2. \[Required only if your run was done on Logic app template published - before 02/09\] Export Pruned Schema as mentioned in Logic App setup - instructions or as mentioned in [Export Application Provisioning - configuration and roll back to a known good state for disaster - recovery in Microsoft Entra ID - Microsoft Entra ID \| Microsoft - Learn](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/export-import-provisioning-configuration#export-your-provisioning-configuration) - -3. Since this is a pilot, we would like to run the tests ourselves as a - sanity check. This step will not be required once we build an - end-to-end experience. For this, we will need the SCIM endpoint and - a long-lived bearer token. Please also let us know if there are any - constraints (for example, a required domain for the - userPrincipalName) - -# Frequently Asked Questions: - -Note: Below are some of the known issues and most probable explanations. -Each issue could be caused by many other reasons too. - -1. **Why do errors occur when the aadOptscim062020 feature flag is used - with a Logic App SCIM endpoint?** - -**Explanation ** -The aadOptscim062020 feature flag is supported only for Microsoft Entra -ID provisioning scenarios. This flag is not required in logic app -configuration. When it is configured on a Logic App SCIM endpoint, SCIM -GET requests may fail with Bad Request errors. - -**Resolution ** -Remove the aadOptscim062020 flag from the Logic App SCIM endpoint -configuration. -Configure this flag only while setting up connection in non gallery app -by going to: - -Microsoft Entra ID → Enterprise Application → Provisioning → Tenant URL - -2. **Why do Logic App test runs fail intermittently due to - authentication issues?** - -**Explanation ** -Logic App test runs can exceed the lifetime of short-lived access -tokens. When a token expires during execution, authentication failures -may occur. - -**Resolution ** -Use long-lived access tokens when running Logic App tests. - -3. **Why does the Get_Templates action return an Unauthorized error?** - -**Explanation ** -The Logic App’s Managed Identity does not have sufficient permissions to -access the required template resources. - -**Resolution ** -Assign the appropriate roles to the Managed Identity and allow time for -permission changes to take effect. -If the issue continues, recreate the Logic App and reconfigure the -Managed Identity and permissions. - -4. **Why do SCIM requests with attribute-based filters fail?** - -**Explanation ** -Microsoft Entra ID can issue SCIM GET requests with filters on **any -attribute configured as a matching property**. When such a request is -sent, the target SCIM endpoint is expected to support filtering on that -matching property. - -If the SCIM server does not support filtering on one or more matching -properties configured in Entra ID, the filtered request may fail and -appear as an error in provisioning logs. - -**Resolution ** -Ensure that the SCIM endpoint supports filtered GET requests for **all -attributes configured as matching properties** in: - -Enterprise Application → Provisioning → Attribute Mappings - -**Examples** - -- **Email as a matching property** - If emails\[type eq "work"\].value is configured as a matching - property, the SCIM endpoint must support filtering on this attribute. - The following example API call **must be supported**: - -> GET /scim/v2/Users?filter=emails\[type eq "work"\].value eq -> "user@contoso.com" - -5. **Why do Logic App tests fail with a SCIM 409 Conflict error?** - -**Possible Explanation ** -In some scenarios, the SCIM service may not respond as expected to -update requests, which can result in retry attempts and a 409 Conflict -error. - -**Resolution ** -Re-run the test to confirm whether the issue is transient. -If the issue occurs consistently, verify that the SCIM service responds -correctly to update requests and does not introduce response delays. - -6. **Why does a Logic App SCIM GET API call fail when querying a - nonexistent user?** - -**Explanation** -The SCIM specification allows a server to return a 404 Not Found -response when a queried user does not exist. Although this behavior is -SCIM compliant, it is not supported by this system. - -This system requires SCIM servers to return a **successful response (200 -OK) with zero results** for filter-based queries that do not match any -users. If a SCIM server returns a 404 Not Found response for a -nonexistent user, the Logic App SCIM GET call fails due to -incompatibility with the expected response behavior. - -**Resolution** -As part of onboarding, ensure that the SCIM endpoint is configured to -return a **200 OK response with zero results** (for example, -totalResults: 0 and an empty Resources array) when a queried user does -not exist. - -This behavior is a **mandatory onboarding requirement** and is validated -during the onboarding checklist process. - -# Provide feedback - -Once you get a chance to test the pilot, please fill out the following -feedback form: [Feedback Form for Self-Service Validation of -Provisioning Integrations (Pilot) – Fill out -form](https://forms.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR1xPIYfdXw5FhHBIH8BxY9ZUNTJTRkc0SDUxOTdHSFk5UEZQVkVZRjhTMy4u) - -In the form, you may specify whether you are interested in participating -in a follow-up feedback session with the Entra App Provisioning feature -team. In this feedback session, we would ask you more questions about -your experience. - -We’re excited to hear more from you! Thank you for participating in our -pilot—your insights help us make Microsoft Entra ID better. - -# Appendix - -## Script for assigning permissions to your Logic app - -[SCIMReferenceCode/Microsoft.SCIM.LogicAppValidationTemplate/AssignRolesTOManagedIdentity-LogicApps -1.ps1 at master · AzureAD/SCIMReferenceCode · -GitHub](https://github.com/AzureAD/SCIMReferenceCode/blob/master/Microsoft.SCIM.LogicAppValidationTemplate/AssignRolesTOManagedIdentity-LogicApps%201.ps1) - -## Script for Logic App Validation - -[SCIMReferenceCode/Microsoft.SCIM.LogicAppValidationTemplate/ValidateLogicAppRun.ps1 -at master · AzureAD/SCIMReferenceCode · -GitHub](https://github.com/AzureAD/SCIMReferenceCode/blob/master/Microsoft.SCIM.LogicAppValidationTemplate/ValidateLogicAppRun.ps1) diff --git a/Microsoft.SCIM.LogicAppValidationTemplate/[deprecated]logicAppTemplate.json b/Microsoft.SCIM.LogicAppValidationTemplate/[deprecated]logicAppTemplate.json deleted file mode 100644 index 55a1686..0000000 --- a/Microsoft.SCIM.LogicAppValidationTemplate/[deprecated]logicAppTemplate.json +++ /dev/null @@ -1,7779 +0,0 @@ -{ - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "triggers": { - "Manual_Recurrence": { - "recurrence": { - "frequency": "Month", - "interval": 1 - }, - "evaluatedRecurrence": { - "frequency": "Month", - "interval": 1 - }, - "type": "Recurrence" - } - }, - "actions": { - "Initialize_Tests": { - "actions": { - "List_Existing_Jobs": { - "runAfter": {}, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/servicePrincipals/@{parameters('servicePrincipalId')}/synchronization/jobs", - "method": "GET", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Compose_SyncJobId": { - "runAfter": { - "List_Existing_Jobs": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": "@{coalesce(first(body('List_Existing_Jobs')?['value'])?['id'])}" - }, - "Get_Job_Details": { - "runAfter": { - "Compose_SyncJobId": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/v1.0/servicePrincipals/@{parameters('servicePrincipalId')}/synchronization/jobs/@{outputs('Compose_SyncJobId')}", - "method": "GET", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Get_Schema": { - "runAfter": { - "Get_Job_Details": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/servicePrincipals/@{parameters('servicePrincipalId')}/synchronization/jobs/@{outputs('Compose_SyncJobId')}/schema", - "method": "GET", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Compose_Job_Settings_And_Templates": { - "runAfter": { - "Get_Schema": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": { - "jobSettings": "@body('Get_Job_Details')", - "schema": "@body('Get_Schema')" - } - }, - "Get_App_Roles": { - "runAfter": { - "Compose_Job_Settings_And_Templates": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/servicePrincipals/@{parameters('servicePrincipalId')}?$select=appRoles", - "method": "GET", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Filter_User_AppRole": { - "runAfter": { - "Get_App_Roles": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@body('Get_App_Roles')?['appRoles']", - "where": "@equals(toLower(item()?['displayName']), 'user')" - } - }, - "Generate_TestNames": { - "actions": { - "Generate_Test_UserNames": { - "type": "Compose", - "inputs": { - "createUser": "@{concat('lacreate', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "updateUser": "@{concat('laupdate', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "disableUser": "@{concat('ladis', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "deleteUser": "@{concat('ladel', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "managerUser": "@{concat('lamgr', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "managerUserNew": "@{concat('lamgrnew', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "memberUser1": "@{concat('lamem1', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "memberUser2": "@{concat('lamem2', substring(guid(),0,8), '@', parameters('testUserDomain'))}", - "index": "@rand(0, sub(length(parameters('defaultUserProperties')), 1))", - "managerUserInitial": "@{concat('lamgrinit', substring(guid(),0,8), '@', parameters('testUserDomain'))}" - } - }, - "Generate_Test_GroupNames": { - "runAfter": { - "Generate_Test_UserNames": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": { - "createGroup": "@{concat('LACreateGroup-', substring(guid(),0,8))}", - "deleteGroup": "@{concat('LADeleteGroup-', substring(guid(),0,8))}", - "memberGroup": "@{concat('LAMemberGroup-', substring(guid(),0,8))}" - } - } - }, - "runAfter": { - "Filter_User_AppRole": [ - "Succeeded" - ] - }, - "type": "Scope" - } - }, - "runAfter": {}, - "type": "Scope" - }, - "Evaluate_Test_Results": { - "runAfter": { - "UserTests_Scope": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ], - "GroupTests_Scope": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Compose", - "inputs": { - "enabledTestsEvaluation": { - "createUserTestEnabled": "@or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Create_User_Test'))", - "createGroupTestEnabled": "@and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Create_Group_Test')))", - "updateUserTestEnabled": "@or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Update_User_Test'))", - "disableUserTestEnabled": "@and(parameters('IsSoftDeleted'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Disable_User_Test')))", - "deleteUserTestEnabled": "@or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Delete_User_Test'))", - "managerTestEnabled": "@and(parameters('IsManagerAttributeSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests')), equals(parameters('EnabledTests'), 'User_Update_Manager_Test')))", - "updateGroupTestEnabled": "@and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Update_Group_Test')))", - "deleteGroupTestEnabled": "@and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Delete_Group_Test')))", - "addMemberTestEnabled": "@and(parameters('IsGroupSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Add_Member_Test')))", - "removeMemberTestEnabled": "@and(parameters('IsGroupSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Remove_Member_Test')))" - }, - "testResults": { - "createUserTestResult": "@if(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Create_User_Test')), variables('CreateUserTestOutputs')['overallResult'], 'SKIPPED')", - "updateUserTestResult": "@if(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Update_User_Test')), variables('UpdateUserTestOutputs')['overallResult'], 'SKIPPED')", - "disableUserTestResult": "@if(and(parameters('IsSoftDeleted'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Disable_User_Test'))), variables('DisableUserTestOutputs')['overallResult'], 'SKIPPED')", - "deleteUserTestResult": "@if(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Delete_User_Test')), variables('DeleteUserTestOutputs')['overallResult'], 'SKIPPED')", - "managerTestResult": "@if(and(parameters('IsManagerAttributeSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests')), equals(parameters('EnabledTests'), 'User_Update_Manager_Test'))), variables('ManagerTestOutputs')['overallResult'], 'SKIPPED')", - "createGroupTestResult": "@if(and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Create_Group_Test'))), variables('CreateGroupTestOutputs')['overallResult'], 'SKIPPED')", - "updateGroupTestResult": "@if(and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Update_Group_Test'))), variables('UpdateGroupTestOutputs')['overallResult'], 'SKIPPED')", - "deleteGroupTestResult": "@if(and(parameters('IsGroupSupported'), or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Delete_Group_Test'))), variables('DeleteGroupTestOutputs')['overallResult'], 'SKIPPED')", - "addMemberTestResult": "@if(and(parameters('IsGroupSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Add_Member_Test'))), variables('AddMemberTestOutputs')['overallResult'], 'SKIPPED')", - "removeMemberTestResult": "@if(and(parameters('IsGroupSupported'), or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Remove_Member_Test'))), variables('RemoveMemberTestOutputs')['overallResult'], 'SKIPPED')" - }, - "overallLogicAppResult": "@if(or(or(or(or(or(or(or(or(or(and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Create_User_Test')), equals(variables('CreateUserTestOutputs')['overallResult'], 'FAILED')), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Update_User_Test')), equals(variables('UpdateUserTestOutputs')['overallResult'], 'FAILED'))), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Disable_User_Test')), equals(variables('DisableUserTestOutputs')['overallResult'], 'FAILED'))), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests'), equals(parameters('EnabledTests'), 'Delete_User_Test')), equals(variables('DeleteUserTestOutputs')['overallResult'], 'FAILED'))), and(or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'UserTests')), equals(parameters('EnabledTests'), 'User_Update_Manager_Test')), equals(variables('ManagerTestOutputs')['overallResult'], 'FAILED'))), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Create_Group_Test')), equals(variables('CreateGroupTestOutputs')['overallResult'], 'FAILED'))), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Update_Group_Test')), equals(variables('UpdateGroupTestOutputs')['overallResult'], 'FAILED'))), and(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests'), equals(parameters('EnabledTests'), 'Delete_Group_Test')), equals(variables('DeleteGroupTestOutputs')['overallResult'], 'FAILED'))), and(or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Add_Member_Test')), equals(variables('AddMemberTestOutputs')['overallResult'], 'FAILED'))), and(or(or(equals(parameters('EnabledTests'), 'All'), equals(parameters('EnabledTests'), 'GroupTests')), equals(parameters('EnabledTests'), 'Group_Update_Remove_Member_Test')), equals(variables('RemoveMemberTestOutputs')['overallResult'], 'FAILED'))), 'Failed', 'Succeeded')" - } - }, - "Final_TestResults": { - "runAfter": { - "Evaluate_Test_Results": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@union(if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['createUserTestEnabled'], if(equals(variables('CreateUserTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Create_User_Test\",\"testResult\":\"', variables('CreateUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Create_User_Test\",\"testResult\":\"', variables('CreateUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('CreateUserTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Create_User_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['updateUserTestEnabled'], if(equals(variables('UpdateUserTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Update_User_Test\",\"testResult\":\"', variables('UpdateUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Update_User_Test\",\"testResult\":\"', variables('UpdateUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('UpdateUserTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Update_User_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['disableUserTestEnabled'], if(equals(variables('DisableUserTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Disable_User_Test\",\"testResult\":\"', variables('DisableUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Disable_User_Test\",\"testResult\":\"', variables('DisableUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('DisableUserTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Disable_User_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['deleteUserTestEnabled'], if(equals(variables('DeleteUserTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Delete_User_Test\",\"testResult\":\"', variables('DeleteUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Delete_User_Test\",\"testResult\":\"', variables('DeleteUserTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('DeleteUserTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Delete_User_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['managerTestEnabled'], if(equals(variables('ManagerTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"User_Update_Manager_Test\",\"testResult\":\"', variables('ManagerTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"User_Update_Manager_Test\",\"testResult\":\"', variables('ManagerTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('ManagerTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"User_Update_Manager_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['createGroupTestEnabled'], if(equals(variables('CreateGroupTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Create_Group_Test\",\"testResult\":\"', variables('CreateGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Create_Group_Test\",\"testResult\":\"', variables('CreateGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('CreateGroupTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Create_Group_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['updateGroupTestEnabled'], if(equals(variables('UpdateGroupTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Update_Group_Test\",\"testResult\":\"', variables('UpdateGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Update_Group_Test\",\"testResult\":\"', variables('UpdateGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('UpdateGroupTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Update_Group_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['deleteGroupTestEnabled'], if(equals(variables('DeleteGroupTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Delete_Group_Test\",\"testResult\":\"', variables('DeleteGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Delete_Group_Test\",\"testResult\":\"', variables('DeleteGroupTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('DeleteGroupTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Delete_Group_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['addMemberTestEnabled'], if(equals(variables('AddMemberTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Group_Update_Add_Member_Test\",\"testResult\":\"', variables('AddMemberTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Group_Update_Add_Member_Test\",\"testResult\":\"', variables('AddMemberTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('AddMemberTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Group_Update_Add_Member_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')), if(outputs('Evaluate_Test_Results')?['enabledTestsEvaluation']?['removeMemberTestEnabled'], if(equals(variables('RemoveMemberTestOutputs')['overallResult'], 'PASSED'), json(concat('[{\"testName\":\"Group_Update_Remove_Member_Test\",\"testResult\":\"', variables('RemoveMemberTestOutputs')['result'], '\",\"provisioningErrorDetails\":null,\"recommendationUrl\":\"\"}]')), json(concat('[{\"testName\":\"Group_Update_Remove_Member_Test\",\"testResult\":\"', variables('RemoveMemberTestOutputs')['result'], '\",\"provisioningErrorDetails\":', string(variables('RemoveMemberTestOutputs')['errorDetails']), ',\"recommendationUrl\":\"https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/known-issues\"}]'))), json('[{\"testName\":\"Group_Update_Remove_Member_Test\",\"testResult\":\"SKIPPED\",\"provisioningErrorDetails\":\"\",\"recommendationUrl\":\"\"}]')))" - }, - "Terminate_With_Test_Status": { - "runAfter": { - "Final_TestResults": [ - "Succeeded" - ] - }, - "type": "Terminate", - "inputs": { - "runStatus": "@outputs('Evaluate_Test_Results')?['overallLogicAppResult']" - } - }, - "UserTests_Scope": { - "actions": { - "Create_User_Test": { - "actions": { - "Create_User_Test_Actions": { - "actions": { - "Create_User_Initial_Verify_User_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['createUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Create_User_Graph": { - "runAfter": { - "Create_User_Initial_Verify_User_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['createUser']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['createUser'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['createUser']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@if(greater(length(coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json('[]'))), 0), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@if(greater(length(coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json('[]'))), 0), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json('[]'))", - "mail": "@{outputs('Generate_Test_UserNames')['createUser']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Assign_User_To_App": { - "runAfter": { - "Create_User_Graph": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Create_User_Graph')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Create_User_Graph')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{coalesce(first(body('Filter_User_AppRole'))?['id'], first(body('Get_App_Roles')?['appRoles'])?['id'])}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Poll_Create_User": { - "actions": { - "SCIM_Query_Created_User": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['createUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_Create_User_15s": { - "runAfter": { - "SCIM_Query_Created_User": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Assign_User_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('SCIM_Query_Created_User')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DoUntil_Poll_Provisioning_Logs": { - "actions": { - "Verify_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Create_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delay_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Poll_Create_User": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_Failed_Action_Details": { - "actions": { - "Get_Actions_Results": { - "type": "Compose", - "inputs": "@result('Create_User_Test_Actions')" - }, - "Filter_Failed_Actions": { - "runAfter": { - "Get_Actions_Results": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Actions_Results')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateUserFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_Actions')), 0), first(body('Filter_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Failed_Action_Response": { - "runAfter": { - "Set_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateUserFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_Actions')), 0), coalesce(first(body('Filter_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_Create_User_Test_Status_Failed": { - "runAfter": { - "Set_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Create_User_Test_Actions": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Create_User_Test_Status_Success": { - "runAfter": { - "Create_User_Test_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Create_User_Test_Analyze_Provisioning_Results": { - "runAfter": { - "Create_User_Test_Actions": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Failed_Action_Details": [ - "Succeeded", - "Skipped" - ], - "Set_Create_User_Test_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('CreateUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Verify_Provisioning_Logs: ', coalesce(first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Verify_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('CreateUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('CreateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('CreateUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('CreateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_CreateUser_Output_Variables": { - "actions": { - "Set_CreateUserTestOutputs": { - "type": "SetVariable", - "inputs": { - "name": "CreateUserTestOutputs", - "value": { - "overallResult": "@outputs('Create_User_Test_Analyze_Provisioning_Results')?['overallResult']", - "result": "@outputs('Create_User_Test_Analyze_Provisioning_Results')?['provisioningResult']", - "errorDetails": "@outputs('Create_User_Test_Analyze_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Create_User_Test_Analyze_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Delete_Created_User": { - "runAfter": { - "Set_CreateUser_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Create_User_Graph')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "else": { - "actions": {} - }, - "expression": { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "UserTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Create_User_Test" - ] - } - ] - }, - "type": "If" - }, - "Update_User_Test": { - "actions": { - "Update_User_Test_-_Actions": { - "actions": { - "Update_User_Verify_Creation_And_Provisioning": { - "actions": { - "Update_User_-_Initial_Verify_User_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['updateUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_User_-_Create_User_Graph": { - "runAfter": { - "Compose_Final_User_Body": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": "@outputs('Compose_Final_User_Body')", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_User_-_Assign_User_To_App": { - "runAfter": { - "Update_User_-_Create_User_Graph": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Update_User_-_Create_User_Graph')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Update_User_-_Create_User_Graph')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_DoUntil_Wait_For_User_Creation": { - "actions": { - "Update_User_Verify_User_Created": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['updateUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}", - "Content-Type": "@{parameters('scimContentType')}" - } - } - }, - "Update_Delay_Creation_15s": { - "runAfter": { - "Update_User_Verify_User_Created": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_User_-_Assign_User_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Update_User_Verify_User_Created')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Update_DoUntil_Poll_Create_Provisioning_Logs": { - "actions": { - "Update_Verify_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Update_User_-_Create_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Delay_Create_Provisioning_Logs_15s": { - "runAfter": { - "Update_Verify_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_DoUntil_Wait_For_User_Creation": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Compose_User_Body_With_Nulls": { - "runAfter": { - "Update_User_-_Initial_Verify_User_Exists": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['updateUser']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['updateUser'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['updateUser']}", - "mail": "@{if(contains(outputs('Select_Graph_Property_Names'), 'mail'), outputs('Generate_Test_UserNames')['updateUser'], null)}", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - }, - "givenName": "@{if(contains(outputs('Select_Graph_Property_Names'), 'givenName'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'], concat('Given', substring(guid(),0,6))), null)}", - "surname": "@{if(contains(outputs('Select_Graph_Property_Names'), 'surname'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'], concat('Sur', substring(guid(),0,6))), null)}", - "jobTitle": "@{if(contains(outputs('Select_Graph_Property_Names'), 'jobTitle'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'], concat('Title', substring(guid(),0,6))), null)}", - "department": "@{if(contains(outputs('Select_Graph_Property_Names'), 'department'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'], concat('Dept', substring(guid(),0,6))), null)}", - "companyName": "@{if(contains(outputs('Select_Graph_Property_Names'), 'companyName'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'], concat('Company', substring(guid(),0,6))), null)}", - "businessPhones": "@if(contains(outputs('Select_Graph_Property_Names'), 'businessPhones'), if(greater(length(coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json('[]'))), 0), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]'))), null)", - "mobilePhone": "@{if(contains(outputs('Select_Graph_Property_Names'), 'mobilePhone'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'], concat('+1-555-', substring(guid(),0,4))), null)}", - "officeLocation": "@{if(contains(outputs('Select_Graph_Property_Names'), 'officeLocation'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'], concat('Office', substring(guid(),0,4))), null)}", - "preferredLanguage": "@{if(contains(outputs('Select_Graph_Property_Names'), 'preferredLanguage'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'], 'en-US'), null)}", - "employeeId": "@{if(contains(outputs('Select_Graph_Property_Names'), 'employeeId'), substring(guid(), 0, 8), null)}", - "employeeType": "@{if(contains(outputs('Select_Graph_Property_Names'), 'employeeType'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'], 'Employee'), null)}", - "streetAddress": "@{if(contains(outputs('Select_Graph_Property_Names'), 'streetAddress'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'], concat('Street', substring(guid(),0,4))), null)}", - "city": "@{if(contains(outputs('Select_Graph_Property_Names'), 'city'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'], concat('City', substring(guid(),0,4))), null)}", - "state": "@{if(contains(outputs('Select_Graph_Property_Names'), 'state'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'], 'WA'), null)}", - "country": "@{if(contains(outputs('Select_Graph_Property_Names'), 'country'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'], 'US'), null)}", - "postalCode": "@{if(contains(outputs('Select_Graph_Property_Names'), 'postalCode'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'], substring(guid(),0,5)), null)}", - "usageLocation": "@{if(contains(outputs('Select_Graph_Property_Names'), 'usageLocation'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'], 'US'), null)}", - "otherMails": "@if(contains(outputs('Select_Graph_Property_Names'), 'otherMails'), if(greater(length(coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json('[]'))), 0), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], null), null)", - "faxNumber": "@{if(contains(outputs('Select_Graph_Property_Names'), 'faxNumber'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'], concat('+1-555-', substring(guid(),0,4))), null)}", - "userType": "@{if(contains(outputs('Select_Graph_Property_Names'), 'userType'), coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'], 'Member'), null)}", - "employeeOrgData": "@if(and(not(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division')), not(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter'))), null, json(concat('{', if(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division'), concat('\"division\":\"', coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], concat('Div', substring(guid(),0,4))), '\"'), ''), if(and(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division'), contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter')), ',', ''), if(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter'), concat('\"costCenter\":\"', coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], substring(guid(),0,5)), '\"'), ''), '}')))" - } - }, - "Compose_Final_User_Body": { - "runAfter": { - "Compose_User_Body_With_Nulls": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@union(if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['givenName'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['givenName'], ''))), json(concat('{\"givenName\":\"', outputs('Compose_User_Body_With_Nulls')['givenName'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['surname'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['surname'], ''))), json(concat('{\"surname\":\"', outputs('Compose_User_Body_With_Nulls')['surname'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['jobTitle'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['jobTitle'], ''))), json(concat('{\"jobTitle\":\"', outputs('Compose_User_Body_With_Nulls')['jobTitle'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['department'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['department'], ''))), json(concat('{\"department\":\"', outputs('Compose_User_Body_With_Nulls')['department'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['companyName'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['companyName'], ''))), json(concat('{\"companyName\":\"', outputs('Compose_User_Body_With_Nulls')['companyName'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['mobilePhone'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['mobilePhone'], ''))), json(concat('{\"mobilePhone\":\"', outputs('Compose_User_Body_With_Nulls')['mobilePhone'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['officeLocation'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['officeLocation'], ''))), json(concat('{\"officeLocation\":\"', outputs('Compose_User_Body_With_Nulls')['officeLocation'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['preferredLanguage'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['preferredLanguage'], ''))), json(concat('{\"preferredLanguage\":\"', outputs('Compose_User_Body_With_Nulls')['preferredLanguage'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['employeeId'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['employeeId'], ''))), json(concat('{\"employeeId\":\"', outputs('Compose_User_Body_With_Nulls')['employeeId'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['employeeType'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['employeeType'], ''))), json(concat('{\"employeeType\":\"', outputs('Compose_User_Body_With_Nulls')['employeeType'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['streetAddress'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['streetAddress'], ''))), json(concat('{\"streetAddress\":\"', outputs('Compose_User_Body_With_Nulls')['streetAddress'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['city'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['city'], ''))), json(concat('{\"city\":\"', outputs('Compose_User_Body_With_Nulls')['city'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['state'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['state'], ''))), json(concat('{\"state\":\"', outputs('Compose_User_Body_With_Nulls')['state'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['country'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['country'], ''))), json(concat('{\"country\":\"', outputs('Compose_User_Body_With_Nulls')['country'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['postalCode'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['postalCode'], ''))), json(concat('{\"postalCode\":\"', outputs('Compose_User_Body_With_Nulls')['postalCode'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['usageLocation'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['usageLocation'], ''))), json(concat('{\"usageLocation\":\"', outputs('Compose_User_Body_With_Nulls')['usageLocation'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['faxNumber'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['faxNumber'], ''))), json(concat('{\"faxNumber\":\"', outputs('Compose_User_Body_With_Nulls')['faxNumber'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['userType'], null)), not(equals(outputs('Compose_User_Body_With_Nulls')['userType'], ''))), json(concat('{\"userType\":\"', outputs('Compose_User_Body_With_Nulls')['userType'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['businessPhones'], null)), greater(length(coalesce(outputs('Compose_User_Body_With_Nulls')['businessPhones'], json('[]'))), 0)), json(concat('{\"businessPhones\":', string(outputs('Compose_User_Body_With_Nulls')['businessPhones']), '}')), json('{}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['otherMails'], null)), greater(length(coalesce(outputs('Compose_User_Body_With_Nulls')['otherMails'], json('[]'))), 0)), json(concat('{\"otherMails\":', string(outputs('Compose_User_Body_With_Nulls')['otherMails']), '}')), json('{}')), json(concat('{\"accountEnabled\":', toLower(string(outputs('Compose_User_Body_With_Nulls')['accountEnabled'])), ',\"displayName\":\"', outputs('Compose_User_Body_With_Nulls')['displayName'], '\",\"mailNickname\":\"', outputs('Compose_User_Body_With_Nulls')['mailNickname'], '\",\"userPrincipalName\":\"', outputs('Compose_User_Body_With_Nulls')['userPrincipalName'], '\",\"mail\":\"', outputs('Compose_User_Body_With_Nulls')['mail'], '\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":', toLower(string(outputs('Compose_User_Body_With_Nulls')['passwordProfile']['forceChangePasswordNextSignIn'])), ',\"password\":\"', outputs('Compose_User_Body_With_Nulls')['passwordProfile']['password'], '\"}}')), if(and(not(equals(outputs('Compose_User_Body_With_Nulls')['employeeOrgData'], null)), not(empty(string(outputs('Compose_User_Body_With_Nulls')['employeeOrgData'])))), json(concat('{\"employeeOrgData\":', string(outputs('Compose_User_Body_With_Nulls')['employeeOrgData']), '}')), json('{}')))" - } - }, - "type": "Scope" - }, - "Update_User_Analyze_Create_Provisioning_Results": { - "runAfter": { - "Update_User_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Update_CreatePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_UpdateUser_CreatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Update_Verify_Create_Provisioning_Logs: ', coalesce(first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Update_Verify_Create_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('UpdateUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('UpdateUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Update_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Update_User_Check_Create_Phase_Status": { - "actions": { - "Update_User_Verify_Update_And_Provisioning": { - "actions": { - "Update_User_Query_User_By_Id": { - "runAfter": { - "Compose_Final_Update_User_Body": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "@concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['updateUser'], ''), '%22')", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_User_Update_User_Attributes": { - "runAfter": { - "Update_User_Query_User_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Update_User_-_Create_User_Graph')?['id']}", - "method": "PATCH", - "headers": { - "Content-Type": "application/json" - }, - "body": "@outputs('Compose_Final_Update_User_Body')", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_DoUntil_Wait_For_Attribute_Updates": { - "actions": { - "Update_User_-_Query_User_By_Id_After_Attributes_Update": { - "type": "Http", - "inputs": { - "uri": "@concat(parameters('scimEndpoint'), '/Users/', coalesce(first(body('Update_User_Query_User_By_Id')?['Resources'])?['id'], ''))", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_Delay_Final_15s": { - "runAfter": { - "Update_User_-_Query_User_By_Id_After_Attributes_Update": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_User_Update_User_Attributes": [ - "Succeeded" - ] - }, - "expression": "@and(not(empty(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['id'])), equals(coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['givenName'], ''), coalesce(outputs('Compose_Final_Update_User_Body')?['givenName'], '')))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Update_User_-_Match_Expected_Attributes_After_Attributes_Update": { - "runAfter": { - "Update_DoUntil_Wait_For_Attribute_Updates": [ - "Succeeded", - "TimedOut", - "Failed" - ] - }, - "type": "Compose", - "inputs": { - "expectedUserPrincipalName": "@coalesce(outputs('Compose_Final_Update_User_Body')?['userPrincipalName'], '')", - "actualUserPrincipalName": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['userName'], '')", - "expectedDisplayName": "@coalesce(outputs('Compose_Final_Update_User_Body')?['displayName'], '')", - "actualDisplayName": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['displayName'], '')", - "expectedGivenName": "@coalesce(outputs('Compose_Final_Update_User_Body')?['givenName'], '')", - "actualGivenName": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['givenName'], '')", - "expectedSurname": "@coalesce(outputs('Compose_Final_Update_User_Body')?['surname'], '')", - "actualSurname": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['familyName'], '')", - "expectedJobTitle": "@coalesce(outputs('Compose_Final_Update_User_Body')?['jobTitle'], '')", - "actualJobTitle": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['title'], '')", - "expectedDepartment": "@coalesce(outputs('Compose_Final_Update_User_Body')?['department'], '')", - "actualDepartment": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['department'], '')", - "expectedCompanyName": "@coalesce(outputs('Compose_Final_Update_User_Body')?['companyName'], '')", - "actualCompanyName": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['organization'], '')", - "expectedOfficeLocation": "@coalesce(outputs('Compose_Final_Update_User_Body')?['officeLocation'], '')", - "actualOfficeLocation": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['officeLocation'], '')", - "expectedPreferredLanguage": "@coalesce(outputs('Compose_Final_Update_User_Body')?['preferredLanguage'], '')", - "actualPreferredLanguage": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['preferredLanguage'], '')", - "expectedEmployeeType": "@coalesce(outputs('Compose_Final_Update_User_Body')?['employeeType'], '')", - "actualEmployeeType": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['employeeType'], '')", - "expectedUsageLocation": "@coalesce(outputs('Compose_Final_Update_User_Body')?['usageLocation'], '')", - "actualUsageLocation": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['usageLocation'], '')", - "expectedCountry": "@coalesce(outputs('Compose_Final_Update_User_Body')?['country'], '')", - "actualCountry": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['country'], '')", - "expectedStreetAddress": "@coalesce(outputs('Compose_Final_Update_User_Body')?['streetAddress'], '')", - "actualStreetAddress": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['streetAddress'], '')", - "expectedCity": "@coalesce(outputs('Compose_Final_Update_User_Body')?['city'], '')", - "actualCity": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['locality'], '')", - "expectedState": "@coalesce(outputs('Compose_Final_Update_User_Body')?['state'], '')", - "actualState": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['region'], '')", - "expectedPostalCode": "@coalesce(outputs('Compose_Final_Update_User_Body')?['postalCode'], '')", - "actualPostalCode": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['postalCode'], '')", - "expectedDivision": "@coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['division'], '')", - "actualDivision": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['division'], '')", - "expectedCostCenter": "@coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['costCenter'], '')", - "actualCostCenter": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['costCenter'], '')", - "expectedMailNickname": "@coalesce(outputs('Compose_Final_Update_User_Body')?['mailNickname'], '')", - "actualMailNickname": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['mailNickname'], '')", - "expectedMail": "@coalesce(outputs('Compose_Final_Update_User_Body')?['mail'], '')", - "actualMail": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['emails']?[0]?['value'], '')", - "expectedEmployeeId": "@coalesce(outputs('Compose_Final_Update_User_Body')?['employeeId'], '')", - "actualEmployeeId": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['employeeNumber'], '')", - "expectedUserType": "@coalesce(outputs('Compose_Final_Update_User_Body')?['userType'], '')", - "actualUserType": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['userType'], '')", - "expectedMobilePhone": "@coalesce(outputs('Compose_Final_Update_User_Body')?['mobilePhone'], '')", - "actualMobilePhone": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['phoneNumbers']?[0]?['value'], '')", - "expectedFaxNumber": "@coalesce(outputs('Compose_Final_Update_User_Body')?['faxNumber'], '')", - "actualFaxNumber": "@coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['faxNumber'], '')", - "displayNameMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['displayName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['displayName'], ''))", - "givenNameMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['givenName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['givenName'], ''))", - "surnameMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['surname'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['familyName'], ''))", - "jobTitleMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['jobTitle'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['title'], ''))", - "departmentMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['department'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['department'], ''))", - "companyNameMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['companyName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['organization'], ''))", - "officeLocationMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['officeLocation'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['officeLocation'], ''))", - "preferredLanguageMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['preferredLanguage'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['preferredLanguage'], ''))", - "employeeTypeMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeType'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['employeeType'], ''))", - "usageLocationMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['usageLocation'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['usageLocation'], ''))", - "countryMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['country'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['country'], ''))", - "streetAddressMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['streetAddress'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['streetAddress'], ''))", - "cityMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['city'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['locality'], ''))", - "stateMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['state'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['region'], ''))", - "postalCodeMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['postalCode'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['postalCode'], ''))", - "divisionMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['division'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['division'], ''))", - "costCenterMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['costCenter'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['costCenter'], ''))", - "userPrincipalNameMatches": "@equals(coalesce(outputs('Compose_Final_Update_User_Body')?['userPrincipalName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['userName'], ''))", - "attributesMatch": "@and(and(and(and(and(and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['userPrincipalName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['userName'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['displayName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['displayName'], ''))), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['givenName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['givenName'], ''))), and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['surname'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['name']?['familyName'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['jobTitle'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['title'], '')))), and(and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['department'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['department'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['companyName'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['organization'], ''))), and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['officeLocation'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['officeLocation'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['preferredLanguage'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['preferredLanguage'], ''))))), and(and(and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeType'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['employeeType'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['usageLocation'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['usageLocation'], ''))), and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['country'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['country'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['streetAddress'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['streetAddress'], '')))), and(and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['city'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['locality'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['state'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['region'], ''))), and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['postalCode'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['addresses']?[0]?['postalCode'], '')), and(equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['division'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['division'], '')), equals(coalesce(outputs('Compose_Final_Update_User_Body')?['employeeOrgData']?['costCenter'], ''), coalesce(body('Update_User_-_Query_User_By_Id_After_Attributes_Update')?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['costCenter'], ''))))))), true)" - } - }, - "Update_DoUntil_Poll_Update_Provisioning_Logs": { - "actions": { - "Update_Verify_Update_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Update_User_-_Create_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27&$top=1&$orderby=activityDateTime%20desc')", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Delay_Update_Provisioning_Logs_15s": { - "runAfter": { - "Update_Verify_Update_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_User_-_Match_Expected_Attributes_After_Attributes_Update": [ - "Succeeded", - "Failed" - ] - }, - "expression": "@greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Compose_Update_User_Body_With_Nulls": { - "type": "Compose", - "inputs": { - "userPrincipalName": "@{if(contains(outputs('Select_Graph_Property_Names'), 'userPrincipalName'), concat('updated-', outputs('Generate_Test_UserNames')['updateUser']), null)}", - "displayName": "@{concat(outputs('Generate_Test_UserNames')['updateUser'], ' - Updated')}", - "mailNickname": "@{if(contains(outputs('Select_Graph_Property_Names'), 'mailNickname'), if(empty(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['mailNickname']), concat('upd', substring(guid(),0,8)), parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['mailNickname']), null)}", - "mail": "@{if(contains(outputs('Select_Graph_Property_Names'), 'mail'), concat('updated-', outputs('Generate_Test_UserNames')['updateUser']), null)}", - "employeeId": "@{if(contains(outputs('Select_Graph_Property_Names'), 'employeeId'), if(empty(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['employeeId']), substring(guid(),0,8), parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['employeeId']), null)}", - "userType": "@{if(contains(outputs('Select_Graph_Property_Names'), 'userType'), if(empty(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['userType']), 'Member', parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['userType']), null)}", - "givenName": "@{if(contains(outputs('Select_Graph_Property_Names'), 'givenName'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['givenName'], 'UpdatedGiven'), null)}", - "surname": "@{if(contains(outputs('Select_Graph_Property_Names'), 'surname'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['surname'], 'UpdatedSurname'), null)}", - "jobTitle": "@{if(contains(outputs('Select_Graph_Property_Names'), 'jobTitle'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['jobTitle'], 'Updated Senior Test Position'), null)}", - "department": "@{if(contains(outputs('Select_Graph_Property_Names'), 'department'), parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['department'], null)}", - "companyName": "@{if(contains(outputs('Select_Graph_Property_Names'), 'companyName'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['companyName'], 'Updated Test Company'), null)}", - "businessPhones": "@if(contains(outputs('Select_Graph_Property_Names'), 'businessPhones'), if(greater(length(coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['businessPhones'], json('[]'))), 0), parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]'))), null)", - "mobilePhone": "@{if(contains(outputs('Select_Graph_Property_Names'), 'mobilePhone'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['mobilePhone'], '+1-555-8888'), null)}", - "officeLocation": "@{if(contains(outputs('Select_Graph_Property_Names'), 'officeLocation'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['officeLocation'], 'Updated Building B, Floor 5'), null)}", - "preferredLanguage": "@{if(contains(outputs('Select_Graph_Property_Names'), 'preferredLanguage'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['preferredLanguage'], 'es-ES'), null)}", - "employeeType": "@{if(contains(outputs('Select_Graph_Property_Names'), 'employeeType'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['employeeType'], 'Contractor'), null)}", - "streetAddress": "@{if(contains(outputs('Select_Graph_Property_Names'), 'streetAddress'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['streetAddress'], '456 Updated Street'), null)}", - "city": "@{if(contains(outputs('Select_Graph_Property_Names'), 'city'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['city'], 'Updated Seattle'), null)}", - "state": "@{if(contains(outputs('Select_Graph_Property_Names'), 'state'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['state'], 'WA'), null)}", - "country": "@{if(contains(outputs('Select_Graph_Property_Names'), 'country'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['country'], 'US'), null)}", - "postalCode": "@{if(contains(outputs('Select_Graph_Property_Names'), 'postalCode'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['postalCode'], '90210'), null)}", - "usageLocation": "@{if(contains(outputs('Select_Graph_Property_Names'), 'usageLocation'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['usageLocation'], 'IN'), null)}", - "otherMails": "@if(contains(outputs('Select_Graph_Property_Names'), 'otherMails'), if(greater(length(coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['otherMails'], json('[]'))), 0), parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['otherMails'], null), null)", - "faxNumber": "@{if(contains(outputs('Select_Graph_Property_Names'), 'faxNumber'), coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['faxNumber'], '+1-555-7777'), null)}", - "employeeOrgData": "@if(and(not(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division')), not(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter'))), null, json(concat('{', if(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division'), concat('\"division\":\"', coalesce(parameters('defaultUserProperties')[mod(add(outputs('Generate_Test_UserNames')['index'], 1), length(parameters('defaultUserProperties')))]['employeeOrgData']['division'], 'UpdatedDiv'), '\"'), ''), if(and(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.division'), contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter')), ',', ''), if(contains(outputs('Select_Graph_Property_Names'), 'employeeOrgData.costCenter'), '\"costCenter\":\"99999\"', ''), '}')))" - } - }, - "Compose_Final_Update_User_Body": { - "runAfter": { - "Compose_Update_User_Body_With_Nulls": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@union(if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['userPrincipalName'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['userPrincipalName'], ''))), json(concat('{\"userPrincipalName\":\"', outputs('Compose_Update_User_Body_With_Nulls')['userPrincipalName'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mailNickname'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mailNickname'], ''))), json(concat('{\"mailNickname\":\"', outputs('Compose_Update_User_Body_With_Nulls')['mailNickname'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['userType'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['userType'], ''))), json(concat('{\"userType\":\"', outputs('Compose_Update_User_Body_With_Nulls')['userType'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['givenName'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['givenName'], ''))), json(concat('{\"givenName\":\"', outputs('Compose_Update_User_Body_With_Nulls')['givenName'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['surname'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['surname'], ''))), json(concat('{\"surname\":\"', outputs('Compose_Update_User_Body_With_Nulls')['surname'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['jobTitle'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['jobTitle'], ''))), json(concat('{\"jobTitle\":\"', outputs('Compose_Update_User_Body_With_Nulls')['jobTitle'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['department'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['department'], ''))), json(concat('{\"department\":\"', outputs('Compose_Update_User_Body_With_Nulls')['department'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['companyName'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['companyName'], ''))), json(concat('{\"companyName\":\"', outputs('Compose_Update_User_Body_With_Nulls')['companyName'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mobilePhone'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mobilePhone'], ''))), json(concat('{\"mobilePhone\":\"', outputs('Compose_Update_User_Body_With_Nulls')['mobilePhone'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['officeLocation'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['officeLocation'], ''))), json(concat('{\"officeLocation\":\"', outputs('Compose_Update_User_Body_With_Nulls')['officeLocation'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['preferredLanguage'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['preferredLanguage'], ''))), json(concat('{\"preferredLanguage\":\"', outputs('Compose_Update_User_Body_With_Nulls')['preferredLanguage'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['employeeId'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['employeeId'], ''))), json(concat('{\"employeeId\":\"', outputs('Compose_Update_User_Body_With_Nulls')['employeeId'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['employeeType'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['employeeType'], ''))), json(concat('{\"employeeType\":\"', outputs('Compose_Update_User_Body_With_Nulls')['employeeType'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mail'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['mail'], ''))), json(concat('{\"mail\":\"', outputs('Compose_Update_User_Body_With_Nulls')['mail'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['streetAddress'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['streetAddress'], ''))), json(concat('{\"streetAddress\":\"', outputs('Compose_Update_User_Body_With_Nulls')['streetAddress'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['city'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['city'], ''))), json(concat('{\"city\":\"', outputs('Compose_Update_User_Body_With_Nulls')['city'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['state'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['state'], ''))), json(concat('{\"state\":\"', outputs('Compose_Update_User_Body_With_Nulls')['state'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['country'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['country'], ''))), json(concat('{\"country\":\"', outputs('Compose_Update_User_Body_With_Nulls')['country'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['postalCode'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['postalCode'], ''))), json(concat('{\"postalCode\":\"', outputs('Compose_Update_User_Body_With_Nulls')['postalCode'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['usageLocation'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['usageLocation'], ''))), json(concat('{\"usageLocation\":\"', outputs('Compose_Update_User_Body_With_Nulls')['usageLocation'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['faxNumber'], null)), not(equals(outputs('Compose_Update_User_Body_With_Nulls')['faxNumber'], ''))), json(concat('{\"faxNumber\":\"', outputs('Compose_Update_User_Body_With_Nulls')['faxNumber'], '\"}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['businessPhones'], null)), greater(length(coalesce(outputs('Compose_Update_User_Body_With_Nulls')['businessPhones'], json('[]'))), 0)), json(concat('{\"businessPhones\":', string(outputs('Compose_Update_User_Body_With_Nulls')['businessPhones']), '}')), json('{}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['otherMails'], null)), greater(length(coalesce(outputs('Compose_Update_User_Body_With_Nulls')['otherMails'], json('[]'))), 0)), json(concat('{\"otherMails\":', string(outputs('Compose_Update_User_Body_With_Nulls')['otherMails']), '}')), json('{}')), json(concat('{\"displayName\":\"', outputs('Compose_Update_User_Body_With_Nulls')['displayName'], '\"}')), if(and(not(equals(outputs('Compose_Update_User_Body_With_Nulls')['employeeOrgData'], null)), not(empty(string(outputs('Compose_Update_User_Body_With_Nulls')['employeeOrgData'])))), json(concat('{\"employeeOrgData\":', string(outputs('Compose_Update_User_Body_With_Nulls')['employeeOrgData']), '}')), json('{}')))" - } - }, - "type": "Scope" - }, - "Capture_Update_UpdatePhase_Failed_Actions": { - "actions": { - "Get_Failed_UpdatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Update_User_Verify_Update_And_Provisioning')" - }, - "Filter_Failed_UpdatePhase_Actions": { - "runAfter": { - "Get_Failed_UpdatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_UpdatePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_UpdateUser_UpdatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_UpdatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_UpdatePhase_Actions')), 0), first(body('Filter_Failed_UpdatePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_UpdateUser_UpdatePhase_Failed_Action_Response": { - "runAfter": { - "Set_UpdateUser_UpdatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_UpdatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_UpdatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_UpdateUser_UpdatePhase_Status_Failed": { - "runAfter": { - "Set_UpdateUser_UpdatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Update_User_Verify_Update_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_UpdateUser_UpdatePhase_Status_Success": { - "runAfter": { - "Update_User_Verify_Update_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Set_UpdateUser_UpdatePhase_Output_Variables": { - "actions": { - "Set_UpdateUserTest_UpdatePhase_Outputs": { - "type": "SetVariable", - "inputs": { - "name": "UpdateUserTestOutputs", - "value": { - "overallResult": "@outputs('Update_Analyze_Update_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Update_Analyze_Update_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Update Phase: ', outputs('Update_Analyze_Update_Provisioning_Results')?['provisioningResult']), outputs('Update_Analyze_Update_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Update_Analyze_Update_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Update_Analyze_Update_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Update_Analyze_Update_Provisioning_Results": { - "runAfter": { - "Update_User_Verify_Update_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Update_UpdatePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_UpdateUser_UpdatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Update_Verify_Update_Provisioning_Logs: ', coalesce(first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Update_Verify_Update_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('UpdateUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('UpdateUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('UpdateUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Verify_Update_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Update_Verify_Update_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - } - }, - "runAfter": { - "Set_UpdateUser_CreatePhase_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('UpdateUserTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - }, - "Update_Cleanup_Delete_User": { - "runAfter": { - "Update_User_Check_Create_Phase_Status": [ - "Succeeded", - "Failed", - "TimedOut", - "Skipped" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Update_User_-_Create_User_Graph')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Capture_Update_CreatePhase_Failed_Actions": { - "actions": { - "Get_Failed_CreatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Update_User_Verify_Creation_And_Provisioning')" - }, - "Filter_Failed_CreatePhase_Actions": { - "runAfter": { - "Get_Failed_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_CreatePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_UpdateUser_CreatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_CreatePhase_Actions')), 0), first(body('Filter_Failed_CreatePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_UpdateUser_CreatePhase_Failed_Action_Response": { - "runAfter": { - "Set_UpdateUser_CreatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_CreatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_CreatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_UpdateUser_CreatePhase_Status_Failed": { - "runAfter": { - "Set_UpdateUser_CreatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Update_User_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_UpdateUser_CreatePhase_Status_Success": { - "runAfter": { - "Update_User_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Set_UpdateUser_CreatePhase_Output_Variables": { - "actions": { - "Set_UpdateUserTestOutputs": { - "type": "SetVariable", - "inputs": { - "name": "UpdateUserTestOutputs", - "value": { - "overallResult": "@outputs('Update_User_Analyze_Create_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Update_User_Analyze_Create_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('Update_User_Analyze_Create_Provisioning_Results')?['provisioningResult']), outputs('Update_User_Analyze_Create_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Update_User_Analyze_Create_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Update_User_Analyze_Create_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "UserTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Update_User_Test" - ] - } - ] - }, - "type": "If" - }, - "Delete_User_Test": { - "actions": { - "Delete_User_Test_Actions": { - "actions": { - "DeleteUser_Phase1_Verify_Creation_And_Provisioning": { - "actions": { - "DeleteUser_Check_Delete_User_Exists_Initial": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['deleteUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DeleteUser_Create_Delete_User_Graph": { - "runAfter": { - "DeleteUser_Check_Delete_User_Exists_Initial": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['deleteUser']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['deleteUser'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['deleteUser']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "mail": "@{outputs('Generate_Test_UserNames')['deleteUser']}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_Assign_Delete_User_To_App": { - "runAfter": { - "DeleteUser_Create_Delete_User_Graph": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('DeleteUser_Create_Delete_User_Graph')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('DeleteUser_Create_Delete_User_Graph')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_DoUntil_Wait_For_User_Creation": { - "actions": { - "DeleteUser_Check_User_Synced": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['deleteUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DeleteUser_Delay_Creation_15s": { - "runAfter": { - "DeleteUser_Check_User_Synced": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DeleteUser_Assign_Delete_User_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('DeleteUser_Check_User_Synced')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DeleteUser_DoUntil_Poll_Provisioning_Logs": { - "actions": { - "DeleteUser_Verify_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('DeleteUser_Create_Delete_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27create%27&$orderby=activityDateTime%20desc&$top=1')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_Delay_Provisioning_Logs_15s": { - "runAfter": { - "DeleteUser_Verify_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DeleteUser_DoUntil_Wait_For_User_Creation": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "DeleteUser_Capture_Phase1_Failed_Actions": { - "actions": { - "DeleteUser_Get_Phase1_Failed_Actions": { - "type": "Compose", - "inputs": "@result('DeleteUser_Phase1_Verify_Creation_And_Provisioning')" - }, - "DeleteUser_Filter_Phase1_Failed_Actions": { - "runAfter": { - "DeleteUser_Get_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('DeleteUser_Get_Phase1_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "DeleteUser_Set_Phase1_Failed_Action_Name": { - "runAfter": { - "DeleteUser_Filter_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserFailedActionName", - "value": "@{if(greater(length(body('DeleteUser_Filter_Phase1_Failed_Actions')), 0), first(body('DeleteUser_Filter_Phase1_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "DeleteUser_Set_Phase1_Failed_Action_Response": { - "runAfter": { - "DeleteUser_Set_Phase1_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserFailedActionResponse", - "value": "@if(greater(length(body('DeleteUser_Filter_Phase1_Failed_Actions')), 0), coalesce(first(body('DeleteUser_Filter_Phase1_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "DeleteUser_Set_Phase1_Status_Failed": { - "runAfter": { - "DeleteUser_Set_Phase1_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "DeleteUser_Phase1_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "DeleteUser_Set_Phase1_Status_Success": { - "runAfter": { - "DeleteUser_Phase1_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "DeleteUser_Analyze_Phase1_Provisioning_Results": { - "runAfter": { - "DeleteUser_Phase1_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "DeleteUser_Capture_Phase1_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "DeleteUser_Set_Phase1_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('DeleteUser_Verify_Provisioning_Logs: ', coalesce(first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'DeleteUser_Verify_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('DeleteUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('DeleteUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DeleteUser_Verify_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "DeleteUser_Set_Phase1_Output_Variables": { - "actions": { - "DeleteUser_Set_DeleteUserTestOutputs_Phase1": { - "type": "SetVariable", - "inputs": { - "name": "DeleteUserTestOutputs", - "value": { - "overallResult": "@outputs('DeleteUser_Analyze_Phase1_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('DeleteUser_Analyze_Phase1_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('DeleteUser_Analyze_Phase1_Provisioning_Results')?['provisioningResult']), outputs('DeleteUser_Analyze_Phase1_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('DeleteUser_Analyze_Phase1_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "DeleteUser_Analyze_Phase1_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "DeleteUser_Check_Phase1_Status": { - "actions": { - "DeleteUser_Phase2_Verify_Deletion_And_Provisioning": { - "actions": { - "DeleteUser_Query_User_By_Id": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['deleteUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DeleteUser_Delete_User_From_Graph": { - "runAfter": { - "DeleteUser_Query_User_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('DeleteUser_Create_Delete_User_Graph')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_DoUntil_Wait_For_User_Deletion": { - "actions": { - "DeleteUser_Check_User_Deleted": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['deleteUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DeleteUser_Delay_Deletion_15s": { - "runAfter": { - "DeleteUser_Check_User_Deleted": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DeleteUser_Delete_User_From_Graph": [ - "Succeeded" - ] - }, - "expression": "@or(equals(length(coalesce(body('DeleteUser_Check_User_Deleted')?['Resources'], json('[]'))), 0), if(parameters('IsSoftDeleted'), and(greater(length(coalesce(body('DeleteUser_Check_User_Deleted')?['Resources'], json('[]'))), 0), equals(first(body('DeleteUser_Check_User_Deleted')?['Resources'])?['active'], false)), false))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DeleteUser_DoUntil_Poll_Delete_Provisioning_Logs": { - "actions": { - "DeleteUser_Verify_Disable_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('DeleteUser_Create_Delete_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Disable%27&$orderby=activityDateTime%20desc&$top=1')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_Verify_Delete_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('DeleteUser_Create_Delete_User_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Delete%27&$orderby=activityDateTime%20desc&$top=1')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DeleteUser_Delay": { - "runAfter": { - "DeleteUser_Verify_Disable_Provisioning_Logs": [ - "Succeeded", - "Failed" - ], - "DeleteUser_Verify_Delete_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DeleteUser_DoUntil_Wait_For_User_Deletion": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@or(and(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), and(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "DeleteUser_Capture_Phase2_Failed_Actions": { - "actions": { - "DeleteUser_Get_Phase2_Failed_Actions": { - "type": "Compose", - "inputs": "@result('DeleteUser_Phase2_Verify_Deletion_And_Provisioning')" - }, - "DeleteUser_Filter_Phase2_Failed_Actions": { - "runAfter": { - "DeleteUser_Get_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('DeleteUser_Get_Phase2_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "DeleteUser_Set_Phase2_Failed_Action_Name": { - "runAfter": { - "DeleteUser_Filter_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserFailedActionName", - "value": "@{if(greater(length(body('DeleteUser_Filter_Phase2_Failed_Actions')), 0), first(body('DeleteUser_Filter_Phase2_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "DeleteUser_Set_Phase2_Failed_Action_Response": { - "runAfter": { - "DeleteUser_Set_Phase2_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserFailedActionResponse", - "value": "@if(greater(length(body('DeleteUser_Filter_Phase2_Failed_Actions')), 0), coalesce(first(body('DeleteUser_Filter_Phase2_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "DeleteUser_Set_Phase2_Status_Failed": { - "runAfter": { - "DeleteUser_Set_Phase2_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "DeleteUser_Phase2_Verify_Deletion_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "DeleteUser_Set_Phase2_Status_Success": { - "runAfter": { - "DeleteUser_Phase2_Verify_Deletion_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "DeleteUser_Analyze_Phase2_Provisioning_Results": { - "runAfter": { - "DeleteUser_Phase2_Verify_Deletion_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "DeleteUser_Capture_Phase2_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "DeleteUser_Set_Phase2_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "disableLogsCount": "@length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]')))", - "deleteLogsCount": "@length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]')))", - "hasDisableLogs": "@greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0)", - "hasDeleteLogs": "@greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0)", - "disableStatus": "@if(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "deleteStatus": "@if(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'success (Disable)', if(and(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'success (Delete)', concat('Disable: ', if(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS'), ', Delete: ', if(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS')))), concat('Failed Action: ', variables('DeleteUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], if(and(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), variables('DeleteUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('DeleteUserScopeExecutionStatus'), 'Succeeded'), if(or(and(greater(length(coalesce(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), and(greater(length(coalesce(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DeleteUser_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "DeleteUser_Set_Phase2_Output_Variables": { - "actions": { - "DeleteUser_Set_DeleteUserTestOutputs_Phase2": { - "type": "SetVariable", - "inputs": { - "name": "DeleteUserTestOutputs", - "value": { - "overallResult": "@outputs('DeleteUser_Analyze_Phase2_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('DeleteUser_Analyze_Phase2_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Delete Phase: ', outputs('DeleteUser_Analyze_Phase2_Provisioning_Results')?['provisioningResult']), outputs('DeleteUser_Analyze_Phase2_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('DeleteUser_Analyze_Phase2_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "DeleteUser_Analyze_Phase2_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "DeleteUser_Set_Phase1_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('DeleteUserTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "UserTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Delete_User_Test" - ] - } - ] - }, - "type": "If" - }, - "User_Update_Manager_Test": { - "actions": { - "User_Update_Manager_Test_Actions": { - "actions": { - "Phase1_Create_Users_And_Initial_Sync": { - "actions": { - "Step1_Check_User_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Step2_Create_Test_User": { - "runAfter": { - "Step1_Check_User_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['managerUser']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['managerUser'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['managerUser']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "mail": "@{outputs('Generate_Test_UserNames')['managerUser']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Step3_Create_Initial_Manager": { - "runAfter": { - "Step2_Create_Test_User": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "Initial Manager User", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['managerUserInitial'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['managerUserInitial']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "mail": "@{outputs('Generate_Test_UserNames')['managerUserInitial']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Step4_Create_New_Manager": { - "runAfter": { - "Step3_Create_Initial_Manager": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "New Manager User", - "mailNickname": "newmanageruser", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['managerUserNew']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "mail": "@{outputs('Generate_Test_UserNames')['managerUserNew']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Step5_Assign_Test_User_To_App": { - "runAfter": { - "Step4_Create_New_Manager": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step2_Create_Test_User')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Step2_Create_Test_User')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Step6_Assign_Initial_Manager_To_App": { - "runAfter": { - "Step5_Assign_Test_User_To_App": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step3_Create_Initial_Manager')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Step3_Create_Initial_Manager')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Step7_Assign_New_Manager_To_App": { - "runAfter": { - "Step6_Assign_Initial_Manager_To_App": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step4_Create_New_Manager')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Step4_Create_New_Manager')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Poll_All_Users_Created": { - "actions": { - "SCIM_Query_Test_User": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "SCIM_Query_Initial_Manager": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUserInitial'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "SCIM_Query_New_Manager": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUserNew'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_15s": { - "runAfter": { - "SCIM_Query_Test_User": [ - "Succeeded", - "Failed" - ], - "SCIM_Query_Initial_Manager": [ - "Succeeded", - "Failed" - ], - "SCIM_Query_New_Manager": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Step7_Assign_New_Manager_To_App": [ - "Succeeded" - ] - }, - "expression": "@and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0))", - "limit": { - "count": 200, - "timeout": "PT60M" - }, - "type": "Until" - }, - "DoUntil_Poll_Initial_Provisioning_Logs": { - "actions": { - "Verify_Test_User_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step2_Create_Test_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Verify_Initial_Manager_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step3_Create_Initial_Manager')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Verify_New_Manager_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step4_Create_New_Manager')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "ManagerTest_Delay_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Test_User_Provisioning_Logs": [ - "Succeeded", - "Failed" - ], - "Verify_Initial_Manager_Provisioning_Logs": [ - "Succeeded", - "Failed" - ], - "Verify_New_Manager_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Poll_All_Users_Created": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_Phase1_Failed_Actions": { - "actions": { - "Get_Phase1_Failed_Actions": { - "type": "Compose", - "inputs": "@result('Phase1_Create_Users_And_Initial_Sync')" - }, - "Filter_Phase1_Failed_Actions": { - "runAfter": { - "Get_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Phase1_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Phase1_Failed_Action_Name": { - "runAfter": { - "Filter_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionName", - "value": "@{if(greater(length(body('Filter_Phase1_Failed_Actions')), 0), first(body('Filter_Phase1_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Phase1_Failed_Action_Response": { - "runAfter": { - "Set_Phase1_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionResponse", - "value": "@if(greater(length(body('Filter_Phase1_Failed_Actions')), 0), coalesce(first(body('Filter_Phase1_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_Phase1_Status_Failed": { - "runAfter": { - "Set_Phase1_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Phase1_Create_Users_And_Initial_Sync": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Phase1_Status_Success": { - "runAfter": { - "Phase1_Create_Users_And_Initial_Sync": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Analyze_Phase1_Provisioning_Results": { - "runAfter": { - "Phase1_Create_Users_And_Initial_Sync": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Phase1_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_Phase1_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "scimVerificationPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0)), false)", - "provisioningLogsPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), not(or(or(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')))), false)", - "provisioningResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0)), and(and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), and(and(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))), 'success', concat(if(not(and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0))), concat('SCIM: SCIM_Query_Test_User: ', if(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), 'FOUND', 'NOT_FOUND'), ', SCIM_Query_Initial_Manager: ', if(greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0), 'FOUND', 'NOT_FOUND'), ', SCIM_Query_New_Manager: ', if(greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0), 'FOUND', 'NOT_FOUND')), ''), if(and(not(and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0))), not(and(and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), and(and(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))))), '; ', ''), if(not(and(and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), and(and(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))), concat('Provisioning: Verify_Test_User_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND'), ', Verify_Initial_Manager_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND'), ', Verify_New_Manager_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')), ''))), concat('Failed Action: ', variables('ManagerTestFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(or(or(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')), json(concat('{\"testUser\":', string(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), ',\"initialManager\":', string(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), ',\"newManager\":', string(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), '}')), null), variables('ManagerTestFailedActionResponse'))", - "overallResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(and(greater(length(coalesce(body('SCIM_Query_Test_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('SCIM_Query_Initial_Manager')?['Resources'], json('[]'))), 0)), greater(length(coalesce(body('SCIM_Query_New_Manager')?['Resources'], json('[]'))), 0)), and(and(and(greater(length(coalesce(body('Verify_Test_User_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Verify_Initial_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), greater(length(coalesce(body('Verify_New_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)), not(or(or(equals(toLower(coalesce(first(body('Verify_Test_User_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure'), equals(toLower(coalesce(first(body('Verify_Initial_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')), equals(toLower(coalesce(first(body('Verify_New_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure'))))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_Phase1_Output_Variables": { - "actions": { - "Set_ManagerTestOutputs_Phase1": { - "type": "SetVariable", - "inputs": { - "name": "ManagerTestOutputs", - "value": { - "overallResult": "@outputs('Analyze_Phase1_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Analyze_Phase1_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', if(not(outputs('Analyze_Phase1_Provisioning_Results')?['scimVerificationPassed']), concat('SCIM Verification FAILED', if(not(outputs('Analyze_Phase1_Provisioning_Results')?['provisioningLogsPassed']), ', ', ''), if(not(outputs('Analyze_Phase1_Provisioning_Results')?['provisioningLogsPassed']), 'Provisioning Logs FAILED', ''), ' [', outputs('Analyze_Phase1_Provisioning_Results')?['provisioningResult'], ']'), if(not(outputs('Analyze_Phase1_Provisioning_Results')?['provisioningLogsPassed']), concat('Provisioning Logs FAILED [', outputs('Analyze_Phase1_Provisioning_Results')?['provisioningResult'], ']'), outputs('Analyze_Phase1_Provisioning_Results')?['provisioningResult']))), outputs('Analyze_Phase1_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Analyze_Phase1_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Analyze_Phase1_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Cleanup_Delete_Test_User": { - "runAfter": { - "Check_Phase1_Status": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step2_Create_Test_User')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Cleanup_Delete_Initial_Manager": { - "runAfter": { - "Cleanup_Delete_Test_User": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step3_Create_Initial_Manager')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Cleanup_Delete_New_Manager": { - "runAfter": { - "Cleanup_Delete_Initial_Manager": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step4_Create_New_Manager')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Check_Phase1_Status": { - "actions": { - "Phase2_Set_Manager": { - "actions": { - "Step1_Set_Manager_Relationship": { - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step2_Create_Test_User')?['id']}/manager/$ref", - "method": "PUT", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "@@odata.id": "https://graph.microsoft.com/beta/users/@{body('Step3_Create_Initial_Manager')?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Wait_For_Manager_Set": { - "actions": { - "SCIM_Verify_Manager_Set": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_Manager_Set_15s": { - "runAfter": { - "SCIM_Verify_Manager_Set": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Set_Manager_Timestamp": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id']))", - "limit": { - "count": 200, - "timeout": "PT60M" - }, - "type": "Until" - }, - "DoUntil_Poll_Set_Manager_Provisioning_Logs": { - "actions": { - "Verify_Set_Manager_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step2_Create_Test_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20activityDateTime%20ge%20', outputs('Set_Manager_Timestamp'), '%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27manager%27%20or%20p/displayName%20eq%20%27urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager%27)')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delay_Set_Manager_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Set_Manager_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Wait_For_Manager_Set": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), and(or(empty(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue']), equals(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue'], 'null')), equals(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue'], first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id'])))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Set_Manager_Timestamp": { - "runAfter": { - "Step1_Set_Manager_Relationship": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@utcNow()" - } - }, - "type": "Scope" - }, - "Capture_Phase2_Failed_Actions": { - "actions": { - "Get_Phase2_Failed_Actions": { - "type": "Compose", - "inputs": "@result('Phase2_Set_Manager')" - }, - "Filter_Phase2_Failed_Actions": { - "runAfter": { - "Get_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Phase2_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Phase2_Failed_Action_Name": { - "runAfter": { - "Filter_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionName", - "value": "@{if(greater(length(body('Filter_Phase2_Failed_Actions')), 0), first(body('Filter_Phase2_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Phase2_Failed_Action_Response": { - "runAfter": { - "Set_Phase2_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionResponse", - "value": "@{if(greater(length(body('Filter_Phase2_Failed_Actions')), 0), coalesce(first(body('Filter_Phase2_Failed_Actions'))?['outputs'], json('{}')), json('{}'))}" - } - }, - "Set_Phase2_Status_Failed": { - "runAfter": { - "Set_Phase2_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Phase2_Set_Manager": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Phase2_Status_Success": { - "runAfter": { - "Phase2_Set_Manager": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Analyze_Phase2_Provisioning_Results": { - "runAfter": { - "Phase2_Set_Manager": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Phase2_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_Phase2_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "scimVerificationPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id'])), false)", - "provisioningLogsPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), false)", - "setManagerProvisioningStatus": "@if(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "hasProvisioningLogs": "@greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)", - "hasFailures": "@equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')", - "provisioningResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id'])), and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'success', concat(if(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id']))), 'SCIM: SCIM_Verify_Manager_Set: manager not confirmed in SCIM response', ''), if(and(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id']))), not(and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))), '; ', ''), if(not(and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), concat('Provisioning: Verify_Set_Manager_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')), ''))), concat('Failed Action: ', variables('ManagerTestFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('ManagerTestFailedActionResponse'))", - "overallResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Set')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Set')), first(body('SCIM_Query_Initial_Manager')?['Resources'])?['id'])), and(greater(length(coalesce(body('Verify_Set_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Set_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_Phase2_Output_Variables": { - "actions": { - "Set_ManagerTestOutputs_Phase2": { - "type": "SetVariable", - "inputs": { - "name": "ManagerTestOutputs", - "value": { - "overallResult": "@outputs('Analyze_Phase2_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Analyze_Phase2_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Update Initial Manager Phase: ', if(not(outputs('Analyze_Phase2_Provisioning_Results')?['scimVerificationPassed']), concat('SCIM Verification FAILED', if(not(outputs('Analyze_Phase2_Provisioning_Results')?['provisioningLogsPassed']), ', ', ''), if(not(outputs('Analyze_Phase2_Provisioning_Results')?['provisioningLogsPassed']), 'Provisioning Logs FAILED', ''), ' [', outputs('Analyze_Phase2_Provisioning_Results')?['provisioningResult'], ']'), if(not(outputs('Analyze_Phase2_Provisioning_Results')?['provisioningLogsPassed']), concat('Provisioning Logs FAILED [', outputs('Analyze_Phase2_Provisioning_Results')?['provisioningResult'], ']'), outputs('Analyze_Phase2_Provisioning_Results')?['provisioningResult']))), outputs('Analyze_Phase2_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Analyze_Phase2_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Analyze_Phase2_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Check_Phase2_Status": { - "actions": { - "Phase3_Change_Manager": { - "actions": { - "Step1_Change_Manager_Relationship": { - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step2_Create_Test_User')?['id']}/manager/$ref", - "method": "PUT", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "@@odata.id": "https://graph.microsoft.com/beta/users/@{body('Step4_Create_New_Manager')?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Wait_For_Manager_Change": { - "actions": { - "SCIM_Verify_Manager_Change": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_Manager_Change_15s": { - "runAfter": { - "SCIM_Verify_Manager_Change": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Change_Manager_Timestamp": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id']))", - "limit": { - "count": 200, - "timeout": "PT60M" - }, - "type": "Until" - }, - "DoUntil_Poll_Change_Manager_Provisioning_Logs": { - "actions": { - "Verify_Change_Manager_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step2_Create_Test_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20activityDateTime%20ge%20', outputs('Change_Manager_Timestamp'), '%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27manager%27%20or%20p/displayName%20eq%20%27urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager%27)')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delay_Change_Manager_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Change_Manager_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Wait_For_Manager_Change": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue'], first(body('SCIM_Query_New_Manager')?['Resources'])?['id']))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Change_Manager_Timestamp": { - "runAfter": { - "Step1_Change_Manager_Relationship": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@utcNow()" - } - }, - "type": "Scope" - }, - "Capture_Phase3_Failed_Actions": { - "actions": { - "Get_Phase3_Failed_Actions": { - "type": "Compose", - "inputs": "@result('Phase3_Change_Manager')" - }, - "Filter_Phase3_Failed_Actions": { - "runAfter": { - "Get_Phase3_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Phase3_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Phase3_Failed_Action_Name": { - "runAfter": { - "Filter_Phase3_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionName", - "value": "@{if(greater(length(body('Filter_Phase3_Failed_Actions')), 0), first(body('Filter_Phase3_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Phase3_Failed_Action_Response": { - "runAfter": { - "Set_Phase3_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionResponse", - "value": "@{if(greater(length(body('Filter_Phase3_Failed_Actions')), 0), coalesce(first(body('Filter_Phase3_Failed_Actions'))?['outputs'], json('{}')), json('{}'))}" - } - }, - "Set_Phase3_Status_Failed": { - "runAfter": { - "Set_Phase3_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Phase3_Change_Manager": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Phase3_Status_Success": { - "runAfter": { - "Phase3_Change_Manager": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Analyze_Phase3_Provisioning_Results": { - "runAfter": { - "Phase3_Change_Manager": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Phase3_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_Phase3_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "scimVerificationPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id'])), false)", - "provisioningLogsPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), false)", - "changeManagerProvisioningStatus": "@if(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "hasProvisioningLogs": "@greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)", - "hasFailures": "@equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')", - "provisioningResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id'])), and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'success', concat(if(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id']))), 'SCIM: SCIM_Verify_Manager_Change: new manager not confirmed in SCIM response', ''), if(and(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id']))), not(and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))), '; ', ''), if(not(and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), concat('Provisioning: Verify_Change_Manager_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')), ''))), concat('Failed Action: ', variables('ManagerTestFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('ManagerTestFailedActionResponse'))", - "overallResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Change')?['Resources'], json('[]'))), 0), contains(string(body('SCIM_Verify_Manager_Change')), first(body('SCIM_Query_New_Manager')?['Resources'])?['id'])), and(greater(length(coalesce(body('Verify_Change_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Change_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_Phase3_Output_Variables": { - "actions": { - "Set_ManagerTestOutputs_Phase3": { - "type": "SetVariable", - "inputs": { - "name": "ManagerTestOutputs", - "value": { - "overallResult": "@outputs('Analyze_Phase3_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Analyze_Phase3_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Update New Manager Phase: ', if(not(outputs('Analyze_Phase3_Provisioning_Results')?['scimVerificationPassed']), concat('SCIM Verification FAILED', if(not(outputs('Analyze_Phase3_Provisioning_Results')?['provisioningLogsPassed']), ', ', ''), if(not(outputs('Analyze_Phase3_Provisioning_Results')?['provisioningLogsPassed']), 'Provisioning Logs FAILED', ''), ' [', outputs('Analyze_Phase3_Provisioning_Results')?['provisioningResult'], ']'), if(not(outputs('Analyze_Phase3_Provisioning_Results')?['provisioningLogsPassed']), concat('Provisioning Logs FAILED [', outputs('Analyze_Phase3_Provisioning_Results')?['provisioningResult'], ']'), outputs('Analyze_Phase3_Provisioning_Results')?['provisioningResult']))), outputs('Analyze_Phase3_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Analyze_Phase3_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Analyze_Phase3_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Check_Phase3_Status": { - "actions": { - "Phase4_Remove_Manager": { - "actions": { - "Step1_Remove_Manager_Relationship": { - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Step2_Create_Test_User')?['id']}/manager/$ref", - "method": "DELETE", - "headers": { - "Content-Type": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Wait_For_Manager_Remove": { - "actions": { - "SCIM_Verify_Manager_Remove": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['managerUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_Manager_Remove_15s": { - "runAfter": { - "SCIM_Verify_Manager_Remove": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Remove_Manager_Timestamp": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value'])))", - "limit": { - "count": 200, - "timeout": "PT60M" - }, - "type": "Until" - }, - "DoUntil_Poll_Remove_Manager_Provisioning_Logs": { - "actions": { - "Verify_Remove_Manager_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Step2_Create_Test_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20activityDateTime%20ge%20', outputs('Remove_Manager_Timestamp'), '%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27manager%27%20or%20p/displayName%20eq%20%27urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager%27)')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delay_Remove_Manager_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Remove_Manager_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Wait_For_Manager_Remove": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), and(equals(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue'], first(body('SCIM_Query_New_Manager')?['Resources'])?['id']), or(empty(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue']), equals(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue'], 'null'))))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Remove_Manager_Timestamp": { - "runAfter": { - "Step1_Remove_Manager_Relationship": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@utcNow()" - } - }, - "type": "Scope" - }, - "Capture_Phase4_Failed_Actions": { - "actions": { - "Get_Phase4_Failed_Actions": { - "type": "Compose", - "inputs": "@result('Phase4_Remove_Manager')" - }, - "Filter_Phase4_Failed_Actions": { - "runAfter": { - "Get_Phase4_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Phase4_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Phase4_Failed_Action_Name": { - "runAfter": { - "Filter_Phase4_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionName", - "value": "@{if(greater(length(body('Filter_Phase4_Failed_Actions')), 0), first(body('Filter_Phase4_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Phase4_Failed_Action_Response": { - "runAfter": { - "Set_Phase4_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestFailedActionResponse", - "value": "@{if(greater(length(body('Filter_Phase4_Failed_Actions')), 0), coalesce(first(body('Filter_Phase4_Failed_Actions'))?['outputs'], json('{}')), json('{}'))}" - } - }, - "Set_Phase4_Status_Failed": { - "runAfter": { - "Set_Phase4_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Phase4_Remove_Manager": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Phase4_Status_Success": { - "runAfter": { - "Phase4_Remove_Manager": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "ManagerTestScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Analyze_Phase4_Provisioning_Results": { - "runAfter": { - "Phase4_Remove_Manager": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Phase4_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_Phase4_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "scimVerificationPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value']))), false)", - "provisioningLogsPassed": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), false)", - "removeManagerProvisioningStatus": "@if(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "hasProvisioningLogs": "@greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0)", - "hasFailures": "@equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'failure')", - "provisioningResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value']))), and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'success', concat(if(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value'])))), 'SCIM: SCIM_Verify_Manager_Remove: manager not removed in SCIM response', ''), if(and(not(and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value'])))), not(and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')))), '; ', ''), if(not(and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), concat('Provisioning: Verify_Remove_Manager_Provisioning_Logs: ', if(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')), ''))), concat('Failed Action: ', variables('ManagerTestFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('ManagerTestFailedActionResponse'))", - "overallResult": "@if(equals(variables('ManagerTestScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('SCIM_Verify_Manager_Remove')?['Resources'], json('[]'))), 0), or(not(contains(string(body('SCIM_Verify_Manager_Remove')), 'manager')), empty(first(body('SCIM_Verify_Manager_Remove')?['Resources'])?['urn:ietf:params:scim:schemas:extension:enterprise:2.0:User']?['manager']?['value']))), and(greater(length(coalesce(body('Verify_Remove_Manager_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Remove_Manager_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_Phase4_Output_Variables": { - "actions": { - "Set_ManagerTestOutputs_Phase4": { - "type": "SetVariable", - "inputs": { - "name": "ManagerTestOutputs", - "value": { - "overallResult": "@outputs('Analyze_Phase4_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Analyze_Phase4_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Remove Manager Phase: ', if(not(outputs('Analyze_Phase4_Provisioning_Results')?['scimVerificationPassed']), concat('SCIM Verification FAILED', if(not(outputs('Analyze_Phase4_Provisioning_Results')?['provisioningLogsPassed']), ', ', ''), if(not(outputs('Analyze_Phase4_Provisioning_Results')?['provisioningLogsPassed']), 'Provisioning Logs FAILED', ''), ' [', outputs('Analyze_Phase4_Provisioning_Results')?['provisioningResult'], ']'), if(not(outputs('Analyze_Phase4_Provisioning_Results')?['provisioningLogsPassed']), concat('Provisioning Logs FAILED [', outputs('Analyze_Phase4_Provisioning_Results')?['provisioningResult'], ']'), outputs('Analyze_Phase4_Provisioning_Results')?['provisioningResult']))), outputs('Analyze_Phase4_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Analyze_Phase4_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Analyze_Phase4_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "Set_Phase3_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('ManagerTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - } - }, - "runAfter": { - "Set_Phase2_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('ManagerTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - } - }, - "runAfter": { - "Set_Phase1_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('ManagerTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsManagerAttributeSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "UserTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "User_Update_Manager_Test" - ] - } - ] - } - ] - }, - "type": "If" - }, - "Disable_User_Test": { - "actions": { - "DisableUserTest_Disable_User_Test_Actions": { - "actions": { - "DisableUserTest_Phase1_Create_User_And_Verify": { - "actions": { - "DisableUserTest_Disable_Step1_Check_User_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['disableUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}", - "Content-Type": "@{parameters('scimContentType')}" - } - } - }, - "DisableUserTest_Disable_Step2_Create_User": { - "runAfter": { - "DisableUserTest_Disable_Step1_Check_User_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['disableUser']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['disableUser'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['disableUser']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "mail": "@{outputs('Generate_Test_UserNames')['disableUser']}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DisableUserTest_Disable_Assign_User_To_App": { - "runAfter": { - "DisableUserTest_Disable_Step2_Create_User": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('DisableUserTest_Disable_Step2_Create_User')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('DisableUserTest_Disable_Step2_Create_User')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DisableUserTest_Disable_DoUntil_Wait_For_User_Creation": { - "actions": { - "DisableUserTest_Disable_Step3_Fetch_User_By_Filter": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['disableUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DisableUserTest_Disable_Delay_Creation_15s": { - "runAfter": { - "DisableUserTest_Disable_Step3_Fetch_User_By_Filter": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DisableUserTest_Disable_Assign_User_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('DisableUserTest_Disable_Step3_Fetch_User_By_Filter')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DisableUserTest_Disable_Create_Poll_Provisioning_Logs": { - "actions": { - "DisableUserTest_Disable_Create_Check_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('DisableUserTest_Disable_Step2_Create_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DisableUserTest_Disable_Create_Polling_Wait": { - "runAfter": { - "DisableUserTest_Disable_Create_Check_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DisableUserTest_Disable_DoUntil_Wait_For_User_Creation": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "DisableUserTest_Capture_Phase1_Failed_Actions": { - "actions": { - "DisableUserTest_Get_Phase1_Failed_Actions": { - "type": "Compose", - "inputs": "@result('DisableUserTest_Phase1_Create_User_And_Verify')" - }, - "DisableUserTest_Filter_Phase1_Failed_Actions": { - "runAfter": { - "DisableUserTest_Get_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('DisableUserTest_Get_Phase1_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "DisableUserTest_Set_Phase1_Failed_Action_Name": { - "runAfter": { - "DisableUserTest_Filter_Phase1_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserFailedActionName", - "value": "@{if(greater(length(body('DisableUserTest_Filter_Phase1_Failed_Actions')), 0), first(body('DisableUserTest_Filter_Phase1_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "DisableUserTest_Set_Phase1_Failed_Action_Response": { - "runAfter": { - "DisableUserTest_Set_Phase1_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserFailedActionResponse", - "value": "@if(greater(length(body('DisableUserTest_Filter_Phase1_Failed_Actions')), 0), coalesce(first(body('DisableUserTest_Filter_Phase1_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "DisableUserTest_Set_Phase1_Status_Failed": { - "runAfter": { - "DisableUserTest_Set_Phase1_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "DisableUserTest_Phase1_Create_User_And_Verify": [ - "Failed" - ] - }, - "type": "Scope" - }, - "DisableUserTest_Set_Phase1_Status_Success": { - "runAfter": { - "DisableUserTest_Phase1_Create_User_And_Verify": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "DisableUserTest_Analyze_Phase1_Provisioning_Results": { - "runAfter": { - "DisableUserTest_Phase1_Create_User_And_Verify": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "DisableUserTest_Capture_Phase1_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "DisableUserTest_Set_Phase1_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('DisableUserTest_Disable_Create_Check_Provisioning_Logs: ', coalesce(first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'DisableUserTest_Disable_Create_Check_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('DisableUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('DisableUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DisableUserTest_Disable_Create_Check_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "DisableUserTest_Set_Phase1_Output_Variables": { - "actions": { - "DisableUserTest_Set_DisableUserTestOutputs_Phase1": { - "type": "SetVariable", - "inputs": { - "name": "DisableUserTestOutputs", - "value": { - "overallResult": "@outputs('DisableUserTest_Analyze_Phase1_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('DisableUserTest_Analyze_Phase1_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('DisableUserTest_Analyze_Phase1_Provisioning_Results')?['provisioningResult']), outputs('DisableUserTest_Analyze_Phase1_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('DisableUserTest_Analyze_Phase1_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "DisableUserTest_Analyze_Phase1_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "DisableUserTest_Check_Phase1_Status": { - "actions": { - "DisableUserTest_Phase2_Disable_User_And_Verify": { - "actions": { - "DisableUserTest_Disable_Step4_Query_User_By_Id": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['disableUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DisableUserTest_Disable_Step5_Disable_Or_Delete_User": { - "runAfter": { - "DisableUserTest_Disable_Step4_Query_User_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('DisableUserTest_Disable_Step2_Create_User')?['id']}", - "method": "@{if(parameters('IsSoftDeleted'), 'PATCH', 'DELETE')}", - "headers": { - "Content-Type": "application/json" - }, - "body": "@{if(parameters('IsSoftDeleted'), json('{\"accountEnabled\": false}'), null)}", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DisableUserTest_Disable_DoUntil_Wait_For_User_Disable": { - "actions": { - "DisableUserTest_Disable_Step6_Check_User_After_Disable": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['disableUser'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "DisableUserTest_Disable_Delay_Final_15s": { - "runAfter": { - "DisableUserTest_Disable_Step6_Check_User_After_Disable": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DisableUserTest_Disable_Step5_Disable_Or_Delete_User": [ - "Succeeded" - ] - }, - "expression": "@if(parameters('IsSoftDeleted'), and(greater(length(coalesce(body('DisableUserTest_Disable_Step6_Check_User_After_Disable')?['Resources'], json('[]'))), 0), equals(first(body('DisableUserTest_Disable_Step6_Check_User_After_Disable')?['Resources'])?['active'], false)), equals(length(coalesce(body('DisableUserTest_Disable_Step6_Check_User_After_Disable')?['Resources'], json('[]'))), 0))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DisableUserTest_Disable_DoUntil_Poll_Disable_Provisioning_Logs": { - "actions": { - "DisableUserTest_Disable_Verify_Disable_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('DisableUserTest_Disable_Step2_Create_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27', if(parameters('IsSoftDeleted'), 'Disable', 'Delete'), '%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DisableUserTest_Disable_Delay_Disable_Provisioning_Logs_15s": { - "runAfter": { - "DisableUserTest_Disable_Verify_Disable_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DisableUserTest_Disable_DoUntil_Wait_For_User_Disable": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "DisableUserTest_Capture_Phase2_Failed_Actions": { - "actions": { - "DisableUserTest_Get_Phase2_Failed_Actions": { - "type": "Compose", - "inputs": "@result('DisableUserTest_Phase2_Disable_User_And_Verify')" - }, - "DisableUserTest_Filter_Phase2_Failed_Actions": { - "runAfter": { - "DisableUserTest_Get_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('DisableUserTest_Get_Phase2_Failed_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "DisableUserTest_Set_Phase2_Failed_Action_Name": { - "runAfter": { - "DisableUserTest_Filter_Phase2_Failed_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserFailedActionName", - "value": "@{if(greater(length(body('DisableUserTest_Filter_Phase2_Failed_Actions')), 0), first(body('DisableUserTest_Filter_Phase2_Failed_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "DisableUserTest_Set_Phase2_Failed_Action_Response": { - "runAfter": { - "DisableUserTest_Set_Phase2_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserFailedActionResponse", - "value": "@if(greater(length(body('DisableUserTest_Filter_Phase2_Failed_Actions')), 0), coalesce(first(body('DisableUserTest_Filter_Phase2_Failed_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "DisableUserTest_Set_Phase2_Status_Failed": { - "runAfter": { - "DisableUserTest_Set_Phase2_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "DisableUserTest_Phase2_Disable_User_And_Verify": [ - "Failed" - ] - }, - "type": "Scope" - }, - "DisableUserTest_Set_Phase2_Status_Success": { - "runAfter": { - "DisableUserTest_Phase2_Disable_User_And_Verify": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DisableUserScopeExecutionStatus", - "value": "Succeeded" - } - }, - "DisableUserTest_Analyze_Phase2_Provisioning_Results": { - "runAfter": { - "DisableUserTest_Phase2_Disable_User_And_Verify": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "DisableUserTest_Capture_Phase2_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "DisableUserTest_Set_Phase2_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs: ', coalesce(first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'DisableUserTest_Disable_Verify_Disable_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('DisableUserFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('DisableUserFailedActionResponse'))", - "overallResult": "@if(equals(variables('DisableUserScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('DisableUserTest_Disable_Verify_Disable_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "DisableUserTest_Set_Phase2_Output_Variables": { - "actions": { - "DisableUserTest_Set_DisableUserTestOutputs_Phase2": { - "type": "SetVariable", - "inputs": { - "name": "DisableUserTestOutputs", - "value": { - "overallResult": "@outputs('DisableUserTest_Analyze_Phase2_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('DisableUserTest_Analyze_Phase2_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Disable Phase: ', outputs('DisableUserTest_Analyze_Phase2_Provisioning_Results')?['provisioningResult']), outputs('DisableUserTest_Analyze_Phase2_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('DisableUserTest_Analyze_Phase2_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "DisableUserTest_Analyze_Phase2_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "DisableUserTest_Set_Phase1_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('DisableUserTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - }, - "DisableUserTest_Cleanup_Delete_User": { - "runAfter": { - "DisableUserTest_Check_Phase1_Status": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('DisableUserTest_Disable_Step2_Create_User')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsSoftDeleted')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Disable_User_Test" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "UserTests" - ] - } - ] - } - ] - }, - "type": "If" - } - }, - "runAfter": { - "Initialize_All_Group_Test_Variables": [ - "Succeeded" - ] - }, - "type": "Scope" - }, - "GroupTests_Scope": { - "actions": { - "Create_Group_Test": { - "actions": { - "Create_Group_Test_Actions": { - "actions": { - "Create_Group_Initial_Verify_Group_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['createGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Create_Group_Create_Group_Graph": { - "runAfter": { - "Create_Group_Initial_Verify_Group_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{outputs('Generate_Test_GroupNames')['createGroup']}", - "description": "@{parameters('defaultGroupProperties')['description']}", - "mailEnabled": "@parameters('defaultGroupProperties')['mailEnabled']", - "mailNickname": "@{replace(outputs('Generate_Test_GroupNames')['createGroup'], '-', '')}", - "securityEnabled": "@parameters('defaultGroupProperties')['securityEnabled']", - "groupTypes": "@parameters('defaultGroupProperties')['groupTypes']", - "isAssignableToRole": "@parameters('defaultGroupProperties')['isAssignableToRole']", - "visibility": "@{parameters('defaultGroupProperties')['visibility']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Create_Group_Assign_Group_To_App": { - "runAfter": { - "Create_Group_Create_Group_Graph": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Create_Group_Create_Group_Graph')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Create_Group_Create_Group_Graph')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "DoUntil_Poll_Create_Group": { - "actions": { - "Create_Group_Query_Create_Group": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['createGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delay_Create_Group_15s": { - "runAfter": { - "Create_Group_Query_Create_Group": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Create_Group_Assign_Group_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Create_Group_Query_Create_Group')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "DoUntil_Poll_Group_Provisioning_Logs": { - "actions": { - "Verify_Group_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Create_Group_Create_Group_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delay_Group_Provisioning_Logs_15s": { - "runAfter": { - "Verify_Group_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "DoUntil_Poll_Create_Group": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_Failed_Group_Action_Details": { - "actions": { - "Get_Failed_Group_Actions": { - "type": "Compose", - "inputs": "@result('Create_Group_Test_Actions')" - }, - "Filter_Failed_Group_Actions": { - "runAfter": { - "Get_Failed_Group_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_Group_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_Failed_Group_Action_Name": { - "runAfter": { - "Filter_Failed_Group_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateGroupFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_Group_Actions')), 0), first(body('Filter_Failed_Group_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_Failed_Group_Action_Response": { - "runAfter": { - "Set_Failed_Group_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateGroupFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_Group_Actions')), 0), coalesce(first(body('Filter_Failed_Group_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_Create_Group_Test_Status_Failed": { - "runAfter": { - "Set_Failed_Group_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateGroupScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Create_Group_Test_Actions": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_Create_Group_Test_Status_Success": { - "runAfter": { - "Create_Group_Test_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "CreateGroupScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Create_Group_Test_Analyze_Provisioning_Results": { - "runAfter": { - "Create_Group_Test_Actions": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Failed_Group_Action_Details": [ - "Succeeded", - "Skipped" - ], - "Set_Create_Group_Test_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('CreateGroupScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Verify_Group_Provisioning_Logs: ', coalesce(first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Verify_Group_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('CreateGroupFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('CreateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('CreateGroupFailedActionResponse'))", - "overallResult": "@if(equals(variables('CreateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Verify_Group_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Verify_Group_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_CreateGroup_Output_Variables": { - "actions": { - "Set_CreateGroupTestOutputs": { - "type": "SetVariable", - "inputs": { - "name": "CreateGroupTestOutputs", - "value": { - "overallResult": "@outputs('Create_Group_Test_Analyze_Provisioning_Results')?['overallResult']", - "result": "@outputs('Create_Group_Test_Analyze_Provisioning_Results')?['provisioningResult']", - "errorDetails": "@outputs('Create_Group_Test_Analyze_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Create_Group_Test_Analyze_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Delete_Created_Group": { - "runAfter": { - "Set_CreateGroup_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Create_Group_Create_Group_Graph')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsGroupSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "GroupTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Create_Group_Test" - ] - } - ] - } - ] - }, - "type": "If" - }, - "Update_Group_Test": { - "actions": { - "Update_Group_Test_Actions": { - "actions": { - "Update_Group_Verify_Creation_And_Provisioning": { - "actions": { - "Update_Group_Initial_Verify_Group_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update'), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_Group_Create_Group_Graph": { - "runAfter": { - "Update_Group_Initial_Verify_Group_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update')}", - "description": "@{parameters('defaultGroupProperties')['description']}", - "mailEnabled": "@parameters('defaultGroupProperties')['mailEnabled']", - "mailNickname": "@{replace(concat(outputs('Generate_Test_GroupNames')['createGroup'], 'Update'), '-', '')}", - "securityEnabled": "@parameters('defaultGroupProperties')['securityEnabled']", - "groupTypes": "@parameters('defaultGroupProperties')['groupTypes']", - "isAssignableToRole": "@parameters('defaultGroupProperties')['isAssignableToRole']", - "visibility": "@{parameters('defaultGroupProperties')['visibility']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Group_Assign_To_App": { - "runAfter": { - "Update_Group_Create_Group_Graph": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Update_Group_Create_Group_Graph')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Update_Group_Create_Group_Graph')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Group_DoUntil_Wait_For_Creation": { - "actions": { - "Update_Group_Check_Group_Create": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update'), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_Group_Delay_Creation_15s": { - "runAfter": { - "Update_Group_Check_Group_Create": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_Group_Assign_To_App": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Update_Group_Check_Group_Create')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Update_Group_DoUntil_Poll_Create_Provisioning": { - "actions": { - "Update_Group_Verify_Create_Provisioning": { - "type": "Http", - "inputs": { - "uri": "@concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Update_Group_Create_Group_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Group_Delay_Create_Provisioning_15s": { - "runAfter": { - "Update_Group_Verify_Create_Provisioning": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_Group_DoUntil_Wait_For_Creation": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_Update_Group_CreatePhase_Failed": { - "actions": { - "Get_Failed_CreatePhase_Group_Actions": { - "type": "Compose", - "inputs": "@result('Update_Group_Verify_Creation_And_Provisioning')" - }, - "Filter_Failed_CreatePhase_Group_Actions": { - "runAfter": { - "Get_Failed_CreatePhase_Group_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_CreatePhase_Group_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_UpdateGroup_CreatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_CreatePhase_Group_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_CreatePhase_Group_Actions')), 0), first(body('Filter_Failed_CreatePhase_Group_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_UpdateGroup_CreatePhase_Failed_Action_Response": { - "runAfter": { - "Set_UpdateGroup_CreatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_CreatePhase_Group_Actions')), 0), coalesce(first(body('Filter_Failed_CreatePhase_Group_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_UpdateGroup_CreatePhase_Status_Failed": { - "runAfter": { - "Set_UpdateGroup_CreatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Update_Group_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_UpdateGroup_CreatePhase_Status_Success": { - "runAfter": { - "Update_Group_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Update_Group_Analyze_Create_Provisioning": { - "runAfter": { - "Update_Group_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Update_Group_CreatePhase_Failed": [ - "Succeeded", - "Skipped" - ], - "Set_UpdateGroup_CreatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0), coalesce(first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Update_Group_Verify_Create_Provisioning: ', coalesce(first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Update_Group_Verify_Create_Provisioning: NO_LOGS_FOUND'), concat('Failed Action: ', variables('UpdateGroupFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0), equals(toLower(first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('UpdateGroupFailedActionResponse'))", - "overallResult": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Group_Verify_Create_Provisioning')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Update_Group_Verify_Create_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_UpdateGroup_CreatePhase_Output_Variables": { - "actions": { - "Set_UpdateGroupTestOutputs_CreatePhase": { - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupTestOutputs", - "value": { - "overallResult": "@outputs('Update_Group_Analyze_Create_Provisioning')?['overallResult']", - "result": "@if(equals(outputs('Update_Group_Analyze_Create_Provisioning')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('Update_Group_Analyze_Create_Provisioning')?['provisioningResult']), outputs('Update_Group_Analyze_Create_Provisioning')?['provisioningResult'])", - "errorDetails": "@outputs('Update_Group_Analyze_Create_Provisioning')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Update_Group_Analyze_Create_Provisioning": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - }, - "Update_Group_Check_Create_Phase_Status": { - "actions": { - "Update_Group_Verify_Update_And_Provisioning": { - "actions": { - "Update_Group_Query_Group_By_Id": { - "type": "Http", - "inputs": { - "uri": "@concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update'), '%22')", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_Group_Update_Group_Attributes": { - "runAfter": { - "Update_Group_Query_Group_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Update_Group_Create_Group_Graph')?['id']}", - "method": "PATCH", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update-Modified')}", - "description": "Updated Test Group Description" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Group_DoUntil_Wait_For_Updates": { - "actions": { - "Update_Group_Query_Group_By_Id_After_Attributes_Update": { - "type": "Http", - "inputs": { - "uri": "@concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', concat(outputs('Generate_Test_GroupNames')['createGroup'], '-Update-Modified'), '%22')", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Update_Group_Delay_Update_15s": { - "runAfter": { - "Update_Group_Query_Group_By_Id_After_Attributes_Update": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_Group_Update_Group_Attributes": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Update_Group_Query_Group_By_Id_After_Attributes_Update')?['Resources'], json('[]'))), 0), contains(string(body('Update_Group_Query_Group_By_Id_After_Attributes_Update')), '-Modified'))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Update_Group_DoUntil_Poll_Update_Provisioning": { - "actions": { - "Update_Group_Verify_Update_Provisioning": { - "type": "Http", - "inputs": { - "uri": "@concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Update_Group_Create_Group_Graph')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27&$top=1&$orderby=activityDateTime%20desc')", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Update_Group_Delay_Update_Provisioning_15s": { - "runAfter": { - "Update_Group_Verify_Update_Provisioning": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Update_Group_DoUntil_Wait_For_Updates": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_Update_Group_UpdatePhase_Failed": { - "actions": { - "Get_Failed_UpdatePhase_Group_Actions": { - "type": "Compose", - "inputs": "@result('Update_Group_Verify_Update_And_Provisioning')" - }, - "Filter_Failed_UpdatePhase_Group_Actions": { - "runAfter": { - "Get_Failed_UpdatePhase_Group_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_UpdatePhase_Group_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_UpdateGroup_UpdatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_UpdatePhase_Group_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_UpdatePhase_Group_Actions')), 0), first(body('Filter_Failed_UpdatePhase_Group_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_UpdateGroup_UpdatePhase_Failed_Action_Response": { - "runAfter": { - "Set_UpdateGroup_UpdatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_UpdatePhase_Group_Actions')), 0), coalesce(first(body('Filter_Failed_UpdatePhase_Group_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_UpdateGroup_UpdatePhase_Status_Failed": { - "runAfter": { - "Set_UpdateGroup_UpdatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Update_Group_Verify_Update_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_UpdateGroup_UpdatePhase_Status_Success": { - "runAfter": { - "Update_Group_Verify_Update_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Update_Group_Analyze_Update_Provisioning": { - "runAfter": { - "Update_Group_Verify_Update_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_Update_Group_UpdatePhase_Failed": [ - "Succeeded", - "Skipped" - ], - "Set_UpdateGroup_UpdatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0), coalesce(first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Update_Group_Verify_Update_Provisioning: ', coalesce(first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Update_Group_Verify_Update_Provisioning: NO_LOGS_FOUND'), concat('Failed Action: ', variables('UpdateGroupFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0), equals(toLower(first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('UpdateGroupFailedActionResponse'))", - "overallResult": "@if(equals(variables('UpdateGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Update_Group_Verify_Update_Provisioning')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Update_Group_Verify_Update_Provisioning')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_UpdateGroup_UpdatePhase_Output_Variables": { - "actions": { - "Set_UpdateGroupTestOutputs_UpdatePhase": { - "type": "SetVariable", - "inputs": { - "name": "UpdateGroupTestOutputs", - "value": { - "overallResult": "@outputs('Update_Group_Analyze_Update_Provisioning')?['overallResult']", - "result": "@if(equals(outputs('Update_Group_Analyze_Update_Provisioning')?['overallResult'], 'FAILED'), concat('Update Phase: ', outputs('Update_Group_Analyze_Update_Provisioning')?['provisioningResult']), outputs('Update_Group_Analyze_Update_Provisioning')?['provisioningResult'])", - "errorDetails": "@outputs('Update_Group_Analyze_Update_Provisioning')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Update_Group_Analyze_Update_Provisioning": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "Set_UpdateGroup_CreatePhase_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('UpdateGroupTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - }, - "Update_Group_Cleanup_Delete": { - "runAfter": { - "Update_Group_Check_Create_Phase_Status": [ - "Succeeded", - "Failed", - "TimedOut", - "Skipped" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Update_Group_Create_Group_Graph')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsGroupSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "GroupTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Update_Group_Test" - ] - } - ] - } - ] - }, - "type": "If" - }, - "Delete_Group_Test": { - "actions": { - "Delete_Group_Test_Actions": { - "actions": { - "Delete_Group_Verify_Creation_And_Provisioning": { - "actions": { - "Delete_DoUntil_Wait_For_Group_Creation": { - "actions": { - "Delete_Step3_Fetch_Group_By_Filter": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['deleteGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delete_Group_Delay_Creation_15s": { - "runAfter": { - "Delete_Step3_Fetch_Group_By_Filter": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Delete_Group_Assign_App_Role": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Delete_Step3_Fetch_Group_By_Filter')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Delete_Group_DoUntil_Poll_Create_Provisioning_Logs": { - "actions": { - "Delete_Group_Verify_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Delete_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delete_Group_Delay_Create_Provisioning_Logs_15s": { - "runAfter": { - "Delete_Group_Verify_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Delete_DoUntil_Wait_For_Group_Creation": [ - "Succeeded" - ] - }, - "expression": "@greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Delete_Step2_Create_Group": { - "runAfter": { - "Delete_Step1_Check_Group_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{outputs('Generate_Test_GroupNames')['deleteGroup']}", - "description": "@{parameters('defaultGroupProperties')['description']}", - "mailEnabled": "@parameters('defaultGroupProperties')['mailEnabled']", - "mailNickname": "@{replace(outputs('Generate_Test_GroupNames')['deleteGroup'], '-', '')}", - "securityEnabled": "@parameters('defaultGroupProperties')['securityEnabled']", - "groupTypes": "@parameters('defaultGroupProperties')['groupTypes']", - "isAssignableToRole": "@parameters('defaultGroupProperties')['isAssignableToRole']", - "visibility": "@{parameters('defaultGroupProperties')['visibility']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delete_Step1_Check_Group_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['deleteGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delete_Group_Assign_App_Role": { - "runAfter": { - "Delete_Step2_Create_Group": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Delete_Step2_Create_Group')?['id']}/appRoleAssignments", - "method": "POST", - "body": { - "principalId": "@{body('Delete_Step2_Create_Group')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "type": "Scope" - }, - "Capture_DeleteGroup_CreatePhase_Failed_Actions": { - "actions": { - "Get_Failed_DeleteGroup_CreatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Delete_Group_Verify_Creation_And_Provisioning')" - }, - "Filter_Failed_DeleteGroup_CreatePhase_Actions": { - "runAfter": { - "Get_Failed_DeleteGroup_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_DeleteGroup_CreatePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_DeleteGroup_CreatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_DeleteGroup_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_DeleteGroup_CreatePhase_Actions')), 0), first(body('Filter_Failed_DeleteGroup_CreatePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_DeleteGroup_CreatePhase_Failed_Action_Response": { - "runAfter": { - "Set_DeleteGroup_CreatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_DeleteGroup_CreatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_DeleteGroup_CreatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_DeleteGroup_CreatePhase_Status_Failed": { - "runAfter": { - "Set_DeleteGroup_CreatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Delete_Group_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_DeleteGroup_CreatePhase_Status_Success": { - "runAfter": { - "Delete_Group_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Delete_Group_Analyze_Create_Provisioning_Results": { - "runAfter": { - "Delete_Group_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_DeleteGroup_CreatePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_DeleteGroup_CreatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Delete_Group_Verify_Create_Provisioning_Logs: ', coalesce(first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Delete_Group_Verify_Create_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('DeleteGroupFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('DeleteGroupFailedActionResponse'))", - "overallResult": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Delete_Group_Verify_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Delete_Group_Check_Create_Phase_Status": { - "actions": { - "Delete_Group_Verify_Delete_And_Provisioning": { - "actions": { - "Delete_Step4_Query_Group_By_Id": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['deleteGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delete_Step5_Delete_Group_By_Id": { - "runAfter": { - "Delete_Step4_Query_Group_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Delete_Step2_Create_Group')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delete_DoUntil_Wait_For_Group_Deletion": { - "actions": { - "Delete_Step6_Check_Group_Exists_Final": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['deleteGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Delete_Group_Delay_Final_15s": { - "runAfter": { - "Delete_Step6_Check_Group_Exists_Final": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Delete_Step5_Delete_Group_By_Id": [ - "Succeeded" - ] - }, - "expression": "@equals(length(coalesce(body('Delete_Step6_Check_Group_Exists_Final')?['Resources'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Delete_Group_DoUntil_Poll_Delete_Provisioning_Logs": { - "actions": { - "Delete_Group_Verify_Delete_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Delete_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Delete%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Delete_Group_Delay_Delete_Provisioning_Logs_15s": { - "runAfter": { - "Delete_Group_Verify_Delete_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Delete_DoUntil_Wait_For_Group_Deletion": [ - "Succeeded", - "Failed", - "TimedOut" - ] - }, - "expression": "@greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0)", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_DeleteGroup_DeletePhase_Failed_Actions": { - "actions": { - "Get_Failed_DeleteGroup_DeletePhase_Actions": { - "type": "Compose", - "inputs": "@result('Delete_Group_Verify_Delete_And_Provisioning')" - }, - "Filter_Failed_DeleteGroup_DeletePhase_Actions": { - "runAfter": { - "Get_Failed_DeleteGroup_DeletePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_DeleteGroup_DeletePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_DeleteGroup_DeletePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_DeleteGroup_DeletePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_DeleteGroup_DeletePhase_Actions')), 0), first(body('Filter_Failed_DeleteGroup_DeletePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_DeleteGroup_DeletePhase_Failed_Action_Response": { - "runAfter": { - "Set_DeleteGroup_DeletePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_DeleteGroup_DeletePhase_Actions')), 0), coalesce(first(body('Filter_Failed_DeleteGroup_DeletePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_DeleteGroup_DeletePhase_Status_Failed": { - "runAfter": { - "Set_DeleteGroup_DeletePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Delete_Group_Verify_Delete_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_DeleteGroup_DeletePhase_Status_Success": { - "runAfter": { - "Delete_Group_Verify_Delete_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Delete_Group_Analyze_Delete_Provisioning_Results": { - "runAfter": { - "Delete_Group_Verify_Delete_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_DeleteGroup_DeletePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_DeleteGroup_DeletePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Delete_Group_Verify_Delete_Provisioning_Logs: ', coalesce(first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Delete_Group_Verify_Delete_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('DeleteGroupFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('DeleteGroupFailedActionResponse'))", - "overallResult": "@if(equals(variables('DeleteGroupScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Delete_Group_Verify_Delete_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_DeleteGroup_Output_Variables": { - "actions": { - "Set_DeleteGroupTestOutputs_DeletePhase": { - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupTestOutputs", - "value": { - "overallResult": "@coalesce(outputs('Delete_Group_Analyze_Delete_Provisioning_Results')?['overallResult'], 'FAILED')", - "result": "@if(equals(coalesce(outputs('Delete_Group_Analyze_Delete_Provisioning_Results')?['overallResult'], 'FAILED'), 'FAILED'), concat('Delete Phase: ', coalesce(outputs('Delete_Group_Analyze_Delete_Provisioning_Results')?['provisioningResult'], 'SKIPPED')), coalesce(outputs('Delete_Group_Analyze_Delete_Provisioning_Results')?['provisioningResult'], 'SKIPPED'))", - "errorDetails": "@coalesce(outputs('Delete_Group_Analyze_Delete_Provisioning_Results')?['provisioningErrorDetails'], null)" - } - } - } - }, - "runAfter": { - "Delete_Group_Analyze_Delete_Provisioning_Results": [ - "Succeeded" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "Set_DeleteGroup_CreatePhase_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('DeleteGroupTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - }, - "Set_DeleteGroup_CreatePhase_Output_Variables": { - "actions": { - "Set_DeleteGroupTestOutputs_CreatePhase": { - "type": "SetVariable", - "inputs": { - "name": "DeleteGroupTestOutputs", - "value": { - "overallResult": "@outputs('Delete_Group_Analyze_Create_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Delete_Group_Analyze_Create_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('Delete_Group_Analyze_Create_Provisioning_Results')?['provisioningResult']), outputs('Delete_Group_Analyze_Create_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Delete_Group_Analyze_Create_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Delete_Group_Analyze_Create_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsGroupSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "GroupTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Delete_Group_Test" - ] - } - ] - } - ] - }, - "type": "If" - }, - "Group_Update_Add_Member_Test": { - "actions": { - "Group_Update_Add_Member_Test_Actions": { - "actions": { - "Add_Member_Verify_Creation_And_Provisioning": { - "actions": { - "Add_DoUntil_Wait_For_Initial_Sync": { - "actions": { - "Add_Step4_Check_Group_And_User": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Add_Step4_Check_User": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['memberUser1'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Add_Delay_Initial_15s": { - "runAfter": { - "Add_Step4_Check_Group_And_User": [ - "Succeeded", - "Failed" - ], - "Add_Step4_Check_User": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Add_Assign_Group_To_App": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Add_Step4_Check_Group_And_User')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('Add_Step4_Check_User')?['Resources'], json('[]'))), 0))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Add_Member_DoUntil_Poll_Group_Create_Provisioning_Logs": { - "actions": { - "Add_Member_Verify_Group_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Add_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Member_Delay_Group_Create_Provisioning_Logs_15s": { - "runAfter": { - "Add_Member_Verify_Group_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ], - "Add_Member_Verify_User_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - }, - "Add_Member_Verify_User_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Add_Step3_Create_Member_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - } - }, - "runAfter": { - "Add_DoUntil_Wait_For_Initial_Sync": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Add_Assign_Group_To_App": { - "runAfter": { - "Add_Assign_User_To_App": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/servicePrincipals/@{parameters('servicePrincipalId')}/appRoleAssignedTo", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Add_Step2_Create_Group')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Assign_User_To_App": { - "runAfter": { - "Add_Step3_Create_Member_User": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Add_Step3_Create_Member_User')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Add_Step3_Create_Member_User')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Step3_Create_Member_User": { - "runAfter": { - "Add_Step2_Create_Group": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['memberUser1']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['memberUser1'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['memberUser1']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "mail": "@{outputs('Generate_Test_UserNames')['memberUser1']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Step2_Create_Group": { - "runAfter": { - "Add_Step1_Check_Group_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{outputs('Generate_Test_GroupNames')['memberGroup']}", - "description": "@{parameters('defaultGroupProperties')['description']}", - "mailEnabled": "@parameters('defaultGroupProperties')['mailEnabled']", - "mailNickname": "@{replace(outputs('Generate_Test_GroupNames')['memberGroup'], '-', '')}", - "securityEnabled": "@parameters('defaultGroupProperties')['securityEnabled']", - "groupTypes": "@parameters('defaultGroupProperties')['groupTypes']", - "isAssignableToRole": "@parameters('defaultGroupProperties')['isAssignableToRole']", - "visibility": "@{parameters('defaultGroupProperties')['visibility']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Step1_Check_Group_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - } - }, - "type": "Scope" - }, - "Add_Member_Analyze_Group_Create_Provisioning_Results": { - "runAfter": { - "Add_Member_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_AddMember_CreatePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_AddMember_CreatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningStatus": "@concat('Group: ', if(greater(length(coalesce(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS'), ', User: ', if(greater(length(coalesce(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS'))", - "provisioningResult": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0)), concat('Group: ', coalesce(first(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), ', User: ', coalesce(first(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN')), 'PROVISIONING_LOGS_MISSING'), concat('Failed Action: ', variables('AddMemberFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(or(and(greater(length(coalesce(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), and(greater(length(coalesce(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure'))), json(concat('{\"group\":', string(coalesce(first(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), ',\"user\":', string(coalesce(first(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), '}')), null), variables('AddMemberFailedActionResponse'))", - "overallResult": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0)), and(equals(toLower(coalesce(first(body('Add_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), equals(toLower(coalesce(first(body('Add_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Add_Member_Check_Create_Phase_Status": { - "actions": { - "Add_Member_Verify_Update_And_Provisioning": { - "actions": { - "Add_Step5_Add_User_To_Group": { - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Add_Step2_Create_Group')?['id']}/members/$ref", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "@@odata.id": "https://graph.microsoft.com/beta/users/@{body('Add_Step3_Create_Member_User')?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_DoUntil_Wait_For_Member_Addition": { - "actions": { - "Add_Step6_Query_Group_With_Members": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Add_Delay_Member_15s": { - "runAfter": { - "Add_Step6_Query_Group_With_Members": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Add_Step5_Add_User_To_Group": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Add_Step6_Query_Group_With_Members')?['Resources'], json('[]'))), 0), and(greater(length(coalesce(first(coalesce(body('Add_Step6_Query_Group_With_Members')?['Resources'], json('[]')))?['members'], json('[]'))), 0), contains(string(coalesce(first(coalesce(body('Add_Step6_Query_Group_With_Members')?['Resources'], json('[]')))?['members'], json('[]'))), coalesce(first(coalesce(body('Add_Step4_Check_User')?['Resources'], json('[]')))?['id'], ''))))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Add_Step7_Query_Group_By_Id": { - "runAfter": { - "Add_DoUntil_Wait_For_Member_Addition": [ - "Succeeded", - "TimedOut", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Add_Member_DoUntil_Poll_Add_Member_Provisioning_Logs": { - "actions": { - "Add_Member_Verify_Add_Member_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Add_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27members%27)&$orderby=activityDateTime%20desc&$top=1')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Member_Delay_Add_Member_Provisioning_Logs_15s": { - "runAfter": { - "Add_Member_Verify_Add_Member_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Add_Step7_Query_Group_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "expression": "@and(greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0), and(empty(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue']), not(empty(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue']))))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_AddMember_AddMemberPhase_Failed_Actions": { - "actions": { - "Get_Failed_AddMember_UpdatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Add_Member_Verify_Update_And_Provisioning')" - }, - "Filter_Failed_AddMember_UpdatePhase_Actions": { - "runAfter": { - "Get_Failed_AddMember_UpdatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_AddMember_UpdatePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_AddMember_UpdatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_AddMember_UpdatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_AddMember_UpdatePhase_Actions')), 0), first(body('Filter_Failed_AddMember_UpdatePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_AddMember_UpdatePhase_Failed_Action_Response": { - "runAfter": { - "Set_AddMember_UpdatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_AddMember_UpdatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_AddMember_UpdatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_AddMember_UpdatePhase_Status_Failed": { - "runAfter": { - "Set_AddMember_UpdatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Add_Member_Verify_Update_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_AddMember_UpdatePhase_Status_Success": { - "runAfter": { - "Add_Member_Verify_Update_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Add_Member_Analyze_Add_Member_Provisioning_Results": { - "runAfter": { - "Add_Member_Verify_Update_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_AddMember_AddMemberPhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_AddMember_UpdatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND')", - "provisioningResult": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Add_Member_Verify_Add_Member_Provisioning_Logs: ', coalesce(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Add_Member_Verify_Add_Member_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('AddMemberFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('AddMemberFailedActionResponse'))", - "overallResult": "@if(equals(variables('AddMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Add_Member_Verify_Add_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_AddMember_UpdatePhase_Output_Variables": { - "actions": { - "Set_AddMemberTestOutputs_UpdatePhase": { - "type": "SetVariable", - "inputs": { - "name": "AddMemberTestOutputs", - "value": { - "overallResult": "@outputs('Add_Member_Analyze_Add_Member_Provisioning_Results')?['overallResult']", - "result": "@outputs('Add_Member_Analyze_Add_Member_Provisioning_Results')?['provisioningResult']", - "errorDetails": "@outputs('Add_Member_Analyze_Add_Member_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Add_Member_Analyze_Add_Member_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "Set_AddMember_CreatePhase_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@toLower(variables('AddMemberTestOutputs')['overallResult'])", - "passed" - ] - } - ] - }, - "type": "If" - }, - "Add_Cleanup_Delete_User": { - "runAfter": { - "Add_Member_Check_Create_Phase_Status": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Add_Step3_Create_Member_User')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Add_Cleanup_Delete_Group": { - "runAfter": { - "Add_Cleanup_Delete_User": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Add_Step2_Create_Group')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Capture_AddMember_CreatePhase_Failed_Actions": { - "actions": { - "Get_Failed_AddMember_CreatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Add_Member_Verify_Creation_And_Provisioning')" - }, - "Filter_Failed_AddMember_CreatePhase_Actions": { - "runAfter": { - "Get_Failed_AddMember_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_AddMember_CreatePhase_Actions')", - "where": "@equals(item()?['status'], 'Failed')" - } - }, - "Set_AddMember_CreatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_AddMember_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberFailedActionName", - "value": "@{if(greater(length(body('Filter_Failed_AddMember_CreatePhase_Actions')), 0), first(body('Filter_Failed_AddMember_CreatePhase_Actions'))?['name'], 'Unknown_Action')}" - } - }, - "Set_AddMember_CreatePhase_Failed_Action_Response": { - "runAfter": { - "Set_AddMember_CreatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_AddMember_CreatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_AddMember_CreatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_AddMember_CreatePhase_Status_Failed": { - "runAfter": { - "Set_AddMember_CreatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Add_Member_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_AddMember_CreatePhase_Status_Success": { - "runAfter": { - "Add_Member_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "AddMemberScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Set_AddMember_CreatePhase_Output_Variables": { - "actions": { - "Set_AddMemberTestOutputs_CreatePhase": { - "type": "SetVariable", - "inputs": { - "name": "AddMemberTestOutputs", - "value": { - "overallResult": "@outputs('Add_Member_Analyze_Group_Create_Provisioning_Results')?['overallResult']", - "result": "@outputs('Add_Member_Analyze_Group_Create_Provisioning_Results')?['provisioningResult']", - "errorDetails": "@outputs('Add_Member_Analyze_Group_Create_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Add_Member_Analyze_Group_Create_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsGroupSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "GroupTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Group_Update_Add_Member_Test" - ] - } - ] - } - ] - }, - "type": "If" - }, - "Group_Update_Remove_Member_Test": { - "actions": { - "Group_Update_Remove_Member_Test_-_Actions": { - "actions": { - "Remove_Member_Test_-_Verify_Creation_And_Provisioning": { - "actions": { - "Remove_DoUntil_Wait_For_Initial_Member_Addition": { - "actions": { - "Remove_Step4a_Check_Group_With_Member": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '-Remove%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Remove_Step4b_Check_User": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Users?filter=userName%20eq%20%22', coalesce(outputs('Generate_Test_UserNames')?['memberUser2'], ''), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Remove_Delay_Initial_15s": { - "runAfter": { - "Remove_Step4a_Check_Group_With_Member": [ - "Succeeded", - "Failed" - ], - "Remove_Step4b_Check_User": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Remove_Step4_Add_User_To_Group": [ - "Succeeded" - ] - }, - "expression": "@and(and(greater(length(coalesce(body('Remove_Step4a_Check_Group_With_Member')?['Resources'], json('[]'))), 0), greater(length(coalesce(body('Remove_Step4b_Check_User')?['Resources'], json('[]'))), 0)), and(not(empty(first(coalesce(body('Remove_Step4b_Check_User')?['Resources'], json('[]'))))), contains(string(body('Remove_Step4a_Check_Group_With_Member')), coalesce(first(coalesce(body('Remove_Step4b_Check_User')?['Resources'], json('[]')))?['id'], ''))))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Remove_Member_DoUntil_Poll_Group_Create_Provisioning_Logs": { - "actions": { - "Remove_Member_Verify_Group_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Remove_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27members%27)&$top=1&$orderby=activityDateTime%20desc')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Member_Verify_User_Create_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$top=1&$orderby=activityDateTime%20desc&$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Remove_Step3_Create_Member_User')?['id'], '%27%20and%20provisioningAction%20eq%20%27Create%27')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Member_Delay_Group_Create_Provisioning_Logs_15s": { - "runAfter": { - "Remove_Member_Verify_Group_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ], - "Remove_Member_Verify_User_Create_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Remove_DoUntil_Wait_For_Initial_Member_Addition": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0), and(not(empty(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue'])), empty(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue'])))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Remove_Step4_Add_User_To_Group": { - "runAfter": { - "Remove_Assign_Group_To_App": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Remove_Step2_Create_Group')?['id']}/members/$ref", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "@@odata.id": "https://graph.microsoft.com/beta/users/@{body('Remove_Step3_Create_Member_User')?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Assign_Group_To_App": { - "runAfter": { - "Remove_Assign_User_To_App": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/servicePrincipals/@{parameters('servicePrincipalId')}/appRoleAssignedTo", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Remove_Step2_Create_Group')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Assign_User_To_App": { - "runAfter": { - "Remove_Step3_Create_Member_User": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Remove_Step3_Create_Member_User')?['id']}/appRoleAssignments", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "principalId": "@{body('Remove_Step3_Create_Member_User')?['id']}", - "resourceId": "@{parameters('servicePrincipalId')}", - "appRoleId": "@{first(body('Get_App_Roles')?['appRoles'])?['id']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Step3_Create_Member_User": { - "runAfter": { - "Remove_Step2_Create_Group": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "accountEnabled": true, - "displayName": "@{outputs('Generate_Test_UserNames')['memberUser2']}", - "mailNickname": "@{replace(first(split(outputs('Generate_Test_UserNames')['memberUser2'],'@')),'.','')}", - "userPrincipalName": "@{outputs('Generate_Test_UserNames')['memberUser2']}", - "givenName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName']), concat('Given', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['givenName'])}", - "surname": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname']), concat('Sur', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['surname'])}", - "jobTitle": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle']), concat('Title', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['jobTitle'])}", - "department": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department']), concat('Dept', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['department'])}", - "companyName": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName']), concat('Company', substring(guid(),0,6)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['companyName'])}", - "businessPhones": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['businessPhones'], json(concat('[\"+ 1-555-', substring(guid(),0,4), '\"]')))", - "mobilePhone": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['mobilePhone'])}", - "officeLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation']), concat('Office', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['officeLocation'])}", - "preferredLanguage": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage']), 'en-US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['preferredLanguage'])}", - "employeeId": "@{substring(guid(), 0, 8)}", - "employeeType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType']), 'Employee', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeType'])}", - "streetAddress": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress']), concat('Street', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['streetAddress'])}", - "city": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city']), concat('City', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['city'])}", - "state": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state']), 'WA', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['state'])}", - "country": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['country'])}", - "postalCode": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['postalCode'])}", - "usageLocation": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation']), 'US', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['usageLocation'])}", - "otherMails": "@coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['otherMails'], json(concat('[\"', substring(guid(),0,8), '@example.com\"]')))", - "mail": "@{outputs('Generate_Test_UserNames')['memberUser2']}", - "faxNumber": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber']), concat('+1-555-', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['faxNumber'])}", - "userType": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType']), 'Member', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['userType'])}", - "employeeOrgData": "@if(or(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'])), json(concat('{\"division\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), concat('Div', substring(guid(),0,4)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division']), '\",\"costCenter\":\"', if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), substring(guid(),0,5), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter']), '\"}')), json(concat('{\"division\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['division'], '\",\"costCenter\":\"', parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['employeeOrgData']['costCenter'], '\"}')))", - "passwordProfile": { - "forceChangePasswordNextSignIn": "@{coalesce(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['forceChangePasswordNextSignIn'], true)}", - "password": "@{if(empty(parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password']), concat('Tmp!', substring(guid(),0,8), '@', substring(guid(),24,8)), parameters('defaultUserProperties')[outputs('Generate_Test_UserNames')['index']]['passwordProfile']['password'])}" - } - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Step2_Create_Group": { - "runAfter": { - "Remove_Step1_Check_Group_Exists": [ - "Succeeded" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups", - "method": "POST", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "displayName": "@{concat(outputs('Generate_Test_GroupNames')['memberGroup'], '-Remove')}", - "description": "@{parameters('defaultGroupProperties')['description']}", - "mailEnabled": "@parameters('defaultGroupProperties')['mailEnabled']", - "mailNickname": "@{replace(concat(outputs('Generate_Test_GroupNames')['memberGroup'], 'Remove'), '-', '')}", - "securityEnabled": "@parameters('defaultGroupProperties')['securityEnabled']", - "groupTypes": "@parameters('defaultGroupProperties')['groupTypes']", - "isAssignableToRole": "@parameters('defaultGroupProperties')['isAssignableToRole']", - "visibility": "@{parameters('defaultGroupProperties')['visibility']}" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Step1_Check_Group_Exists": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '-Remove%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - } - }, - "type": "Scope" - }, - "Remove_Member_Analyze_Group_Create_Provisioning_Results": { - "runAfter": { - "Remove_Member_Test_-_Verify_Creation_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_RemoveMember_CreatePhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_RemoveMember_CreatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningStatus": "@concat('Group: ', if(greater(length(coalesce(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS'), ', User: ', if(greater(length(coalesce(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS'))", - "provisioningResult": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0)), concat('Group: ', if(equals(toLower(coalesce(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Remove_Member_Verify_Group_Create_Provisioning_Logs: ', coalesce(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), ', User: ', if(equals(toLower(coalesce(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Remove_Member_Verify_User_Create_Provisioning_Logs: ', coalesce(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN')))), 'PROVISIONING_LOGS_MISSING'), concat('Failed Action: ', variables('RemoveMemberFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(or(and(greater(length(coalesce(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), and(greater(length(coalesce(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure'))), json(concat('{\"group\":', string(coalesce(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), ',\"user\":', string(coalesce(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null)), '}')), null), variables('RemoveMemberFailedActionResponse'))", - "overallResult": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(and(and(greater(length(coalesce(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'], json('[]'))), 0), greater(length(coalesce(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'], json('[]'))), 0)), and(equals(toLower(coalesce(first(body('Remove_Member_Verify_Group_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), equals(toLower(coalesce(first(body('Remove_Member_Verify_User_Create_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'))), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Remove_Member_Check_Create_Phase_Status": { - "actions": { - "Remove_Member_Verify_Update_And_Provisioning": { - "actions": { - "Remove_Step5_Remove_User_From_Group": { - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Remove_Step2_Create_Group')?['id']}/members/@{body('Remove_Step3_Create_Member_User')?['id']}/$ref", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_DoUntil_Wait_For_Member_Removal": { - "actions": { - "Remove_Step6_Query_Group_After_Remove": { - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', outputs('Generate_Test_GroupNames')['memberGroup'], '-Remove%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Remove_Delay_Final_15s": { - "runAfter": { - "Remove_Step6_Query_Group_After_Remove": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Remove_Step5_Remove_User_From_Group": [ - "Succeeded" - ] - }, - "expression": "@and(greater(length(coalesce(body('Remove_Step6_Query_Group_After_Remove')?['Resources'], json('[]'))), 0), and(not(empty(first(coalesce(body('Remove_Step4b_Check_User')?['Resources'], json('[]'))))), not(contains(string(body('Remove_Step6_Query_Group_After_Remove')), coalesce(first(coalesce(body('Remove_Step4b_Check_User')?['Resources'], json('[]')))?['id'], '')))))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - }, - "Remove_Step7_Query_Group_By_Id": { - "runAfter": { - "Remove_DoUntil_Wait_For_Member_Removal": [ - "Succeeded", - "TimedOut", - "Failed" - ] - }, - "type": "Http", - "inputs": { - "uri": "@{concat(parameters('scimEndpoint'), '/Groups?filter=displayName%20eq%20%22', concat(outputs('Generate_Test_GroupNames')['memberGroup'], '-Remove'), '%22')}", - "method": "GET", - "headers": { - "Authorization": "@{concat('Bearer ', parameters('scimBearerToken'))}", - "Accept": "@{parameters('scimContentType')}" - } - } - }, - "Remove_Member_DoUntil_Poll_Remove_Member_Provisioning_Logs": { - "actions": { - "Remove_Member_Verify_Remove_Member_Provisioning_Logs": { - "type": "Http", - "inputs": { - "uri": "@{concat('https://graph.microsoft.com/beta/auditLogs/provisioning?$filter=jobId%20eq%20%27', outputs('Compose_SyncJobId'), '%27%20and%20servicePrincipal/id%20eq%20%27', parameters('servicePrincipalId'), '%27%20and%20sourceIdentity/id%20eq%20%27', body('Remove_Step2_Create_Group')?['id'], '%27%20and%20provisioningAction%20eq%20%27Update%27%20and%20modifiedProperties/any(p:%20p/displayName%20eq%20%27members%27)&$orderby=activityDateTime%20desc&$top=1')}", - "method": "GET", - "headers": { - "Accept": "application/json" - }, - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Member_Delay_Remove_Member_Provisioning_Logs_15s": { - "runAfter": { - "Remove_Member_Verify_Remove_Member_Provisioning_Logs": [ - "Succeeded", - "Failed" - ] - }, - "type": "Wait", - "inputs": { - "interval": { - "count": 15, - "unit": "Second" - } - } - } - }, - "runAfter": { - "Remove_Step7_Query_Group_By_Id": [ - "Succeeded", - "Failed" - ] - }, - "expression": "@and(greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0), and(not(empty(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['oldValue'])), empty(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['modifiedProperties'][0]?['newValue'])))", - "limit": { - "count": 150, - "timeout": "PT40M" - }, - "type": "Until" - } - }, - "type": "Scope" - }, - "Capture_RemoveMember_RemoveMemberPhase_Failed_Actions": { - "actions": { - "Get_Failed_RemoveMember_RemoveMemberPhase_Actions": { - "type": "Compose", - "inputs": "@result('Remove_Member_Verify_Update_And_Provisioning')" - }, - "Filter_Failed_RemoveMember_RemoveMemberPhase_Actions": { - "runAfter": { - "Get_Failed_RemoveMember_RemoveMemberPhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_RemoveMember_RemoveMemberPhase_Actions')", - "where": "@or(equals(item()?['status'], 'Failed'), equals(item()?['status'], 'TimedOut'))" - } - }, - "Set_RemoveMember_RemoveMemberPhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_RemoveMember_RemoveMemberPhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberFailedActionName", - "value": "@{coalesce(first(body('Filter_Failed_RemoveMember_RemoveMemberPhase_Actions'))?['name'], 'Unknown')}" - } - }, - "Set_RemoveMember_RemoveMemberPhase_Failed_Action_Response": { - "runAfter": { - "Set_RemoveMember_RemoveMemberPhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_RemoveMember_RemoveMemberPhase_Actions')), 0), coalesce(first(body('Filter_Failed_RemoveMember_RemoveMemberPhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_RemoveMember_RemoveMemberPhase_Status_Failed": { - "runAfter": { - "Set_RemoveMember_RemoveMemberPhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Remove_Member_Verify_Update_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_RemoveMember_UpdatePhase_Status_Success": { - "runAfter": { - "Remove_Member_Verify_Update_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Remove_Member_Analyze_Remove_Member_Provisioning_Results": { - "runAfter": { - "Remove_Member_Verify_Update_And_Provisioning": [ - "Succeeded", - "Failed", - "TimedOut" - ], - "Capture_RemoveMember_RemoveMemberPhase_Failed_Actions": [ - "Succeeded", - "Skipped" - ], - "Set_RemoveMember_UpdatePhase_Status_Success": [ - "Succeeded", - "Skipped" - ] - }, - "type": "Compose", - "inputs": { - "provisioningLogsCount": "@length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]')))", - "hasProvisioningLogs": "@greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0)", - "provisioningStatus": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Failed'), 'FAILED', if(greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0), coalesce(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'), 'NO_LOGS_FOUND'))", - "provisioningResult": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0), if(equals(toLower(coalesce(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success'), 'success', concat('Remove_Member_Verify_Remove_Member_Provisioning_Logs: ', coalesce(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], 'UNKNOWN'))), 'Remove_Member_Verify_Remove_Member_Provisioning_Logs: NO_LOGS_FOUND'), concat('Failed Action: ', variables('RemoveMemberFailedActionName')))", - "provisioningErrorDetails": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status']), 'failure')), first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['errorInformation'], null), variables('RemoveMemberFailedActionResponse'))", - "overallResult": "@if(equals(variables('RemoveMemberScopeExecutionStatus'), 'Succeeded'), if(and(greater(length(coalesce(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'], json('[]'))), 0), equals(toLower(coalesce(first(body('Remove_Member_Verify_Remove_Member_Provisioning_Logs')?['value'])?['provisioningStatusInfo']?['status'], '')), 'success')), 'PASSED', 'FAILED'), 'FAILED')" - } - }, - "Set_RemoveMember_UpdatePhase_Output_Variables": { - "actions": { - "Set_RemoveMemberTestOutputs_UpdatePhase": { - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberTestOutputs", - "value": { - "overallResult": "@outputs('Remove_Member_Analyze_Remove_Member_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Remove_Member_Analyze_Remove_Member_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Remove Member Phase: ', outputs('Remove_Member_Analyze_Remove_Member_Provisioning_Results')?['provisioningResult']), outputs('Remove_Member_Analyze_Remove_Member_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Remove_Member_Analyze_Remove_Member_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Remove_Member_Analyze_Remove_Member_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "runAfter": { - "Set_RemoveMemberCreatePhase_Output_Variables": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@variables('RemoveMemberTestOutputs')['overallResult']", - "PASSED" - ] - } - ] - }, - "type": "If" - }, - "Remove_Cleanup_Delete_User": { - "runAfter": { - "Remove_Member_Check_Create_Phase_Status": [ - "Succeeded", - "Failed", - "Skipped", - "TimedOut" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/users/@{body('Remove_Step3_Create_Member_User')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Remove_Cleanup_Delete_Group": { - "runAfter": { - "Remove_Cleanup_Delete_User": [ - "Succeeded", - "Failed", - "Skipped" - ] - }, - "type": "Http", - "inputs": { - "uri": "https://graph.microsoft.com/beta/groups/@{body('Remove_Step2_Create_Group')?['id']}", - "method": "DELETE", - "authentication": { - "type": "ManagedServiceIdentity", - "audience": "https://graph.microsoft.com/" - } - } - }, - "Capture_RemoveMember_CreatePhase_Failed_Actions": { - "actions": { - "Get_Failed_RemoveMember_CreatePhase_Actions": { - "type": "Compose", - "inputs": "@result('Remove_Member_Test_-_Verify_Creation_And_Provisioning')" - }, - "Filter_Failed_RemoveMember_CreatePhase_Actions": { - "runAfter": { - "Get_Failed_RemoveMember_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "Query", - "inputs": { - "from": "@outputs('Get_Failed_RemoveMember_CreatePhase_Actions')", - "where": "@or(equals(item()?['status'], 'Failed'), equals(item()?['status'], 'TimedOut'))" - } - }, - "Set_RemoveMember_CreatePhase_Failed_Action_Name": { - "runAfter": { - "Filter_Failed_RemoveMember_CreatePhase_Actions": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberFailedActionName", - "value": "@{coalesce(first(body('Filter_Failed_RemoveMember_CreatePhase_Actions'))?['name'], 'Unknown')}" - } - }, - "Set_RemoveMember_CreatePhase_Failed_Action_Response": { - "runAfter": { - "Set_RemoveMember_CreatePhase_Failed_Action_Name": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberFailedActionResponse", - "value": "@if(greater(length(body('Filter_Failed_RemoveMember_CreatePhase_Actions')), 0), coalesce(first(body('Filter_Failed_RemoveMember_CreatePhase_Actions'))?['outputs'], json('{}')), json('{}'))" - } - }, - "Set_RemoveMember_CreatePhase_Status_Failed": { - "runAfter": { - "Set_RemoveMember_CreatePhase_Failed_Action_Response": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberScopeExecutionStatus", - "value": "Failed" - } - } - }, - "runAfter": { - "Remove_Member_Test_-_Verify_Creation_And_Provisioning": [ - "Failed" - ] - }, - "type": "Scope" - }, - "Set_RemoveMember_CreatePhase_Status_Success": { - "runAfter": { - "Remove_Member_Test_-_Verify_Creation_And_Provisioning": [ - "Succeeded" - ] - }, - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberScopeExecutionStatus", - "value": "Succeeded" - } - }, - "Set_RemoveMemberCreatePhase_Output_Variables": { - "actions": { - "Set_RemoveMemberTestOutputs_CreatePhase": { - "type": "SetVariable", - "inputs": { - "name": "RemoveMemberTestOutputs", - "value": { - "overallResult": "@outputs('Remove_Member_Analyze_Group_Create_Provisioning_Results')?['overallResult']", - "result": "@if(equals(outputs('Remove_Member_Analyze_Group_Create_Provisioning_Results')?['overallResult'], 'FAILED'), concat('Create Phase: ', outputs('Remove_Member_Analyze_Group_Create_Provisioning_Results')?['provisioningResult']), outputs('Remove_Member_Analyze_Group_Create_Provisioning_Results')?['provisioningResult'])", - "errorDetails": "@outputs('Remove_Member_Analyze_Group_Create_Provisioning_Results')?['provisioningErrorDetails']" - } - } - } - }, - "runAfter": { - "Remove_Member_Analyze_Group_Create_Provisioning_Results": [ - "Succeeded", - "Failed" - ] - }, - "type": "Scope" - } - }, - "type": "Scope" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "equals": [ - "@parameters('IsGroupSupported')", - true - ] - }, - { - "or": [ - { - "equals": [ - "@parameters('EnabledTests')", - "All" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "GroupTests" - ] - }, - { - "equals": [ - "@parameters('EnabledTests')", - "Group_Update_Remove_Member_Test" - ] - } - ] - } - ] - }, - "type": "If" - } - }, - "runAfter": { - "Initialize_All_Group_Test_Variables": [ - "Succeeded" - ] - }, - "type": "Scope" - }, - "Initialize_All_User_Test_Variables": { - "runAfter": { - "Process_Template_Mappings": [ - "Succeeded" - ] - }, - "type": "InitializeVariable", - "inputs": { - "variables": [ - { - "name": "CreateUserFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "CreateUserFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "CreateUserScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "CreateUserTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "UpdateUserFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "UpdateUserFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "UpdateUserScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "UpdateUserTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "DisableUserFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "DisableUserFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "DisableUserScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "DisableUserTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "DeleteUserFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "DeleteUserFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "DeleteUserScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "DeleteUserTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "ManagerTestFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "ManagerTestFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "ManagerTestScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "ManagerTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - } - ] - } - }, - "Initialize_All_Group_Test_Variables": { - "runAfter": { - "Initialize_All_User_Test_Variables": [ - "Succeeded" - ] - }, - "type": "InitializeVariable", - "inputs": { - "variables": [ - { - "name": "CreateGroupFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "CreateGroupFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "CreateGroupScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "UpdateGroupFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "UpdateGroupFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "UpdateGroupScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "DeleteGroupFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "DeleteGroupFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "DeleteGroupScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "AddMemberFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "AddMemberFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "AddMemberScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "RemoveMemberFailedActionName", - "type": "string", - "value": "" - }, - { - "name": "RemoveMemberFailedActionResponse", - "type": "Object", - "value": {} - }, - { - "name": "RemoveMemberScopeExecutionStatus", - "type": "string", - "value": "InProgress" - }, - { - "name": "RemoveMemberTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "CreateGroupTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "UpdateGroupTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "DeleteGroupTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - }, - { - "name": "AddMemberTestOutputs", - "type": "Object", - "value": { - "overallResult": "", - "result": "", - "errorDetails": {} - } - } - ] - } - }, - "Parse_Templates": { - "runAfter": { - "Initialize_Tests": [ - "Succeeded" - ] - }, - "type": "ParseJson", - "inputs": { - "content": "@body('Get_Schema')", - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "synchronizationRules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "objectMappings": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sourceDirectoryName": { - "type": "string" - }, - "targetDirectoryName": { - "type": "string" - }, - "sourceObjectName": { - "type": "string" - }, - "targetObjectName": { - "type": "string" - }, - "attributeMappings": { - "type": "array", - "items": { - "type": "object", - "properties": { - "targetAttributeName": { - "type": "string" - }, - "source": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "expression": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "Initialize_MappedSources": { - "runAfter": { - "Parse_Templates": [ - "Succeeded" - ] - }, - "type": "InitializeVariable", - "inputs": { - "variables": [ - { - "name": "mappedSources", - "type": "Array", - "value": [] - } - ] - } - }, - "Initialize_AllSourceAttributeNames": { - "runAfter": { - "Initialize_MappedSources": [ - "Succeeded" - ] - }, - "type": "InitializeVariable", - "inputs": { - "variables": [ - { - "name": "allSourceAttributeNames", - "type": "Array", - "value": [] - } - ] - } - }, - "Process_Template_Mappings": { - "actions": { - "Filter_User_ObjectMapping": { - "runAfter": {}, - "type": "Query", - "inputs": { - "from": "@coalesce(first(body('Parse_Templates')?['synchronizationRules'])?['objectMappings'], json('[]'))", - "where": "@equals(item()?['targetObjectName'], 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User')" - } - }, - "ForEach_AttributeMappings": { - "foreach": "@coalesce(first(body('Filter_User_ObjectMapping'))?['attributeMappings'], json('[]'))", - "actions": { - "If_TargetAttribute_Present": { - "actions": { - "Filter_Source_Parameters": { - "runAfter": {}, - "type": "Query", - "inputs": { - "from": "@coalesce(items('ForEach_AttributeMappings')?['source']?['parameters'], json('[]'))", - "where": "@equals(item()?['key'], 'source')" - } - }, - "Select_Source_Attribute_Names": { - "runAfter": { - "Filter_Source_Parameters": [ - "Succeeded" - ] - }, - "type": "Select", - "inputs": { - "from": "@body('Filter_Source_Parameters')", - "select": "@item()?['value']?['name']" - } - }, - "Append_Mapping": { - "runAfter": { - "Select_Source_Attribute_Names": [ - "Succeeded" - ] - }, - "type": "AppendToArrayVariable", - "inputs": { - "name": "mappedSources", - "value": { - "source": "@if(equals(items('ForEach_AttributeMappings')?['source']?['type'], 'Attribute'), items('ForEach_AttributeMappings')?['source']?['name'], first(body('Select_Source_Attribute_Names')))", - "sourceAttributes": "@if(equals(items('ForEach_AttributeMappings')?['source']?['type'], 'Attribute'), createArray(items('ForEach_AttributeMappings')?['source']?['name']), body('Select_Source_Attribute_Names'))", - "target": "@items('ForEach_AttributeMappings')?['targetAttributeName']", - "sourceObject": "@coalesce(first(body('Filter_User_ObjectMapping'))?['sourceObjectName'], '')", - "targetObject": "@coalesce(first(body('Filter_User_ObjectMapping'))?['targetObjectName'], '')", - "sourceDirectoryName": "@coalesce(first(body('Filter_User_ObjectMapping'))?['sourceDirectoryName'], '')", - "targetDirectoryName": "@coalesce(first(body('Filter_User_ObjectMapping'))?['targetDirectoryName'], '')", - "mappingType": "@coalesce(items('ForEach_AttributeMappings')?['source']['type'], '')" - } - } - }, - "ForEach_Source_Attribute": { - "foreach": "@if(equals(items('ForEach_AttributeMappings')?['source']?['type'], 'Attribute'), createArray(items('ForEach_AttributeMappings')?['source']?['name']), body('Select_Source_Attribute_Names'))", - "actions": { - "Append_Each_Source_Name": { - "type": "AppendToArrayVariable", - "inputs": { - "name": "allSourceAttributeNames", - "value": "@items('ForEach_Source_Attribute')" - } - } - }, - "runAfter": { - "Append_Mapping": [ - "Succeeded" - ] - }, - "type": "Foreach" - } - }, - "else": { - "actions": {} - }, - "expression": { - "and": [ - { - "not": { - "equals": [ - "@items('ForEach_AttributeMappings')?['targetAttributeName']", - null - ] - } - }, - { - "not": { - "equals": [ - "@items('ForEach_AttributeMappings')?['targetAttributeName']", - "" - ] - } - } - ] - }, - "type": "If" - } - }, - "runAfter": { - "Filter_User_ObjectMapping": [ - "Succeeded" - ] - }, - "type": "Foreach" - }, - "Select_Graph_Property_Names": { - "runAfter": { - "ForEach_AttributeMappings": [ - "Succeeded" - ] - }, - "type": "Compose", - "inputs": "@union(variables('allSourceAttributeNames'), json('[]'))" - } - }, - "runAfter": { - "Initialize_AllSourceAttributeNames": [ - "Succeeded" - ] - }, - "type": "Scope" - } - }, - "outputs": {}, - "parameters": { - "servicePrincipalId": { - "defaultValue": "fb120034-36e9-4fc0-8173-fd95257fe1cc", - "type": "String" - }, - "scimEndpoint": { - "defaultValue": "https://scimdemo.etelej.com/sainilogicapp1", - "type": "String" - }, - "scimBearerToken": { - "defaultValue": "12345", - "type": "SecureString", - "metadata": { - "description": "Bearer token for SCIM API authentication" - } - }, - "testUserDomain": { - "defaultValue": "proviamtest07.onmicrosoft.com", - "type": "String" - }, - "templateId": { - "defaultValue": "scim", - "type": "String" - }, - "EnabledTests": { - "defaultValue": "All", - "allowedValues": [ - "All", - "UserTests", - "GroupTests", - "Create_User_Test", - "Update_User_Test", - "Disable_User_Test", - "Delete_User_Test", - "User_Update_Manager_Test", - "Create_Group_Test", - "Update_Group_Test", - "Delete_Group_Test", - "Group_Update_Add_Member_Test", - "Group_Update_Remove_Member_Test" - ], - "type": "String" - }, - "defaultUserProperties": { - "defaultValue": [ - { - "displayName": "User1", - "mailNickname": "testuser1", - "passwordProfile": { - "forceChangePasswordNextSignIn": true, - "password": "Pass@word123" - }, - "givenName": "User1 Given", - "surname": "User", - "jobTitle": "Software Engineer", - "department": "Research", - "companyName": "Test Company", - "businessPhones": [ - "+1-555-0100" - ], - "mobilePhone": "+1-555-0101", - "faxNumber": "+1-555-0102", - "officeLocation": "Building A, Floor 3", - "preferredLanguage": "en-US", - "employeeType": "Employee", - "employeeId": "E12345", - "streetAddress": "123 Test Street", - "city": "Seattle", - "state": "WA", - "country": "US", - "postalCode": "98101", - "usageLocation": "US", - "hireDate": "2023-01-01T00:00:00Z", - "employeeOrgData": { - "division": "Engineering", - "costCenter": "12345" - }, - "userType": "Member", - "otherMails": [] - }, - { - "displayName": "User2", - "mailNickname": "testuser2", - "passwordProfile": { - "forceChangePasswordNextSignIn": true, - "password": "Pass@word123" - }, - "givenName": "User2 Given", - "surname": "User", - "jobTitle": "Software Dev Engineer", - "department": "Legal", - "companyName": "Test Company", - "businessPhones": [ - "+1-555-2001" - ], - "mobilePhone": "+1-555-0120", - "faxNumber": "+1-555-0102", - "officeLocation": "Building A, Floor 3", - "preferredLanguage": "en-US", - "employeeType": "Employee", - "employeeId": "E12345", - "streetAddress": "240 East 24th Ave", - "city": "Sanjose", - "state": "CA", - "country": "US", - "postalCode": "98101", - "usageLocation": "US", - "hireDate": "2023-01-01T00:00:00Z", - "employeeOrgData": { - "division": "Legal", - "costCenter": "12345" - }, - "userType": "Member", - "otherMails": [] - }, - { - "displayName": "User3", - "mailNickname": "testuser3", - "passwordProfile": { - "forceChangePasswordNextSignIn": true, - "password": "Pass@word123" - }, - "givenName": "User3 Given", - "surname": "User", - "jobTitle": "Research Scientist", - "department": "HumanResources", - "companyName": "Test Company", - "businessPhones": [ - "+1-555-2001" - ], - "mobilePhone": "+1-555-0120", - "faxNumber": "+1-555-0102", - "officeLocation": "Building A, Floor 3", - "preferredLanguage": "en-US", - "employeeType": "Employee", - "employeeId": "E12345", - "streetAddress": "240 East 24th Ave", - "city": "Delhi", - "state": "DL", - "country": "IN", - "postalCode": "98101", - "usageLocation": "IN", - "hireDate": "2023-01-01T00:00:00Z", - "employeeOrgData": { - "division": "Research", - "costCenter": "67463" - }, - "userType": "Member", - "otherMails": [] - } - ], - "type": "Array", - "metadata": { - "description": "Combined default user properties for Microsoft Graph User creation" - } - }, - "IsSoftDeleted": { - "defaultValue": true, - "type": "Bool", - "metadata": { - "description": "If true, user will be disabled (soft delete). If false, user will be deleted (hard delete)." - } - }, - "scimContentType": { - "defaultValue": "application/scim+json", - "type": "String", - "metadata": { - "description": "Content-Type header for SCIM API calls" - } - }, - "IsGroupSupported": { - "defaultValue": true, - "type": "Bool", - "metadata": { - "description": "If true, Group tests will run. If false, all Group tests will be skipped." - } - }, - "IsManagerAttributeSupported": { - "defaultValue": true, - "type": "Bool", - "metadata": { - "description": "If true, manager attribute tests will run. If false, User_Update_Manager_Test will be skipped." - } - }, - "defaultGroupProperties": { - "defaultValue": { - "description": "Default test group for provisioning validation", - "mailEnabled": false, - "securityEnabled": true, - "groupTypes": [], - "allowExternalSenders": false, - "autoSubscribeNewMembers": false, - "classification": "", - "hideFromAddressLists": false, - "hideFromOutlookClients": false, - "isAssignableToRole": false, - "isSubscribedByMail": false, - "preferredDataLocation": "US", - "preferredLanguage": "en-US", - "theme": "Blue", - "visibility": "Private" - }, - "type": "Object", - "metadata": { - "description": "Default group properties for Microsoft Graph Group creation" - } - }, - "LogicAppVersion": { - "defaultValue": "3.1", - "type": "String", - "metadata": { - "description": "Version of the Logic App for tracking and deployment purposes" - } - }, - "$connections": { - "type": "Object", - "defaultValue": {} - } - } - }, - "parameters": { - "scimBearerToken": {}, - "$connections": { - "type": "Object", - "value": {} - } - } -}