[Python] Unable to deploy using fabric-cicd library

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to deploy notebook files from my local machine to Fabric workspace, I have a service principal, i have given the SP the permissions (Dataset.ReadWrite.All,Tenant.ReadWrite.All,Workspace.GitUpdate.All,Workspace.ReadWrite.All), Also allowed SP to use API's on workspace in Fabric setting enabled. I have assigned the SP on the workspace as admin. I used the fabric-cicd library below to publish, it succesfully runs but no changes on workspace/no files published.

    from azure.identity import AzureCliCredential
    from azure.identity import ClientSecretCredential
    from fabric_cicd import FabricWorkspace, publish_all_items

    client_id = ""
    client_secret = ""
    tenant_id = ""
    token_credential = ClientSecretCredential(client_id=client_id, client_secret=client_secret, tenant_id=tenant_id)

    # Initialize the FabricWorkspace object with the required parameters
    target_workspace = FabricWorkspace(
    workspace_id = "**",
    repository_directory = "C:\\Users\\user1\\Downloads\\Notebooks",

    item_type_in_scope=["Notebook"],
    token_credential=token_credential,
    )

    # Publish all items defined in item_type_in_scope
    publish_all_items(target_workspace)


    Output


    ['data_cleaning_functional_dependencies_tutorial.ipynb', 'nb-sync-uc-fabric-onelake.ipynb', 'test_notebook.ipynb'] [INFO] 16:04:59 - Executing as Application Id '**' Publishing started...

    #################################################################################################### ########## Publishing Notebooks #################################################################### ####################################################################################################

    Publishing completed.
    ​

    Continue reading...

Compartilhe esta Página