Skip to content

Instantly share code, notes, and snippets.

View rndazurescript's full-sized avatar

R&D Azure Script rndazurescript

View GitHub Profile
@rndazurescript
rndazurescript / storage.py
Last active May 2, 2020 17:02
Play with Azure Storage
from azure.storage.common.cloudstorageaccount import CloudStorageAccount
from azure.storage.common.models import AccessPolicy
from azure.storage.blob import BlockBlobService, PageBlobService, AppendBlobService
from azure.storage.models import CorsRule, Logging, Metrics, RetentionPolicy, ResourceTypes, AccountPermissions
from azure.storage.blob.models import BlobBlock, ContainerPermissions, ContentSettings
from datetime import datetime, timedelta
import time
import json
settings= {}
@rndazurescript
rndazurescript / VersionDataBricks.bat
Created April 2, 2020 19:34
Versioning databricks workspace files
@echo off
REM Create a conda environment
conda create -n databricks pip
REM Activate environment
conda activate databricks
REM Ensure pip is located inside that environment
pip --version
REM Should have envs\databricks in the output like ...conda\envs\databricks\lib\site-packages\pip
@rndazurescript
rndazurescript / Enable-LongPathSupport.ps1
Created March 13, 2020 10:18
Enable long paths on windows
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem"
$Name = "LongPathsEnabled"
$expectedValue = "1"
$currentValue=(Get-ItemProperty -Path $registryPath -Name $Name).$Name
if ($currentValue -ne $expectedValue){
Write-Host "Enabling long path support"
New-ItemProperty -Path $registryPath -Name $name -Value $expectedValue -PropertyType DWORD -Force | Out-Null
@rndazurescript
rndazurescript / DataBricksGetIpCell.png
Last active March 7, 2020 21:03
Get DataBricks IP
DataBricksGetIpCell.png
@rndazurescript
rndazurescript / DeployADFv2ArmTemplate.ps1
Last active January 22, 2022 19:35
Deploy ADFv2 exported ARM templates
# Based on
# https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment
# https://azure.microsoft.com/mediahandler/files/resourcefiles/whitepaper-adf-on-azuredevops/Azure%20data%20Factory-Whitepaper-DevOps.pdf
#
# WARNING: Deleting the pipelines will also delete the execution log. If you do need the log, consider exporting it to Azure Monitor
# as described https://docs.microsoft.com/en-us/azure/data-factory/monitor-using-azure-monitor. Also keep in mind that
# ADF stores pipeline-run data for only 45 days, so exporting to azure monitor will assist preserving the data for more time.
#
# Prerequisites
# This code runs on powershell 7+ to use ForEach-Object -Parallel.