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
resources | |
| where type == "microsoft.sql/servers/databases" or type == "microsoft.sql/managedinstances" or type == "microsoft.sql/servers/elasticpools" | |
| where properties.licenseType == "LicenseIncluded" | |
| extend SqlEdition = case(sku.name hasprefix_cs "GP_", "Standard", sku.name hasprefix_cs "HS_", "Standard", sku.name hasprefix_cs "BC_", "Enterprise", "Unknown") | |
| extend vCores = toint(sku.capacity) | |
| extend licensesNeeded = toint(round(vCores/2)) | |
| project licensesNeeded, vCores, SqlEdition | |
| summarize sum(licensesNeeded) by SqlEdition |
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
$allRecommendations = New-Object -TypeName "System.Collections.ArrayList" | |
Get-AzSubscription | ForEach-Object { | |
$sub = $_ | |
Set-AzContext -SubscriptionId $_.Id | |
$recommendations = Get-AzSqlServer | Get-AzSqlDatabase | Where-Object Edition -ne "System" | Get-AzSqlDatabaseSensitivityRecommendation | |
$recommendations | ForEach-Object { | |
$dbinfo = $_ | |
$_.SensitivityLabels | ForEach-Object { | |
$newRecommandation = $_ | Select-Object @{label = 'SubscriptionId'; expression = {$sub.Id}}, @{label = 'ResourceGroupName'; expression = {$dbinfo.ResourceGroupName}}, @{label = 'ServerName'; expression = {$dbinfo.ServerName}}, @{label = 'DatabaseName'; expression = {$dbinfo.DatabaseName}}, * | |
$allRecommendations.Add($newRecommandation) |
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
resources | |
| where type == "microsoft.hybridcompute/machines" | |
| where properties.osName == "windows" | |
| extend joinId = tolower(id) | |
| join kind = leftouter ( | |
resources | |
| where type == "microsoft.azurearcdata/sqlserverinstances" | |
| extend arcMachineId = tolower(tostring(properties.containerResourceId)) | |
| extend sqlVersion = tostring(properties.version) | |
| extend vCores = toint(properties.vCore) |
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
{ | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"workbookDisplayName": { | |
"type": "string", | |
"defaultValue": "SQL Licensing Summary", | |
"metadata": { | |
"description": "The friendly name for the workbook that is used in the Gallery or Saved List. This name must be unique within a resource group." | |
} | |
}, |
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
# Run this first via Cloud Shell to create your Service Principal and get all the needed information | |
$sp = New-AzADServicePrincipal -DisplayName "Arc-for-servers" -Role "Owner" | |
$tenantId= (Get-AzContext).Tenant.Id | |
$sp.AppId | |
$sp.PasswordCredentials.SecretText | |
$tenantId | |
# Run this locally after all permissions have been set. | |
$servicePrincipalAppId="Value of $sp.AddId" |
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
# Need two parameters when called, the input CSV list of all servers and the Output folder | |
# CSV File must be structured like below (Note ServerName,InstanceName header must be included) | |
# ServerName,InstanceName | |
# localhost,MSSQLSERVER | |
param($CsvPath, $OutFolder) | |
mkdir -p "$OutFolder\SqlAssessments" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
sudo snap remove docker | |
sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common gnupg2 | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/docker.gpg | |
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
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
export client_id="YourUserManagedIdentityClientIdGUID" | |
export DATABRICKS_AAD_TOKEN=$(curl "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d&client_id=$client_id" -H Metadata:true -s | jq -r '.access_token') | |
databricks configure --aad-token # or you can use the DATABRICKS_AAD_TOKEN env var anywhere else you need to auth! |
NewerOlder