-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the function to accept workspace id where lakehouses exists and workspace id where warehouses exits
- Loading branch information
Muhammad Samy
committed
Oct 17, 2024
1 parent
8ed8813
commit f5af7db
Showing
3 changed files
with
111 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,74 +68,4 @@ workspace_head = get_git_status(WORKSPACE_ID, access_token) | |
commit_all_items_to_git(WORKSPACE_ID, workspace_head, access_token) | ||
logger.command("Program Completed") | ||
|
||
``` | ||
|
||
### To edit pipeline connection while migrating the code between dev --> Uat --> Prod | ||
|
||
you can use `update_linked_services` | ||
the following refer to the full code of update from git | ||
|
||
```yml | ||
trigger: | ||
branches: | ||
include: | ||
- dev # Change this to your development branch if different | ||
|
||
pr: | ||
branches: | ||
include: | ||
- uat # Trigger on PRs to UAT | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
- task: AzureKeyVault@2 | ||
displayName: 'Azure Key Vault: da-dev-uaen-01-kv' | ||
inputs: | ||
azureSubscription: FabricSPNConnection | ||
KeyVaultName: 'da-dev-uaen-01-kv' | ||
SecretsFilter: 'CLIENTID, TENANTID, email, password, CLIENTSECRET' | ||
RunAsPreJob: true | ||
|
||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.x' | ||
addToPath: true | ||
|
||
- bash: 'python -m pip install updatefromgit --no-cache-dir --upgrade' | ||
displayName: 'Bash Script' | ||
|
||
- script: | | ||
python3 -c "from update import update_linked_services; update_linked_services('$(Build.SourcesDirectory)/linkedservice-config.json', '$(Build.SourcesDirectory)')" | ||
displayName: 'Run Python Script to Modify JSON Files' | ||
|
||
- task: Bash@3 | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
# Set up Git configuration for committing changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
# Checkout the UAT branch | ||
git checkout uat | ||
# Stage all changes | ||
git add "$BUILD_SOURCESDIRECTORY/**/*.json" # Adjust this pattern to your needs | ||
# Commit changes | ||
git commit -m "Automated update of pipeline-content.json files from PR" | ||
# Push changes to the UAT branch | ||
git push https://$(System.AccessToken)@dev.azure.com/your_org/your_project/_git/your_repo uat | ||
- task: PythonScript@0 | ||
displayName: 'Run a Python script' | ||
inputs: | ||
scriptSource: 'filePath' | ||
scriptPath: '$(Build.SourcesDirectory)/update.py' #look to examples | ||
arguments: '--WORKSPACE_ID $(WORKSPACE_ID) --CLIENT_ID $(CLIENTID) --TENANT_ID $(TENANTID) --USER_NAME $(email) --PASSWORD $(password) --CLIENT_SECRET $(CLIENTSECRET)' | ||
workingDirectory: '$(Build.SourcesDirectory)' | ||
|
||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "updatefromgit" | ||
version = "2.0.4" | ||
version = "2.0.5" | ||
dependencies = ["msal", "azlog"] | ||
requires-python = ">=3.6" | ||
authors = [{ name = "Muhammad Samy", email = "[email protected]" }] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters