Azure Logic Apps Management Client Library

10.0.0 · active · verified Sat Apr 11

This is the Microsoft Azure Logic Apps Management Client Library for Python. It provides programmatic access to manage Azure Logic Apps, enabling users to create, update, and delete automated workflows that integrate various applications, data, services, and on-premises systems. The library is currently at version 10.0.0 and is part of the broader Azure SDK for Python, which follows a continuous release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to instantiate the `LogicManagementClient` and list Integration Accounts within your Azure subscription using `DefaultAzureCredential` for authentication. Make sure your Azure credentials are set up as environment variables or other methods supported by `azure-identity`.

import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.logic import LogicManagementClient

# It's recommended to set these environment variables:
# AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID
# for DefaultAzureCredential to automatically pick them up.

subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "<your-subscription-id>")

try:
    # Authenticate using DefaultAzureCredential
    # This will attempt various authentication methods, including environment variables.
    credential = DefaultAzureCredential()

    # Create a LogicManagementClient
    logic_client = LogicManagementClient(credential, subscription_id)

    print(f"Listing Integration Accounts in subscription: {subscription_id}")

    # List all Integration Accounts within the subscription
    # Integration Accounts are often used with Logic Apps for B2B scenarios.
    integration_accounts = logic_client.integration_accounts.list_by_subscription()

    found_accounts = False
    for account in integration_accounts:
        print(f"- Name: {account.name}, Location: {account.location}, Resource Group: {account.id.split('/')[4]}")
        found_accounts = True

    if not found_accounts:
        print("No Integration Accounts found in this subscription. (This is normal for new subscriptions)")

except Exception as e:
    print(f"An error occurred: {e}")
    print("Please ensure your Azure environment variables (e.g., AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID) are set correctly and you have the necessary permissions.")

view raw JSON →