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")
Metadata
Release files for updatefromgit 2.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| updatefromgit-2.0.5.tar.gz | 8.9 kB | Without provenance | Details for updatefromgit-2.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| updatefromgit-2.0.5-py3-none-any.whl | Python 3 | none | any | Details for updatefromgit-2.0.5-py3-none-any.whl |
Total release size: 17.7 kB
Release files / updatefromgit-2.0.5.tar.gz
| Download URL | updatefromgit-2.0.5.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe4cb06fadd68e65dcba35c59f1ff3425268b74d860dcab34451f11d7a3b55a3
|
|
BLAKE2b-256 checksum How to use checksums |
68761239a4404353acc14e21759af81aa940f2d603976396264371dd408c0ce2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / updatefromgit-2.0.5-py3-none-any.whl
| Download URL | updatefromgit-2.0.5-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
218fd5098f70b07c338f59d37d9c59fa00d8e4dc88c0f42caace503c125f6828
|
|
BLAKE2b-256 checksum How to use checksums |
63452a1ed81254b3e696f7d33993e1a84886c03a659715555e6ed1f1f002c29c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for updatefromgit 2.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.