Skip to content

Commit dfc4525

Browse files
author
Melony QIN
authored
Merge pull request #11 from microsoft/master
merge from master
2 parents abd4e9e + 09f3471 commit dfc4525

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

samples/manage/azure-hybrid-benefit/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services: Azure SQL
33
platforms: Azure
44
author: anosov1960
55
ms.author: sashan
6-
ms.date: 3/9/2021
6+
ms.date: 3/27/2021
77
---
88

99
# Overview
@@ -16,10 +16,10 @@ This script provides a simple solution to analyze and track the consolidated uti
1616
|Time|Time of the scan|
1717
|Subscription name|The name of the subscription|
1818
|Subscription ID|The unique subscription ID|
19-
|AHB Std vCores|Total vCores used by General Purpose service tier or SQL Server Standard edition billed with hybrid benefit discount|
20-
|AHB Ent vCores|Total vCores used by Business Critical service tier or SQL Server Enterprise edition billed with hybrid benefit discount|
21-
|PAYG Std vCores|Total vCores used by General Purpose service tier or SQL Server Standard edition billed at full price|
22-
|PAYG Ent vCores|Total vCores used by Business Critical service tier or SQL Server Enterprise edition billed at full price|
19+
|AHB Std vCores|Total vCores used by Standard level SQL services (General Purpose service tier or SQL Server Standard edition) that have Azure hybrid benefit enabled|
20+
|AHB Ent vCores|Total vCores used by Premium level SQL services (Business Critical service tier or SQL Server Enterprise edition) that have Azure hybrid benefit enabled|
21+
|PAYG Std vCores|Total vCores used by Standard level SQL services (General Purpose service tier or SQL Server Standard edition) that are billed using the pay-as-you-go method|
22+
|PAYG Ent vCores|Total vCores used by Premium level SQL services (Business Critical service tier or SQL Server Enterprise edition) that are billed using the pay-as-you-go method|
2323
|HADR Std vCores|Total vCores used by HADR replicas running SQL Server Standard edition|
2424
|HADR Ent vCores|Total vCores used by HADR replicas running SQL Server Enterprise edition|
2525
|Developer vCores|Total vCores used by SQL Server Developer edition|
@@ -42,7 +42,7 @@ The following resources are in scope for the license utilization analysis:
4242
> - For PaaS workloads, each vCore of Business Critical service tier is counted as one Enterprise vCore and each vCore of General Purpose service tier is counted as one Standard vCore.
4343
> - In the DTU-based purchasing model, the SQL license cost is built into the individual SKU prices. These resources are not eligible for Azure Hybrid Benefit or HADR benefit, and therefore are not in scope of the tool.
4444
> - You must be at least a *Reader* of each subscription you scan.
45-
> - To report unregistered vCores, you must be a subscription *Contributor* or *Owner*, otherwise this column will show a zero value.
45+
> - To report unregistered vCores, you must be a subscription *Contributor* or *Owner*, otherwise this column will show a zero value. Selecting this option will substantially increase the execution time, especially for the subscriptions with large numbers of virtual machines.
4646
> - The values AHB ECs and PAYG ECs are reserved for the future use and should be ignored
4747
4848
# Launching the script
@@ -57,7 +57,7 @@ The script accepts the following command line parameters:
5757
|-Database|database_name|Optional: database name where data will be saved.<br> Must be accompanied by -Server and -Cred|
5858
|-Cred|credential_object|Optional: value of type PSCredential to securely pass database user and password|
5959
|-FilePath|csv_file_name|Optional: filename where the data will be saved in a .csv format. Ignored if database parameters are specified|
60-
|-ShowUnregistered|\$True or \$False (default)|Optional: causes the script to report the total size of VMs that self-host SQL server instance that is unregistered with the IaaS SQL extension|
60+
|-ShowUnregistered|\$True or \$False (default)|Optional: causes the script to report the total size of VMs with a self-hosted SQL server instance that is unregistered with the IaaS SQL extension|
6161

6262
<sup>1</sup>You can create a .csv file using the following command and then edit to remove the subscriptions you don't want to scan.
6363
```PowerShell

samples/manage/azure-hybrid-benefit/sql-license-usage.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
param (
3030
[Parameter (Mandatory= $false)]
31-
[string] $SubId = '4f6d3845-d3e3-4c31-bdf0-c73464aaff0e',
31+
[string] $SubId,
3232
[Parameter (Mandatory= $false)]
3333
[string] $Server,
3434
[Parameter (Mandatory= $false)]
@@ -88,7 +88,7 @@ function GetVCores {
8888
$global:VM_SKUs = Get-AzComputeResourceSku "westus" | where-object {$_.ResourceType -in 'virtualMachines','hostGroups/hosts'}
8989
}
9090
# Select first size and get the VCPus available
91-
$size_info = $global:VM_SKUs | Where-Object {$_.ResourceType.Contains($type) -and $_.Name.Contains($name)} | Select-Object -First 1
91+
$size_info = $global:VM_SKUs | Where-Object {$_.ResourceType.Contains($type) -and ($_.Name -eq $name)} | Select-Object -First 1
9292

9393
# Save the VCPU count
9494
switch ($type) {
@@ -254,7 +254,7 @@ if ($SubId -like "*.csv") {
254254

255255
[bool] $useDatabase = $PSBoundParameters.ContainsKey("Server") -and $PSBoundParameters.ContainsKey("Cred") -and $PSBoundParameters.ContainsKey("Database")
256256

257-
# Initialize tables and arrays
257+
# Initialize tables and arrays
258258

259259
if ($useDatabase){
260260

6 KB
Binary file not shown.

samples/manage/sql-assessment-api/release-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ Download: [SMO NuGet Package](https://www.nuget.org/packages/Microsoft.SqlServer
1414

1515
You can use GitHub issues to provide feedback to the product team.
1616

17+
## March 2021 - 1.0.305
18+
19+
Version: SqlServer PowerShell module 21.1.18245, SqlManagementObjects (SMO) package wasn't updated
20+
21+
### Bug fixes and improvements
22+
23+
- Fixed an issue that may cause the 'ReplErrors24H' check to fail on case-sensitive SQL Server instances with Distributor databases
24+
1725
## March 2021 - 1.0.304
1826

1927
Version: SqlServer PowerShell module wasn't updated, SqlManagementObjects (SMO) package wasn't updated

samples/manage/sql-assessment-api/ruleset.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": "1.0",
33
"name": "Microsoft ruleset",
4-
"version": "1.0.304",
4+
"version": "1.0.305",
55
"rules": [
66
{
77
"id": "AutoCreateStats",
@@ -8871,7 +8871,7 @@
88718871
"version": "[11.0,)"
88728872
},
88738873
"implementation": {
8874-
"query": "DECLARE @cmd NVARCHAR(max) = N''; SELECT @cmd = @cmd + N' USE ' + QUOTENAME([name]) + N'; SELECT msa.publisher_db ,msa.publication FROM dbo.MSdistribution_history AS msh INNER JOIN dbo.MSrepl_errors AS mse ON mse.id = msh.error_id INNER JOIN dbo.MSdistribution_agents AS msa ON msh.agent_id = msa.id WHERE mse.TIME >= DATEADD(hh, - 24, GETDATE()) GROUP BY msa.publisher_db ,msa.publication;' FROM [master].sys.databases WHERE is_distributor = 1; EXEC (@cmd);"
8874+
"query": "DECLARE @cmd NVARCHAR(max) = N''; SELECT @cmd = @cmd + N' USE ' + QUOTENAME([name]) + N'; SELECT msa.publisher_db ,msa.publication FROM dbo.MSdistribution_history AS msh INNER JOIN dbo.MSrepl_errors AS mse ON mse.id = msh.error_id INNER JOIN dbo.MSdistribution_agents AS msa ON msh.agent_id = msa.id WHERE mse.time >= DATEADD(hh, - 24, GETDATE()) GROUP BY msa.publisher_db ,msa.publication;' FROM [master].sys.databases WHERE is_distributor = 1; EXEC (@cmd);"
88758875
}
88768876
}
88778877
],

0 commit comments

Comments
 (0)