Manage your resource with SDK & APIs

Important

Test Base for Microsoft 365 will transition to end-of-life (EOL) on May 31, 2024. We're committed to working closely with each customer to provide support and guidance to make the transition as smooth as possible. If you have any questions, concerns, or need assistance, submit a support request.

Automation is a key aspect of DevOps and agile development. Are you looking to manage Test Base for Microsoft 365 resources, get test results programmatically, and integrate them with our CI tools? Test Base APIs/SDK can help you achieve all these and more!

These APIs/SDK enable IT professionals and app developers to:

  • Manage Test Base accounts, including create, update, and offboard.
  • Manage application packages, including create, update, delete, and download package.
  • Get the test summary, detailed test results, and analysis results. The analysis result includes CPU regression analysis, CPU utilization analysis, memory regression analysis, and memory utilization analysis.
  • Download test results and test execution video recording.

Check out the step-by-step outline below to find out how to access this new capability in Test Base for Microsoft 365 service.

A step-by-step example of Test Base account creation by using Python SDK

  1. Pre-requisites:

  2. Below code snippet covers flow to create a Test Base Account including

    • Request credential via Azure CLI for interaction with Azure
    • Initialize Test Base SDK client with the credential and subscription ID for later operations
    • Invoke begin_create from test_base_accounts model to create Test Base Account

    Copy the code to your Python development environment, and replace "subscription-id" with your Azure subscription ID and "resource-group-name" with your Resource Group you created above.

    from azure.identity import AzureCliCredential
    from azure.mgmt.testbase import TestBase
    from azure.mgmt.testbase.models import TestBaseAccountResource
    from azure.mgmt.testbase.models import TestBaseAccountSKU
    
    # requesting token from Azure CLI for request
    # For other authentication approaches, please see: https://pypi.org/project/azure-identity/
    credential = AzureCliCredential()
    subscription_id = "<subscription-id>"
    resource_group = "<resource-group-name>"
    testBaseAccount_name = "contoso-testbaseAccount"
    testBaseAccount_location = "global"
    sku_name = "S0"
    sku_tier = "Standard"
    sku_locations = {"global"}
    
    # Create client
    testBase_client = TestBase(credential, subscription_id)
    
    # Create sku for test base account
    sku = TestBaseAccountSKU(name=sku_name, tier=sku_tier, locations=sku_locations)
    
    # Create test base account
    parameters = TestBaseAccountResource(location=testBaseAccount_location, sku=sku)
    testBaseAccount = testBase_client.test_base_accounts.begin_create(resource_group, testBaseAccount_name, parameters).result()
    print("Create test base account:\n{}".format(testBaseAccount))
    

Learn more

Check below links to learn more details about the SDK & API.

Azure Subscription:

Python SDK:

REST API: