How to configure Azure credentials using a service principal
❗️ Preview Release: This documentation covers a preview of Radius which uses different Resource Types from the current release. Enable it by passing the --preview to the Radius CLI or settingRADIUS_PREVIEW=true.
Radius authenticates to Azure with a service principal to deploy and connect to Azure resources. This guide creates a service principal and registers it as an Azure credential in the Radius control plane.
Step 1: Create a service principal
Radius authenticates to Azure with a service principal. Create one and note the appId, password, and tenant:
az ad sp create-for-rbac
{
"appId": "****",
"displayName": "****",
"password": "****",
"tenant": "****"
}
Grant the service principal access to the resource group using the Azure role that allows creating the resources you plan to deploy.
Step 2a: Interactively via rad initialize
If Radius has not been installed already, rad initialize --full can be used to interactively install Radius and configure an Azure service principal at the same time.
rad initialize --full --preview
Follow the prompts:
- When prompted with “Add cloud providers for cloud resources?”, select Yes.
- Select Azure, then Service Principal.
- Enter the
appId,password, andtenantrecorded in Step 1. - Enter the Azure subscription ID and resource group to use for the
defaultEnvironment. The resource group must already exist.
Step 2b: Manual configuration
Create the Azure credential in the Radius control plane with rad credential register azure sp:
rad credential register azure sp \
--client-id myClientId \
--client-secret myClientSecret \
--tenant-id myTenantId
Radius will use the provided service principal for all interactions with Azure.
Step 3: Update existing Environments
If you have existing Environments, you must also update your Environments with your Azure subscription ID and resource group. The resource group must already exist:
rad environment update myEnvironment \
--azure-subscription-id myAzureSubscriptionId \
--azure-resource-group myAzureResourceGroup \
--preview
This command updates the configuration of an environment for properties that are able to be changed. For more information visit rad environment update.
Next steps
Once AWS or Azure credentials are configured, set up access to the Radius Dashboard.
Next step: How to configure access to the Radius dashboardFeedback
Was this page helpful?
Glad to hear it! Please feel free to star our repo and join our Discord server to stay up to date with the project.
Sorry to hear that. If you would like to also contribute a suggestion visit and tell us how we can improve.