Azure Credentials
Overview
PyBritive provides two Azure-specific checkout modes that integrate directly with Microsoft Azure tooling. Both modes retrieve temporary credentials from Britive and activate them in your local Azure session — no long-lived credentials required.
What you’ll learn:
- How to authenticate to Azure using
azloginmode with the Azure CLI - How to authenticate using
azpsmode with Azure PowerShell - How to use the simplified Azure profile format
Before You Begin
- PyBritive installed and authenticated — see Getting Started
- Azure CLI installed — run
az --versionto check, or Azure PowerShell if usingazpsmode - At least one Azure profile available for checkout — see Listing Your Access
Note: Profile names in this tutorial are from the Britive demo tenant. Replace them with your own profile names from
pybritive ls profiles.
Get Azure Credentials
Authenticate using azlogin
The azlogin mode retrieves temporary Azure credentials from Britive and outputs an az login command. Use eval to execute it and activate the credentials in your current shell session.
eval $(pybritive checkout "Britive Azure Tenant/Subscription Owner" --mode azlogin)This authenticates the Azure CLI as a service principal with the permissions defined in the Britive profile. Verify the active account:
az account showAuthenticate using azps
The azps mode delivers temporary credentials in a format compatible with Azure PowerShell.
pybritive checkout "Britive Azure Tenant/Subscription Owner" --mode azpsVerify the active account in PowerShell:
Get-AzContextUse the simplified Azure profile format
For Azure profiles, the application name and environment name are the same. You can use the two-part format Application Name/Profile Name instead of the full three-part format.
For example, instead of:
pybritive checkout "Britive Azure Tenant/Britive Azure Tenant/Subscription Owner" --mode azloginYou can use:
pybritive checkout "Britive Azure Tenant/Subscription Owner" --mode azloginPyBritive converts the two-part format to the required three-part format automatically.
Check in when done
When you are finished, check in the profile to revoke the temporary credentials:
pybritive checkin "Britive Azure Tenant/Subscription Owner"Troubleshoot
| Symptom | Cause | Fix |
|---|---|---|
az: command not found | Azure CLI not installed | Install the Azure CLI before using azlogin mode |
Get-AzContext returns no account | azps mode did not activate credentials | Re-run the checkout and check for errors in the output |
| Profile not found with two-part format | Profile name typo | Run pybritive ls profiles and confirm the exact name |
Not authenticated error | Session expired | Run pybritive login and try again |
Next Steps
- Approval Workflows — manage access requests for profiles that require approval before checkout
- SSH Access — connect to cloud instances via Session Manager and Identity Aware Proxy