Azure AD B2C extension
The Azure AD B2C extension for VS Code lets you quickly navigate through Azure AD B2C custom policy. Create elements, such as: technical profiles and claim definition. For more information, see Get started with custom policies.
To start working with your custom policy. Open you Visual Studio Code, and open your folder that containing the custom policy XML files. Or open the policy XML files directly from any folder.
Azure AD B2C Custom policy Features
You can now upload your policy directly from VS Code.
With autocomplete feature, you can save your time customizing a B2C policy. B2C extension provides you the list of policy settings, claims, technical profiles, and claims transformation aggregated from your policy files. Select one of the following attributes and click ctrl+space (cmd+space), or start:
Custom policy explorer
From Custom policy explorer click the XML element type and select the element you want to open. Note: custom policy explorer shows elements from selected file only.
Go to definition and find all references
To go any XML element definition. Clt-Click, click F12 or right-click and select Go to definition or Peak definition. Note: Go to definition navigates you to the source element in the selected file only.
To search for references in your Open folder XML files or any XML file you open with VS code, select Find all references or click Shift+F12.
Adding XML elements
You can add following elements to your policy. Note: make sure your cursor is located in the right place.
Smart Copy & Paste
When you customize an XML element in the extension policy, Smart Copy allows you copy the entire element with its parents elements from the base policy. For example, when you copy the AAD-UserWriteUsingAlternativeSecurityId technical profile, smart copy generates an XML containing the following elements, so you don't need to look for the parents element, such as the claim provider.
On contrariety, the Smart Paste, pastes from the clipboard only the necessary elements. Given the above XML, and your extension policy already has a claims provider named
Help and more information
After you run the commends, B2C extension shows you information message with a link to relevant article.
XML Schema quick help
Move your mouse over any XML tag name, to see the description
Collect logs from Azure AD B2C and diagnose problems with your Azure AD B2C vocode extension. Read more here. The logs are organized by the policy name, correlation Id (the application insights presents the first digit of the correlation Id), and the log timestamp. This allows you to find the relevant log based on the local timestamp and see the user journey as executed by Azure AD B2C.
Allows you to manage the values of your Azure AD B2C environments. When you execute the B2C Policy build command, the VS code extension finds and replaces the values of your settings with the ones configure in the policy file, and creates a directory that contains all of your policy files (after the replacement). In the following example, the extension replaces the keys with the value configure in the
To build your policy, type
On the first time, you run the B2C Policy build command, the VS code extension lets you create the
You can add, or remove environments, keys, and values, to accommodate your needs. For example, you can add new settings, such as the URL of a REST API end point, Google+ app Id, URL of content definitions. You can also add new environment, such as pre-prod. Make sure you provide the same set of key (with the relevant values) for each environment. In the following example, we add the Pre-Production environment and new set of key-values.
After the command is completed, you will find the exported policies under the Environment folder. Important: Before you upload the policy to your Azure AD B2C tenant, check the values of the exported policy files.
The extension is developed and managed by the open-source community in GitHub. The extension is not part of Azure AD B2C product and it's not supported under any Microsoft standard support program or service. The extension is provided AS IS without warranty of any kind. For any issue, visit the GitHub repository.