- RESOURCE_GROUP
- name of an Azure resource group
- must be unique in the Azure subscription
- e.g. 'cloudshell-identity-test'
- KEY_VAULT_NAME
- 3-24 alphanumeric characters
- must begin with a letter
- must be globally unique
az group create -n $RESOURCE_GROUP --location westus2
az keyvault create -g $RESOURCE_GROUP -n $KEY_VAULT_NAME --sku standard
The tests expect the vault's URI in an environment variable:
export AZURE_IDENTITY_TEST_VAULT_URL=$(az keyvault show -g $RESOURCE_GROUP -n $KEY_VAULT_NAME --query properties.vaultUri | tr -d '"')
This may take several minutes:
git clone https://github.com/azure/azure-sdk-for-python --single-branch --branch main --depth 1
cd azure-sdk-for-python/sdk/identity/azure-identity
The Azure SDK supports Python 3.8+. Python 3 should be installed in your Cloud Shell.
python -m venv ~/venv
For example:
source ~/venv/bin/activate
pip install -r dev_requirements.txt .
export AZURE_TEST_RUN_LIVE=true
export AZURE_SKIP_LIVE_RECORDING=true
pytest ./tests -vrs -m cloudshell
deactivate
After running tests, delete the resources provisioned earlier:
az group delete -n $RESOURCE_GROUP -y --no-wait