Skip to content

Commit f4d667c

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into ml-upgrade
2 parents 9d24e73 + 766b5b2 commit f4d667c

File tree

326 files changed

+3162
-1912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+3162
-1912
lines changed

.openpublishing.redirection.app-service.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/app-service/security-recommendations.md",
5+
"redirect_url": "/security/benchmark/azure/baselines/app-service-security-baseline",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path_from_root": "/articles/app-service/scenario-secure-app-authentication-app-service-as-user.md",
510
"redirect_url": "/azure/app-service/scenario-secure-app-authentication-app-service",

.openpublishing.redirection.sentinel.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,21 @@
10541054
"source_path_from_root": "/articles/sentinel/process-events-normalization-schema.md",
10551055
"redirect_url": "/azure/sentinel/normalization-schema-process-event",
10561056
"redirect_document_id": true
1057+
},
1058+
{
1059+
"source_path_from_root": "/articles/sentinel/notebooks-with-synapse.md",
1060+
"redirect_url": "/azure/sentinel/notebooks-hunt",
1061+
"redirect_document_id": false
1062+
},
1063+
{
1064+
"source_path_from_root": "/articles/sentinel/notebooks-with-synapse-export-data.md",
1065+
"redirect_url": "/azure/sentinel/notebooks-hunt",
1066+
"redirect_document_id": false
1067+
},
1068+
{
1069+
"source_path_from_root": "/articles/sentinel/notebooks-with-synapse-hunt.md",
1070+
"redirect_url": "/azure/sentinel/notebooks-hunt",
1071+
"redirect_document_id": false
10571072
}
10581073
]
10591074
}
Lines changed: 40 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
2-
title: Manage custom policies with PowerShell
2+
title: Manage custom policies with Microsoft Graph PowerShell
33
titleSuffix: Azure AD B2C
4-
description: Use the Azure Active Directory (Azure AD) PowerShell cmdlet for programmatic management of your Azure AD B2C custom policies. Create, read, update, and delete custom policies with PowerShell.
4+
description: Use the Microsoft Graph PowerShell cmdlets for programmatic management of your Azure AD B2C custom policies. Create, read, update, and delete custom policies with PowerShell.
55
author: kengaderdus
66
manager: CelesteDG
77

88
ms.service: active-directory
99

10-
ms.custom: devx-track-azurepowershell, has-azure-ad-ps-ref
10+
ms.custom: devx-track-azurepowershell, has-azure-ad-ps-ref, azure-ad-ref-level-one-done
1111
ms.topic: how-to
1212
ms.date: 01/11/2024
1313
ms.author: kengaderdus
1414
ms.subservice: B2C
1515

1616

17-
#Customer intent: As an Azure AD B2C administrator, I want to manage custom policies using Azure PowerShell, so that I can review, update, and delete policies in my Azure AD B2C tenant.
17+
#Customer intent: As an Azure AD B2C administrator, I want to manage custom policies using Microsoft Graph PowerShell, so that I can review, update, and delete policies in my Azure AD B2C tenant.
1818

1919
---
2020

21-
# Manage Azure AD B2C custom policies with Azure PowerShell
21+
# Manage Azure AD B2C custom policies with Microsoft Graph PowerShell
2222

23-
Azure PowerShell provides several cmdlets for command line- and script-based custom policy management in your Azure AD B2C tenant. Learn how to use the Azure AD PowerShell module to:
23+
Microsoft Graph PowerShell provides several cmdlets for command line- and script-based custom policy management in your Azure AD B2C tenant. Learn how to use the Azure AD PowerShell module to:
2424

2525
* List the custom policies in an Azure AD B2C tenant
2626
* Download a policy from a tenant
@@ -32,41 +32,42 @@ Azure PowerShell provides several cmdlets for command line- and script-based cus
3232

3333
* [Azure AD B2C tenant](tutorial-create-tenant.md), and credentials for a user in the directory with the [B2C IEF Policy Administrator](../active-directory/roles/permissions-reference.md#b2c-ief-policy-administrator) role
3434
* [Custom policies](tutorial-create-user-flows.md?pivots=b2c-custom-policy) uploaded to your tenant
35-
* [Azure AD PowerShell for Graph **preview module**](/powershell/azure/active-directory/install-adv2)
35+
* [Microsoft Graph PowerShell SDK beta module](/powershell/microsoftgraph/installation#installation)
3636

3737
## Connect PowerShell session to B2C tenant
3838

39-
To work with custom policies in your Azure AD B2C tenant, you first need to connect your PowerShell session to the tenant by using the [Connect-AzureAD][Connect-AzureAD] command.
39+
To work with custom policies in your Azure AD B2C tenant, you first need to connect your PowerShell session to the tenant by using the [Connect-MgGraph][Connect-MgGraph] command.
4040

41-
Execute the following command, substituting `{b2c-tenant-name}` with the name of your Azure AD B2C tenant. Sign in with an account that's assigned the [B2C IEF Policy Administrator](../active-directory/roles/permissions-reference.md#b2c-ief-policy-administrator) role in the directory.
41+
Execute the following command. Sign in with an account that's assigned the [B2C IEF Policy Administrator](/entra/identity/role-based-access-control/permissions-reference#b2c-ief-policy-administrator) role in the directory.
4242

4343
```PowerShell
44-
Connect-AzureAD -Tenant "{b2c-tenant-name}.onmicrosoft.com"
44+
Connect-MgGraph -TenantId "{b2c-tenant-name}.onmicrosoft.com" -Scopes "Policy.ReadWrite.TrustFramework"
4545
```
4646

4747
Example command output showing a successful sign-in:
4848

49-
```Console
50-
PS C:\> Connect-AzureAD -Tenant "contosob2c.onmicrosoft.com"
49+
```output
50+
Welcome to Microsoft Graph!
5151
52-
Account Environment TenantId TenantDomain AccountType
53-
------- ----------- -------- ------------ -----------
54-
[email protected] AzureCloud 00000000-0000-0000-0000-000000000000 contosob2c.onmicrosoft.com User
52+
Connected via delegated access using 64636d5d-8eb5-42c9-b9eb-f53754c5571f
53+
Readme: https://aka.ms/graph/sdk/powershell
54+
SDK Docs: https://aka.ms/graph/sdk/powershell/docs
55+
API Docs: https://aka.ms/graph/docs
56+
57+
NOTE: You can use the -NoWelcome parameter to suppress this message.
5558
```
5659

5760
## List all custom policies in the tenant
5861

59-
Discovering custom policies allows an Azure AD B2C administrator to review, manage, and add business logic to their operations. Use the [Get-AzureADMSTrustFrameworkPolicy][Get-AzureADMSTrustFrameworkPolicy] command to return a list of the IDs of the custom policies in an Azure AD B2C tenant.
62+
Discovering custom policies allows an Azure AD B2C administrator to review, manage, and add business logic to their operations. Use the [Get-MgBetaTrustFrameworkPolicy][Get-MgBetaTrustFrameworkPolicy] command to return a list of the IDs of the custom policies in an Azure AD B2C tenant.
6063

6164
```PowerShell
62-
Get-AzureADMSTrustFrameworkPolicy
65+
Get-MgBetaTrustFrameworkPolicy
6366
```
6467

6568
Example command output:
6669

67-
```Console
68-
PS C:\> Get-AzureADMSTrustFrameworkPolicy
69-
70+
```output
7071
Id
7172
--
7273
B2C_1A_TrustFrameworkBase
@@ -78,16 +79,15 @@ B2C_1A_PasswordReset
7879

7980
## Download a policy
8081

81-
After reviewing the list of policy IDs, you can target a specific policy with [Get-AzureADMSTrustFrameworkPolicy][Get-AzureADMSTrustFrameworkPolicy] to download its content.
82+
After reviewing the list of policy IDs, you can target a specific policy with [Get-MgBetaTrustFrameworkPolicy][Get-MgBetaTrustFrameworkPolicy] to download its content.
8283

8384
```PowerShell
84-
Get-AzureADMSTrustFrameworkPolicy [-Id <policyId>]
85+
Get-MgBetaTrustFrameworkPolicy [-TrustFrameworkPolicyId <policyId>]
8586
```
8687

8788
In this example, the policy with ID *B2C_1A_signup_signin* is downloaded:
8889

89-
```Console
90-
PS C:\> Get-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin
90+
```output
9191
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0" TenantId="contosob2c.onmicrosoft.com" PolicyId="B2C_1A_signup_signin" PublicPolicyUri="http://contosob2c.onmicrosoft.com/B2C_1A_signup_signin" TenantObjectId="00000000-0000-0000-0000-000000000000">
9292
<BasePolicy>
9393
<TenantId>contosob2c.onmicrosoft.com</TenantId>
@@ -113,94 +113,72 @@ PS C:\> Get-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin
113113
</TrustFrameworkPolicy>
114114
```
115115

116-
To edit the policy content locally, pipe the command output to a file with the `-OutputFilePath` argument, and then open the file in your favorite editor.
117-
118-
Example command sending output to a file:
119-
120-
```PowerShell
121-
# Download and send policy output to a file
122-
Get-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin -OutputFilePath C:\RPPolicy.xml
123-
```
116+
To edit the policy content locally, pipe the command output to a file, and then open the file in your favorite editor.
124117

125118
## Update an existing policy
126119

127-
After editing a policy file you've created or downloaded, you can publish the updated policy to Azure AD B2C by using the [Set-AzureADMSTrustFrameworkPolicy][Set-AzureADMSTrustFrameworkPolicy] command.
120+
After editing a policy file you've created or downloaded, you can publish the updated policy to Azure AD B2C by using the [Update-MgBetaTrustFrameworkPolicy][Update-MgBetaTrustFrameworkPolicy] command.
128121

129-
If you issue the `Set-AzureADMSTrustFrameworkPolicy` command with the ID of a policy that already exists in your Azure AD B2C tenant, the content of that policy is overwritten.
122+
If you issue the `Update-MgBetaTrustFrameworkPolicy` command with the ID of a policy that already exists in your Azure AD B2C tenant, the content of that policy is overwritten.
130123

131124
```PowerShell
132-
Set-AzureADMSTrustFrameworkPolicy [-Id <policyId>] -InputFilePath <inputpolicyfilePath> [-OutputFilePath <outputFilePath>]
125+
Update-MgBetaTrustFrameworkPolicy -TrustFrameworkPolicyId <policyId> -BodyParameter @{trustFrameworkPolicy = "<policy file path>"}
133126
```
134127

135128
Example command:
136129

137130
```PowerShell
138131
# Update an existing policy from file
139-
Set-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin -InputFilePath C:\B2C_1A_signup_signin.xml
132+
Update-MgBetaTrustFrameworkPolicy -TrustFrameworkPolicyId B2C_1A_signup_signin -BodyParameter @{trustFrameworkPolicy = C:\B2C_1A_signup_signin.xml}
140133
```
141134

142-
For additional examples, see the [Set-AzureADMSTrustFrameworkPolicy][Set-AzureADMSTrustFrameworkPolicy] command reference.
143-
144135
## Upload a new policy
145136

146137
When you make a change to a custom policy that's running in production, you might want to publish multiple versions of the policy for fallback or A/B testing scenarios. Or, you might want to make a copy of an existing policy, modify it with a few small changes, then upload it as a new policy for use by a different application.
147138

148-
Use the [New-AzureADMSTrustFrameworkPolicy][New-AzureADMSTrustFrameworkPolicy] command to upload a new policy:
139+
Use the [New-MgBetaTrustFrameworkPolicy][New-MgBetaTrustFrameworkPolicy] command to upload a new policy:
149140

150141
```PowerShell
151-
New-AzureADMSTrustFrameworkPolicy -InputFilePath <inputpolicyfilePath> [-OutputFilePath <outputFilePath>]
142+
New-MgBetaTrustFrameworkPolicy -BodyParameter @{trustFrameworkPolicy = "<policy file path>"}
152143
```
153144

154145
Example command:
155146

156147
```PowerShell
157148
# Add new policy from file
158-
New-AzureADMSTrustFrameworkPolicy -InputFilePath C:\SignUpOrSignInv2.xml
149+
New-MgBetaTrustFrameworkPolicy -BodyParameter @{trustFrameworkPolicy = C:\B2C_1A_signup_signin.xml }
159150
```
160151

161152
## Delete a custom policy
162153

163154
To maintain a clean operations life cycle, we recommend that you periodically remove unused custom policies. For example, you might want to remove old policy versions after performing a migration to a new set of policies and verifying the new policies' functionality. Additionally, if you attempt to publish a set of custom policies and receive an error, it might make sense to remove the policies that were created as part of the failed release.
164155

165-
Use the [Remove-AzureADMSTrustFrameworkPolicy][Remove-AzureADMSTrustFrameworkPolicy] command to delete a policy from your tenant.
156+
Use the [Remove-MgBetaTrustFrameworkPolicy][Remove-MgBetaTrustFrameworkPolicy] command to delete a policy from your tenant.
166157

167158
```PowerShell
168-
Remove-AzureADMSTrustFrameworkPolicy -Id <policyId>
159+
Remove-MgBetaTrustFrameworkPolicy -TrustFrameworkPolicyId <policyId>
169160
```
170161

171162
Example command:
172163

173164
```PowerShell
174165
# Delete an existing policy
175-
Remove-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin
166+
Remove-MgBetaTrustFrameworkPolicy -TrustFrameworkPolicyId B2C_1A_signup_signin
176167
```
177168

178169
## Troubleshoot policy upload
179170

180171
When you try to publish a new custom policy or update an existing policy, improper XML formatting and errors in the policy file inheritance chain can cause validation failures.
181172

182-
For example, here's an attempt at updating a policy with content that contains malformed XML (output is truncated for brevity):
183-
184-
```Console
185-
PS C:\> Set-AzureADMSTrustFrameworkPolicy -Id B2C_1A_signup_signin -InputFilePath C:\B2C_1A_signup_signin.xml
186-
Set-AzureADMSTrustFrameworkPolicy : Error occurred while executing PutTrustFrameworkPolicy
187-
Code: AADB2C
188-
Message: Validation failed: 1 validation error(s) found in policy "B2C_1A_SIGNUP_SIGNIN" of tenant "contosob2c.onmicrosoft.com".Schema validation error found at line
189-
14 col 55 in policy "B2C_1A_SIGNUP_SIGNIN" of tenant "contosob2c.onmicrosoft.com": The element 'OutputClaims' in namespace
190-
'http://schemas.microsoft.com/online/cpim/schemas/2013/06' cannot contain text. List of possible elements expected: 'OutputClaim' in namespace
191-
'http://schemas.microsoft.com/online/cpim/schemas/2013/06'.
192-
...
193-
```
194-
195173
For information about troubleshooting custom policies, see [Troubleshoot Azure AD B2C custom policies and Identity Experience Framework](./troubleshoot.md).
196174

197175
## Next steps
198176

199177
For information about using PowerShell to deploy custom policies as part of a continuous integration/continuous delivery (CI/CD) pipeline, see [Deploy custom policies from an Azure DevOps pipeline](deploy-custom-policies-devops.md).
200178

201179
<!-- LINKS - External -->
202-
[Connect-AzureAD]: /powershell/module/azuread/get-azureadmstrustframeworkpolicy
203-
[Get-AzureADMSTrustFrameworkPolicy]: /powershell/module/azuread/get-azureadmstrustframeworkpolicy
204-
[New-AzureADMSTrustFrameworkPolicy]: /powershell/module/azuread/new-azureadmstrustframeworkpolicy
205-
[Remove-AzureADMSTrustFrameworkPolicy]: /powershell/module/azuread/remove-azureadmstrustframeworkpolicy
206-
[Set-AzureADMSTrustFrameworkPolicy]: /powershell/module/azuread/set-azureadmstrustframeworkpolicy
180+
[Connect-MgGraph]: /powershell/microsoftgraph/authentication-commands#using-connect-mggraph
181+
[Get-MgBetaTrustFrameworkPolicy]: /powershell/module/microsoft.graph.beta.identity.signins/get-mgbetatrustframeworkpolicy?view
182+
[New-MgBetaTrustFrameworkPolicy]: /powershell/module/microsoft.graph.beta.identity.signins/new-mgbetatrustframeworkpolicy
183+
[Remove-MgBetaTrustFrameworkPolicy]: /powershell/module/microsoft.graph.beta.identity.signins/remove-mgbetatrustframeworkpolicy
184+
[Update-MgBetaTrustFrameworkPolicy]: /powershell/module/microsoft.graph.beta.identity.signins/update-mgbetatrustframeworkpolicy

0 commit comments

Comments
 (0)