Skip to main content

Update Fabric Workspace From Git Repo using A user with Email And Password

Project description

UpdateFromGit PyPI and TestPyPI

Update From Git

This package is built on top of this repository.I have enhanced it to be more suitable for Azure Pipelines.

Description

This package is designed to be used within an Azure DevOps Pipeline to update a Fabric Workspace from a Git repository using a user with an email and password. It supports both public client and confidential client applications. For more information about the differences, click here

Note This is currently the only available method because Microsoft does not support service principals for these operations. Once it becomes available, please use it. For more information, check Microsoft Entra supported identities here.

Another method is to schedule a notebook on Fabric running under the authority of a user who is a contributor or higher in an administration workspace using this libirary.

Install

To install the package, use the following command:

pip install updatefromgit

Usage

First, import the required functions. This example uses a confidential App but you can use a public one and omit the client secret

import logging
import os
import sys
import time
from azlog import AzLogger

from updatefromgit import (
    acquire_token_user_id_password_confidential,
    commit_all_items_to_git,
    get_git_status,
    update_workspace_from_git,
)

logger = AzLogger(__name__)
logger.setLevel(logging.INFO)

Next, create your constants:

FABRIC_API_URL = "https://api.fabric.microsoft.com/v1"
CLIENT_ID = ""
TENANT_ID = ""
USERNAME = ""
PASSWORD = ""
WORKSPACE_ID = ""

Then, you can call the functions:

access_token = acquire_token_user_id_password_confidential(
    TENANT_ID, CLIENT_ID, USERNAME, PASSWORD, CLIENT_SECRET
)
update_workspace_from_git(WORKSPACE_ID, access_token)
time.sleep(600) #adjust it per your need
workspace_head = get_git_status(WORKSPACE_ID, access_token)
commit_all_items_to_git(WORKSPACE_ID, workspace_head, access_token)
logger.command("Program Completed")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

updatefromgit-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

updatefromgit-1.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file updatefromgit-1.0.1.tar.gz.

File metadata

  • Download URL: updatefromgit-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for updatefromgit-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9388643af16b7ec0b3a94d5a6b6f3b710b5e01cb645a8509762b0fec6183b700
MD5 74ed9a12147a701e0df0c4428d57191d
BLAKE2b-256 5a0fabc12943571f2c4b82f92c85c9b8ab2a54bd26997cf747dde81a7e00aae4

See more details on using hashes here.

File details

Details for the file updatefromgit-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: updatefromgit-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for updatefromgit-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37a5630c9f01aa37689066ebbbdd6127c2c810a75bebaaadf338798aa9c0a5cb
MD5 b00b37d3331df7feffe0e4c0a4fa099f
BLAKE2b-256 02bef60d6b4cbb31cfc71f20e349b6a064f157e4544a3ae9371b0539b3d6dcf7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page