I am trying to automate the upload of custom policies as I have multiple tenants and each tenant consists of multiple custom policies. I am interested in either Azure cli or SDK for the same. I searched on Google but could not find anything related.
Anyone work on this kind of automation?
Local/Manual deployment options:
PowerShell Script again the Trust Framework Policy Graph API, Azure AD PowerShell module, or using the Microsoft.Graph.Beta PowerShell SDK - You would need to handle variable substitution before uploading the policies.
Using VSCode, use the Azure AD B2C Tools extension, which allows adding multiple environments. Variable substitution is handled by the package.
CI/CD Pipeline:
Azure DevOps pipeline - You would need to handle variable substitution in the pipeline. Azure DevOps pipeline for Azure AD B2C Sample
GitHub Actions pipeline - You would need to handle variable substitution in the pipeline. Github Action for Azure AD B2C using ieftool Sample
IEF Tool npm package - You would need to handle variable substitution in the pipeline. Sample below for Azure DevOps Pipeline
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '10.x'
- script: npm install -g ieftool
displayName: 'Install IEF Tool'
- script: ieftool deploy -t $(TenantId) -c $(DeploymentClientId) -s $(DeploymentClientSecret) -p $(Pipeline.Workspace)/b2c-policies
displayName: 'Uploading IEF policies'