Apparently it's not possible to create an Azure B2C tenant via bicep using a service principal:
How do I obtain the ROPC flow token programmatically for creating a new tenant?
Here's my workflow file:
name: CI
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
jobs:
build:
name: Deploy infrastructure
timeout-minutes: 15
runs-on: ubuntu-latest
environment: Dev
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
# Checkout code
- uses: actions/checkout@main
# Log into Azure
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Deploy Bicep file
- name: deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ secrets.AZURE_RG }}
template: ./.azure/main.bicep
parameters: ./.azure/parameters/dev.json
failOnStdErr: false