Skip to content

Commit c2f449f

Browse files
authored
Added premissions and restructured
1 parent 51494ce commit c2f449f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 8 additions & 6 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: 10/26/2022
6+
ms.date: 01/07/2023
77
---
88

99
# Overview
@@ -42,9 +42,10 @@ The following resources are in scope for the license utilization analysis:
4242
> - For IaaS workloads, such as SQL Server in Virtual Machines or SSIS integration runtimes, each vCPU is counted as one vCore.
4343
> - 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.
4444
> - 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.
45-
> - You must be at least a *Reader* of each subscription you scan.
46-
> - 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.
47-
> - The values AHB ECs and PAYG ECs are reserved for the future use and should be ignored
45+
46+
# Required permissions
47+
48+
You must be at least a *Reader* of each subscription you scan. If you report unregistered vCores, you must have the `Microsoft.Compute/virtualMachines/runCommand/action` permission. The [Virtual Machine Contributor](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#virtual-machine-contributor) role and higher levels have this permission. If you don't have this permission, the tool will shows zero value for unregistered cores.
4849

4950
# Launching the script
5051

@@ -59,15 +60,16 @@ The script accepts the following command line parameters:
5960
|-Cred|credential_object|Optional: value of type PSCredential to securely pass database user and password|
6061
|-FilePath|csv_file_name|Optional: filename where the data will be saved in a .csv format. Ignored if database parameters are specified|
6162
|-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|
62-
|-ShowNC|\$True or \$False (default)|Optional: causes the script to report the AHB and PAYG consumption in normalized cores (NC). For more information about normalized cores, see [How licenses apply to Azure resources](https://learn.microsoft.com/azure/cost-management-billing/scope-level/overview-azure-hybrid-benefit-scope#how-licenses-apply-to-azure-resources).|
63-
6463

6564
<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.
6665
```PowerShell
6766
Get-AzSubscription | Export-Csv .\mysubscriptions.csv -NoTypeInformation
6867
```
6968
If both database parameters and *FilePath* are omitted, the script will write the results to a `.\sql-license-usage.csv` file. The file is created automatically. If the file already exists, the consecutive scans will append the results to it. If the database parameters are specified, the data will be saved in a *Usage-per-subscription* table. If the table doesn't exist, it will be created automatically.
7069

70+
>[!IMPORTANT]
71+
> Selecting `-ShowUnregistered` option will substantially increase the execution time, especially for the subscriptions with a large number of virtual machines.
72+
7173
## Example 1
7274

7375
The following command will scan all the subscriptions to which the user has access to and save the results in `.\sql-license-usage.csv`

0 commit comments

Comments
 (0)