{"id":23327,"library":"azure-devtools","title":"Azure Python DevTools","description":"Microsoft Azure Development Tools for SDK – provides utilities for CI (Git helpers, GitHub REST API wrapper, issue bot framework), scenario testing (resource management, playback support), and config management. Current version: 1.2.0. Released September 2020, low maintenance cadence.","status":"maintenance","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-python-devtools","tags":["azure","test-utilities","sdk","scenario-tests"],"install":[{"cmd":"pip install azure-devtools","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used by config management module","package":"configparser","optional":false},{"reason":"Used for recording/playback in scenario tests","package":"vcrpy","optional":true},{"reason":"Resource management for test cleanup","package":"azure-mgmt-resource","optional":true}],"imports":[{"note":"Common mistake: import from azure.mgmt.resource instead of azure-devtools","wrong":"from azure.mgmt.resource import ResourceGroupPreparer","symbol":"ResourceGroupPreparer","correct":"from azure_devtools.scenario_tests.preparers import ResourceGroupPreparer"},{"note":"Wrong package: azure-devtools provides this utility","wrong":"from azure.mgmt.resource.resources import create_random_name","symbol":"create_random_name","correct":"from azure_devtools.scenario_tests.utilities import create_random_name"}],"quickstart":{"code":"from azure_devtools.scenario_tests.preparers import ResourceGroupPreparer\nfrom azure.mgmt.resource import ResourceManagementClient\nfrom azure.identity import DefaultAzureCredential\nimport os\n\ncredential = DefaultAzureCredential()\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '')\n\n@ResourceGroupPreparer()\ndef test_resource_group(resource_group, **kwargs):\n    client = ResourceManagementClient(credential, subscription_id)\n    rg = client.resource_groups.get(resource_group.name)\n    print(f\"Resource group {rg.name} exists in {rg.location}\")","lang":"python","description":"Example of using ResourceGroupPreparer in a test to create and clean up a resource group."},"warnings":[{"fix":"Ensure resource_group is the first parameter of your test function after self if using pytest or unittest method.","message":"ResourceGroupPreparer only works with positional arguments. If you change the function signature and the resource_group parameter is not the first argument, the preparer will fail silently.","severity":"gotcha","affected_versions":"<=1.2.0"},{"fix":"Migrate to GitHub CLI (`gh`) or Azure DevOps REST API directly.","message":"The ci_tools module (Git helpers, GitHub REST API wrapper) is no longer actively maintained and may be removed in future versions. Prefer dedicated GitHub Actions or Azure DevOps tasks.","severity":"deprecated","affected_versions":"1.1.0 - 1.2.0"},{"fix":"Check your resource cleanup logic; use ResourceGroupPreparer with 'random_name' setting to avoid dependency on deletion order.","message":"In version 1.0.0, the resource removal sequence was reversed. Tests that relied on a specific deletion order may fail or leave resources behind.","severity":"breaking","affected_versions":"<=0.5.5 -> 1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install azure-devtools","cause":"Package name with hyphen vs underscore: pip installs 'azure-devtools', but imports are underscore 'azure_devtools'.","error":"ImportError: No module named 'azure_devtools'"},{"fix":"Use: from azure_devtools.scenario_tests import ...","cause":"The scenario_tests subpackage is not automatically imported; you must import it explicitly.","error":"AttributeError: module 'azure_devtools' has no attribute 'scenario_tests'"},{"fix":"Use create_random_name(prefix='test', length=20) – check documentation for your version. For >=1.2.0, only 'prefix' is accepted.","cause":"Function signature changed between versions; older versions accepted 'length', newer ones do not.","error":"TypeError: create_random_name() got an unexpected keyword argument 'length'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}