Skip to content
Azure Credentials

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 azlogin mode with the Azure CLI
  • How to authenticate using azps mode 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 --version to check, or Azure PowerShell if using azps mode
  • 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 show

Authenticate using azps

The azps mode delivers temporary credentials in a format compatible with Azure PowerShell.

pybritive checkout "Britive Azure Tenant/Subscription Owner" --mode azps

Verify the active account in PowerShell:

Get-AzContext

Use 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 azlogin

You can use:

pybritive checkout "Britive Azure Tenant/Subscription Owner" --mode azlogin

PyBritive 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

SymptomCauseFix
az: command not foundAzure CLI not installedInstall the Azure CLI before using azlogin mode
Get-AzContext returns no accountazps mode did not activate credentialsRe-run the checkout and check for errors in the output
Profile not found with two-part formatProfile name typoRun pybritive ls profiles and confirm the exact name
Not authenticated errorSession expiredRun 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
Last updated on