How to Create the Azure Ad App Registration (CSP Tenant Profile) for Codiac Relay
To use Codiac with Azure, you need to set up the app registration (CSP Tenant Profile) for Codiac Relay.
Suggested Reading:
Step 1: Create App Registration
- Log into your Azure Portal.
- Open Azure AD.
- Click on App Registrations.
- Click Add new.
- Create an App Registration called
Codiac Relay
.
- Choose the default (
Single Tenant
) for Supported Account Types.
- After it is created, drill down into its overview blade.
- Click Authentication in the left column. i. Click Platform Configurations > Add a platform. a. Choose Mobile and Desktop. b. Add the following Custom Redirect URL: http://localhost:5799/csp/azure/login/auth-code-catcher c. Click Configure. ii. Make sure the following redirect URL exists under Mobile and Desktop Applications: http://localhost:5799/csp/azure/login/auth-code-catcher
- Set Account Types to
Single Tenant
if it's not already the default. - Enable Public Client Flows.
- Click Save.
Step 2: Add API Permissions
- Click "API Permissions" in the left column.
- Click Add a Permission.
- Click the APIs my organization uses tab.
- Search for "Azure Key Vault".
- Add permissions for:
- Azure Key Vault:
User_impersonation
- Azure Service Management:
User_impersonation
- Microsoft Graph:
Email
,Openid
,Profile
, andUser.Read
- Azure Key Vault:
- IMPORTANT!! Click Grant Admin Consent for all these permissions.
Step 3: Add a Client Secret
- Click Certificates & Secrets in the left column.
- Click New client secret.
- Capture the secret and place it into a keyvault.
info
This is for future use in calling the Codiac CLI from pipelines using the ClientCredential auth flow.
Step 4: Update Subscriptions
For each subscription:
- Open the Access Control (IAM) blade.
- Add the
Azure Kubernetes Service Cluster Admin
role to the Codiac Relay principal.
Step 5: Update ACRs
For each ACR:
- Add these role assignments to the Codiac Relay principal:
- Reader
- AcrDelete
- AcrPull
- AcrPush
Step 6: Update KeyVaults
For each KeyVault:
- Add the
Key Vault Contributor
role assignments to the Codiac Relay principal.
tip
If you are not comfortable with this role assignment, you can currently just use Key Vault Reader
. At this time, Codiac only reads from KeyVault. No write permissions are required.