-- Create DB
CREATE DATABASE raki_pitr_test
CREATE TABLE table1 (ID int, value nvarchar(10))
GO
INSERT INTO table1 VALUES (1, 'demo1')
INSERT INTO table1 VALUES (2, 'demo2')
View fluentbit_otlp_json_kafka_export.json
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
{ | |
"resourceLogs": [ | |
{ | |
"resource": {}, | |
"scopeLogs": [ | |
{ | |
"scope": {}, | |
"logRecords": [ | |
{ | |
"timeUnixNano": "1652102891470000028", |
View arc-scc.yaml
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
apiVersion: security.openshift.io/v1 | |
kind: SecurityContextConstraints | |
metadata: | |
name: arc-data-scc | |
allowHostDirVolumePlugin: false | |
allowHostIPC: false | |
allowHostNetwork: false | |
allowHostPID: false | |
allowHostPorts: false | |
allowPrivilegeEscalation: true |
View Synapse-Logical-DWH.sql
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
CREATE DATABASE Ldw | |
COLLATE Latin1_General_100_BIN2_UTF8; | |
USE Ldw; | |
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'MyRand0mPa33W0rd1!'; | |
CREATE DATABASE SCOPED CREDENTIAL WorkspaceIdentity | |
WITH IDENTITY = 'Managed Identity'; | |
GO |
View Arc-onboarding-ansible-mimic.sh
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
# Login Into Azure Using Service Principal | |
az_cli_cmd login --service-principal -u az_client_id -p az_client_secret --tenant az_tenant_id | |
# Set Azure Subscription | |
az_cli_cmd account set --subscription az_subscription_id | |
# Create AZ Resource Group: Arc K8s | |
az_cli_cmd group create -l az_location -n az_resource_group | |
# OCP Login |
View get-schema-purview.py
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
# Reusable Functions | |
def azuread_auth(tenant_id: str, client_id: str, client_secret: str, resource_url: str): | |
""" | |
Authenticates Service Principal to the provided Resource URL, and returns the OAuth Access Token | |
""" | |
url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/token" | |
payload= f'grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}&resource={resource_url}' | |
headers = { | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} |
View arc-april-PITR.sh
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
# Correct date | |
cat <<EOF | kubectl create -f - | |
apiVersion: tasks.sql.arcdata.microsoft.com/v1 | |
kind: SqlManagedInstanceRestoreTask | |
metadata: | |
name: sql-restore-raki-correct | |
namespace: arc | |
spec: | |
source: | |
name: sql-gp-1 |
View tina-onboarder-rbac.yaml
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
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: arc-data-deployer-cluster-role | |
rules: | |
# CRDs in general | |
- apiGroups: ["apiextensions.k8s.io"] | |
resources: ["customresourcedefinitions"] | |
verbs: ['create', 'update', 'patch', 'delete', 'list', 'get', 'watch'] # Can figure out lesser scope if needed | |
# All Arc Data apiGroups, I think some of these may be redundant - K8s doesn't give an easy way to get custom apiGroups so I put everything in |
View create-kubeconfig.sh
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
# the Namespace and ServiceAccount name that is used for the config | |
namespace=arc | |
serviceAccount=arcOnboard | |
###################### | |
# actual script starts | |
set -o errexit | |
secretName=$(kubectl --namespace $namespace get serviceAccount $serviceAccount -o jsonpath='{.secrets[0].name}') | |
ca=$(kubectl --namespace $namespace get secret/$secretName -o jsonpath='{.data.ca\.crt}') |
View SQL_MI_Restore_issue.md
View list_synapse_files_recursively.py
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
def deep_ls(path: str, max_depth=1): | |
""" | |
List all files and folders in specified path and | |
subfolders within maximum recursion depth. | |
""" | |
# List all files in path and apply sorting rules | |
li = mssparkutils.fs.ls(path) | |
# Return all files |
NewerOlder