-
-## Outputs
-
-| Output Name | Type | Description |
-| :------------------ | :----- | :--------------------------------------------------------------------- |
-| `name` | string | The name of the Integration Runtime. |
-| `resourceGroupName` | string | The name of the Resource Group the Integration Runtime was created in. |
-| `resourceId` | string | The resource ID of the Integration Runtime. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.DataFactory/factories/integrationRuntimes/version.json b/src/modules/Microsoft.DataFactory/factories/integrationRuntimes/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.DataFactory/factories/integrationRuntimes/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/deploy.bicep b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/deploy.bicep
deleted file mode 100644
index a64a1fd9..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/deploy.bicep
+++ /dev/null
@@ -1,61 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/deploy.bicep
-// Date: 2023-02-02
-// Version: 0.9
-
-@description('Conditional. The name of the parent Azure Data Factory. Required if the template is used in a standalone deployment.')
-param dataFactoryName string
-
-@description('Required. The name of the Managed Virtual Network.')
-param name string
-
-@description('Optional. An array of managed private endpoints objects created in the Data Factory managed virtual network.')
-param managedPrivateEndpoints array = []
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-var enableReferencedModulesTelemetry = false
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' existing = {
- name: dataFactoryName
-}
-
-resource managedVirtualNetwork 'Microsoft.DataFactory/factories/managedVirtualNetworks@2018-06-01' = {
- name: name
- parent: dataFactory
- properties: {}
-}
-
-module managedVirtualNetwork_managedPrivateEndpoint 'managedPrivateEndpoints/deploy.bicep' = [for (managedPrivateEndpoint, index) in managedPrivateEndpoints: {
- name: '${deployment().name}-managedPrivateEndpoint-${index}'
- params: {
- dataFactoryName: dataFactoryName
- managedVirtualNetworkName: name
- name: managedPrivateEndpoint.name
- fqdns: managedPrivateEndpoint.fqdns
- groupId: managedPrivateEndpoint.groupId
- privateLinkResourceId: managedPrivateEndpoint.privateLinkResourceId
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}]
-
-@description('The name of the Resource Group the Managed Virtual Network was created in.')
-output resourceGroupName string = resourceGroup().name
-
-@description('The name of the Managed Virtual Network.')
-output name string = managedVirtualNetwork.name
-
-@description('The resource ID of the Managed Virtual Network.')
-output resourceId string = managedVirtualNetwork.id
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/deploy.bicep b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/deploy.bicep
deleted file mode 100644
index 6f901053..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/deploy.bicep
+++ /dev/null
@@ -1,63 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/deploy.bicep
-// Date: 2023-02-02
-// Version: 0.9
-
-@description('Conditional. The name of the parent data factory. Required if the template is used in a standalone deployment.')
-param dataFactoryName string
-
-@description('Required. The name of the parent managed virtual network.')
-param managedVirtualNetworkName string
-
-@description('Required. The managed private endpoint resource name.')
-param name string
-
-@description('Required. The groupId to which the managed private endpoint is created.')
-param groupId string
-
-@description('Required. Fully qualified domain names.')
-param fqdns array
-
-@description('Required. The ARM resource ID of the resource to which the managed private endpoint is created.')
-param privateLinkResourceId string
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-resource datafactory 'Microsoft.DataFactory/factories@2018-06-01' existing = {
- name: dataFactoryName
-
- resource managedVirtualNetwork 'managedVirtualNetworks@2018-06-01' existing = {
- name: managedVirtualNetworkName
- }
-}
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource managedPrivateEndpoint 'Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints@2018-06-01' = {
- name: name
- parent: datafactory::managedVirtualNetwork
- properties: {
- fqdns: fqdns
- groupId: groupId
- privateLinkResourceId: privateLinkResourceId
- }
-}
-
-@description('The name of the deployed managed private endpoint.')
-output name string = managedPrivateEndpoint.name
-
-@description('The resource ID of the deployed managed private endpoint.')
-output resourceId string = managedPrivateEndpoint.id
-
-@description('The resource group of the deployed managed private endpoint.')
-output resourceGroupName string = resourceGroup().name
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/readme.md b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/readme.md
deleted file mode 100644
index 2a91e56b..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/readme.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# DataFactory Factories ManagedVirtualNetwork ManagedPrivateEndpoints `[Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints]`
-
-Copied from [Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints) - **CARML v0.9** (Feb 2, 2023>)
-
-
-
-
-This module deploys a Managed Private Endpoint in a Managed Virtual Network for an Azure Data Factory
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/managedVirtualNetworks/managedPrivateEndpoints) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :-------------------------- | :----- | :------------------------------------------------------------------------------------ |
-| `fqdns` | array | Fully qualified domain names. |
-| `groupId` | string | The groupId to which the managed private endpoint is created. |
-| `managedVirtualNetworkName` | string | The name of the parent managed virtual network. |
-| `name` | string | The managed private endpoint resource name. |
-| `privateLinkResourceId` | string | The ARM resource ID of the resource to which the managed private endpoint is created. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :---------------- | :----- | :------------------------------------------------------------------------------------------------ |
-| `dataFactoryName` | string | The name of the parent data factory. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :----------------------- | :--- | :------------ | :-------------------------------------------------------- |
-| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
-
-## Outputs
-
-| Output Name | Type | Description |
-| :------------------ | :----- | :----------------------------------------------------------- |
-| `name` | string | The name of the deployed managed private endpoint. |
-| `resourceGroupName` | string | The resource group of the deployed managed private endpoint. |
-| `resourceId` | string | The resource ID of the deployed managed private endpoint. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/version.json b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/readme.md b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/readme.md
deleted file mode 100644
index e76bd412..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/readme.md
+++ /dev/null
@@ -1,105 +0,0 @@
-# Data Factory Managed Virtual Network `[Microsoft.DataFactory/factories/managedVirtualNetworks]`
-
-Copied from [Microsoft.DataFactory/factories/managedVirtualNetworks](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.DataFactory/factories/managedVirtualNetworks) - **CARML v0.9** (Feb 2, 2023>)
-
-
-
-
-This module deploys a Managed Virtual Network for an Azure Data Factory
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.DataFactory/factories/managedVirtualNetworks` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/managedVirtualNetworks) |
-| `Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/managedVirtualNetworks/managedPrivateEndpoints) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :------------- | :----- | :--------------------------------------- |
-| `name` | string | The name of the Managed Virtual Network. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :---------------- | :----- | :------------------------------------------------------------------------------------------------------ |
-| `dataFactoryName` | string | The name of the parent Azure Data Factory. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :------------------------ | :------------------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------- |
-| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `managedPrivateEndpoints` | _[managedPrivateEndpoints](managedPrivateEndpoints/readme.md)_ array | `[]` | An array of managed private endpoints objects created in the Data Factory managed virtual network. |
-
-### Parameter Usage: `managedPrivateEndpoints`
-
-To use Managed Private Endpoints the following dependencies must be deployed:
-
-- Destination private link resource must be created before and permissions allow requesting a private link connection to that resource.
-
-Parameter JSON format
-
-```json
-"managedPrivateEndpoints": {
- "value": [
- {
- "name": "mystorageaccount-managed-privateEndpoint", // Required: The managed private endpoint resource name
- "groupId": "blob", // Required: The groupId to which the managed private endpoint is created
- "fqdns": [
- "mystorageaccount.blob.core.windows.net" // Required: Fully qualified domain names
- ],
- "privateLinkResourceId": "/subscriptions/<Bicep format
-
-```bicep
-managedPrivateEndpoints: [
- // Example showing all available fields
- {
- name: 'mystorageaccount-managed-privateEndpoint' // Required: The managed private endpoint resource name
- groupId: 'blob' // Required: The groupId to which the managed private endpoint is created
- fqdns: [
- 'mystorageaccount.blob.core.windows.net' // Required: Fully qualified domain names
- ]
- privateLinkResourceId: '/subscriptions/<
-
-## Outputs
-
-| Output Name | Type | Description |
-| :------------------ | :----- | :------------------------------------------------------------------------- |
-| `name` | string | The name of the Managed Virtual Network. |
-| `resourceGroupName` | string | The name of the Resource Group the Managed Virtual Network was created in. |
-| `resourceId` | string | The resource ID of the Managed Virtual Network. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/version.json b/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.DataFactory/factories/managedVirtualNetworks/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.DataFactory/factories/readme.md b/src/modules/Microsoft.DataFactory/factories/readme.md
deleted file mode 100644
index 7f342380..00000000
--- a/src/modules/Microsoft.DataFactory/factories/readme.md
+++ /dev/null
@@ -1,627 +0,0 @@
-# Data Factories `[Microsoft.DataFactory/factories]`
-
-Copied from [Microsoft.DataFactory/factories](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.DataFactory/factories) - **CARML v0.9** (Feb 2, 2023>)
-
-
-
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-- [Deployment examples](#deployment-examples)
-
-## Resource types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.Authorization/locks` | [2020-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.DataFactory/factories` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories) |
-| `Microsoft.DataFactory/factories/integrationRuntimes` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/integrationRuntimes) |
-| `Microsoft.DataFactory/factories/managedVirtualNetworks` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/managedVirtualNetworks) |
-| `Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints` | [2018-06-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DataFactory/2018-06-01/factories/managedVirtualNetworks/managedPrivateEndpoints) |
-| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
-| `Microsoft.Network/privateEndpoints` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints) |
-| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints/privateDnsZoneGroups) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :------------- | :----- | :--------------------------------------- |
-| `name` | string | The name of the Azure Factory to create. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :---------------------------------- | :----- | :------------ | :----------------------------------------------------------------------------------------------------------------------------- |
-| `cMKKeyVaultResourceId` | string | `''` | The resource ID of a key vault to reference a customer managed key for encryption from. Required if 'cMKKeyName' is not empty. |
-| `cMKUserAssignedIdentityResourceId` | string | `''` | User assigned identity to use when fetching the customer managed key. Required if 'cMKKeyName' is not empty. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-------------------------------------- | :----------------------------------------------------------- | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. |
-| `cMKKeyVersion` | string | `''` | | The version of the customer managed key to reference for encryption. If not provided, the latest key version is used. |
-| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
-| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `[ActivityRuns, allLogs, PipelineRuns, SSISIntegrationRuntimeLogs, SSISPackageEventMessageContext, SSISPackageEventMessages, SSISPackageExecutableStatistics, SSISPackageExecutionComponentPhases, SSISPackageExecutionDataStatistics, TriggerRuns]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
-| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
-| `diagnosticSettingsName` | string | `[format('{0}-diagnosticSettings', parameters('name'))]` | | The name of the diagnostic setting, if deployed. |
-| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
-| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `gitAccountName` | string | `''` | | The account name. |
-| `gitCollaborationBranch` | string | `'main'` | | The collaboration branch name. Default is 'main'. |
-| `gitConfigureLater` | bool | `True` | | Boolean to define whether or not to configure git during template deployment. |
-| `gitProjectName` | string | `''` | | The project name. Only relevant for 'FactoryVSTSConfiguration'. |
-| `gitRepositoryName` | string | `''` | | The repository name. |
-| `gitRepoType` | string | `'FactoryVSTSConfiguration'` | | Repository type - can be 'FactoryVSTSConfiguration' or 'FactoryGitHubConfiguration'. Default is 'FactoryVSTSConfiguration'. |
-| `gitRootFolder` | string | `'/'` | | The root folder path name. Default is '/'. |
-| `integrationRuntimes` | _[integrationRuntimes](integrationRuntimes/readme.md)_ array | `[]` | | An array of objects for the configuration of an Integration Runtime. |
-| `location` | string | `[resourceGroup().location]` | | Location for all Resources. |
-| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
-| `managedPrivateEndpoints` | array | `[]` | | An array of managed private endpoints objects created in the Data Factory managed virtual network. |
-| `managedVirtualNetworkName` | string | `''` | | The name of the Managed Virtual Network. |
-| `privateEndpoints` | array | `[]` | | Configuration Details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
-| `publicNetworkAccess` | string | `''` | `['', Disabled, Enabled]` | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set. |
-| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-| `systemAssignedIdentity` | bool | `False` | | Enables system assigned managed identity on the resource. |
-| `tags` | object | `{object}` | | Tags of the resource. |
-| `userAssignedIdentities` | object | `{object}` | | The ID(s) to assign to the resource. |
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `userAssignedIdentities`
-
-You can specify multiple user assigned identities to a resource by providing additional resource IDs using the following format:
-
-Parameter JSON format
-
-```json
-"userAssignedIdentities": {
- "value": {
- "/subscriptions/<Bicep format
-
-```bicep
-userAssignedIdentities: {
- '/subscriptions/<
-
-### Parameter Usage: `privateEndpoints`
-
-To use Private Endpoint the following dependencies must be deployed:
-
-- Destination subnet must be created with the following configuration option - `"privateEndpointNetworkPolicies": "Disabled"`. Setting this option acknowledges that NSG rules are not applied to Private Endpoints (this capability is coming soon). A full example is available in the Virtual Network Module.
-- Although not strictly required, it is highly recommended to first create a private DNS Zone to host Private Endpoint DNS records. See [Azure Private Endpoint DNS configuration](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns) for more information.
-
-Parameter JSON format
-
-```json
-"privateEndpoints": {
- "value": [
- // Example showing all available fields
- {
- "name": "sxx-az-pe", // Optional: Name will be automatically generated if one is not provided here
- "subnetResourceId": "/subscriptions/<Bicep format
-
-```bicep
-privateEndpoints: [
- // Example showing all available fields
- {
- name: 'sxx-az-pe' // Optional: Name will be automatically generated if one is not provided here
- subnetResourceId: '/subscriptions/<
-
-### Parameter Usage: `managedPrivateEndpoints`
-
-To use Managed Private Endpoints the following dependencies must be deployed:
-
-- The `managedVirtualNetworkName` property must be set to allow provisioning of a managed virtual network in Azure Data Factory.
-- Destination private link resource must be created before and permissions allow requesting a private link connection to that resource.
-
-Parameter JSON format
-
-```json
-"managedPrivateEndpoints": {
- "value": [
- {
- "name": "mystorageaccount-managed-privateEndpoint", // Required: The managed private endpoint resource name
- "groupId": "blob", // Required: The groupId to which the managed private endpoint is created
- "fqdns": [
- "mystorageaccount.blob.core.windows.net" // Required: Fully qualified domain names
- ],
- "privateLinkResourceId": "/subscriptions/<Bicep format
-
-```bicep
-managedPrivateEndpoints: [
- // Example showing all available fields
- {
- name: 'mystorageaccount-managed-privateEndpoint' // Required: The managed private endpoint resource name
- groupId: 'blob' // Required: The groupId to which the managed private endpoint is created
- fqdns: [
- 'mystorageaccount.blob.core.windows.net' // Required: Fully qualified domain names
- ]
- privateLinkResourceId: '/subscriptions/<
- -## Outputs - -| Output Name | Type | Description | -| :-------------------------- | :----- | :---------------------------------------------------- | -| `location` | string | The location the resource was deployed into. | -| `name` | string | The Name of the Azure Data Factory instance. | -| `resourceGroupName` | string | The name of the Resource Group with the Data factory. | -| `resourceId` | string | The Resource ID of the Data factory. | -| `systemAssignedPrincipalId` | string | The principal ID of the system assigned identity. | - -## Cross-referenced modules - -This section gives you an overview of all local-referenced module files (i.e., other CARML modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs). - -| Reference | Type | -| :----------------------------------- | :-------------- | -| `Microsoft.Network/privateEndpoints` | Local reference | - -## Deployment examples - -The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. - -> **Note**: The name of each example is based on the name of the file from which it is taken. - -> **Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. - -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
diff --git a/src/modules/Microsoft.DataFactory/factories/version.json b/src/modules/Microsoft.DataFactory/factories/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.DataFactory/factories/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.KeyVault/vaults/.bicep/nested_roleAssignments.bicep b/src/modules/Microsoft.KeyVault/vaults/.bicep/nested_roleAssignments.bicep
deleted file mode 100644
index d8e9a364..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/.bicep/nested_roleAssignments.bicep
+++ /dev/null
@@ -1,79 +0,0 @@
-@sys.description('Required. The IDs of the principals to assign the role to.')
-param principalIds array
-
-@sys.description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
-param roleDefinitionIdOrName string
-
-@sys.description('Required. The resource ID of the resource to apply the role assignment to.')
-param resourceId string
-
-@sys.description('Optional. The principal type of the assigned principal ID.')
-@allowed([
- 'ServicePrincipal'
- 'Group'
- 'User'
- 'ForeignGroup'
- 'Device'
- ''
-])
-param principalType string = ''
-
-@sys.description('Optional. The description of the role assignment.')
-param description string = ''
-
-@sys.description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
-param condition string = ''
-
-@sys.description('Optional. Version of the condition.')
-@allowed([
- '2.0'
-])
-param conditionVersion string = '2.0'
-
-@sys.description('Optional. Id of the delegated managed identity resource.')
-param delegatedManagedIdentityResourceId string = ''
-
-var builtInRoleNames = {
- Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
- 'Desktop Virtualization Virtual Machine Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a959dbd1-f747-45e3-8ba6-dd80f235f97c')
- 'Key Vault Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')
- 'Key Vault Certificates Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a4417e6f-fecd-4de8-b567-7b0420556985')
- 'Key Vault Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f25e0fa2-a7c8-4377-a976-54943a77a395')
- 'Key Vault Crypto Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')
- 'Key Vault Crypto Service Encryption User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6')
- 'Key Vault Crypto User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '12338af0-0e69-4776-bea7-57ae8d297424')
- 'Key Vault Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '21090545-7ca7-4776-b22c-e363652d74d2')
- 'Key Vault Secrets Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7')
- 'Key Vault Secrets User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4633458b-17de-408a-b874-0445c86b69e6')
- 'Log Analytics Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
- 'Log Analytics Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
- 'Managed Application Contributor Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '641177b8-a67a-45b9-a033-47bc880bb21e')
- 'Managed Application Operator Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c7393b34-138c-406f-901b-d8cf2b17e6ae')
- 'Managed Applications Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b9331d33-8a36-4f8c-b097-4f54124fdb44')
- 'Managed HSM contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18500a29-7fe2-46b2-a342-b16a415e101d')
- 'Monitoring Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '749f88d5-cbae-40b8-bcfc-e573ddc772fa')
- 'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
- Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
- Reader: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
- 'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
- 'Role Based Access Control Administrator (Preview)': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f58310d9-a9f6-439a-9e8d-f62e7b41a168')
- 'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
-}
-
-resource keyVault 'Microsoft.KeyVault/vaults@2019-09-01' existing = {
- name: last(split(resourceId, '/'))
-}
-
-resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for principalId in principalIds: {
- name: guid(keyVault.id, principalId, roleDefinitionIdOrName)
- properties: {
- description: description
- roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
- principalId: principalId
- principalType: !empty(principalType) ? any(principalType) : null
- condition: !empty(condition) ? condition : null
- conditionVersion: !empty(conditionVersion) && !empty(condition) ? conditionVersion : null
- delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : null
- }
- scope: keyVault
-}]
diff --git a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/deploy.bicep b/src/modules/Microsoft.KeyVault/vaults/accessPolicies/deploy.bicep
deleted file mode 100644
index 6f599362..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/deploy.bicep
+++ /dev/null
@@ -1,55 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.KeyVault/vaults/accessPolicies/deploy.bicep
-// Date: 2023-02-018
-// Version: 0.9
-
-@description('Conditional. The name of the parent key vault. Required if the template is used in a standalone deployment.')
-param keyVaultName string
-
-@description('Optional. The access policy deployment.')
-param name string = 'add'
-
-@description('Optional. An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault\'s tenant ID.')
-param accessPolicies array = []
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-var formattedAccessPolicies = [for accessPolicy in accessPolicies: {
- applicationId: contains(accessPolicy, 'applicationId') ? accessPolicy.applicationId : ''
- objectId: contains(accessPolicy, 'objectId') ? accessPolicy.objectId : ''
- permissions: accessPolicy.permissions
- tenantId: contains(accessPolicy, 'tenantId') ? accessPolicy.tenantId : tenant().tenantId
-}]
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = {
- name: keyVaultName
-}
-
-resource policies 'Microsoft.KeyVault/vaults/accessPolicies@2021-06-01-preview' = {
- name: name
- parent: keyVault
- properties: {
- accessPolicies: formattedAccessPolicies
- }
-}
-
-@description('The name of the resource group the access policies assignment was created in.')
-output resourceGroupName string = resourceGroup().name
-
-@description('The name of the access policies assignment.')
-output name string = policies.name
-
-@description('The resource ID of the access policies assignment.')
-output resourceId string = policies.id
diff --git a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/readme.md b/src/modules/Microsoft.KeyVault/vaults/accessPolicies/readme.md
deleted file mode 100644
index f237c2ce..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/readme.md
+++ /dev/null
@@ -1,111 +0,0 @@
-# Key Vault Access Policies `[Microsoft.KeyVault/vaults/accessPolicies]`
-
-Copied from [Microsoft.KeyVault/vaults/accessPolicies](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.KeyVault/vaults/accessPolicies) - **CARML v0.9** (Feb 18, 2023)
-
-
-
-
-
-This module deploys key vault access policies.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :-- | :-- |
-| `Microsoft.KeyVault/vaults/accessPolicies` | [2021-06-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2021-06-01-preview/vaults/accessPolicies) |
-
-## Parameters
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `keyVaultName` | string | The name of the parent key vault. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :-- | :-- | :-- | :-- |
-| `accessPolicies` | array | `[]` | An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. |
-| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `name` | string | `'add'` | The access policy deployment. |
-
-
-### Parameter Usage: `accessPolicies`
-
-Parameter JSON format
-
-```json
-"accessPolicies": {
- "value": [
- {
- "tenantId": null, // Optional
- "applicationId": null, // Optional
- "objectId": null,
- "permissions": {
- "certificates": [
- "All"
- ],
- "keys": [
- "All"
- ],
- "secrets": [
- "All"
- ]
- }
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-accessPolicies: [
- {
- tenantId: null // Optional
- applicationId: null // Optional
- objectId: null
- permissions: {
- certificates: [
- 'All'
- ]
- keys: [
- 'All'
- ]
- secrets: [
- 'All'
- ]
- }
- }
-]
-```
-
-
-
-## Outputs
-
-| Output Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | The name of the access policies assignment. |
-| `resourceGroupName` | string | The name of the resource group the access policies assignment was created in. |
-| `resourceId` | string | The resource ID of the access policies assignment. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/version.json b/src/modules/Microsoft.KeyVault/vaults/accessPolicies/version.json
deleted file mode 100644
index badc0a22..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/accessPolicies/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.5"
-}
diff --git a/src/modules/Microsoft.KeyVault/vaults/deploy.bicep b/src/modules/Microsoft.KeyVault/vaults/deploy.bicep
deleted file mode 100644
index f7f59d06..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/deploy.bicep
+++ /dev/null
@@ -1,301 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.KeyVault/vaults/deploy.bicep
-// Date: 2023-02-018
-// Version: 0.9
-
-@description('Required. Name of the Key Vault. Must be globally unique.')
-@maxLength(24)
-param name string
-
-@description('Optional. Location for all resources.')
-param location string = resourceGroup().location
-
-@description('Optional. Array of access policies object.')
-param accessPolicies array = []
-
-@description('Optional. All secrets to create.')
-@secure()
-param secrets object = {}
-
-@description('Optional. All keys to create.')
-param keys array = []
-
-@description('Optional. Specifies if the vault is enabled for deployment by script or compute.')
-param enableVaultForDeployment bool = true
-
-@description('Optional. Specifies if the vault is enabled for a template deployment.')
-param enableVaultForTemplateDeployment bool = true
-
-@description('Optional. Specifies if the azure platform has access to the vault for enabling disk encryption scenarios.')
-param enableVaultForDiskEncryption bool = true
-
-@description('Optional. Switch to enable/disable Key Vault\'s soft delete feature.')
-param enableSoftDelete bool = true
-
-@description('Optional. softDelete data retention days. It accepts >=7 and <=90.')
-param softDeleteRetentionInDays int = 90
-
-@description('Optional. Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC.')
-param enableRbacAuthorization bool = false
-
-@description('Optional. The vault\'s create mode to indicate whether the vault need to be recovered or not. - recover or default.')
-param createMode string = 'default'
-
-@description('Optional. Provide \'true\' to enable Key Vault\'s purge protection feature.')
-param enablePurgeProtection bool = true
-
-@description('Optional. Specifies the SKU for the vault.')
-@allowed([
- 'premium'
- 'standard'
-])
-param vaultSku string = 'premium'
-
-@description('Optional. Service endpoint object information. For security reasons, it is recommended to set the DefaultAction Deny.')
-param networkAcls object = {}
-
-@description('Optional. Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set and networkAcls are not set.')
-@allowed([
- ''
- 'Enabled'
- 'Disabled'
-])
-param publicNetworkAccess string = ''
-
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
-@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
-param diagnosticStorageAccountId string = ''
-
-@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
-param diagnosticWorkspaceId string = ''
-
-@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
-param diagnosticEventHubAuthorizationRuleId string = ''
-
-@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
-param diagnosticEventHubName string = ''
-
-@allowed([
- ''
- 'CanNotDelete'
- 'ReadOnly'
-])
-@description('Optional. Specify the type of lock.')
-param lock string = ''
-
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
-param roleAssignments array = []
-
-@description('Optional. Resource tags.')
-param tags object = {}
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource.')
-@allowed([
- 'allLogs'
- 'AuditEvent'
- 'AzurePolicyEvaluationDetails'
-])
-param diagnosticLogCategoriesToEnable array = [
- 'allLogs'
-]
-
-@description('Optional. The name of metrics that will be streamed.')
-@allowed([
- 'AllMetrics'
-])
-param diagnosticMetricsToEnable array = [
- 'AllMetrics'
-]
-
-@description('Optional. The name of the diagnostic setting, if deployed.')
-param diagnosticSettingsName string = '${name}-diagnosticSettings'
-
-// =========== //
-// Variables //
-// =========== //
-var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs'): {
- category: category
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
-}]
-
-var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
- {
- categoryGroup: 'allLogs'
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
- }
-] : diagnosticsLogsSpecified
-
-var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
- category: metric
- timeGrain: null
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
-}]
-
-var formattedAccessPolicies = [for accessPolicy in accessPolicies: {
- applicationId: contains(accessPolicy, 'applicationId') ? accessPolicy.applicationId : ''
- objectId: contains(accessPolicy, 'objectId') ? accessPolicy.objectId : ''
- permissions: accessPolicy.permissions
- tenantId: contains(accessPolicy, 'tenantId') ? accessPolicy.tenantId : tenant().tenantId
-}]
-
-var secretList = !empty(secrets) ? secrets.secureList : []
-
-var enableReferencedModulesTelemetry = false
-
-// ============ //
-// Dependencies //
-// ============ //
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource keyVault 'Microsoft.KeyVault/vaults@2021-11-01-preview' = {
- name: name
- location: location
- tags: tags
- properties: {
- enabledForDeployment: enableVaultForDeployment
- enabledForTemplateDeployment: enableVaultForTemplateDeployment
- enabledForDiskEncryption: enableVaultForDiskEncryption
- enableSoftDelete: enableSoftDelete
- softDeleteRetentionInDays: softDeleteRetentionInDays
- enableRbacAuthorization: enableRbacAuthorization
- createMode: createMode
- enablePurgeProtection: enablePurgeProtection ? enablePurgeProtection : null
- tenantId: subscription().tenantId
- accessPolicies: formattedAccessPolicies
- sku: {
- name: vaultSku
- family: 'A'
- }
- networkAcls: !empty(networkAcls) ? {
- bypass: contains(networkAcls, 'bypass') ? networkAcls.bypass : null
- defaultAction: contains(networkAcls, 'defaultAction') ? networkAcls.defaultAction : null
- virtualNetworkRules: contains(networkAcls, 'virtualNetworkRules') ? networkAcls.virtualNetworkRules : []
- ipRules: contains(networkAcls, 'ipRules') ? networkAcls.ipRules : []
- } : null
- publicNetworkAccess: !empty(publicNetworkAccess) ? any(publicNetworkAccess) : null
- }
-}
-
-resource keyVault_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock)) {
- name: '${keyVault.name}-${lock}-lock'
- properties: {
- level: any(lock)
- notes: lock == 'CanNotDelete' ? 'Cannot delete resource or child resources.' : 'Cannot modify the resource or child resources.'
- }
- scope: keyVault
-}
-
-resource keyVault_diagnosticSettings 'Microsoft.Insights/diagnosticsettings@2021-05-01-preview' = if ((!empty(diagnosticStorageAccountId)) || (!empty(diagnosticWorkspaceId)) || (!empty(diagnosticEventHubAuthorizationRuleId)) || (!empty(diagnosticEventHubName))) {
- name: diagnosticSettingsName
- properties: {
- storageAccountId: !empty(diagnosticStorageAccountId) ? diagnosticStorageAccountId : null
- workspaceId: !empty(diagnosticWorkspaceId) ? diagnosticWorkspaceId : null
- eventHubAuthorizationRuleId: !empty(diagnosticEventHubAuthorizationRuleId) ? diagnosticEventHubAuthorizationRuleId : null
- eventHubName: !empty(diagnosticEventHubName) ? diagnosticEventHubName : null
- metrics: diagnosticsMetrics
- logs: diagnosticsLogs
- }
- scope: keyVault
-}
-
-module keyVault_accessPolicies 'accessPolicies/deploy.bicep' = if (!empty(accessPolicies)) {
- name: '${uniqueString(deployment().name, location)}-KeyVault-AccessPolicies'
- params: {
- keyVaultName: keyVault.name
- accessPolicies: formattedAccessPolicies
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}
-
-module keyVault_secrets 'secrets/deploy.bicep' = [for (secret, index) in secretList: {
- name: '${uniqueString(deployment().name, location)}-KeyVault-Secret-${index}'
- params: {
- name: secret.name
- value: secret.value
- keyVaultName: keyVault.name
- attributesEnabled: contains(secret, 'attributesEnabled') ? secret.attributesEnabled : true
- attributesExp: contains(secret, 'attributesExp') ? secret.attributesExp : -1
- attributesNbf: contains(secret, 'attributesNbf') ? secret.attributesNbf : -1
- contentType: contains(secret, 'contentType') ? secret.contentType : ''
- tags: contains(secret, 'tags') ? secret.tags : {}
- roleAssignments: contains(secret, 'roleAssignments') ? secret.roleAssignments : []
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}]
-
-module keyVault_keys 'keys/deploy.bicep' = [for (key, index) in keys: {
- name: '${uniqueString(deployment().name, location)}-KeyVault-Key-${index}'
- params: {
- name: key.name
- keyVaultName: keyVault.name
- attributesEnabled: contains(key, 'attributesEnabled') ? key.attributesEnabled : true
- attributesExp: contains(key, 'attributesExp') ? key.attributesExp : -1
- attributesNbf: contains(key, 'attributesNbf') ? key.attributesNbf : -1
- curveName: contains(key, 'curveName') ? key.curveName : 'P-256'
- keyOps: contains(key, 'keyOps') ? key.keyOps : []
- keySize: contains(key, 'keySize') ? key.keySize : -1
- kty: contains(key, 'kty') ? key.kty : 'EC'
- tags: contains(key, 'tags') ? key.tags : {}
- roleAssignments: contains(key, 'roleAssignments') ? key.roleAssignments : []
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}]
-
-module keyVault_roleAssignments '.bicep/nested_roleAssignments.bicep' = [for (roleAssignment, index) in roleAssignments: {
- name: '${uniqueString(deployment().name, location)}-KeyVault-Rbac-${index}'
- params: {
- description: contains(roleAssignment, 'description') ? roleAssignment.description : ''
- principalIds: roleAssignment.principalIds
- principalType: contains(roleAssignment, 'principalType') ? roleAssignment.principalType : ''
- roleDefinitionIdOrName: roleAssignment.roleDefinitionIdOrName
- condition: contains(roleAssignment, 'condition') ? roleAssignment.condition : ''
- delegatedManagedIdentityResourceId: contains(roleAssignment, 'delegatedManagedIdentityResourceId') ? roleAssignment.delegatedManagedIdentityResourceId : ''
- resourceId: keyVault.id
- }
-}]
-
-// =========== //
-// Outputs //
-// =========== //
-@description('The resource ID of the key vault.')
-output resourceId string = keyVault.id
-
-@description('The name of the resource group the key vault was created in.')
-output resourceGroupName string = resourceGroup().name
-
-@description('The name of the key vault.')
-output name string = keyVault.name
-
-@description('The URI of the key vault.')
-output uri string = keyVault.properties.vaultUri
-
-@description('The location the resource was deployed into.')
-output location string = keyVault.location
diff --git a/src/modules/Microsoft.KeyVault/vaults/keys/.bicep/nested_roleAssignments.bicep b/src/modules/Microsoft.KeyVault/vaults/keys/.bicep/nested_roleAssignments.bicep
deleted file mode 100644
index 2514374a..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/keys/.bicep/nested_roleAssignments.bicep
+++ /dev/null
@@ -1,79 +0,0 @@
-@sys.description('Required. The IDs of the principals to assign the role to.')
-param principalIds array
-
-@sys.description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
-param roleDefinitionIdOrName string
-
-@sys.description('Required. The resource ID of the resource to apply the role assignment to.')
-param resourceId string
-
-@sys.description('Optional. The principal type of the assigned principal ID.')
-@allowed([
- 'ServicePrincipal'
- 'Group'
- 'User'
- 'ForeignGroup'
- 'Device'
- ''
-])
-param principalType string = ''
-
-@sys.description('Optional. The description of the role assignment.')
-param description string = ''
-
-@sys.description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
-param condition string = ''
-
-@sys.description('Optional. Version of the condition.')
-@allowed([
- '2.0'
-])
-param conditionVersion string = '2.0'
-
-@sys.description('Optional. Id of the delegated managed identity resource.')
-param delegatedManagedIdentityResourceId string = ''
-
-var builtInRoleNames = {
- Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
- 'Desktop Virtualization Virtual Machine Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a959dbd1-f747-45e3-8ba6-dd80f235f97c')
- 'Key Vault Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')
- 'Key Vault Certificates Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a4417e6f-fecd-4de8-b567-7b0420556985')
- 'Key Vault Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f25e0fa2-a7c8-4377-a976-54943a77a395')
- 'Key Vault Crypto Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')
- 'Key Vault Crypto Service Encryption User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6')
- 'Key Vault Crypto User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '12338af0-0e69-4776-bea7-57ae8d297424')
- 'Key Vault Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '21090545-7ca7-4776-b22c-e363652d74d2')
- 'Key Vault Secrets Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7')
- 'Key Vault Secrets User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4633458b-17de-408a-b874-0445c86b69e6')
- 'Log Analytics Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
- 'Log Analytics Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
- 'Managed Application Contributor Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '641177b8-a67a-45b9-a033-47bc880bb21e')
- 'Managed Application Operator Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c7393b34-138c-406f-901b-d8cf2b17e6ae')
- 'Managed Applications Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b9331d33-8a36-4f8c-b097-4f54124fdb44')
- 'Managed HSM contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18500a29-7fe2-46b2-a342-b16a415e101d')
- 'Monitoring Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '749f88d5-cbae-40b8-bcfc-e573ddc772fa')
- 'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
- Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
- Reader: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
- 'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
- 'Role Based Access Control Administrator (Preview)': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f58310d9-a9f6-439a-9e8d-f62e7b41a168')
- 'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
-}
-
-resource key 'Microsoft.KeyVault/vaults/keys@2021-06-01-preview' existing = {
- name: '${split(resourceId, '/')[8]}/${split(resourceId, '/')[10]}'
-}
-
-resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for principalId in principalIds: {
- name: guid(key.id, principalId, roleDefinitionIdOrName)
- properties: {
- description: description
- roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
- principalId: principalId
- principalType: !empty(principalType) ? any(principalType) : null
- condition: !empty(condition) ? condition : null
- conditionVersion: !empty(conditionVersion) && !empty(condition) ? conditionVersion : null
- delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : null
- }
- scope: key
-}]
diff --git a/src/modules/Microsoft.KeyVault/vaults/keys/deploy.bicep b/src/modules/Microsoft.KeyVault/vaults/keys/deploy.bicep
deleted file mode 100644
index d98005e0..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/keys/deploy.bicep
+++ /dev/null
@@ -1,115 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.KeyVault/vaults/keys/deploy.bicep
-// Date: 2023-02-018
-// Version: 0.9
-
-@description('Conditional. The name of the parent key vault. Required if the template is used in a standalone deployment.')
-param keyVaultName string
-
-@description('Required. The name of the key.')
-param name string
-
-@description('Optional. Resource tags.')
-param tags object = {}
-
-@description('Optional. Determines whether the object is enabled.')
-param attributesEnabled bool = true
-
-@description('Optional. Expiry date in seconds since 1970-01-01T00:00:00Z. For security reasons, it is recommended to set an expiration date whenever possible.')
-param attributesExp int = -1
-
-@description('Optional. Not before date in seconds since 1970-01-01T00:00:00Z.')
-param attributesNbf int = -1
-
-@description('Optional. The elliptic curve name.')
-@allowed([
- 'P-256'
- 'P-256K'
- 'P-384'
- 'P-521'
-])
-param curveName string = 'P-256'
-
-@description('Optional. Array of JsonWebKeyOperation.')
-@allowed([
- 'decrypt'
- 'encrypt'
- 'import'
- 'sign'
- 'unwrapKey'
- 'verify'
- 'wrapKey'
-])
-param keyOps array = []
-
-@description('Optional. The key size in bits. For example: 2048, 3072, or 4096 for RSA.')
-param keySize int = -1
-
-@description('Optional. The type of the key.')
-@allowed([
- 'EC'
- 'EC-HSM'
- 'RSA'
- 'RSA-HSM'
-])
-param kty string = 'EC'
-
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
-param roleAssignments array = []
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = {
- name: keyVaultName
-}
-
-resource key 'Microsoft.KeyVault/vaults/keys@2019-09-01' = {
- name: name
- parent: keyVault
- tags: tags
- properties: {
- attributes: {
- enabled: attributesEnabled
- exp: attributesExp != -1 ? attributesExp : null
- nbf: attributesNbf != -1 ? attributesNbf : null
- }
- curveName: curveName
- keyOps: keyOps
- keySize: keySize != -1 ? keySize : null
- kty: kty
- }
-}
-
-module key_roleAssignments '.bicep/nested_roleAssignments.bicep' = [for (roleAssignment, index) in roleAssignments: {
- name: '${deployment().name}-Rbac-${index}'
- params: {
- description: contains(roleAssignment, 'description') ? roleAssignment.description : ''
- principalIds: roleAssignment.principalIds
- principalType: contains(roleAssignment, 'principalType') ? roleAssignment.principalType : ''
- roleDefinitionIdOrName: roleAssignment.roleDefinitionIdOrName
- condition: contains(roleAssignment, 'condition') ? roleAssignment.condition : ''
- delegatedManagedIdentityResourceId: contains(roleAssignment, 'delegatedManagedIdentityResourceId') ? roleAssignment.delegatedManagedIdentityResourceId : ''
- resourceId: key.id
- }
-}]
-
-@description('The name of the key.')
-output name string = key.name
-
-@description('The resource ID of the key.')
-output resourceId string = key.id
-
-@description('The name of the resource group the key was created in.')
-output resourceGroupName string = resourceGroup().name
diff --git a/src/modules/Microsoft.KeyVault/vaults/keys/readme.md b/src/modules/Microsoft.KeyVault/vaults/keys/readme.md
deleted file mode 100644
index 032451ee..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/keys/readme.md
+++ /dev/null
@@ -1,166 +0,0 @@
-# Key Vault Key `[Microsoft.KeyVault/vaults/keys]`
-
-Copied from [Microsoft.KeyVault/vaults/keys](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.KeyVault/vaults/keys) - **CARML v0.9** (Feb 18, 2023)
-
-
-
-
-
-This module deploys a key vault key.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :-- | :-- |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.KeyVault/vaults/keys` | [2019-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2019-09-01/vaults/keys) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | The name of the key. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `keyVaultName` | string | The name of the parent key vault. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-- | :-- | :-- | :-- | :-- |
-| `attributesEnabled` | bool | `True` | | Determines whether the object is enabled. |
-| `attributesExp` | int | `-1` | | Expiry date in seconds since 1970-01-01T00:00:00Z. For security reasons, it is recommended to set an expiration date whenever possible. |
-| `attributesNbf` | int | `-1` | | Not before date in seconds since 1970-01-01T00:00:00Z. |
-| `curveName` | string | `'P-256'` | `[P-256, P-256K, P-384, P-521]` | The elliptic curve name. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `keyOps` | array | `[]` | `[decrypt, encrypt, import, sign, unwrapKey, verify, wrapKey]` | Array of JsonWebKeyOperation. |
-| `keySize` | int | `-1` | | The key size in bits. For example: 2048, 3072, or 4096 for RSA. |
-| `kty` | string | `'EC'` | `[EC, EC-HSM, RSA, RSA-HSM]` | The type of the key. |
-| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-| `tags` | object | `{object}` | | Resource tags. |
-
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-## Outputs
-
-| Output Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | The name of the key. |
-| `resourceGroupName` | string | The name of the resource group the key was created in. |
-| `resourceId` | string | The resource ID of the key. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.KeyVault/vaults/keys/version.json b/src/modules/Microsoft.KeyVault/vaults/keys/version.json
deleted file mode 100644
index badc0a22..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/keys/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.5"
-}
diff --git a/src/modules/Microsoft.KeyVault/vaults/readme.md b/src/modules/Microsoft.KeyVault/vaults/readme.md
deleted file mode 100644
index 9629a9d6..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/readme.md
+++ /dev/null
@@ -1,842 +0,0 @@
-# Key Vaults `[Microsoft.KeyVault/vaults]`
-
-Copied from [Microsoft.KeyVault/vaults](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.KeyVault/vaults) - **CARML v0.9** (Feb 18, 2023)
-
-
-
-
-
-This module deploys a key vault and its child resources.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-- [Deployment examples](#deployment-examples)
-
-## Resource types
-
-| Resource Type | API Version |
-| :-- | :-- |
-| `Microsoft.Authorization/locks` | [2020-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
-| `Microsoft.KeyVault/vaults` | [2021-11-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2021-11-01-preview/vaults) |
-| `Microsoft.KeyVault/vaults/accessPolicies` | [2021-06-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2021-06-01-preview/vaults/accessPolicies) |
-| `Microsoft.KeyVault/vaults/keys` | [2019-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2019-09-01/vaults/keys) |
-| `Microsoft.KeyVault/vaults/secrets` | [2019-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2019-09-01/vaults/secrets) |
-| `Microsoft.Network/privateEndpoints` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints) |
-| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints/privateDnsZoneGroups) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | Name of the Key Vault. Must be globally unique. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-- | :-- | :-- | :-- | :-- |
-| `accessPolicies` | _[accessPolicies](accessPolicies/readme.md)_ array | `[]` | | Array of access policies object. |
-| `createMode` | string | `'default'` | | The vault's create mode to indicate whether the vault need to be recovered or not. - recover or default. |
-| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
-| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
-| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `[allLogs, AuditEvent, AzurePolicyEvaluationDetails]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
-| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
-| `diagnosticSettingsName` | string | `[format('{0}-diagnosticSettings', parameters('name'))]` | | The name of the diagnostic setting, if deployed. |
-| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
-| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `enablePurgeProtection` | bool | `True` | | Provide 'true' to enable Key Vault's purge protection feature. |
-| `enableRbacAuthorization` | bool | `False` | | Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC. |
-| `enableSoftDelete` | bool | `True` | | Switch to enable/disable Key Vault's soft delete feature. |
-| `enableVaultForDeployment` | bool | `True` | | Specifies if the vault is enabled for deployment by script or compute. |
-| `enableVaultForDiskEncryption` | bool | `True` | | Specifies if the azure platform has access to the vault for enabling disk encryption scenarios. |
-| `enableVaultForTemplateDeployment` | bool | `True` | | Specifies if the vault is enabled for a template deployment. |
-| `keys` | _[keys](keys/readme.md)_ array | `[]` | | All keys to create. |
-| `location` | string | `[resourceGroup().location]` | | Location for all resources. |
-| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
-| `networkAcls` | object | `{object}` | | Service endpoint object information. For security reasons, it is recommended to set the DefaultAction Deny. |
-| `privateEndpoints` | array | `[]` | | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
-| `publicNetworkAccess` | string | `''` | `['', Disabled, Enabled]` | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set and networkAcls are not set. |
-| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-| `secrets` | secureObject | `{object}` | | All secrets to create. |
-| `softDeleteRetentionInDays` | int | `90` | | softDelete data retention days. It accepts >=7 and <=90. |
-| `tags` | object | `{object}` | | Resource tags. |
-| `vaultSku` | string | `'premium'` | `[premium, standard]` | Specifies the SKU for the vault. |
-
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `networkAcls`
-
-Parameter JSON format
-
-```json
-"networkAcls": {
- "value": {
- "bypass": "AzureServices",
- "defaultAction": "Deny",
- "virtualNetworkRules": [
- {
- "id": "/subscriptions/<Bicep format
-
-```bicep
-networkAcls: {
- bypass: 'AzureServices'
- defaultAction: 'Deny'
- virtualNetworkRules: [
- {
- id: '/subscriptions/<
-
-### Parameter Usage: `accessPolicies`
-
-Parameter JSON format
-
-```json
-"accessPolicies": {
- "value": [
- {
- "tenantId": null, // Optional
- "applicationId": null, // Optional
- "objectId": null,
- "permissions": {
- "certificates": [
- "All"
- ],
- "keys": [
- "All"
- ],
- "secrets": [
- "All"
- ]
- }
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-accessPolicies: [
- {
- tenantId: null // Optional
- applicationId: null // Optional
- objectId: null
- permissions: {
- certificates: [
- 'All'
- ]
- keys: [
- 'All'
- ]
- secrets: [
- 'All'
- ]
- }
- }
-]
-```
-
-
-
-### Parameter Usage: `privateEndpoints`
-
-To use Private Endpoint the following dependencies must be deployed:
-
-- Destination subnet must be created with the following configuration option - `"privateEndpointNetworkPolicies": "Disabled"`. Setting this option acknowledges that NSG rules are not applied to Private Endpoints (this capability is coming soon). A full example is available in the Virtual Network Module.
-- Although not strictly required, it is highly recommended to first create a private DNS Zone to host Private Endpoint DNS records. See [Azure Private Endpoint DNS configuration](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns) for more information.
-
-Parameter JSON format
-
-```json
-"privateEndpoints": {
- "value": [
- // Example showing all available fields
- {
- "name": "sxx-az-pe", // Optional: Name will be automatically generated if one is not provided here
- "subnetResourceId": "/subscriptions/<Bicep format
-
-```bicep
-privateEndpoints: [
- // Example showing all available fields
- {
- name: 'sxx-az-pe' // Optional: Name will be automatically generated if one is not provided here
- subnetResourceId: '/subscriptions/<
- -## Outputs - -| Output Name | Type | Description | -| :-- | :-- | :-- | -| `location` | string | The location the resource was deployed into. | -| `name` | string | The name of the key vault. | -| `resourceGroupName` | string | The name of the resource group the key vault was created in. | -| `resourceId` | string | The resource ID of the key vault. | -| `uri` | string | The URI of the key vault. | - -## Cross-referenced modules - -This section gives you an overview of all local-referenced module files (i.e., other CARML modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs). - -| Reference | Type | -| :-- | :-- | -| `Microsoft.Network/privateEndpoints` | Local reference | - -## Deployment examples - -The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. - >**Note**: The name of each example is based on the name of the file from which it is taken. - - >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. - -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
diff --git a/src/modules/Microsoft.KeyVault/vaults/secrets/.bicep/nested_roleAssignments.bicep b/src/modules/Microsoft.KeyVault/vaults/secrets/.bicep/nested_roleAssignments.bicep
deleted file mode 100644
index 73f7347f..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/secrets/.bicep/nested_roleAssignments.bicep
+++ /dev/null
@@ -1,79 +0,0 @@
-@sys.description('Required. The IDs of the principals to assign the role to.')
-param principalIds array
-
-@sys.description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
-param roleDefinitionIdOrName string
-
-@sys.description('Required. The resource ID of the resource to apply the role assignment to.')
-param resourceId string
-
-@sys.description('Optional. The principal type of the assigned principal ID.')
-@allowed([
- 'ServicePrincipal'
- 'Group'
- 'User'
- 'ForeignGroup'
- 'Device'
- ''
-])
-param principalType string = ''
-
-@sys.description('Optional. The description of the role assignment.')
-param description string = ''
-
-@sys.description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
-param condition string = ''
-
-@sys.description('Optional. Version of the condition.')
-@allowed([
- '2.0'
-])
-param conditionVersion string = '2.0'
-
-@sys.description('Optional. Id of the delegated managed identity resource.')
-param delegatedManagedIdentityResourceId string = ''
-
-var builtInRoleNames = {
- Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
- 'Desktop Virtualization Virtual Machine Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a959dbd1-f747-45e3-8ba6-dd80f235f97c')
- 'Key Vault Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')
- 'Key Vault Certificates Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a4417e6f-fecd-4de8-b567-7b0420556985')
- 'Key Vault Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f25e0fa2-a7c8-4377-a976-54943a77a395')
- 'Key Vault Crypto Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')
- 'Key Vault Crypto Service Encryption User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'e147488a-f6f5-4113-8e2d-b22465e65bf6')
- 'Key Vault Crypto User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '12338af0-0e69-4776-bea7-57ae8d297424')
- 'Key Vault Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '21090545-7ca7-4776-b22c-e363652d74d2')
- 'Key Vault Secrets Officer': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7')
- 'Key Vault Secrets User': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4633458b-17de-408a-b874-0445c86b69e6')
- 'Log Analytics Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
- 'Log Analytics Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
- 'Managed Application Contributor Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '641177b8-a67a-45b9-a033-47bc880bb21e')
- 'Managed Application Operator Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c7393b34-138c-406f-901b-d8cf2b17e6ae')
- 'Managed Applications Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b9331d33-8a36-4f8c-b097-4f54124fdb44')
- 'Managed HSM contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18500a29-7fe2-46b2-a342-b16a415e101d')
- 'Monitoring Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '749f88d5-cbae-40b8-bcfc-e573ddc772fa')
- 'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
- Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
- Reader: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
- 'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
- 'Role Based Access Control Administrator (Preview)': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f58310d9-a9f6-439a-9e8d-f62e7b41a168')
- 'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
-}
-
-resource secret 'Microsoft.KeyVault/vaults/secrets@2021-06-01-preview' existing = {
- name: '${split(resourceId, '/')[8]}/${split(resourceId, '/')[10]}'
-}
-
-resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for principalId in principalIds: {
- name: guid(secret.id, principalId, roleDefinitionIdOrName)
- properties: {
- description: description
- roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
- principalId: principalId
- principalType: !empty(principalType) ? any(principalType) : null
- condition: !empty(condition) ? condition : null
- conditionVersion: !empty(conditionVersion) && !empty(condition) ? conditionVersion : null
- delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : null
- }
- scope: secret
-}]
diff --git a/src/modules/Microsoft.KeyVault/vaults/secrets/deploy.bicep b/src/modules/Microsoft.KeyVault/vaults/secrets/deploy.bicep
deleted file mode 100644
index 7983f590..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/secrets/deploy.bicep
+++ /dev/null
@@ -1,88 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.KeyVault/vaults/secrets/deploy.bicep
-// Date: 2023-02-018
-// Version: 0.9
-
-@description('Conditional. The name of the parent key vault. Required if the template is used in a standalone deployment.')
-param keyVaultName string
-
-@description('Required. The name of the secret.')
-param name string
-
-@description('Optional. Resource tags.')
-param tags object = {}
-
-@description('Optional. Determines whether the object is enabled.')
-param attributesEnabled bool = true
-
-@description('Optional. Expiry date in seconds since 1970-01-01T00:00:00Z. For security reasons, it is recommended to set an expiration date whenever possible.')
-param attributesExp int = -1
-
-@description('Optional. Not before date in seconds since 1970-01-01T00:00:00Z.')
-param attributesNbf int = -1
-
-@description('Optional. The content type of the secret.')
-@secure()
-param contentType string = ''
-
-@description('Required. The value of the secret. NOTE: "value" will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.')
-@secure()
-param value string
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
-param roleAssignments array = []
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = {
- name: keyVaultName
-}
-
-resource secret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
- name: name
- parent: keyVault
- tags: tags
- properties: {
- contentType: contentType
- attributes: {
- enabled: attributesEnabled
- exp: attributesExp != -1 ? attributesExp : null
- nbf: attributesNbf != -1 ? attributesNbf : null
- }
- value: value
- }
-}
-
-module secret_roleAssignments '.bicep/nested_roleAssignments.bicep' = [for (roleAssignment, index) in roleAssignments: {
- name: '${deployment().name}-Rbac-${index}'
- params: {
- description: contains(roleAssignment, 'description') ? roleAssignment.description : ''
- principalIds: roleAssignment.principalIds
- principalType: contains(roleAssignment, 'principalType') ? roleAssignment.principalType : ''
- roleDefinitionIdOrName: roleAssignment.roleDefinitionIdOrName
- condition: contains(roleAssignment, 'condition') ? roleAssignment.condition : ''
- delegatedManagedIdentityResourceId: contains(roleAssignment, 'delegatedManagedIdentityResourceId') ? roleAssignment.delegatedManagedIdentityResourceId : ''
- resourceId: secret.id
- }
-}]
-
-@description('The name of the secret.')
-output name string = secret.name
-
-@description('The resource ID of the secret.')
-output resourceId string = secret.id
-
-@description('The name of the resource group the secret was created in.')
-output resourceGroupName string = resourceGroup().name
diff --git a/src/modules/Microsoft.KeyVault/vaults/secrets/readme.md b/src/modules/Microsoft.KeyVault/vaults/secrets/readme.md
deleted file mode 100644
index f51241ae..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/secrets/readme.md
+++ /dev/null
@@ -1,163 +0,0 @@
-# Key Vault Secret `[Microsoft.KeyVault/vaults/secrets]`
-
-Copied from [Microsoft.KeyVault/vaults/secrets](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.KeyVault/vaults/secrets) - **CARML v0.9** (Feb 18, 2023)
-
-
-
-
-This module deploys a key vault secret.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :-- | :-- |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.KeyVault/vaults/secrets` | [2019-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2019-09-01/vaults/secrets) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | The name of the secret. |
-| `value` | secureString | The value of the secret. NOTE: "value" will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `keyVaultName` | string | The name of the parent key vault. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :-- | :-- | :-- | :-- |
-| `attributesEnabled` | bool | `True` | Determines whether the object is enabled. |
-| `attributesExp` | int | `-1` | Expiry date in seconds since 1970-01-01T00:00:00Z. For security reasons, it is recommended to set an expiration date whenever possible. |
-| `attributesNbf` | int | `-1` | Not before date in seconds since 1970-01-01T00:00:00Z. |
-| `contentType` | secureString | `''` | The content type of the secret. |
-| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `roleAssignments` | array | `[]` | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-| `tags` | object | `{object}` | Resource tags. |
-
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-## Outputs
-
-| Output Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | The name of the secret. |
-| `resourceGroupName` | string | The name of the resource group the secret was created in. |
-| `resourceId` | string | The resource ID of the secret. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.KeyVault/vaults/secrets/version.json b/src/modules/Microsoft.KeyVault/vaults/secrets/version.json
deleted file mode 100644
index badc0a22..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/secrets/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.5"
-}
diff --git a/src/modules/Microsoft.KeyVault/vaults/version.json b/src/modules/Microsoft.KeyVault/vaults/version.json
deleted file mode 100644
index badc0a22..00000000
--- a/src/modules/Microsoft.KeyVault/vaults/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.5"
-}
diff --git a/src/modules/Microsoft.Resources/deploymentScripts/deploy.bicep b/src/modules/Microsoft.Resources/deploymentScripts/deploy.bicep
deleted file mode 100644
index 1efc5ba5..00000000
--- a/src/modules/Microsoft.Resources/deploymentScripts/deploy.bicep
+++ /dev/null
@@ -1,117 +0,0 @@
-@description('Required. Display name of the script to be run.')
-param name string
-
-@description('Optional. The ID(s) to assign to the resource.')
-param userAssignedIdentities object = {}
-
-@description('Optional. Location for all resources.')
-param location string = resourceGroup().location
-
-@description('Optional. Type of the script. AzurePowerShell.')
-@allowed([
- 'AzurePowerShell'
-])
-param kind string = 'AzurePowerShell'
-
-@description('Optional. Azure PowerShell module version to be used.')
-param azPowerShellVersion string = '8.0'
-
-@description('Optional. Script body. Max length: 32000 characters. To run an external script, use primaryScriptURI instead.')
-param scriptContent string = ''
-
-@description('Optional. Uri for the external script. This is the entry point for the external script. To run an internal script, use the scriptContent instead.')
-param primaryScriptUri string = ''
-
-@description('Optional. The environment variables to pass over to the script. Must have a \'name\' and a \'value\' or a \'secretValue\' property.')
-param environmentVariables array = []
-
-@description('Optional. List of supporting files for the external script (defined in primaryScriptUri). Does not work with internal scripts (code defined in scriptContent).')
-param supportingScriptUris array = []
-
-@description('Optional. Command-line arguments to pass to the script. Arguments are separated by spaces.')
-param arguments string = ''
-
-@description('Optional. Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P7D means one week).')
-param retentionInterval string = 'P1D'
-
-@description('Optional. When set to false, script will run every time the template is deployed. When set to true, the script will only run once.')
-param runOnce bool = false
-
-@description('Optional. The clean up preference when the script execution gets in a terminal state. Specify the preference on when to delete the deployment script resources. The default value is Always, which means the deployment script resources are deleted despite the terminal state (Succeeded, Failed, canceled).')
-@allowed([
- 'Always'
- 'OnSuccess'
- 'OnExpiration'
-])
-param cleanupPreference string = 'Always'
-
-@description('Optional. Container group name, if not specified then the name will get auto-generated. Not specifying a \'containerGroupName\' indicates the system to generate a unique name which might end up flagging an Azure Policy as non-compliant. Use \'containerGroupName\' when you have an Azure Policy that expects a specific naming convention or when you want to fully control the name. \'containerGroupName\' property must be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end with a dash and consecutive dashes are not allowed.')
-param containerGroupName string = ''
-
-@description('Optional. Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H - 1 hour; \'PT30M\' - 30 minutes; \'P5D\' - 5 days; \'P1Y\' 1 year.')
-param timeout string = 'PT1H'
-
-@description('Generated. Do not provide a value! This date value is used to make sure the script run every time the template is deployed.')
-param baseTime string = utcNow('yyyy-MM-dd-HH-mm-ss')
-
-@description('Optional. Tags of the resource.')
-param tags object = {}
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-var containerSettings = {
- containerGroupName: containerGroupName
-}
-
-var identityType = !empty(userAssignedIdentities) ? 'UserAssigned' : 'None'
-
-var identity = identityType != 'None' ? {
- type: identityType
- userAssignedIdentities: !empty(userAssignedIdentities) ? userAssignedIdentities : null
-} : null
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource deploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
- name: name
- location: location
- tags: tags
- identity: identity
- kind: kind
- properties: {
- azPowerShellVersion: azPowerShellVersion
- containerSettings: empty(containerGroupName) ? null : containerSettings
- arguments: arguments
- environmentVariables: empty(environmentVariables) ? null : environmentVariables
- scriptContent: empty(scriptContent) ? null : scriptContent
- primaryScriptUri: empty(primaryScriptUri) ? null : primaryScriptUri
- supportingScriptUris: empty(supportingScriptUris) ? null : supportingScriptUris
- cleanupPreference: cleanupPreference
- forceUpdateTag: runOnce ? resourceGroup().name : baseTime
- retentionInterval: retentionInterval
- timeout: timeout
- }
-}
-
-@description('The resource ID of the deployment script.')
-output resourceId string = deploymentScript.id
-
-@description('The resource group the deployment script was deployed into.')
-output resourceGroupName string = resourceGroup().name
-
-@description('The name of the deployment script.')
-output name string = deploymentScript.name
-
-@description('The location the resource was deployed into.')
-output location string = deploymentScript.location
diff --git a/src/modules/Microsoft.Resources/deploymentScripts/readme.md b/src/modules/Microsoft.Resources/deploymentScripts/readme.md
deleted file mode 100644
index 690f5128..00000000
--- a/src/modules/Microsoft.Resources/deploymentScripts/readme.md
+++ /dev/null
@@ -1,321 +0,0 @@
-# Deployment Scripts `[Microsoft.Resources/deploymentScripts]`
-
-This module deploys a deployment script.
-
-## Navigation
-
-- [Resource types](#Resource-types)
-- [Parameters](#Parameters)
-- [Outputs](#Outputs)
-- [Considerations](#Considerations)
-- [Cross-referenced modules](#Cross-referenced-modules)
-- [Deployment examples](#Deployment-examples)
-
-## Resource types
-
-| Resource Type | API Version |
-| :-- | :-- |
-| `Microsoft.Authorization/locks` | [2020-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
-| `Microsoft.Resources/deploymentScripts` | [2020-10-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Resources/2020-10-01/deploymentScripts) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :-- | :-- | :-- |
-| `name` | string | Display name of the script to be run. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-- | :-- | :-- | :-- | :-- |
-| `arguments` | string | `''` | | Command-line arguments to pass to the script. Arguments are separated by spaces. |
-| `azCliVersion` | string | `''` | | Azure CLI module version to be used. |
-| `azPowerShellVersion` | string | `'3.0'` | | Azure PowerShell module version to be used. |
-| `cleanupPreference` | string | `'Always'` | `[Always, OnExpiration, OnSuccess]` | The clean up preference when the script execution gets in a terminal state. Specify the preference on when to delete the deployment script resources. The default value is Always, which means the deployment script resources are deleted despite the terminal state (Succeeded, Failed, canceled). |
-| `containerGroupName` | string | `''` | | Container group name, if not specified then the name will get auto-generated. Not specifying a 'containerGroupName' indicates the system to generate a unique name which might end up flagging an Azure Policy as non-compliant. Use 'containerGroupName' when you have an Azure Policy that expects a specific naming convention or when you want to fully control the name. 'containerGroupName' property must be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end with a dash and consecutive dashes are not allowed. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `environmentVariables` | array | `[]` | | The environment variables to pass over to the script. Must have a 'name' and a 'value' or a 'secretValue' property. |
-| `kind` | string | `'AzurePowerShell'` | `[AzureCLI, AzurePowerShell]` | Type of the script. AzurePowerShell, AzureCLI. |
-| `location` | string | `[resourceGroup().location]` | | Location for all resources. |
-| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
-| `primaryScriptUri` | string | `''` | | Uri for the external script. This is the entry point for the external script. To run an internal script, use the scriptContent instead. |
-| `retentionInterval` | string | `'P1D'` | | Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P7D means one week). |
-| `runOnce` | bool | `False` | | When set to false, script will run every time the template is deployed. When set to true, the script will only run once. |
-| `scriptContent` | string | `''` | | Script body. Max length: 32000 characters. To run an external script, use primaryScriptURI instead. |
-| `supportingScriptUris` | array | `[]` | | List of supporting files for the external script (defined in primaryScriptUri). Does not work with internal scripts (code defined in scriptContent). |
-| `tags` | object | `{object}` | | Tags of the resource. |
-| `timeout` | string | `'PT1H'` | | Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H - 1 hour; 'PT30M' - 30 minutes; 'P5D' - 5 days; 'P1Y' 1 year. |
-| `userAssignedIdentities` | object | `{object}` | | The ID(s) to assign to the resource. |
-
-**Generated parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :-- | :-- | :-- | :-- |
-| `baseTime` | string | `[utcNow('yyyy-MM-dd-HH-mm-ss')]` | Do not provide a value! This date value is used to make sure the script run every time the template is deployed. |
-
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `userAssignedIdentities`
-
-You can specify multiple user assigned identities to a resource by providing additional resource IDs using the following format:
-
-Parameter JSON format
-
-```json
-"userAssignedIdentities": {
- "value": {
- "/subscriptions/<Bicep format
-
-```bicep
-userAssignedIdentities: {
- '/subscriptions/<
- -## Outputs - -| Output Name | Type | Description | -| :-- | :-- | :-- | -| `location` | string | The location the resource was deployed into. | -| `name` | string | The name of the deployment script. | -| `resourceGroupName` | string | The resource group the deployment script was deployed into. | -| `resourceId` | string | The resource ID of the deployment script. | - -## Considerations - -This module requires a User Assigned Identity (MSI, managed service identity) to exist, and this MSI has to have contributor rights on the subscription - that allows the Deployment Script to create the required Storage Account and the Azure Container Instance. - -## Cross-referenced modules - -_None_ - -## Deployment examples - -The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. - >**Note**: The name of each example is based on the name of the file from which it is taken. - - >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. - -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/deploy.bicep b/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/deploy.bicep
deleted file mode 100644
index e8cead29..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/deploy.bicep
+++ /dev/null
@@ -1,61 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.Storage/storageAccounts/blobServices/deploy.bicep
-// Date: 2023-02-01
-// Version: 0.9
-
-@maxLength(24)
-@description('Conditional. The name of the parent Storage Account. Required if the template is used in a standalone deployment.')
-param storageAccountName string
-
-@description('Optional. Name of the blob service.')
-param blobServicesName string = 'default'
-
-@description('Required. The name of the storage container to deploy.')
-param name string
-
-@allowed([
- 'Container'
- 'Blob'
- 'None'
-])
-@description('Optional. Specifies whether data in the container may be accessed publicly and the level of access.')
-param publicAccess string = 'None'
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
- name: storageAccountName
-
- resource blobServices 'blobServices@2021-09-01' existing = {
- name: blobServicesName
- }
-}
-
-resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-09-01' = {
- name: name
- parent: storageAccount::blobServices
- properties: {
- publicAccess: publicAccess
- }
-}
-
-@description('The name of the deployed container.')
-output name string = container.name
-
-@description('The resource ID of the deployed container.')
-output resourceId string = container.id
-
-@description('The resource group of the deployed container.')
-output resourceGroupName string = resourceGroup().name
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/readme.md b/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/readme.md
deleted file mode 100644
index e585f3ee..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/readme.md
+++ /dev/null
@@ -1,120 +0,0 @@
-# Storage Account Container `[Microsoft.Storage/storageAccounts/blobServices/containers]`
-
-Copied from [Microsoft.Storage/storageAccounts/blobServices/containers](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.Storage/storageAccounts/blobServices/containers) - **CARML v0.9** (Feb 1, 2023)
-
-
-
-
-This module deploys a blob container
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers/immutabilityPolicies) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :------------- | :----- | :------------------------------------------- |
-| `name` | string | The name of the storage container to deploy. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :------------------- | :----- | :--------------------------------------------------------------------------------------------------- |
-| `storageAccountName` | string | The name of the parent Storage Account. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :----------------------------- | :----- | :------------ | :------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `blobServicesName` | string | `'default'` | | Name of the blob service. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `immutabilityPolicyName` | string | `'default'` | | Name of the immutable policy. |
-| `immutabilityPolicyProperties` | object | `{object}` | | Configure immutability policy. |
-| `publicAccess` | string | `'None'` | `[Blob, Container, None]` | Specifies whether data in the container may be accessed publicly and the level of access. |
-| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-## Outputs
-
-| Output Name | Type | Description |
-| :------------------ | :----- | :-------------------------------------------- |
-| `name` | string | The name of the deployed container. |
-| `resourceGroupName` | string | The resource group of the deployed container. |
-| `resourceId` | string | The resource ID of the deployed container. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/version.json b/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/containers/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/deploy.bicep b/src/modules/Microsoft.Storage/storageAccounts/blobServices/deploy.bicep
deleted file mode 100644
index 60eb6bef..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/deploy.bicep
+++ /dev/null
@@ -1,157 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.Storage/storageAccounts/blobServices/deploy.bicep
-// Date: 2023-02-01
-// Version: 0.9
-
-@maxLength(24)
-@description('Conditional. The name of the parent Storage Account. Required if the template is used in a standalone deployment.')
-param storageAccountName string
-
-@description('Optional. The name of the blob service.')
-param name string = 'default'
-
-@description('Optional. Indicates whether DeleteRetentionPolicy is enabled for the Blob service.')
-param deleteRetentionPolicy bool = true
-
-@description('Optional. Indicates the number of days that the deleted blob should be retained. The minimum specified value can be 1 and the maximum value can be 365.')
-param deleteRetentionPolicyDays int = 7
-
-@description('Optional. Automatic Snapshot is enabled if set to true.')
-param automaticSnapshotPolicyEnabled bool = false
-
-@description('Optional. Blob containers to create.')
-param containers array = []
-
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
-@description('Optional. Resource ID of the diagnostic storage account.')
-param diagnosticStorageAccountId string = ''
-
-@description('Optional. Resource ID of a log analytics workspace.')
-param diagnosticWorkspaceId string = ''
-
-@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
-param diagnosticEventHubAuthorizationRuleId string = ''
-
-@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category.')
-param diagnosticEventHubName string = ''
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource.')
-@allowed([
- 'allLogs'
- 'StorageRead'
- 'StorageWrite'
- 'StorageDelete'
-])
-param diagnosticLogCategoriesToEnable array = [
- 'allLogs'
-]
-
-@description('Optional. The name of metrics that will be streamed.')
-@allowed([
- 'Transaction'
-])
-param diagnosticMetricsToEnable array = [
- 'Transaction'
-]
-
-@description('Optional. The name of the diagnostic setting, if deployed.')
-param diagnosticSettingsName string = '${name}-diagnosticSettings'
-
-var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs'): {
- category: category
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
-}]
-
-var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
- {
- categoryGroup: 'allLogs'
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
- }
-] : diagnosticsLogsSpecified
-
-var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
- category: metric
- timeGrain: null
- enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
-}]
-
-var enableReferencedModulesTelemetry = false
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
- name: storageAccountName
-}
-
-resource blobServices 'Microsoft.Storage/storageAccounts/blobServices@2021-09-01' = {
- name: name
- parent: storageAccount
- properties: {
- deleteRetentionPolicy: {
- enabled: deleteRetentionPolicy
- days: deleteRetentionPolicyDays
- }
- automaticSnapshotPolicyEnabled: automaticSnapshotPolicyEnabled
- }
-}
-
-resource blobServices_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if ((!empty(diagnosticStorageAccountId)) || (!empty(diagnosticWorkspaceId)) || (!empty(diagnosticEventHubAuthorizationRuleId)) || (!empty(diagnosticEventHubName))) {
- name: diagnosticSettingsName
- properties: {
- storageAccountId: !empty(diagnosticStorageAccountId) ? diagnosticStorageAccountId : null
- workspaceId: !empty(diagnosticWorkspaceId) ? diagnosticWorkspaceId : null
- eventHubAuthorizationRuleId: !empty(diagnosticEventHubAuthorizationRuleId) ? diagnosticEventHubAuthorizationRuleId : null
- eventHubName: !empty(diagnosticEventHubName) ? diagnosticEventHubName : null
- metrics: diagnosticsMetrics
- logs: diagnosticsLogs
- }
- scope: blobServices
-}
-
-module blobServices_container 'containers/deploy.bicep' = [for (container, index) in containers: {
- name: '${deployment().name}-Container-${index}'
- params: {
- storageAccountName: storageAccount.name
- blobServicesName: blobServices.name
- name: container.name
- publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None'
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}]
-
-@description('The name of the deployed blob service.')
-output name string = blobServices.name
-
-@description('The resource ID of the deployed blob service.')
-output resourceId string = blobServices.id
-
-@description('The name of the deployed blob service.')
-output resourceGroupName string = resourceGroup().name
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/readme.md b/src/modules/Microsoft.Storage/storageAccounts/blobServices/readme.md
deleted file mode 100644
index 4be71995..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/readme.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Storage Account blob services `[Microsoft.Storage/storageAccounts/blobServices]`
-
-Copied from [Microsoft.Storage/storageAccounts/blobServices](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.Storage/storageAccounts/blobServices) - **CARML v0.9** (Feb 1, 2023)
-
-
-
-
-This module can be used to deploy a blob service into a storage account.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource Types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Cross-referenced modules](#cross-referenced-modules)
-
-## Resource Types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
-| `Microsoft.Storage/storageAccounts/blobServices` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers/immutabilityPolicies) |
-
-## Parameters
-
-**Conditional parameters**
-
-| Parameter Name | Type | Description |
-| :------------------- | :----- | :--------------------------------------------------------------------------------------------------- |
-| `storageAccountName` | string | The name of the parent Storage Account. Required if the template is used in a standalone deployment. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-------------------------------------- | :----------------------------------------- | :------------------------------------------------------- | :---------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
-| `automaticSnapshotPolicyEnabled` | bool | `False` | | Automatic Snapshot is enabled if set to true. |
-| `containers` | _[containers](containers/readme.md)_ array | `[]` | | Blob containers to create. |
-| `deleteRetentionPolicy` | bool | `True` | | Indicates whether DeleteRetentionPolicy is enabled for the Blob service. |
-| `deleteRetentionPolicyDays` | int | `7` | | Indicates the number of days that the deleted blob should be retained. The minimum specified value can be 1 and the maximum value can be 365. |
-| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
-| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `[allLogs, StorageDelete, StorageRead, StorageWrite]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
-| `diagnosticMetricsToEnable` | array | `[Transaction]` | `[Transaction]` | The name of metrics that will be streamed. |
-| `diagnosticSettingsName` | string | `[format('{0}-diagnosticSettings', parameters('name'))]` | | The name of the diagnostic setting, if deployed. |
-| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
-| `diagnosticWorkspaceId` | string | `''` | | Resource ID of a log analytics workspace. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `name` | string | `'default'` | | The name of the blob service. |
-
-## Outputs
-
-| Output Name | Type | Description |
-| :------------------ | :----- | :-------------------------------------------- |
-| `name` | string | The name of the deployed blob service. |
-| `resourceGroupName` | string | The name of the deployed blob service. |
-| `resourceId` | string | The resource ID of the deployed blob service. |
-
-## Cross-referenced modules
-
-_None_
diff --git a/src/modules/Microsoft.Storage/storageAccounts/blobServices/version.json b/src/modules/Microsoft.Storage/storageAccounts/blobServices/version.json
deleted file mode 100644
index 56f8d9ca..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/blobServices/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.4"
-}
diff --git a/src/modules/Microsoft.Storage/storageAccounts/deploy.bicep b/src/modules/Microsoft.Storage/storageAccounts/deploy.bicep
deleted file mode 100644
index 80e90b04..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/deploy.bicep
+++ /dev/null
@@ -1,142 +0,0 @@
-// Source: https://github.com/Azure/ResourceModules/blob/main/modules/Microsoft.Storage/storageAccounts/deploy.bicep
-// Date: 2023-02-01
-// Version: 0.9
-
-@maxLength(24)
-@description('Required. Name of the Storage Account.')
-param name string
-
-@description('Optional. Location for all resources.')
-param location string = resourceGroup().location
-
-@allowed([
- 'Premium_LRS'
- 'Premium_ZRS'
-])
-@description('Optional. Storage Account Sku Name.')
-param storageAccountSku string = 'Premium_LRS'
-
-@allowed([
- 'Hot'
- 'Cool'
-])
-@description('Optional. Storage Account Access Tier.')
-param storageAccountAccessTier string = 'Hot'
-
-@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
-param privateEndpoints array = []
-
-@description('Optional. Networks ACLs, this value contains IPs to whitelist and/or Subnet information. For security reasons, it is recommended to set the DefaultAction Deny.')
-param networkAcls object = {}
-
-@description('Optional. Blob service and containers to deploy.')
-param blobServices object = {}
-
-@description('Optional. Indicates whether public access is enabled for all blobs or containers in the storage account. For security reasons, it is recommended to set it to false.')
-param allowBlobPublicAccess bool = false
-
-@allowed([
- 'TLS1_0'
- 'TLS1_1'
- 'TLS1_2'
-])
-@description('Optional. Set the minimum TLS version on request to storage.')
-param minimumTlsVersion string = 'TLS1_2'
-
-@description('Optional. If true, enables Secure File Transfer Protocol for the storage account. Requires enableHierarchicalNamespace to be true.')
-param enableSftp bool = false
-
-@description('Optional. If true, enables NFS 3.0 support for the storage account. Requires enableHierarchicalNamespace to be true.')
-param enableNfsV3 bool = false
-
-@description('Optional. Tags of the resource.')
-param tags object = {}
-
-@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
-param enableDefaultTelemetry bool = true
-
-@description('Optional. Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set and networkAcls are not set.')
-@allowed([
- ''
- 'Enabled'
- 'Disabled'
-])
-param publicNetworkAccess string = ''
-
-@description('Optional. Allows HTTPS traffic only to storage service if sets to true.')
-param supportsHttpsTrafficOnly bool = true
-
-var enableReferencedModulesTelemetry = false
-
-resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
- name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- resources: []
- }
- }
-}
-
-resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
- name: name
- location: location
- kind: 'BlockBlobStorage'
- sku: {
- name: storageAccountSku
- }
- tags: tags
- properties: {
- accessTier: storageAccountAccessTier
- supportsHttpsTrafficOnly: supportsHttpsTrafficOnly
- isHnsEnabled: true
- isSftpEnabled: enableSftp
- isNfsV3Enabled: enableNfsV3
- minimumTlsVersion: minimumTlsVersion
- networkAcls: !empty(networkAcls) ? {
- bypass: contains(networkAcls, 'bypass') ? networkAcls.bypass : null
- defaultAction: contains(networkAcls, 'defaultAction') ? networkAcls.defaultAction : null
- virtualNetworkRules: contains(networkAcls, 'virtualNetworkRules') ? networkAcls.virtualNetworkRules : []
- ipRules: contains(networkAcls, 'ipRules') ? networkAcls.ipRules : []
- } : null
- allowBlobPublicAccess: allowBlobPublicAccess
- publicNetworkAccess: !empty(publicNetworkAccess) ? any(publicNetworkAccess) : (!empty(privateEndpoints) && empty(networkAcls) ? 'Disabled' : null)
- }
-}
-
-// Containers
-module storageAccount_blobServices 'blobServices/deploy.bicep' = if (!empty(blobServices)) {
- name: '${uniqueString(deployment().name, location)}-Storage-BlobServices'
- params: {
- storageAccountName: storageAccount.name
- containers: contains(blobServices, 'containers') ? blobServices.containers : []
- automaticSnapshotPolicyEnabled: contains(blobServices, 'automaticSnapshotPolicyEnabled') ? blobServices.automaticSnapshotPolicyEnabled : false
- deleteRetentionPolicy: contains(blobServices, 'deleteRetentionPolicy') ? blobServices.deleteRetentionPolicy : true
- deleteRetentionPolicyDays: contains(blobServices, 'deleteRetentionPolicyDays') ? blobServices.deleteRetentionPolicyDays : 7
- diagnosticLogsRetentionInDays: contains(blobServices, 'diagnosticLogsRetentionInDays') ? blobServices.diagnosticLogsRetentionInDays : 365
- diagnosticStorageAccountId: contains(blobServices, 'diagnosticStorageAccountId') ? blobServices.diagnosticStorageAccountId : ''
- diagnosticEventHubAuthorizationRuleId: contains(blobServices, 'diagnosticEventHubAuthorizationRuleId') ? blobServices.diagnosticEventHubAuthorizationRuleId : ''
- diagnosticEventHubName: contains(blobServices, 'diagnosticEventHubName') ? blobServices.diagnosticEventHubName : ''
- diagnosticLogCategoriesToEnable: contains(blobServices, 'diagnosticLogCategoriesToEnable') ? blobServices.diagnosticLogCategoriesToEnable : []
- diagnosticMetricsToEnable: contains(blobServices, 'diagnosticMetricsToEnable') ? blobServices.diagnosticMetricsToEnable : []
- diagnosticWorkspaceId: contains(blobServices, 'diagnosticWorkspaceId') ? blobServices.diagnosticWorkspaceId : ''
- enableDefaultTelemetry: enableReferencedModulesTelemetry
- }
-}
-
-@description('The resource ID of the deployed storage account.')
-output resourceId string = storageAccount.id
-
-@description('The name of the deployed storage account.')
-output name string = storageAccount.name
-
-@description('The resource group of the deployed storage account.')
-output resourceGroupName string = resourceGroup().name
-
-@description('The primary blob endpoint reference if blob services are deployed.')
-output primaryBlobEndpoint string = !empty(blobServices) && contains(blobServices, 'containers') ? reference('Microsoft.Storage/storageAccounts/${storageAccount.name}', '2019-04-01').primaryEndpoints.blob : ''
-
-@description('The location the resource was deployed into.')
-output location string = storageAccount.location
diff --git a/src/modules/Microsoft.Storage/storageAccounts/readme.md b/src/modules/Microsoft.Storage/storageAccounts/readme.md
deleted file mode 100644
index f40abd65..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/readme.md
+++ /dev/null
@@ -1,1181 +0,0 @@
-# Storage Accounts `[Microsoft.Storage/storageAccounts]`
-
-Copied from [Microsoft.Storage/storageAccounts](https://github.com/Azure/ResourceModules/tree/main/modules/Microsoft.Storage/resourceTypes) - **CARML v0.9** (Feb 1, 2023)
-
-
-
-
-This module is used to deploy a storage account, with the ability to deploy 1 or more blob containers, file shares, tables and queues. Optional ACLs can be configured on the storage account and optional RBAC can be assigned on the storage account and on each child resource.
-
-## Navigation
-
-- [Navigation](#navigation)
-- [Resource types](#resource-types)
-- [Parameters](#parameters)
-- [Outputs](#outputs)
-- [Considerations](#considerations)
-- [Cross-referenced modules](#cross-referenced-modules)
-- [Deployment examples](#deployment-examples)
-
-## Resource types
-
-| Resource Type | API Version |
-| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `Microsoft.Authorization/locks` | [2020-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
-| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
-| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
-| `Microsoft.Network/privateEndpoints` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints) |
-| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2022-05-01/privateEndpoints/privateDnsZoneGroups) |
-| `Microsoft.Storage/storageAccounts` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts) |
-| `Microsoft.Storage/storageAccounts/blobServices` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers) |
-| `Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/blobServices/containers/immutabilityPolicies) |
-| `Microsoft.Storage/storageAccounts/fileServices` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/fileServices) |
-| `Microsoft.Storage/storageAccounts/fileServices/shares` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/fileServices/shares) |
-| `Microsoft.Storage/storageAccounts/localUsers` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2022-05-01/storageAccounts/localUsers) |
-| `Microsoft.Storage/storageAccounts/managementPolicies` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/managementPolicies) |
-| `Microsoft.Storage/storageAccounts/queueServices` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/queueServices) |
-| `Microsoft.Storage/storageAccounts/queueServices/queues` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/queueServices/queues) |
-| `Microsoft.Storage/storageAccounts/tableServices` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/tableServices) |
-| `Microsoft.Storage/storageAccounts/tableServices/tables` | [2021-09-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2021-09-01/storageAccounts/tableServices/tables) |
-
-## Parameters
-
-**Required parameters**
-
-| Parameter Name | Type | Description |
-| :------------- | :----- | :--------------------------- |
-| `name` | string | Name of the Storage Account. |
-
-**Conditional parameters**
-
-| Parameter Name | Type | Default Value | Description |
-| :---------------------------------- | :----- | :------------ | :----------------------------------------------------------------------------------------------------------------------------- |
-| `cMKKeyVaultResourceId` | string | `''` | The resource ID of a key vault to reference a customer managed key for encryption from. Required if 'cMKKeyName' is not empty. |
-| `cMKUserAssignedIdentityResourceId` | string | `''` | User assigned identity to use when fetching the customer managed key. Required if 'cMKKeyName' is not empty. |
-| `enableHierarchicalNamespace` | bool | `False` | If true, enables Hierarchical Namespace for the storage account. Required if enableSftp or enableNfsV3 is set to true. |
-
-**Optional parameters**
-
-| Parameter Name | Type | Default Value | Allowed Values | Description |
-| :-------------------------------------- | :------------------------------------------------ | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `allowBlobPublicAccess` | bool | `False` | | Indicates whether public access is enabled for all blobs or containers in the storage account. For security reasons, it is recommended to set it to false. |
-| `azureFilesIdentityBasedAuthentication` | object | `{object}` | | Provides the identity based authentication settings for Azure Files. |
-| `blobServices` | _[blobServices](blobServices/readme.md)_ object | `{object}` | | Blob service and containers to deploy. |
-| `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. Cannot be deployed together with the parameter 'systemAssignedIdentity' enabled. |
-| `cMKKeyVersion` | string | `''` | | The version of the customer managed key to reference for encryption. If not provided, latest is used. |
-| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
-| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
-| `diagnosticMetricsToEnable` | array | `[Transaction]` | `[Transaction]` | The name of metrics that will be streamed. |
-| `diagnosticSettingsName` | string | `[format('{0}-diagnosticSettings', parameters('name'))]` | | The name of the diagnostic setting, if deployed. |
-| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
-| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
-| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
-| `enableNfsV3` | bool | `False` | | If true, enables NFS 3.0 support for the storage account. Requires enableHierarchicalNamespace to be true. |
-| `enableSftp` | bool | `False` | | If true, enables Secure File Transfer Protocol for the storage account. Requires enableHierarchicalNamespace to be true. |
-| `fileServices` | _[fileServices](fileServices/readme.md)_ object | `{object}` | | File service and shares to deploy. |
-| `largeFileSharesState` | string | `'Disabled'` | `[Disabled, Enabled]` | Allow large file shares if sets to 'Enabled'. It cannot be disabled once it is enabled. Only supported on locally redundant and zone redundant file shares. It cannot be set on FileStorage storage accounts (storage accounts for premium file shares). |
-| `localUsers` | _[localUsers](localUsers/readme.md)_ array | `[]` | | Local users to deploy for SFTP authentication. |
-| `location` | string | `[resourceGroup().location]` | | Location for all resources. |
-| `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. |
-| `managementPolicyRules` | array | `[]` | | The Storage Account ManagementPolicies Rules. |
-| `minimumTlsVersion` | string | `'TLS1_2'` | `[TLS1_0, TLS1_1, TLS1_2]` | Set the minimum TLS version on request to storage. |
-| `networkAcls` | object | `{object}` | | Networks ACLs, this value contains IPs to whitelist and/or Subnet information. For security reasons, it is recommended to set the DefaultAction Deny. |
-| `privateEndpoints` | array | `[]` | | Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible. |
-| `publicNetworkAccess` | string | `''` | `['', Disabled, Enabled]` | Whether or not public network access is allowed for this resource. For security reasons it should be disabled. If not specified, it will be disabled by default if private endpoints are set and networkAcls are not set. |
-| `queueServices` | _[queueServices](queueServices/readme.md)_ object | `{object}` | | Queue service and queues to create. |
-| `requireInfrastructureEncryption` | bool | `True` | | A Boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. For security reasons, it is recommended to set it to true. |
-| `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
-| `storageAccountAccessTier` | string | `'Hot'` | `[Cool, Hot]` | Storage Account Access Tier. |
-| `storageAccountKind` | string | `'StorageV2'` | `[BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2]` | Type of Storage Account to create. |
-| `storageAccountSku` | string | `'Standard_GRS'` | `[Premium_LRS, Premium_ZRS, Standard_GRS, Standard_GZRS, Standard_LRS, Standard_RAGRS, Standard_RAGZRS, Standard_ZRS]` | Storage Account Sku Name. |
-| `supportsHttpsTrafficOnly` | bool | `True` | | Allows HTTPS traffic only to storage service if sets to true. |
-| `systemAssignedIdentity` | bool | `False` | | Enables system assigned managed identity on the resource. |
-| `tableServices` | _[tableServices](tableServices/readme.md)_ object | `{object}` | | Table service and tables to create. |
-| `tags` | object | `{object}` | | Tags of the resource. |
-| `userAssignedIdentities` | object | `{object}` | | The ID(s) to assign to the resource. |
-
-### Parameter Usage: `roleAssignments`
-
-Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to `'ServicePrincipal'`. This will ensure the role assignment waits for the principal's propagation in Azure.
-
-Parameter JSON format
-
-```json
-"roleAssignments": {
- "value": [
- {
- "roleDefinitionIdOrName": "Reader",
- "description": "Reader Role Assignment",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012", // object 1
- "78945612-1234-1234-1234-123456789012" // object 2
- ]
- },
- {
- "roleDefinitionIdOrName": "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11",
- "principalIds": [
- "12345678-1234-1234-1234-123456789012" // object 1
- ],
- "principalType": "ServicePrincipal"
- }
- ]
-}
-```
-
-Bicep format
-
-```bicep
-roleAssignments: [
- {
- roleDefinitionIdOrName: 'Reader'
- description: 'Reader Role Assignment'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- '78945612-1234-1234-1234-123456789012' // object 2
- ]
- }
- {
- roleDefinitionIdOrName: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'
- principalIds: [
- '12345678-1234-1234-1234-123456789012' // object 1
- ]
- principalType: 'ServicePrincipal'
- }
-]
-```
-
-
-
-### Parameter Usage: `networkAcls`
-
-Parameter JSON format
-
-```json
-"networkAcls": {
- "value": {
- "bypass": "AzureServices",
- "defaultAction": "Deny",
- "virtualNetworkRules": [
- {
- "action": "Allow",
- "id": "/subscriptions/<Bicep format
-
-```bicep
-networkAcls: {
- bypass: 'AzureServices'
- defaultAction: 'Deny'
- virtualNetworkRules: [
- {
- action: 'Allow'
- id: '/subscriptions/<
-
-### Parameter Usage: `tags`
-
-Tag names and tag values can be provided as needed. A tag can be left without a value.
-
-Parameter JSON format
-
-```json
-"tags": {
- "value": {
- "Environment": "Non-Prod",
- "Contact": "test.user@testcompany.com",
- "PurchaseOrder": "1234",
- "CostCenter": "7890",
- "ServiceName": "DeploymentValidation",
- "Role": "DeploymentValidation"
- }
-}
-```
-
-Bicep format
-
-```bicep
-tags: {
- Environment: 'Non-Prod'
- Contact: 'test.user@testcompany.com'
- PurchaseOrder: '1234'
- CostCenter: '7890'
- ServiceName: 'DeploymentValidation'
- Role: 'DeploymentValidation'
-}
-```
-
-
-
-### Parameter Usage: `privateEndpoints`
-
-To use Private Endpoint the following dependencies must be deployed:
-
-- Destination subnet must be created with the following configuration option - `"privateEndpointNetworkPolicies": "Disabled"`. Setting this option acknowledges that NSG rules are not applied to Private Endpoints (this capability is coming soon). A full example is available in the Virtual Network Module.
-- Although not strictly required, it is highly recommended to first create a private DNS Zone to host Private Endpoint DNS records. See [Azure Private Endpoint DNS configuration](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns) for more information.
-
-Parameter JSON format
-
-```json
-"privateEndpoints": {
- "value": [
- // Example showing all available fields
- {
- "name": "sxx-az-pe", // Optional: Name will be automatically generated if one is not provided here
- "subnetResourceId": "/subscriptions/<Bicep format
-
-```bicep
-privateEndpoints: [
- // Example showing all available fields
- {
- name: 'sxx-az-pe' // Optional: Name will be automatically generated if one is not provided here
- subnetResourceId: '/subscriptions/<
-
-### Parameter Usage: `userAssignedIdentities`
-
-You can specify multiple user assigned identities to a resource by providing additional resource IDs using the following format:
-
-Parameter JSON format
-
-```json
-"userAssignedIdentities": {
- "value": {
- "/subscriptions/<Bicep format
-
-```bicep
-userAssignedIdentities: {
- '/subscriptions/<
- -## Outputs - -| Output Name | Type | Description | -| :-------------------------- | :----- | :----------------------------------------------------------------- | -| `location` | string | The location the resource was deployed into. | -| `name` | string | The name of the deployed storage account. | -| `primaryBlobEndpoint` | string | The primary blob endpoint reference if blob services are deployed. | -| `resourceGroupName` | string | The resource group of the deployed storage account. | -| `resourceId` | string | The resource ID of the deployed storage account. | -| `systemAssignedPrincipalId` | string | The principal ID of the system assigned identity. | - -## Considerations - -This is a generic module for deploying a Storage Account. Any customization for different storage needs (such as a diagnostic or other storage account) need to be done through the Archetype. -The hierarchical namespace of the storage account (see parameter `enableHierarchicalNamespace`), can be only set at creation time. - -## Cross-referenced modules - -This section gives you an overview of all local-referenced module files (i.e., other CARML modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs). - -| Reference | Type | -| :----------------------------------- | :-------------- | -| `Microsoft.Network/privateEndpoints` | Local reference | - -## Deployment examples - -The following module usage examples are retrieved from the content of the files hosted in the module's `.test` folder. - -> **Note**: The name of each example is based on the name of the file from which it is taken. - -> **Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. - -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
- -
-
-via JSON Parameter file
-
-```json
-{
- "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- // Required parameters
- "name": {
- "value": "<
diff --git a/src/modules/Microsoft.Storage/storageAccounts/version.json b/src/modules/Microsoft.Storage/storageAccounts/version.json
deleted file mode 100644
index badc0a22..00000000
--- a/src/modules/Microsoft.Storage/storageAccounts/version.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "0.5"
-}
diff --git a/src/modules/README.md b/src/modules/README.md
deleted file mode 100644
index 3cc0f508..00000000
--- a/src/modules/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# FinOps toolkit modules
-
-All FinOps toolkit module source is available at the root of this directory. For summary details, see [public docs](../../docs/templates/modules).
-
-Modules:
-
-- [hub.bicep](./hub.bicep) creates a new FinOps hub instance.
-
-
-
-On this page:
-
-- [Telemetry](#telemetry)
-- [About dependencies](#about-dependencies)
-- [About Bicep](#about-bicep)
-
----
-
-## Telemetry
-
-Every FinOps toolkit module includes a `defaultTelemetry` deployment. These should be enabled by default using an input parameter that callers can disable. Telemetry deployments are tracked using a specific ID made up of the FinOps toolkit prefix (`00f120b5-2007-6120-0000-`) followed by a 12-digit hexadecimal representation of the module name (e.g., `h0b000000000` for `hub.bicep`).
-
-Include the following as the last parameter in each module and replace the `
-
-## About Bicep
-
-FinOps toolkit templates are comprised of [Bicep](https://learn.microsoft.com/azure/azure-resource-manager/bicep) modules. Bicep is a domain-specific language that uses declarative syntax to define and deploy Azure resources. For a guided learning experience, start with the [Fundamentals of Bicep](https://learn.microsoft.com/training/paths/fundamentals-bicep/).
diff --git a/src/modules/hub.bicep b/src/modules/hub.bicep
deleted file mode 100644
index 203d6481..00000000
--- a/src/modules/hub.bicep
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * Parameters
- */
-
-@description('Optional. Name of the hub. Used to ensure unique resource names. Default: "finops-hub".')
-param hubName string
-
-// Generate unique storage account name
-var storageAccountSuffix = 'store'
-var storageAccountName = '${substring(replace(toLower(hubName), '-', ''), 0, 24 - length(storageAccountSuffix))}${storageAccountSuffix}'
-
-// Data factory naming requirements: Min 3, Max 63, can only contain letters, numbers and non-repeating dashes
-var dataFactorySuffix = '-engine'
-var dataFactoryName = '${take(hubName, 63 - length(dataFactorySuffix))}${dataFactorySuffix}'
-
-@description('Optional. Azure location where all resources should be created. See https://aka.ms/azureregions. Default: (resource group location).')
-param location string = resourceGroup().location
-
-@allowed([
- 'Premium_LRS'
- 'Premium_ZRS'
-])
-@description('Optional. Storage account SKU. LRS = Lowest cost, ZRS = High availability. Note Standard SKUs are not available for Data Lake gen2 storage. Default: Premium_LRS.')
-param storageSku string = 'Premium_LRS'
-
-@description('Optional. Tags to apply to all resources. We will also add the cm-resource-parent tag for improved cost roll-ups in Cost Management.')
-param tags object = {}
-var resourceTags = union(tags, {
- 'cm-resource-parent': '${resourceGroup().id}/providers/Microsoft.Cloud/hubs/${hubName}'
- })
-
-@description('Optional. Enable telemetry to track anonymous module usage trends, monitor for bugs, and improve future releases.')
-param enableDefaultTelemetry bool = true
-
-@description('Optional. List of scope IDs to create exports for.')
-param exportScopes array
-
-var containerNames = ['config', 'ms-cm-exports', 'ingestion']
-
-// The last segment of the telemetryId is used to identify this module
-var telemetryId = '00f120b5-2007-6120-0000-40b000000000'
-var finOpsToolkitVersion = '0.0.1'
-
-/**
- * Resources
- */
-
-// Telemetry used anonymously to count the number of times the template has been deployed.
-// No information about you or your cost data is collected.
-resource defaultTelemetry 'Microsoft.Resources/deployments@2022-09-01' = if (enableDefaultTelemetry) {
- name: 'pid-${telemetryId}-${uniqueString(deployment().name, location)}'
- properties: {
- mode: 'Incremental'
- template: {
- '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
- contentVersion: '1.0.0.0'
- metadata: {
- _generator: {
- name: 'FinOps toolkit'
- version: finOpsToolkitVersion
- }
- }
- resources: []
- }
- }
-}
-
-// ADLSv2 storage account for staging and archive
-module storageAccount 'Microsoft.Storage/storageAccounts/deploy.bicep' = {
- name: 'storage'
- params: {
- name: storageAccountName
- location: location
- storageAccountSku: storageSku
- tags: resourceTags
- }
-}
-
-module dataFactory 'Microsoft.DataFactory/factories/deploy.bicep' = {
- name: 'dataFactory'
- params: {
- name: dataFactoryName
- location: location
- tags: resourceTags
- }
-}
-
-resource storageAccountLookup 'Microsoft.Storage/storageAccounts@2021-06-01' existing = {
- name: storageAccount.name
-}
-
-resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2021-06-01' = {
- parent: storageAccountLookup
- name: 'default'
-}
-
-resource containers 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = [for containerName in containerNames: {
- parent: blobService
- name: toLower(containerName)
- properties: {
- publicAccess: 'None'
- metadata: {}
- }
-}]
-
-resource uploadSettingsJson 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
- name: 'updateSettingsJson'
- kind: 'AzurePowerShell'
- location: location
- dependsOn: [
- containers
- ]
- properties: {
- azPowerShellVersion: '8.0'
- retentionInterval: 'PT1H'
- environmentVariables: [
- {
- name: 'exportScopes'
- value: join(exportScopes, '|')
- }
- {
- name: 'storageAccountKey'
- value: storageAccountLookup.listKeys().keys[0].value
- }
- {
- name: 'storageAccountName'
- value: storageAccount.name
- }
- {
- name: 'containerName'
- value: 'config'
- }
- ]
- scriptContent: loadTextContent('./scripts/Copy-FileToAzureBlob.ps1')
- }
-}
-
-/**
- * Outputs
- */
-
-@description('Name of the deployed hub instance.')
-output name string = hubName
-
-@description('Azure resource location resources were deployed to.')
-output location string = location
-
-@description('Resource ID of the storage account created for the hub instance. This must be used when creating the Cost Management export.')
-output storageAccountId string = storageAccount.outputs.resourceId
-
-@description('Name of the storage account created for the hub instance. This must be used when connecting FinOps toolkit Power BI reports to your data.')
-output storageAccountName string = storageAccount.outputs.name
-
-@description('URL to use when connecting custom Power BI reports to your data.')
-output storageUrlForPowerBI string = 'https://${storageAccount.outputs.name}.dfs.${environment().suffixes.storage}/ms-cm-exports'
diff --git a/src/powershell/FinOpsToolkit.psm1 b/src/powershell/FinOpsToolkit.psm1
new file mode 100644
index 00000000..3f297b07
--- /dev/null
+++ b/src/powershell/FinOpsToolkit.psm1
@@ -0,0 +1,50 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+#region Public functions
+<#
+ .SYNOPSIS
+ Retrieves available version numbers of the FinOps Hub template.
+
+ .PARAMETER Latest
+ Will only return the latest version number of FinOps Hub template.
+
+ .PARAMETER Preview
+ Includes pre-releases.
+
+ .EXAMPLE
+ Get-FinOpsToolkitVersions
+
+ Returns all available released version numbers of FinOps Hub templates.
+
+ .EXAMPLE
+ Get-FinOpsToolkitVersions -Latest
+
+ Returns only the latest version number of the FinOps Hub templates.
+#>
+function Get-FinOpsToolkitVersions {
+ [CmdletBinding()]
+ param
+ (
+ [Parameter()]
+ [switch]
+ $Latest,
+
+ [Parameter()]
+ [switch]
+ $Preview
+ )
+
+ $releaseUri = 'https://api.github.com/repos/microsoft/cloud-hubs/releases'
+ [array]$releases = Invoke-WebRequest -Uri $releaseUri | ConvertFrom-Json | Where-Object { ($Preview) -or (-not $_.prerelease) }
+
+ if ($Latest) {
+ $releases = $releases | Select-Object -First 1
+ Write-Verbose -Message ($LocalizedData.FoundLatestRelease -f $releases.tag_name)
+ }
+
+ return $releases.tag_name
+}
+#endregion Public functions
+
+Export-ModuleMember -Function 'Get-FinOpsToolkitVersions'
diff --git a/src/reports/CommitmentDiscounts.pbix b/src/reports/CommitmentDiscounts.pbix
deleted file mode 100644
index e811979a..00000000
Binary files a/src/reports/CommitmentDiscounts.pbix and /dev/null differ
diff --git a/src/reports/CostSummary.pbix b/src/reports/CostSummary.pbix
deleted file mode 100644
index 21f9ce40..00000000
Binary files a/src/reports/CostSummary.pbix and /dev/null differ
diff --git a/src/scripts/Add-CopyrightHeader.ps1 b/src/scripts/Add-CopyrightHeader.ps1
new file mode 100644
index 00000000..8ba80f19
--- /dev/null
+++ b/src/scripts/Add-CopyrightHeader.ps1
@@ -0,0 +1,65 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+<#
+ .SYNOPSIS
+ Adds a standard copyright header to all files in the repository that don't already have it.
+ .DESCRIPTION
+ Run this from the /src/scripts folder.
+ .EXAMPLE
+ ./Add-CopyrightHeader
+
+ Loops thru all files in the src folder and adds the header if missing.
+#>
+
+# Header lines to add to the top of each file
+$headerLines = @( "Copyright (c) Microsoft Corporation.", "Licensed under the MIT License." )
+
+# File types to add the copyright header to and their comment characters
+$fileTypes = @{
+ "bicep" = "//"
+ "ps1" = "#"
+ "psd1" = "#"
+ "psm1" = "#"
+}
+$newLine = [Environment]::NewLine
+
+$valid = 0
+$fixed = 0
+$notSupported = 0
+
+Get-ChildItem -Path ../ -Recurse -Include *.* -Exclude *.json, *.md, *.pbix, *.svg -File `
+| ForEach-Object {
+ $file = $_
+
+ # Look up the comment character for the file type
+ $ext = $file.Extension.TrimStart(".")
+ if ($fileTypes.ContainsKey($ext)) {
+ $commentChar = $fileTypes[$file.Extension.TrimStart(".")]
+ } else {
+ Write-Error "File type not supported: $ext"
+ $notSupported++
+ return
+ }
+
+ # Build the header
+ $header = "$commentChar " + ($headerLines -join "$newLine$commentChar ") + $newLine + $newLine
+
+ # Check if the file already has the header and add it if missing
+ $content = Get-Content $file -Raw
+ if ($content.StartsWith($header)) {
+ Write-Host "✔ $($file.FullName)"
+ $valid++
+ } else {
+ Write-Host "✘ $($file.FullName)" -NoNewline
+ Set-Content -Path $file -Value ($header + $content) -NoNewline
+ Write-Host " ...added!"
+ $fixed++
+ }
+}
+
+Write-Host ""
+Write-Host "$($valid + $fixed) files checked"
+Write-Host "$fixed file(s) updated"
+Write-Host "$notSupported unsupported file type(s)"
+Write-Host ""
diff --git a/src/scripts/Build-Bicep.ps1 b/src/scripts/Build-Bicep.ps1
new file mode 100644
index 00000000..3fb5e4c5
--- /dev/null
+++ b/src/scripts/Build-Bicep.ps1
@@ -0,0 +1,241 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+<#
+.SYNOPSIS
+ Builds all Bicep modules for publishing to the Bicep Registry.
+.DESCRIPTION
+ Run this from the /src/scripts folder.
+.EXAMPLE
+ ./Build-Bicep ../bicep-registry/module-name
+ Generates separate modules for each supported scope for the specified module.
+.EXAMPLE
+ ./Build-Bicep ../bicep-registry/module-name -Scope subscription
+ Generates the module for only one scope (subscription in this case).
+.EXAMPLE
+ ./Build-Bicep ../bicep-registry/module-name -Scope subscription -Debug
+ Renders main module and test bicep code to the console instead of generating files.
+.PARAMETER Module
+ Path to the module to build.
+.PARAMETER Scope
+ Optional. Scope to build. If not specified, all scopes will be built.
+.PARAMETER Debug
+ Optional. Renders main module and test bicep code to the console instead of generating files. Line numbers map to original file.
+#>
+Param (
+ [Parameter(Position = 0)][string] $Module,
+ [string] $Scope
+)
+
+# Use the debug flag from common parameters to determine whether to run in debug mode
+$Debug = $DebugPreference -eq "Continue"
+
+$outdir = Join-Path .. .. release
+$scaffoldDir = Join-Path .. bicep-registry .scaffold
+$scopeList = '(subscription|resourceGroup|managementGroup|tenant)';
+$scopeDirective = "//(\s*@$scopeList)+";
+$dir = Get-Item $Module;
+
+# List of supported scopes to be updated later
+$script:scopes = @()
+
+# Generates modules for each supported scope
+function Build-Modules([string] $Path, [switch] $CopySupportingFiles) {
+ # Confirm path
+ if (-not (Test-Path (Join-Path $Module $Path))) {
+ return;
+ }
+
+ # Read code from the bicep file
+ $lines = (Get-Content (Join-Path $Module $Path));
+
+ # Get the supported scopes
+ $script:scopes = [regex]::Matches([regex]::Matches($lines, $scopeDirective).Value, $scopeList).Value `
+ | Sort-Object -Unique `
+ | Where-Object { $_.ToLower() -eq $Scope.ToLower() -or [string]::IsNullOrWhitespace($Scope) }
+
+ # Loop thru each scope
+ $script:scopes `
+ | ForEach-Object {
+ $currentScope = $_
+ $moduleName = "$($currentScope.ToLower())-$($dir.Name)"
+
+ if ($CopySupportingFiles) {
+ Write-Host " $currentScope..."
+ }
+
+ # Init string builder for the scope output
+ $sb = [System.Text.StringBuilder]::new()
+
+ # Write debug header
+ if ($Debug) {
+ Write-Host $moduleName
+ Write-Host "".PadLeft($moduleName.Length, "=")
+ }
+
+ # Use custom iterator to peek at multiple lines
+ $i = 0
+ $script:lastLineEmpty = $lines.Count -le $i -or [string]::IsNullOrWhiteSpace($lines[$i])
+ while ($i -lt ($lines.Count)) {
+ # Helper functions
+ $script:isNewLine = $true
+ function append([string] $Text, [switch] $NoNewLine) {
+ if ($Debug -and $script:isNewLine) { [void]$sb.Append("$($i.ToString().PadLeft(3, ' '))| ") }
+ if ($NoNewLine) { [void]$sb.Append($Text) } else { [void]$sb.AppendLine($Text) }
+ $script:isNewLine = -not $NoNewLine
+ $script:lastLineEmpty = $Text.Trim() -eq ''
+ }
+
+ $line = $lines[$i]
+
+ # Remove empty lines before content starts
+ if ($line.Trim() -eq '' -and $script:lastLineEmpty) {
+ # Do nothing, skip line
+ }
+ # Handle targetScope
+ elseif ($line -match "^\s*targetScope\s*=\s*'(resourceGroup|subscription|managementGroup|tenant)'\s*($scopeDirective)?\s*$") {
+ append "targetScope = '$currentScope'"
+ }
+ # Handle conditional lines
+ elseif ($line -match "[^\s]+\s*$scopeDirective" -and $line.Substring(0, $line.LastIndexOf("//")).Trim().Length -gt 0) {
+ # If current scope, remove directive; otherwise, remove line
+ if ($line.Substring($line.LastIndexOf("//")) -match "@$currentScope") {
+ # If line is commented, uncomment it
+ if ($line -match '^\s*//') { $line = ([regex]'//\s*').Replace($line, '', 1) }
+
+ # Append line without directive
+ append ($line.TrimEnd() -creplace "$scopeDirective$", '')
+ } else {
+ # Do nothing, skip line
+ }
+ }
+ # Handle conditional blocks
+ elseif ($line -match "^\s*$scopeDirective\s*$") {
+ # Check to see if the directive is for the current scope
+ $isCurrentScopeBlock = $line.Substring($line.LastIndexOf("//")) -match "@$currentScope"
+
+ # Loop thru next lines until we find a directive or empty line
+ while ($lines.Count -gt $i + 1 -and -not ($lines[$i + 1] -match "^\s*$scopeDirective\s*$") -and $lines[$i + 1].Trim().Length -gt 0) {
+ # If current scope, uncomment; otherwise, skip line
+ if ($isCurrentScopeBlock) {
+ append ([regex]'//\s*').Replace($lines[++$i], '', 1)
+ } else {
+ $i++
+ }
+ }
+ }
+ # Append standard code
+ else {
+ append $line
+ }
+
+ # Move to next line
+ $i++
+ }
+
+ # Write main file
+ ./New-Directory (Join-Path $outdir $moduleName (Split-Path $Path))
+ if ($Debug) {
+ $sb.ToString()
+ } else {
+ $sb.ToString() | Out-File (Join-Path $outdir $moduleName $Path)
+ }
+
+ # Write template files, if metadata.json exists
+ $scaffoldInputsFile = Join-Path $Module scaffold.json
+ if ($CopySupportingFiles -and -not $Debug -and (Test-Path $scaffoldInputsFile)) {
+ @('main.json', 'metadata.json', 'README.md', 'version.json') `
+ | ForEach-Object {
+ $sourceFile = Join-Path $scaffoldDir $_
+ if (Test-Path $sourceFile) {
+ Copy-Item $sourceFile (Join-Path $outdir $moduleName)
+ }
+ }
+
+ function formatString($text) {
+ $formatParams = @{
+ resourceGroup = @{ scopeLowerPlural = "resource groups" }
+ subscription = @{ scopeLowerPlural = "subscriptions" }
+ managementGroup = @{ scopeLowerPlural = "management groups" }
+ tenant = @{ scopeLowerPlural = "billing accounts" }
+ }[$currentScope]
+ $formatParams.Keys `
+ | ForEach-Object { $text = $text.Replace("{$_}", $formatParams[$_]) }
+ return $text
+ }
+ $scaffoldInputs = Get-Content $scaffoldInputsFile | ConvertFrom-Json
+
+ # Update metadata.json
+ $metadataFile = Join-Path $outdir $moduleName metadata.json
+ $metadata = Get-Content $metadataFile | ConvertFrom-Json
+ $metadata.name = formatString $scaffoldInputs.name
+ $metadata.summary = formatString ($scaffoldInputs.text | Where-Object { $_.scopes.Contains($currentScope) }).summary
+ $metadata | ConvertTo-Json -Depth 100 | Set-Content $metadataFile
+ if ($metadata.summary.Length -gt 120) {
+ Write-Error 'Summary in metadata.json cannot be longer than 120 characters.'
+ }
+
+ # Update version.json
+ $versionFile = Join-Path $outdir $moduleName version.json
+ $version = Get-Content $versionFile | ConvertFrom-Json
+ $version.version = $scaffoldInputs.version
+ $version | ConvertTo-Json -Depth 100 | Set-Content $versionFile
+
+ # Update README.md
+ $readmeFile = Join-Path $outdir $moduleName README.md
+ $readme = Get-Content $readmeFile
+ $desc = formatString (Get-Content (Join-Path $Module README.md))
+ ("# $($metadata.name)", '', $metadata.summary, '', '## Description', '', $desc, '', $readMe) `
+ | Set-Content $readmeFile
+ }
+ }
+}
+
+# Generate module and test code
+Build-Modules main.bicep -CopySupportingFiles
+Build-Modules (Join-Path test main.test.bicep)
+
+# Copy tests to README.md examples
+if (-not $Debug) {
+ Get-ChildItem (Join-Path $outdir * test main.test.bicep) `
+ | Where-Object { $_.Directory.Parent.Name -match "-$($dir.Name)$" } `
+ | ForEach-Object {
+ $testFile = $_
+ $sb = [System.Text.StringBuilder]::new()
+ $writingModule = $false
+
+ Get-Content $testFile `
+ | ForEach-Object {
+ $line = $_
+ # If test comment, write example header
+ if ($line -match '^\s*//\s*Test\s') {
+ # Parse test number and description
+ $regex = [regex]::Matches($line.Trim(), '^//\s*Test\s*([0-9]+)\s*-\s*(.*)');
+ $number = $regex.Groups[1].Value
+ $text = $regex.Groups[2].Value
+
+ [void]$sb.AppendLine().AppendLine("### Example $number").AppendLine()
+ [void]$sb.AppendLine($text).AppendLine()
+ [void]$sb.AppendLine('```bicep')
+ }
+ # If module, adjust the target destination
+ elseif ($line -match '^module\s*' -and $line -match '../main.bicep') {
+ $line = $line -replace "../main.bicep", "br/public:cost/$($testFile.Directory.Parent.Name):1.0"
+ [void]$sb.AppendLine($line)
+ $writingModule = $true
+ }
+ # If module body, append code
+ elseif ($writingModule -and -not ($line -match '^}$')) {
+ [void]$sb.AppendLine($line)
+ }
+ # If end of module, close code block
+ elseif ($writingModule -and $line -eq '}') {
+ [void]$sb.AppendLine($line).AppendLine('```')
+ $writingModule = $false
+ }
+ }
+
+ # Append examples to README file
+ $sb.ToString() | Out-File (Join-Path (Split-Path $testFile -Parent) '..' 'README.md') -Append
+ }
+}
diff --git a/src/scripts/Build-Toolkit.ps1 b/src/scripts/Build-Toolkit.ps1
new file mode 100644
index 00000000..b2df62ba
--- /dev/null
+++ b/src/scripts/Build-Toolkit.ps1
@@ -0,0 +1,94 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+<#
+ .SYNOPSIS
+ Builds all toolkit modules and templates for publishing to the Bicep Registry and Azure Quickstart Templates.
+ .DESCRIPTION
+ Run this from the /src/scripts folder.
+ .PARAMETER Template
+ Optional. Name of the module or template to publish. Default = "*" (all templates and modules).
+ .EXAMPLE
+ ./Build-Toolkit
+
+ Builds all FinOps toolkit modules and templates.
+ .EXAMPLE
+ ./Build-Toolkit -Template "finops-hub"
+
+ Builds only the finops-hub template.
+#>
+Param(
+ [Parameter(Position = 0)][string]$Template = "*"
+)
+
+# Create output directory
+$outDir = "../../release"
+./New-Directory $outDir
+
+# Generate Bicep Registry modules
+Get-ChildItem ..\bicep-registry\$Template* -Directory -ErrorAction SilentlyContinue `
+| Where-Object { $_.Name -ne '.scaffold' }
+| ForEach-Object {
+ $module = $_
+ Write-Host "Building Registry module $($module.Name)..."
+ ./Build-Bicep $module
+ Write-Host ''
+}
+
+# Generate deployment parameters file from main.bicep in the target directory
+function Build-MainBicepParameters($dir) {
+ Write-Host " Generating parameters..."
+ bicep generate-params "$dir/main.bicep" --outfile "$dir/azuredeploy.json"
+ $paramFilePath = "$dir/azuredeploy.parameters.json"
+ $params = Get-Content $paramFilePath -Raw | ConvertFrom-Json;
+ $params.parameters.psobject.Properties `
+ | ForEach-Object {
+ # Add placeholder values for required parameters
+ # See AQT docs for allowed values: https://github.com/Azure/azure-quickstart-templates/tree/4a6e5eae3c860208bf1731b392ae2b8a5fb24f4b/1-CONTRIBUTION-GUIDE#azure-devops-ci
+ if ($_.Name.EndsWith('Name')) { $_.Value.value = "GEN-UNIQUE" }
+ }
+ $params | ConvertTo-Json -Depth 100 | Out-File $paramFilePath
+}
+
+# Generate workbook templates
+Get-ChildItem ..\workbooks\* -Directory `
+| Where-Object { $_.Name -ne '.scaffold' }
+| ForEach-Object {
+ $workbook = $_.Name
+ Write-Host "Building workbook $workbook..."
+ ./Build-Workbook $workbook
+ Build-MainBicepParameters "$outdir/$workbook-workbook"
+ Write-Host ''
+}
+| ForEach-Object { Build-QuickstartTemplate $_ }
+
+# Package Azure Quickstart Template folders
+Get-ChildItem ..\templates\$Template* -Directory -ErrorAction SilentlyContinue `
+| ForEach-Object {
+ $srcDir = $_
+ $templateName = $srcDir.Name
+
+ Write-Host "Building template $templateName..."
+
+ # Create target directory
+ $destDir = "$outdir/$templateName"
+ Remove-Item $destDir -Recurse -ErrorAction SilentlyContinue
+ ./New-Directory $destDir
+
+ # Copy required files
+ Write-Host " Copying files..."
+ Get-ChildItem $srcDir | Copy-Item -Destination $destDir -Recurse -Exclude ".buildignore,scaffold.json"
+
+ # Remove ignored files
+ Get-Content "$srcDir/.buildignore" `
+ | ForEach-Object {
+ $file = $_
+ if (Test-Path "$destDir/$file") {
+ Remove-Item "$destDir/$file" -Recurse -Force
+ }
+ }
+
+ Build-MainBicepParameters $destDir
+
+ Write-Host ''
+}
diff --git a/src/scripts/Build-Workbook.ps1 b/src/scripts/Build-Workbook.ps1
new file mode 100644
index 00000000..47d67d74
--- /dev/null
+++ b/src/scripts/Build-Workbook.ps1
@@ -0,0 +1,78 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+<#
+.SYNOPSIS
+ Builds all workbook templates for publishing to Azure Quickstart Templates.
+.DESCRIPTION
+ Run this from the /src/scripts folder.
+.EXAMPLE
+ ./Build-Workbook workbook-name
+ Generates a template the specified workbook.
+.PARAMETER Workbook
+ Name of the workbook folder.
+.PARAMETER Debug
+ Optional. Renders main module and test bicep code to the console instead of generating files. Line numbers map to original file.
+#>
+Param (
+ [Parameter(Position = 0)][string] $Workbook
+)
+
+# Use the debug flag from common parameters to determine whether to run in debug mode
+$Debug = $DebugPreference -eq "Continue"
+
+$outDir = Join-Path .. .. release "$Workbook-workbook"
+$workbookDir = Join-Path .. workbooks $Workbook
+
+if (-not (Test-Path $workbookDir)) {
+ return
+}
+
+# Copy scaffold and workbook files
+./New-Directory $outDir
+Copy-Item (Join-Path .. workbooks .scaffold *) $outDir -Exclude workbook.json
+Copy-Item (Join-Path $workbookDir workbook.json) $outDir
+Copy-Item (Join-Path $workbookDir createUiDefinition.json) $outDir
+Copy-Item (Join-Path $workbookDir README.md) $outDir
+
+# Read workbook
+$workbookText = Get-Content (Join-Path $workbookDir workbook.json)
+
+# Load scaffold config and add workbook version
+$scaffoldMetadata = Get-Content (Join-Path $workbookDir scaffold.json) | ConvertFrom-Json
+$scaffoldMetadata['main.bicep'] | Add-Member version (($workbookText | ConvertFrom-Json).version)
+$scaffoldMetadata['metadata.json'] | Add-Member itemDisplayName "$($scaffoldMetadata['main.bicep'].displayName) workbook"
+
+# Update template files from scaffold config
+$scaffoldMetadata.PSObject.Properties `
+| ForEach-Object {
+ $file = $_.Name
+ $path = Join-Path $outDir $file
+ $text = Get-Content $path
+ if ($file.EndsWith('.json')) {
+ $json = $text | ConvertFrom-Json;
+ }
+ $_.Value.PSObject.Properties `
+ | ForEach-Object {
+ $var = $_.Name
+ $value = $_.Value
+ if ($file.EndsWith('.bicep')) {
+ $text = $text -replace "^(param $var string|var $var)( = .*)?$", "`$1 = '$value'"
+ } elseif ($file.EndsWith('.json')) {
+ $json | Add-Member -MemberType NoteProperty -Name $var -Value $value -Force
+ }
+ }
+
+ if ($file.EndsWith('.json')) {
+ $json | ConvertTo-Json | Out-File $path
+ } else {
+ $text -join [Environment]::NewLine | Out-File $path
+ }
+
+ if ($Debug) {
+ Write-Host ""
+ Write-Host " $file"
+ Write-Host " $($file -replace ".","=")"
+ Write-Host ((Get-Content $path) -join [Environment]::NewLine)
+ }
+}
diff --git a/src/scripts/Deploy-Toolkit.ps1 b/src/scripts/Deploy-Toolkit.ps1
index 685c1fff..70ca75b8 100644
--- a/src/scripts/Deploy-Toolkit.ps1
+++ b/src/scripts/Deploy-Toolkit.ps1
@@ -1,6 +1,9 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
<#
.SYNOPSIS
- Deploys toolkit templates for local testing purposes.
+ Deploys a toolkit template or module for local testing purposes.
.DESCRIPTION
Run this from the /src/scripts folder.
.EXAMPLE
@@ -8,13 +11,21 @@
Deploys a new FinOps hub instance.
.EXAMPLE
./Deploy-Toolkit -WhatIf
- Validates the deployment template without changing resources.
+ Validates the deployment template or module without changing resources.
.PARAMETER Template
- Name of the FinOps toolkit template to deploy. Default = finops-hub.
+ Name of the template or module to deploy. Default = finops-hub.
.PARAMETER ResourceGroup
Optional. Name of the resource group to deploy to. Will be created if it doesn't exist. Default = ftk-
-## Deploy-Toolkit
+## 📦 Build-Toolkit
+
+[Build-Toolkit.ps1](./Build-Toolkit.ps1) builds toolkit modules and templates for local testing and and to prepare them for publishing.
+
+Example:
+
+```powershell
+./Build-Toolkit
+```
+
+Build-Toolkit runs the following scripts internally:
+
+- [Build-Bicep](./Build-Bicep.ps1) for Bicep Registry modules
+- [Build-Workbook](./Build-Workbook.ps1) for Azure Monitor workbook templates
+
+
+
+## 🚀 Deploy-Toolkit
[Deploy-Toolkit.ps1](./Deploy-Toolkit.ps1) deploys toolkit templates for local testing purposes.
Parameters:
-- ResourceGroup (Default: "ftk-
+
+## 🚚 Publish-Toolkit
+
+[Publish-Toolkit.ps1](./Publish-Toolkit.ps1) publishes a template to the Azure Quickstart Templates repository.
+
+Parameters:
+
+| Parameter | Description |
+| -------------- | ------------------------------------------------------------------------------------------------------------------------ |
+| `-Template` | Required. Name of the template or module to deploy. |
+| `-Destination` | Required. Path to the local clone of the Azure Quickstart Templates repository. |
+| `-Build` | Optional. Indicates whether the the `Build-Toolkit` command should be executed first. Default = `false`. |
+| `-Commit` | Optional. Indicates whether to commit the changes and start a pull request in the Azure Quickstart Templates repository. |
+
+Example:
+
+```powershell
+./Publish-Toolkit "finops-hub" "../../../aqt" -Build -Commit
+```
+
+
+
+## 📁 New-Directory
+
+[New-Directory.ps1](./New-Directory.ps1) creates a new directory without failing if it already exists and without writing data to the console.
+
+Example:
+
+```powershell
+./New-Directory "C:\Temp\NewDirectory"
+```
+
+
+
+## 🌿 New-FeatureBranch
+
+[New-FeatureBranch.ps1](./New-FeatureBranch.ps1) creates a new feature branch.
+
+Example:
+
+```powershell
+./New-FeatureBranch "foo"
+```
+
+
diff --git a/src/templates/README.md b/src/templates/README.md
index 8c33ff85..ff7e6e14 100644
--- a/src/templates/README.md
+++ b/src/templates/README.md
@@ -1,12 +1,16 @@
-# FinOps toolkit templates
+# 📦 FinOps toolkit templates
- [finops-hub](./finops-hub)
-Please refer to [Creating templates](#creating-templates) below for template requirements.
+On this page:
+
+- [✨ Creating templates](#-creating-templates)
+- [📦 Building templates](#-building-templates)
+- [🧪 Testing templates](#-testing-templates)
---
-## Creating templates
+## ✨ Creating templates
Templates follow the [Azure Quickstart Templates guidelines](https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/README.md#contribution-guide):
@@ -39,21 +43,106 @@ Templates follow the [Azure Quickstart Templates guidelines](https://github.com/
"description": "1000 char limit",
"summary": "200 char limit",
"githubUsername": "...",
- "dateUpdated": "yyyy-MM-dd",
- "validationType": "Manual"
+ "dateUpdated": "yyyy-MM-dd"
}
```
- `main.bicep`
- 1. Do not include `azuredeploy.json`. This will be built automatically when merged.
- - `azuredeploy.parameters.json`
- 1. Specify a `defaultValue` for all parameters when possible.
- 2. Parameters must be camel-cased.
- 3. Sort the root elements in this order: targetScope, parameters, variables, resources and modules references, outputs.
- 4. Every parameter should have a `@description` or `@metadata` decorator first.
+ 1. Sort the root elements in this order: targetScope, parameters, variables, resources and modules references, outputs.
+ 2. Parameter names should be camel-cased.
+ 3. Every parameter should have a `@description` or `@metadata` decorator first.
+ 4. Specify a default value when possible.
5. Place a blank line between each parameter.
- - `azuredeploy.parameters.us.json` – Only required if parameters are specific to Azure Gov.
+ 6. Do not include `azuredeploy.json`. This will be built automatically when merged.
+ 7. Do not include `azuredeploy.parameters.json`. This will be created by the `Build-Toolkit` script.
+ - PR validation requires all parameters to have a `defaultValue` if not covered in Bicep (unless they can be an empty string).
+ - Our build script assumes parameters are the same in Azure Gov. If they're not, add a custom `azuredeploy.parameters.us.json` file.
+ - If you need to add a default parameter value, update the `Build-Toolkit` script to add it automatically.
+ - If adding a default value automatically isn't feasible, add support for manually-created parameter files (don't auto-generate).
- `createUiDefinition.json`
+ - [CreateUiDef docs](https://learn.microsoft.com/azure/azure-resource-manager/managed-applications/create-uidefinition-overview)
+ - [Test in portal](https://portal.azure.com/?feature.customPortal=falseblade/Microsoft_Azure_CreateUIDef/SandboxBlade)
+ - Optional: `.buildignore`
+ - Add the relative path to any files you want to exclude (e.g., README files for dev docs, test folders).
+
+4. Submit a PR to Azure Quickstart Templates repo.
+
+ - For the [Azure Quickstart Templates repository](https://github.com/Azure/azure-quickstart-templates).
+ - Clone your fork locally.
+ - Run the [`Publish-Toolkit`](../scripts/README.md#-publish-toolkit) script.
+
+ ```powershell
+ cd
+
+## 🧪 Testing templates
+
+Before deploying a template, you first need to sign in to Azure:
+
+```console
+Connect-AzContext
+Set-AzContext -Subscription "Trey Research R&D Playground"
+```
+
+> ℹ️ _**Microsoft contributors:** We recommend using the Trey Research R&D Playground subscription (64e355d7-997c-491d-b0c1-8414dccfcf42) for subscription deployments. Contact @flanakin to request access._
+
+Use the `Deploy-Toolkit` script to deploy a template. In its simplest form, you need only specify the name (not the path) of the module you want to deploy to run the local dev version of the module (not the generated versions):
+
+```console
+cd $repo/src/scripts
+./Deploy-Toolkit finops-hub
+```
+
+You can optionally build templates by specifying the `-Build` parameter:
+
+```console
+cd $repo/src/scripts
+./Deploy-Toolkit finops-hub -Build
+```
+
+Use `-WhatIf` to validate the template without deploying anything first.
+
+> ℹ️ _**Note:** Templates are deployed to a unique resource group based on your username and computer name: `ftk-
diff --git a/src/templates/finops-hub/.buildignore b/src/templates/finops-hub/.buildignore
new file mode 100644
index 00000000..de882327
--- /dev/null
+++ b/src/templates/finops-hub/.buildignore
@@ -0,0 +1,3 @@
+modules/README.md
+reports
+test
\ No newline at end of file
diff --git a/src/templates/finops-hub/README.md b/src/templates/finops-hub/README.md
new file mode 100644
index 00000000..ccdf9f90
--- /dev/null
+++ b/src/templates/finops-hub/README.md
@@ -0,0 +1,64 @@
+# FinOps hub template
+
+![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/PublicLastTestDate.svg)
+![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/PublicDeployment.svg)
+
+![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/FairfaxLastTestDate.svg)
+![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/FairfaxDeployment.svg)
+
+![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/BestPracticeResult.svg)
+![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/CredScanResult.svg)
+![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/finops-hub/BicepVersion.svg)
+
+[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2FcreateUiDefinition.json)
+[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2FcreateUiDefinition.json)
+[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2Fazuredeploy.json)
+
+This template creates a new **FinOps hub** instance. FinOps hubs are a foundation you can use to build homegrown cost management and optimization solutions.
+
+FinOps hubs include:
+
+- Data Lake storage to host cost data.
+- Data Factory for data processing and orchestration.
+- Key Vault for storing secrets.
+
+To learn more about FinOps hubs, the roadmap, or how to contribute , see [FinOps hubs documentation](https://aka.ms/finops/hubs).
+
+
+
+## Prerequisites
+
+Please ensure the following prerequisites are met before deploying this template:
+
+1. You must have permission to create the deployed resources mentioned above.
+2. The Microsoft.EventGrid resource provider must be registered in your subscription. See [Register a resource provider](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider) for details.
+ > ⚠️ _If you forget this step, the deployment will succeed, but the data will not be ready. To fix, register the EventGrid RP, start the `msexports` pipeline trigger, re-run your Cost Management export, wait ~20 minutes, and refresh the data in your reports or custom tools._
+
+To use FinOps hubs, you can either leverage the available Power BI reports or connect directly to the included storage account. To learn more, see [FinOps hubs documentation](https://aka.ms/finops/hubs).
+
+If you run into any issues, see [Troubleshooting FinOps hubs](https://aka.ms/finops/hubs/troubleshoot).
+
+
+
+## How to use this template
+
+1. Register the Microsoft.EventGrid resource provider
+ > See [Register a resource provider](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider) for details.
+2. Deploy the template
+ > [![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2FcreateUiDefinition.json) > > [![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Ffinops-hub%2FcreateUiDefinition.json)
+3. [Create a new cost export](https://learn.microsoft.com/azure/cost-management-billing/costs/tutorial-export-acm-data?tabs=azure-portal) using the following settings:
+ - **Metric** = `Amortized cost`
+ - **Export type** = `Daily export of month-to-date costs`
+ - **Storage account** = (Use subscription/resource from step 1)
+ - **Container** = `msexports`
+ - **Directory** = (Use the resource ID of the scope you're exporting without the first "/")
+4. Run your export using the **Run now** command
+ > Your data should be available within 15 minutes or so, depending on how big your account is.
+5. Connect to the data in Azure Data Lake Storage
+ > Consider using [available Power BI reports](https://aka.ms/finops/hubs/reports)
+
+If you run into any issues, see [Troubleshooting FinOps hubs](https://aka.ms/finops/hubs/troubleshoot).
+
+
+
+`Tags: finops, cost, Microsoft.CostManagement/exports, Microsoft.Storage/storageAccounts, Microsoft.DataFactory/factories`
diff --git a/src/templates/finops-hub/createUiDefinition.json b/src/templates/finops-hub/createUiDefinition.json
new file mode 100644
index 00000000..37df59ae
--- /dev/null
+++ b/src/templates/finops-hub/createUiDefinition.json
@@ -0,0 +1,74 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
+ "handler": "Microsoft.Azure.CreateUIDef",
+ "version": "0.1.2-preview",
+ "parameters": {
+ "config": {
+ "basics": {
+ "description": "FinOps hubs are a reliable, trustworthy platform for cost analytics, insights, and optimization. Connect your hub to one or more billing accounts and subscriptions and build custom reports in Power BI or other tools. [Learn more](https://aka.ms/finops/hubs)",
+ "location": {
+ "label": "Location",
+ "resourceTypes": ["Microsoft.DataFactory/factories", "Microsoft.KeyVault/vaults", "Microsoft.Storage/storageAccounts"]
+ }
+ }
+ },
+ "resourceTypes": ["Microsoft.DataFactory/factories", "Microsoft.KeyVault/vaults", "Microsoft.Storage/storageAccounts"],
+ "basics": [
+ {
+ "name": "hubName",
+ "type": "Microsoft.Common.TextBox",
+ "label": "Name",
+ "defaultValue": "finops-hub",
+ "toolTip": "Name of the hub. Used to ensure unique resource names.",
+ "constraints": {
+ "required": true,
+ "regex": "^[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]$",
+ "validationMessage": "Name must be between 3 and 63 characters long and can contain only lowercase letters, numbers, and hyphens. The first and last characters in the name must be alphanumeric."
+ },
+ "visible": true
+ },
+ {
+ "name": "storageSku",
+ "type": "Microsoft.Common.DropDown",
+ "label": "Storage redundancy",
+ "defaultValue": "Premium_LRS",
+ "toolTip": "The data in your storage account is always replicated to ensure durability and high availability. Choose a replication strategy that matches your durability requirements. [Learn more](https://go.microsoft.com/fwlink/?linkid=2163103)",
+ "constraints": {
+ "required": false,
+ "allowedValues": [
+ {
+ "label": "Locally-redundant (LRS) - Lowest cost",
+ "value": "Premium_LRS"
+ },
+ {
+ "label": "Zone-redundant (ZRS) - High availability",
+ "value": "Premium_ZRS"
+ }
+ ]
+ },
+ "visible": true
+ }
+ ],
+ "steps": [
+ {
+ "name": "tags",
+ "label": "Tags",
+ "elements": [
+ {
+ "name": "tagsByResource",
+ "label": "Tags",
+ "toolTip": "Tags to apply to resources.",
+ "type": "Microsoft.Common.TagsByResource",
+ "resources": ["Microsoft.DataFactory/factories", "Microsoft.KeyVault/vaults", "Microsoft.Storage/storageAccounts"]
+ }
+ ]
+ }
+ ],
+ "outputs": {
+ "hubName": "[basics('hubName')]",
+ "location": "[location()]",
+ "storageSku": "[basics('storageSku')]",
+ "tags": "[steps('tags').tagsByResource]"
+ }
+ }
+}
diff --git a/src/templates/finops-hub/main.bicep b/src/templates/finops-hub/main.bicep
index eaa5f0f9..d5811221 100644
--- a/src/templates/finops-hub/main.bicep
+++ b/src/templates/finops-hub/main.bicep
@@ -1,23 +1,26 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
/**
* Parameters
*/
targetScope = 'resourceGroup'
-@description('Name of the hub. Used for the resource group and to guarantee globally unique resource names.')
+@description('Optional. Name of the hub. Used to ensure unique resource names. Default: "finops-hub".')
param hubName string
-@description('Optional. Location of the resources. Default: Same as deployment. See https://aka.ms/azureregions.')
+@description('Optional. Azure location where all resources should be created. See https://aka.ms/azureregions. Default: Same as deployment.')
param location string = resourceGroup().location
@allowed([
'Premium_LRS'
'Premium_ZRS'
])
-@description('Optional. Storage account SKU. LRS = Lowest cost, ZRS = High availability. Note Standard SKUs are not available for Data Lake gen2 storage.')
+@description('Optional. Storage SKU to use. LRS = Lowest cost, ZRS = High availability. Note Standard SKUs are not available for Data Lake gen2 storage. Allowed: Premium_LRS, Premium_ZRS. Default: Premium_LRS.')
param storageSku string = 'Premium_LRS'
-@description('Optional. Tags for all resources.')
+@description('Optional. Tags to apply to all resources. We will also add the cm-resource-parent tag for improved cost roll-ups in Cost Management.')
param tags object = {}
@description('Optional. List of scope IDs to create exports for.')
@@ -27,7 +30,7 @@ param exportScopes array = []
* Resources
*/
-module hub '../../modules/hub.bicep' = {
+module hub 'modules/hub.bicep' = {
name: 'hub'
params: {
hubName: hubName
@@ -48,6 +51,9 @@ output name string = hubName
@description('The location the resources wer deployed to.')
output location string = location
+@description('Name of the Data Factory.')
+output dataFactorytName string = hub.outputs.dataFactorytName
+
@description('The resource ID of the deployed storage account.')
output storageAccountId string = hub.outputs.storageAccountId
diff --git a/src/templates/finops-hub/metadata.json b/src/templates/finops-hub/metadata.json
new file mode 100644
index 00000000..5aba9741
--- /dev/null
+++ b/src/templates/finops-hub/metadata.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
+ "type": "QuickStart",
+ "itemDisplayName": "FinOps hub",
+ "summary": "Create a new FinOps hub instance",
+ "description": "This template creates a new FinOps hub instance, including Data Lake storage and a Data Factory.",
+ "githubUsername": "flanakin",
+ "dateUpdated": "2023-04-22"
+}
diff --git a/src/templates/finops-hub/modules/README.md b/src/templates/finops-hub/modules/README.md
new file mode 100644
index 00000000..98313bfa
--- /dev/null
+++ b/src/templates/finops-hub/modules/README.md
@@ -0,0 +1,12 @@
+# 📦 FinOps hub modules
+
+All FinOps hub module source is available at the root of this directory.
+
+Modules:
+
+- [hub.bicep](./hub.bicep) orchestrates the creation of all required resources.
+- [storage.bicep](./storage.bicep) creates the storage account, containers, and settings.json file.
+- [keyVault.bicep](./keyVault.bicep) creates the Key Vault instance and stored secrets.
+- [dataFactory.bicep](./dataFactory.bicep) creates Data Factory pipelines, triggers, etc.
+
+
diff --git a/src/templates/finops-hub/modules/dataFactory.bicep b/src/templates/finops-hub/modules/dataFactory.bicep
new file mode 100644
index 00000000..dd2fa927
--- /dev/null
+++ b/src/templates/finops-hub/modules/dataFactory.bicep
@@ -0,0 +1,721 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+//==============================================================================
+// Parameters
+//==============================================================================
+
+@description('Optional. Name of the hub. Used to ensure unique resource names. Default: "finops-hub".')
+param dataFactoryName string
+
+@description('Required. The name of the Azure Key Vault instance.')
+param keyVaultName string
+
+@description('Required. The name of the Azure storage account instance.')
+param storageAccountName string
+
+@description('Required. The name of the container where Cost Management data is exported.')
+param exportContainerName string
+
+@description('Required. The name of the container where normalized data is ingested.')
+param ingestionContainerName string
+
+@description('Optional. Indicates whether ingested data should be converted to Parquet. Default: true.')
+param convertToParquet bool = true
+
+@description('Optional. The location to use for the managed identity and deployment script to auto-start triggers. Default = (resource group location).')
+param location string = resourceGroup().location
+
+//------------------------------------------------------------------------------
+// Variables
+//------------------------------------------------------------------------------
+
+var datasetPropsDelimitedText = {
+ columnDelimiter: ','
+ compressionLevel: 'Optimal'
+ escapeChar: '"'
+ firstRowAsHeader: true
+ quoteChar: '"'
+}
+var datasetPropsCommon = {
+ location: {
+ type: 'AzureBlobFSLocation'
+ fileName: {
+ value: '@{dataset().fileName}'
+ type: 'Expression'
+ }
+ folderPath: {
+ value: '@{dataset().folderName}'
+ type: 'Expression'
+ }
+ }
+}
+
+var safeExportContainerName = replace('${exportContainerName}', '-', '_')
+var safeIngestionContainerName = replace('${ingestionContainerName}', '-', '_')
+
+// All hub triggers (used to auto-start)
+var extractExportTriggerName = exportContainerName
+var allHubTriggers = [
+ extractExportTriggerName
+]
+
+// Roles needed to auto-start triggers
+var autoStartRbacRoles = [
+ '673868aa-7521-48a0-acc6-0f60742d39f5' // Data Factory contributor - https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#data-factory-contributor
+]
+
+//==============================================================================
+// Resources
+//==============================================================================
+
+// Get data factory instance
+resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' existing = {
+ name: dataFactoryName
+}
+
+//------------------------------------------------------------------------------
+// Stop all triggers before deploying
+//------------------------------------------------------------------------------
+
+// Create managed identity to start/stop triggers
+resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
+ name: '${dataFactoryName}_triggerManager'
+ location: location
+}
+
+// Assign access to the identity
+resource identityRoleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for role in autoStartRbacRoles: {
+ name: guid(dataFactory.id, role, identity.id)
+ scope: dataFactory
+ properties: {
+ roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', role)
+ principalId: identity.properties.principalId
+ principalType: 'ServicePrincipal'
+ }
+}]
+
+// Stop hub triggers if they're already running
+resource stopHubTriggers 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
+ name: '${dataFactoryName}_stopHubTriggers'
+ location: location
+ identity: {
+ type: 'UserAssigned'
+ userAssignedIdentities: {
+ '${identity.id}': {}
+ }
+ }
+ kind: 'AzurePowerShell'
+ dependsOn: [
+ identityRoleAssignments
+ ]
+ properties: {
+ azPowerShellVersion: '8.0'
+ retentionInterval: 'PT1H'
+ cleanupPreference: 'OnSuccess'
+ scriptContent: loadTextContent('./scripts/Start-Triggers.ps1')
+ arguments: '-Stop'
+ environmentVariables: [
+ {
+ name: 'DataFactorySubscriptionId'
+ value: subscription().id
+ }
+ {
+ name: 'DataFactoryResourceGroup'
+ value: resourceGroup().name
+ }
+ {
+ name: 'DataFactoryName'
+ value: dataFactoryName
+ }
+ {
+ name: 'Triggers'
+ value: join(allHubTriggers, '|')
+ }
+ ]
+ }
+}
+
+//------------------------------------------------------------------------------
+// Linked services
+//------------------------------------------------------------------------------
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-11-01' existing = {
+ name: keyVaultName
+}
+
+resource linkedService_keyVault 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = {
+ name: 'keyVault'
+ parent: dataFactory
+ properties: {
+ annotations: []
+ parameters: {}
+ type: 'AzureKeyVault'
+ typeProperties: {
+ baseUrl: keyVault.properties.vaultUri
+ }
+ }
+}
+
+resource linkedService_storageAccount 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = {
+ name: 'storage'
+ parent: dataFactory
+ properties: {
+ annotations: []
+ parameters: {}
+ type: 'AzureBlobFS'
+ typeProperties: {
+ url: storageAccount.properties.primaryEndpoints.dfs
+ accountKey: {
+ type: 'AzureKeyVaultSecret'
+ store: {
+ referenceName: linkedService_keyVault.name
+ type: 'LinkedServiceReference'
+ }
+ secretName: storageAccountName
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+// Datasets
+//------------------------------------------------------------------------------
+
+resource dataset_msexports 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
+ name: safeExportContainerName
+ parent: dataFactory
+ dependsOn: [
+ linkedService_keyVault
+ ]
+ properties: {
+ annotations: []
+ parameters: {
+ fileName: {
+ type: 'String'
+ }
+ folderName: {
+ type: 'String'
+ }
+ }
+ type: 'DelimitedText'
+ typeProperties: union(datasetPropsCommon, datasetPropsDelimitedText, { compressionCodec: 'none' })
+ linkedServiceName: {
+ parameters: {}
+ referenceName: linkedService_storageAccount.name
+ type: 'LinkedServiceReference'
+ }
+ }
+}
+
+resource dataset_ingestion 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
+ name: safeIngestionContainerName
+ parent: dataFactory
+ dependsOn: [
+ linkedService_keyVault
+ ]
+ properties: {
+ annotations: []
+ parameters: {
+ fileName: {
+ type: 'String'
+ }
+ folderName: {
+ type: 'String'
+ }
+ }
+ type: any(convertToParquet ? 'Parquet' : 'DelimitedText')
+ typeProperties: union(
+ datasetPropsCommon,
+ convertToParquet ? {} : datasetPropsDelimitedText,
+ { compressionCodec: 'gzip' }
+ )
+ linkedServiceName: {
+ parameters: {}
+ referenceName: linkedService_storageAccount.name
+ type: 'LinkedServiceReference'
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+// Export container extract pipeline + trigger
+// Trigger: New CSV files in exportContainer
+//
+// Queues the transform pipeline.
+// This pipeline must complete ASAP due to ADF's hard limit of 100 concurrent executions per pipeline.
+// If multiple large, partitioned exports run concurrently and this pipeline doesn't finish quickly, the transform pipeline won't get triggered.
+// Queuing up the transform pipeline and exiting immediately greatly reduces the likelihood of this happening.
+//------------------------------------------------------------------------------
+
+// Get storage account instance
+resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
+ name: storageAccountName
+}
+
+// Create trigger
+resource trigger_exportContainer 'Microsoft.DataFactory/factories/triggers@2018-06-01' = {
+ name: safeExportContainerName
+ parent: dataFactory
+ dependsOn: [
+ stopHubTriggers
+ pipeline_extractExport
+ ]
+ properties: {
+ annotations: []
+ pipelines: [
+ {
+ pipelineReference: {
+ referenceName: '${exportContainerName}_extract'
+ type: 'PipelineReference'
+ }
+ parameters: {
+ folderName: '@triggerBody().folderPath'
+ fileName: '@triggerBody().fileName'
+ }
+ }
+ ]
+ type: 'BlobEventsTrigger'
+ typeProperties: {
+ blobPathBeginsWith: '/${exportContainerName}/blobs/'
+ blobPathEndsWith: '.csv'
+ ignoreEmptyBlobs: true
+ scope: storageAccount.id
+ events: [
+ 'Microsoft.Storage.BlobCreated'
+ ]
+ }
+ }
+}
+
+resource pipeline_extractExport 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = {
+ name: '${safeExportContainerName}_extract'
+ parent: dataFactory
+ dependsOn: [
+ pipeline_transformExport
+ ]
+ properties: {
+ activities: [
+ {
+ name: 'Execute'
+ type: 'ExecutePipeline'
+ dependsOn: []
+ userProperties: []
+ typeProperties: {
+ pipeline: {
+ referenceName: '${safeExportContainerName}_transform'
+ type: 'PipelineReference'
+ }
+ waitOnCompletion: false
+ parameters: {
+ folderName: {
+ value: '@pipeline().parameters.folderName'
+ type: 'Expression'
+ }
+ fileName: {
+ value: '@pipeline().parameters.fileName'
+ type: 'Expression'
+ }
+ }
+ }
+ }
+ ]
+ parameters: {
+ folderName: {
+ type: 'string'
+ }
+ fileName: {
+ type: 'string'
+ }
+ }
+ annotations: []
+ }
+}
+
+//------------------------------------------------------------------------------
+// Export container transform pipeline
+// Trigger: pipeline_extractExport
+//
+// Converts CSV files to Parquet or .CSV.GZ files.
+//------------------------------------------------------------------------------
+
+resource pipeline_transformExport 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = {
+ name: '${safeExportContainerName}_transform'
+ parent: dataFactory
+ dependsOn: [
+ dataset_msexports
+ dataset_ingestion
+ ]
+ properties: {
+ activities: [
+ // (start) -> Wait -> Scope -> Metric -> Date -> File -> Folder -> Delete Target -> Convert CSV -> Delete CSV -> (end)
+ // Wait
+ {
+ name: 'Wait'
+ type: 'Wait'
+ dependsOn: []
+ userProperties: []
+ typeProperties: {
+ waitTimeInSeconds: 60
+ }
+ }
+ // Set Scope
+ {
+ name: 'Set Scope'
+ type: 'SetVariable'
+ dependsOn: [
+ {
+ activity: 'Wait'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ userProperties: []
+ typeProperties: {
+ variableName: 'scope'
+ value: {
+ value: '@replace(split(pipeline().parameters.folderName,split(pipeline().parameters.folderName, \'/\')[sub(length(split(pipeline().parameters.folderName, \'/\')), 4)])[0],\'${exportContainerName}\',\'${ingestionContainerName}\')'
+ type: 'Expression'
+ }
+ }
+ }
+ // Set Metric
+ {
+ name: 'Set Metric'
+ type: 'SetVariable'
+ dependsOn: [
+ {
+ activity: 'Set Scope'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ userProperties: []
+ typeProperties: {
+ variableName: 'metric'
+ value: {
+ // TODO: Parse metric out of the export path with self-managed exports -- value: '@first(split(split(pipeline().parameters.folderName, \'/\')[sub(length(split(pipeline().parameters.folderName, \'/\')), 4)], \'-\'))'
+ value: 'amortizedcost'
+ type: 'Expression'
+ }
+ }
+ }
+ // Set Date
+ {
+ name: 'Set Date'
+ type: 'SetVariable'
+ dependsOn: [
+ {
+ activity: 'Set Metric'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ userProperties: []
+ typeProperties: {
+ variableName: 'date'
+ value: {
+ value: '@split(pipeline().parameters.folderName, \'/\')[sub(length(split(pipeline().parameters.folderName, \'/\')), 3)]'
+ type: 'Expression'
+ }
+ }
+ }
+ // Set Destination File Name
+ {
+ name: 'Set Destination File Name'
+ description: ''
+ type: 'SetVariable'
+ dependsOn: [
+ {
+ activity: 'Set Date'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ userProperties: []
+ typeProperties: {
+ variableName: 'destinationFile'
+ value: {
+ value: '@replace(pipeline().parameters.fileName, \'.csv\', \'${convertToParquet ? '.parquet' : '.csv.gz'}\')'
+ type: 'Expression'
+ }
+ }
+ }
+ // Set Destination Folder Name
+ {
+ name: 'Set Destination Folder Name'
+ type: 'SetVariable'
+ dependsOn: [
+ {
+ activity: 'Set Destination File Name'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ userProperties: []
+ typeProperties: {
+ variableName: 'destinationFolder'
+ value: {
+ value: '@replace(concat(variables(\'scope\'),variables(\'date\'),\'/\',variables(\'metric\')),\'//\',\'/\')'
+ type: 'Expression'
+ }
+ }
+ }
+ // Delete Target
+ {
+ name: 'Delete Target'
+ type: 'Delete'
+ dependsOn: [
+ {
+ activity: 'Set Destination Folder Name'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ policy: {
+ timeout: '0.12:00:00'
+ retry: 0
+ retryIntervalInSeconds: 30
+ secureOutput: false
+ secureInput: false
+ }
+ userProperties: []
+ typeProperties: {
+ dataset: {
+ referenceName: safeIngestionContainerName
+ type: 'DatasetReference'
+ parameters: {
+ folderName: {
+ value: '@variables(\'destinationFolder\')'
+ type: 'Expression'
+ }
+ fileName: {
+ value: '@variables(\'destinationFile\')'
+ type: 'Expression'
+ }
+ }
+ }
+ enableLogging: false
+ storeSettings: {
+ type: 'AzureBlobFSReadSettings'
+ recursive: true
+ enablePartitionDiscovery: false
+ }
+ }
+ }
+ // Convert CSV
+ {
+ name: 'Convert CSV'
+ type: 'Copy'
+ dependsOn: [
+ {
+ activity: 'Delete Target'
+ dependencyConditions: [
+ 'Completed'
+ ]
+ }
+ ]
+ policy: {
+ timeout: '0.12:00:00'
+ retry: 0
+ retryIntervalInSeconds: 30
+ secureOutput: false
+ secureInput: false
+ }
+ userProperties: []
+ typeProperties: {
+ source: {
+ type: 'DelimitedTextSource'
+ storeSettings: {
+ type: 'AzureBlobFSReadSettings'
+ recursive: true
+ enablePartitionDiscovery: false
+ }
+ formatSettings: {
+ type: 'DelimitedTextReadSettings'
+ }
+ }
+ sink: {
+ type: 'DelimitedTextSink'
+ storeSettings: {
+ type: 'AzureBlobFSWriteSettings'
+ }
+ formatSettings: convertToParquet ? {
+ type: 'ParquetWriteSettings'
+ fileExtension: '.parquet'
+ } : {
+ type: 'DelimitedTextWriteSettings'
+ quoteAllText: true
+ fileExtension: '.csv.gz'
+ }
+ }
+ enableStaging: false
+ parallelCopies: 1
+ validateDataConsistency: false
+ }
+ inputs: [
+ {
+ referenceName: safeExportContainerName
+ type: 'DatasetReference'
+ parameters: {
+ folderName: {
+ value: '@pipeline().parameters.folderName'
+ type: 'Expression'
+ }
+ fileName: {
+ value: '@pipeline().parameters.fileName'
+ type: 'Expression'
+ }
+ }
+ }
+ ]
+ outputs: [
+ {
+ referenceName: safeIngestionContainerName
+ type: 'DatasetReference'
+ parameters: {
+ folderName: {
+ value: '@variables(\'destinationFolder\')'
+ type: 'Expression'
+ }
+ fileName: {
+ value: '@variables(\'destinationFile\')'
+ type: 'Expression'
+ }
+ }
+ }
+ ]
+ }
+ // Delete CSV
+ {
+ name: 'Delete CSV'
+ type: 'Delete'
+ dependsOn: [
+ {
+ activity: 'Convert CSV'
+ dependencyConditions: [
+ 'Succeeded'
+ ]
+ }
+ ]
+ policy: {
+ timeout: '0.12:00:00'
+ retry: 0
+ retryIntervalInSeconds: 30
+ secureOutput: false
+ secureInput: false
+ }
+ userProperties: []
+ typeProperties: {
+ dataset: {
+ referenceName: safeExportContainerName
+ type: 'DatasetReference'
+ parameters: {
+ folderName: {
+ value: '@pipeline().parameters.folderName'
+ type: 'Expression'
+ }
+ fileName: {
+ value: '@pipeline().parameters.fileName'
+ type: 'Expression'
+ }
+ }
+ }
+ enableLogging: false
+ storeSettings: {
+ type: 'AzureBlobFSReadSettings'
+ recursive: true
+ enablePartitionDiscovery: false
+ }
+ }
+ }
+ ]
+ parameters: {
+ fileName: {
+ type: 'string'
+ }
+ folderName: {
+ type: 'string'
+ }
+ }
+ variables: {
+ destinationFile: {
+ type: 'String'
+ }
+ destinationFolder: {
+ type: 'String'
+ }
+ scope: {
+ type: 'String'
+ }
+ date: {
+ type: 'String'
+ }
+ metric: {
+ type: 'String'
+ }
+ }
+ annotations: []
+ }
+}
+
+//------------------------------------------------------------------------------
+// Start all triggers
+//------------------------------------------------------------------------------
+
+// Start hub triggers
+resource startHubTriggers 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
+ name: '${dataFactoryName}_startHubTriggers'
+ location: location
+ identity: {
+ type: 'UserAssigned'
+ userAssignedIdentities: {
+ '${identity.id}': {}
+ }
+ }
+ kind: 'AzurePowerShell'
+ dependsOn: [
+ identityRoleAssignments
+ trigger_exportContainer
+ ]
+ properties: {
+ azPowerShellVersion: '8.0'
+ retentionInterval: 'PT1H'
+ cleanupPreference: 'OnSuccess'
+ scriptContent: loadTextContent('./scripts/Start-Triggers.ps1')
+ environmentVariables: [
+ {
+ name: 'DataFactorySubscriptionId'
+ value: subscription().id
+ }
+ {
+ name: 'DataFactoryResourceGroup'
+ value: resourceGroup().name
+ }
+ {
+ name: 'DataFactoryName'
+ value: dataFactoryName
+ }
+ {
+ name: 'Triggers'
+ value: join(allHubTriggers, '|')
+ }
+ ]
+ }
+}
+
+//==============================================================================
+// Outputs
+//==============================================================================
+
+@description('The Resource ID of the Data factory.')
+output resourceId string = dataFactory.id
+
+@description('The Name of the Azure Data Factory instance.')
+output name string = dataFactory.name
diff --git a/src/templates/finops-hub/modules/hub.bicep b/src/templates/finops-hub/modules/hub.bicep
new file mode 100644
index 00000000..1d77d14d
--- /dev/null
+++ b/src/templates/finops-hub/modules/hub.bicep
@@ -0,0 +1,175 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+//==============================================================================
+// Parameters
+//==============================================================================
+
+@description('Optional. Name of the hub. Used to ensure unique resource names. Default: "finops-hub".')
+param hubName string
+
+@description('Optional. Azure location where all resources should be created. See https://aka.ms/azureregions. Default: (resource group location).')
+param location string = resourceGroup().location
+
+@allowed([
+ 'Premium_LRS'
+ 'Premium_ZRS'
+])
+@description('Optional. Storage SKU to use. LRS = Lowest cost, ZRS = High availability. Note Standard SKUs are not available for Data Lake gen2 storage. Allowed: Premium_LRS, Premium_ZRS. Default: Premium_LRS.')
+param storageSku string = 'Premium_LRS'
+
+@description('Optional. Tags to apply to all resources. We will also add the cm-resource-parent tag for improved cost roll-ups in Cost Management.')
+param tags object = {}
+
+@description('Optional. List of scope IDs to create exports for.')
+param exportScopes array
+
+@description('Optional. Indicates whether ingested data should be converted to Parquet. Default: true.')
+param convertToParquet bool = true
+
+@description('Optional. Enable telemetry to track anonymous module usage trends, monitor for bugs, and improve future releases.')
+param enableDefaultTelemetry bool = true
+
+//------------------------------------------------------------------------------
+// Variables
+//------------------------------------------------------------------------------
+
+// Add cm-resource-parent to group resources in Cost Management
+var resourceTags = union(tags, {
+ 'cm-resource-parent': '${resourceGroup().id}/providers/Microsoft.Cloud/hubs/${hubName}'
+ })
+
+// Generate globally unique Data Factory name: 3-63 chars; letters, numbers, non-repeating dashes
+var uniqueSuffix = uniqueString(hubName, resourceGroup().id)
+var dataFactoryPrefix = '${replace(hubName, '_', '-')}-engine'
+var dataFactorySuffix = '-${uniqueSuffix}'
+var dataFactoryName = replace('${take(dataFactoryPrefix, 63 - length(dataFactorySuffix))}${dataFactorySuffix}', '--', '-')
+
+// The last segment of the telemetryId is used to identify this module
+var telemetryId = '00f120b5-2007-6120-0000-40b000000000'
+var finOpsToolkitVersion = '0.0.1'
+
+//==============================================================================
+// Resources
+//==============================================================================
+
+//------------------------------------------------------------------------------
+// Telemetry
+// Used to anonymously count the number of times the template has been deployed
+// and to track and fix deployment bugs to ensure the highest quality.
+// No information about you or your cost data is collected.
+//------------------------------------------------------------------------------
+
+resource defaultTelemetry 'Microsoft.Resources/deployments@2022-09-01' = if (enableDefaultTelemetry) {
+ name: 'pid-${telemetryId}-${uniqueString(deployment().name, location)}'
+ properties: {
+ mode: 'Incremental'
+ template: {
+ '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
+ contentVersion: '1.0.0.0'
+ metadata: {
+ _generator: {
+ name: 'FinOps toolkit'
+ version: finOpsToolkitVersion
+ }
+ }
+ resources: []
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+// ADLSv2 storage account for staging and archive
+//------------------------------------------------------------------------------
+
+module storage 'storage.bicep' = {
+ name: 'storage'
+ params: {
+ hubName: hubName
+ uniqueSuffix: uniqueSuffix
+ sku: storageSku
+ location: location
+ tags: resourceTags
+ exportScopes: exportScopes
+ }
+}
+
+//------------------------------------------------------------------------------
+// Data Factory and pipelines
+//------------------------------------------------------------------------------
+
+resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = {
+ name: dataFactoryName
+ location: location
+ tags: tags
+ identity: { type: 'SystemAssigned' }
+ properties: union(
+ // Using union() to hide the error that gets surfaced because globalConfigurations is not in the ADF schema yet.
+ {},
+ {
+ globalConfigurations: {
+ PipelineBillingEnabled: 'true'
+ }
+ })
+}
+
+module dataFactoryResources 'dataFactory.bicep' = {
+ name: 'dataFactoryResources'
+ params: {
+ dataFactoryName: dataFactoryName
+ convertToParquet: convertToParquet
+ keyVaultName: keyVault.outputs.name
+ storageAccountName: storage.outputs.name
+ exportContainerName: storage.outputs.exportContainer
+ ingestionContainerName: storage.outputs.ingestionContainer
+ location: location
+ }
+}
+
+//------------------------------------------------------------------------------
+// Key Vault for storing secrets
+//------------------------------------------------------------------------------
+
+module keyVault 'keyVault.bicep' = {
+ name: 'keyVault'
+ params: {
+ hubName: hubName
+ uniqueSuffix: uniqueSuffix
+ location: location
+ tags: resourceTags
+ storageAccountName: storage.outputs.name
+ accessPolicies: [
+ {
+ objectId: dataFactory.identity.principalId
+ tenantId: subscription().tenantId
+ permissions: {
+ secrets: [
+ 'get'
+ ]
+ }
+ }
+ ]
+ }
+}
+
+//==============================================================================
+// Outputs
+//==============================================================================
+
+@description('Name of the deployed hub instance.')
+output name string = hubName
+
+@description('Azure resource location resources were deployed to.')
+output location string = location
+
+@description('Name of the Data Factory.')
+output dataFactorytName string = dataFactory.name
+
+@description('Resource ID of the storage account created for the hub instance. This must be used when creating the Cost Management export.')
+output storageAccountId string = storage.outputs.resourceId
+
+@description('Name of the storage account created for the hub instance. This must be used when connecting FinOps toolkit Power BI reports to your data.')
+output storageAccountName string = storage.outputs.name
+
+@description('URL to use when connecting custom Power BI reports to your data.')
+output storageUrlForPowerBI string = 'https://${storage.outputs.name}.dfs.${environment().suffixes.storage}/${storage.outputs.ingestionContainer}'
diff --git a/src/templates/finops-hub/modules/keyVault.bicep b/src/templates/finops-hub/modules/keyVault.bicep
new file mode 100644
index 00000000..1a98d700
--- /dev/null
+++ b/src/templates/finops-hub/modules/keyVault.bicep
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+//==============================================================================
+// Parameters
+//==============================================================================
+
+@description('Required. Name of the hub. Used to ensure unique resource names.')
+param hubName string
+
+@description('Required. Suffix to add to the KeyVault instance name to ensure uniqueness.')
+param uniqueSuffix string
+
+@description('Optional. Location for all resources.')
+param location string = resourceGroup().location
+
+@description('Optional. Array of access policies object.')
+param accessPolicies array = []
+
+@description('Required. Name of the storage account to store access keys for.')
+param storageAccountName string
+
+@description('Optional. Specifies the SKU for the vault.')
+@allowed([
+ 'premium'
+ 'standard'
+])
+param sku string = 'premium'
+
+@description('Optional. Resource tags.')
+param tags object = {}
+
+//------------------------------------------------------------------------------
+// Variables
+//------------------------------------------------------------------------------
+
+// Generate globally unique KeyVault name: 3-24 chars; letters, numbers, dashes
+var keyVaultPrefix = '${replace(hubName, '_', '-')}-vault'
+var keyVaultSuffix = '-${uniqueSuffix}'
+var keyVaultName = replace('${take(keyVaultPrefix, 24 - length(keyVaultSuffix))}${keyVaultSuffix}', '--', '-')
+
+var formattedAccessPolicies = [for accessPolicy in accessPolicies: {
+ applicationId: contains(accessPolicy, 'applicationId') ? accessPolicy.applicationId : ''
+ objectId: contains(accessPolicy, 'objectId') ? accessPolicy.objectId : ''
+ permissions: accessPolicy.permissions
+ tenantId: contains(accessPolicy, 'tenantId') ? accessPolicy.tenantId : tenant().tenantId
+}]
+
+//==============================================================================
+// Resources
+//==============================================================================
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-11-01' = {
+ name: keyVaultName
+ location: location
+ tags: tags
+ properties: {
+ enabledForDeployment: true
+ enabledForTemplateDeployment: true
+ enabledForDiskEncryption: true
+ enableSoftDelete: true
+ softDeleteRetentionInDays: 90
+ enableRbacAuthorization: false
+ createMode: 'default'
+ tenantId: subscription().tenantId
+ accessPolicies: formattedAccessPolicies
+ sku: {
+ name: sku
+ family: 'A'
+ }
+ }
+}
+
+resource keyVault_accessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-11-01' = if (!empty(accessPolicies)) {
+ name: 'add'
+ parent: keyVault
+ properties: {
+ accessPolicies: formattedAccessPolicies
+ }
+}
+
+resource storageRef 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
+ name: storageAccountName
+}
+
+resource keyVault_secrets 'Microsoft.KeyVault/vaults/secrets@2022-11-01' = {
+ name: storageRef.name
+ parent: keyVault
+ properties: {
+ attributes: {
+ enabled: true
+ exp: 1702648632
+ nbf: 10000
+ }
+ value: storageRef.listKeys().keys[0].value
+ }
+}
+
+//==============================================================================
+// Outputs
+//==============================================================================
+
+@description('The resource ID of the key vault.')
+output resourceId string = keyVault.id
+
+@description('The name of the key vault.')
+output name string = keyVault.name
+
+@description('The URI of the key vault.')
+output uri string = keyVault.properties.vaultUri
diff --git a/src/modules/scripts/Copy-FileToAzureBlob.ps1 b/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1
similarity index 62%
rename from src/modules/scripts/Copy-FileToAzureBlob.ps1
rename to src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1
index 2b8466cc..a4c1fcc3 100644
--- a/src/modules/scripts/Copy-FileToAzureBlob.ps1
+++ b/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1
@@ -1,13 +1,16 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
$json = [ordered]@{
- '$schema' = 'https://aka.ms/finops/toolkit/settings-schema'
+ '$schema' = 'https://aka.ms/finops/hubs/settings-schema'
type = 'HubInstance'
version = '0.0.1'
- learnMore = 'https://aka.ms/finops/toolkit'
- exportScopes = @()
+ learnMore = 'https://aka.ms/finops/hubs'
+ exportScopes = @()
}
$json.exportScopes = $env:exportScopes.Split('|')
$settingsFile = Join-Path -Path .\ -ChildPath 'settings.json'
$json | ConvertTo-Json | Out-File $settingsFile
-$ctx = New-AzStorageContext -StorageAccountName $env:storageAccountName -StorageAccountKey $env:storageAccountKey
+$ctx = New-AzStorageContext -StorageAccountName $env:storageAccountName -UseConnectedAccount
Set-AzStorageBlobContent -Container $env:containerName -Context $ctx -File $settingsFile
diff --git a/src/templates/finops-hub/modules/scripts/Start-Triggers.ps1 b/src/templates/finops-hub/modules/scripts/Start-Triggers.ps1
new file mode 100644
index 00000000..2066efa6
--- /dev/null
+++ b/src/templates/finops-hub/modules/scripts/Start-Triggers.ps1
@@ -0,0 +1,45 @@
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+
+Param(
+ [switch] $Stop
+)
+
+# Init outputs
+$DeploymentScriptOutputs = @{}
+
+if (-not $Stop) {
+ Start-Sleep -Seconds 10
+}
+
+# Loop thru triggers
+$env:Triggers.Split('|') `
+| ForEach-Object {
+ $trigger = $_
+ if ($Stop) {
+ Write-Host "Stopping trigger $trigger..." -NoNewline
+ $triggerOutput = Stop-AzDataFactoryV2Trigger `
+ -ResourceGroupName $env:DataFactoryResourceGroup `
+ -DataFactoryName $env:DataFactoryName `
+ -Name $trigger `
+ -Force `
+ -ErrorAction SilentlyContinue # Ignore errors, since the trigger may not exist
+ } else {
+ Write-Host "Starting trigger $trigger..." -NoNewline
+ $triggerOutput = Start-AzDataFactoryV2Trigger `
+ -ResourceGroupName $env:DataFactoryResourceGroup `
+ -DataFactoryName $env:DataFactoryName `
+ -Name $trigger `
+ -Force
+ }
+ if ($triggerOutput) {
+ Write-Host 'done'
+ } else {
+ Write-Host 'failed'
+ }
+ $DeploymentScriptOutputs[$trigger] = $triggerOutput
+}
+
+if ($Stop) {
+ Start-Sleep -Seconds 10
+}
diff --git a/src/templates/finops-hub/modules/storage.bicep b/src/templates/finops-hub/modules/storage.bicep
new file mode 100644
index 00000000..676fcecc
--- /dev/null
+++ b/src/templates/finops-hub/modules/storage.bicep
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+//==============================================================================
+// Parameters
+//==============================================================================
+
+@description('Required. Name of the hub. Used to ensure unique resource names.')
+param hubName string
+
+@description('Required. Suffix to add to the storage account name to ensure uniqueness.')
+param uniqueSuffix string
+
+@description('Optional. Azure location where all resources should be created. See https://aka.ms/azureregions. Default: (resource group location).')
+param location string = resourceGroup().location
+
+@allowed([
+ 'Premium_LRS'
+ 'Premium_ZRS'
+])
+@description('Optional. Storage SKU to use. LRS = Lowest cost, ZRS = High availability. Note Standard SKUs are not available for Data Lake gen2 storage. Allowed: Premium_LRS, Premium_ZRS. Default: Premium_LRS.')
+param sku string = 'Premium_LRS'
+
+@description('Optional. Tags to apply to all resources. We will also add the cm-resource-parent tag for improved cost roll-ups in Cost Management.')
+param tags object = {}
+
+@description('Optional. List of scope IDs to create exports for.')
+param exportScopes array
+
+//------------------------------------------------------------------------------
+// Variables
+//------------------------------------------------------------------------------
+
+// Generate globally unique storage account name: 3-24 chars; lowercase letters/numbers only
+var safeHubName = replace(replace(toLower(hubName), '-', ''), '_', '')
+var storageAccountSuffix = uniqueSuffix
+var storageAccountName = '${take(safeHubName, 24 - length(storageAccountSuffix))}${storageAccountSuffix}'
+
+// Roles needed to auto-start triggers
+var blobUploadRbacRoles = [
+ 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor - https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor
+]
+
+//==============================================================================
+// Resources
+//==============================================================================
+
+resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
+ name: storageAccountName
+ location: location
+ sku: {
+ name: sku
+ }
+ kind: 'BlockBlobStorage'
+ tags: tags
+ properties: {
+ supportsHttpsTrafficOnly: true
+ isHnsEnabled: true
+ minimumTlsVersion: 'TLS1_2'
+ allowBlobPublicAccess: false
+ }
+}
+
+//------------------------------------------------------------------------------
+// Containers
+//------------------------------------------------------------------------------
+
+resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2021-06-01' = {
+ parent: storageAccount
+ name: 'default'
+}
+
+resource configContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = {
+ parent: blobService
+ name: 'config'
+ properties: {
+ publicAccess: 'None'
+ metadata: {}
+ }
+}
+
+resource exportContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = {
+ parent: blobService
+ name: 'msexports'
+ properties: {
+ publicAccess: 'None'
+ metadata: {}
+ }
+}
+
+resource ingestionContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = {
+ parent: blobService
+ name: 'ingestion'
+ properties: {
+ publicAccess: 'None'
+ metadata: {}
+ }
+}
+
+//------------------------------------------------------------------------------
+// Settings.json
+//------------------------------------------------------------------------------
+
+// Create managed identity to upload files
+resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
+ name: '${storageAccountName}_blobManager'
+ location: location
+}
+
+// Assign access to the identity
+resource identityRoleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for role in blobUploadRbacRoles: {
+ name: guid(storageAccount.id, role, identity.id)
+ scope: storageAccount
+ properties: {
+ roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', role)
+ principalId: identity.properties.principalId
+ principalType: 'ServicePrincipal'
+ }
+}]
+
+resource uploadSettings 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
+ name: 'uploadSettings'
+ kind: 'AzurePowerShell'
+ location: location
+ identity: {
+ type: 'UserAssigned'
+ userAssignedIdentities: {
+ '${identity.id}': {}
+ }
+ }
+ dependsOn: [
+ configContainer
+ identityRoleAssignments
+ ]
+ properties: {
+ azPowerShellVersion: '8.0'
+ retentionInterval: 'PT1H'
+ environmentVariables: [
+ {
+ name: 'exportScopes'
+ value: join(exportScopes, '|')
+ }
+ {
+ name: 'storageAccountName'
+ value: storageAccountName
+ }
+ {
+ name: 'containerName'
+ value: 'config'
+ }
+ ]
+ scriptContent: loadTextContent('./scripts/Copy-FileToAzureBlob.ps1')
+ }
+}
+
+//==============================================================================
+// Outputs
+//==============================================================================
+
+@description('The resource ID of the storage account.')
+output resourceId string = storageAccount.id
+
+@description('The name of the storage account.')
+output name string = storageAccount.name
+
+@description('The name of the container used for configuration settings.')
+output configContainer string = configContainer.name
+
+@description('The name of the container used for Cost Management exports.')
+output exportContainer string = exportContainer.name
+
+@description('The name of the container used for normalized data ingestion.')
+output ingestionContainer string = ingestionContainer.name
diff --git a/src/templates/finops-hub/reports/CommitmentDiscounts.pbix b/src/templates/finops-hub/reports/CommitmentDiscounts.pbix
new file mode 100644
index 00000000..d4e29aca
Binary files /dev/null and b/src/templates/finops-hub/reports/CommitmentDiscounts.pbix differ
diff --git a/src/templates/finops-hub/reports/CostSummary.pbix b/src/templates/finops-hub/reports/CostSummary.pbix
new file mode 100644
index 00000000..e217d184
Binary files /dev/null and b/src/templates/finops-hub/reports/CostSummary.pbix differ
diff --git a/src/reports/README.md b/src/templates/finops-hub/reports/README.md
similarity index 81%
rename from src/reports/README.md
rename to src/templates/finops-hub/reports/README.md
index cf7fb4fb..2494aad8 100644
--- a/src/reports/README.md
+++ b/src/templates/finops-hub/reports/README.md
@@ -1,17 +1,17 @@
-# FinOps toolkit reports
+# 📊 FinOps hub reports
-FinOps toolkit reports are created and edited using [Power BI Desktop](https://powerbi.microsoft.com/desktop). We currently support the following reports:
+FinOps hub reports are created and edited using [Power BI Desktop](https://powerbi.microsoft.com/desktop). We currently support the following reports:
- [Cost summary](./CostSummary.pbix)
- [Commitment discounts](./CommitmentDiscounts.pbix)
---
-## Changing schema
+## 🔠 Changing schema
-FinOps toolkit reports maintain different queries for each schema version to avoid breaking old reports during an upgrade. Use the following steps when changing the schema:
+FinOps hub reports maintain different queries for each schema version to avoid breaking old reports during an upgrade. Use the following steps when changing the schema:
-1. Open the desired toolkit report in Power BI Desktop.
+1. Open the desired hub report in Power BI Desktop.
2. Select **Transform data** in the toolbar.
3. Either create a new query with **Get data** or right-click the latest query and select **Duplicate**, if the data source is not changing.
- Customize the new query as desired.
@@ -52,11 +52,11 @@ FinOps toolkit reports maintain different queries for each schema version to avo
- Note you may need to update columns and measures depending on the dataset changes.
- Validate columns and measures first and update as needed.
- Then validate visuals and update all as needed.
-13. Document the new dataset in [Queries and datasets](../../docs/reports/README.md#queries-and-datasets).
+13. Document the new dataset in [Queries and datasets](../../../../docs/finops-hub/reports/README.md#queries-and-datasets).
14. Update the references to the latest dataset name in the following places:
- - [Copy queries from a toolkit report](../../docs/reports/README.md#copy-queries-from-a-toolkit-report)
- - [Queries and datasets](../../docs/reports/README.md#queries-and-datasets)
-15. If appropriate, document the new dataset in the [changelog](../../docs/changelog.md).
+ - [Copy queries from a report](../../../../docs/finops-hub/reports/README.md#copy-queries-from-a-report)
+ - [Queries and datasets](../../../../docs/finops-hub/reports/README.md#queries-and-datasets)
+15. If appropriate, document the new dataset in the [changelog](../../../../docs/changelog.md).
16. Repeat these steps for each toolkit report:
1. Rename the old query to `
+
+On this page:
+
+- [✨ Creating workbooks](#-creating-workbooks)
+- [📦 Building workbook templates](#-building-workbook-templates)
+- [🧪 Testing workbook templates](#-testing-workbook-templates)
+
+---
+
+## ✨ Creating workbooks
+
+Workbooks in the FinOps toolkit reuse common scaffolding in the `.scaffold` folder to generate the files needed when publishing. Use the following steps to create a new workbook:
+
+1. Create a folder for the workbook using kebab casing (e.g., `my-workbook`). Workbook names should be singular (e.g., `my-workbook` instead of `my-workbooks`).
+2. Create a `scaffold.json` file:
+
+ 1. Start with the following sample:
+
+ ```json
+ {
+ "main.bicep": {
+ "displayName": "",
+ "description": ""
+ },
+ "metadata.json": {
+ "summary": "",
+ "description": "",
+ "githubUsername": "",
+ "dateUpdated": "yyyy-MM-dd"
+ }
+ }
+ ```
+
+ 2. Set main.bicep properties:
+ - `displayName` to a human-readable name that will be shown in the portal.
+ - `description` to a short description.
+ 3. Set metadata.json properties:
+ - `summary` to a short description.
+ - `description` to a long description.
+ - `githubUsername` to the username of the GitHub.
+ - `dateUpdated` to the date the workbook was last updated.
+
+3. Create a `createUiDefinition.json` file.
+ - [CreateUiDef docs](https://learn.microsoft.com/azure/azure-resource-manager/managed-applications/create-uidefinition-overview)
+ - [Test in portal](https://portal.azure.com/?feature.customPortal=falseblade/Microsoft_Azure_CreateUIDef/SandboxBlade)
+
+
+
+## 📦 Building workbook templates
+
+There are 2 ways to build workbook templates. To build all toolkit modules and templates, run:
+
+```console
+cd $repo/src/scripts
+./Build-Toolkit
+```
+
+To build only a single workbook template, run:
+
+```console
+cd $repo/src/scripts
+./Build-Workbook
+
+## 🧪 Testing workbook templates
+
+Before deploying a workbook template, you first need to sign in to Azure:
+
+```console
+Connect-AzContext
+Set-AzContext -Subscription "Trey Research R&D Playground"
+```
+
+> ℹ️ _**Microsoft contributors:** We recommend using the Trey Research R&D Playground subscription (64e355d7-997c-491d-b0c1-8414dccfcf42) for subscription deployments and the FinOps Toolkit tenant (38a09d9b-84be-4c40-8aef-99ebeed474ff) for tenant deployments. Contact @flanakin to request access._
+>
+> To sign in to the FinOps Toolkit tenant, run:
+>
+> ```console
+> Connect-AzContext -Tenant 38a09d9b-84be-4c40-8aef-99ebeed474ff
+> ```
+
+Use the `Deploy-Toolkit` script to deploy a workbook template. In its simplest form, you need only specify the name (not the path) of the module you want to deploy to run the local dev version of the module (not the generated versions):
+
+```console
+cd $repo/src/scripts
+./Deploy-Toolkit optimization
+```
+
+Workbook templates must be built before they can be deployed. You can optionally build workbook templates by specifying the `-Build` parameter:
+
+```console
+cd $repo/src/scripts
+./Deploy-Toolkit optimization -Build
+```
+
+Use `-WhatIf` to validate the template without deploying anything first.
+
+> ℹ️ _**Note:** Workbooks are deployed to a unique resource group based on your username and computer name: `ftk-
diff --git a/src/workbooks/optimization/README.md b/src/workbooks/optimization/README.md
new file mode 100644
index 00000000..8a57ea64
--- /dev/null
+++ b/src/workbooks/optimization/README.md
@@ -0,0 +1,44 @@
+# Cost optimization workbook template
+
+![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/PublicLastTestDate.svg)
+![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/PublicDeployment.svg)
+
+![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/FairfaxLastTestDate.svg)
+![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/FairfaxDeployment.svg)
+
+![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/BestPracticeResult.svg)
+![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/CredScanResult.svg)
+![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.costmanagement/optimization-workbook/BicepVersion.svg)
+
+[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Foptimization-workbook%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Foptimization-workbook%2FcreateUiDefinition.json)
+[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Foptimization-workbook%2Fazuredeploy.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Foptimization-workbook%2FcreateUiDefinition.json)
+[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.costmanagement%2Foptimization-workbook%2Fazuredeploy.json)
+
+This template creates a new Azure Monitor workbook for **cost optimization**.
+
+The objective of this workbook is to provide an overview of the cost posture of your Azure environment. The workbook is to be used as guidance only and does not represent a guarantee of any cost reduction.
+
+To learn more about the cost optimization workbook, the roadmap, or how to contribute, see [FinOps toolkit documentation](https://aka.ms/finops/toolkit).
+
+
+
+## How to use this template
+
+Once your workbook is deployed, you can use it by navigating to one of the following destinations:
+
+1. From Azure Monitor:
+ 1. Select [**Workbooks**](https://portal.azure.com/#view/Microsoft_Azure_Monitoring/AzureMonitoringBrowseBlade/~/workbooks) in the menu.
+ 2. Verify your subscription is selected in the **Subscription** filter.
+ 3. Select the **Cost optimization** workbook.
+2. From the resource group:
+ 1. Select the workbook resource.
+ 2. Select **Workbook** in the menu.
+3. From [Azure workbooks](https://portal.azure.com/#browse/microsoft.insights%2Fworkbooks):
+ 1. Select the **Cost optimization** workbook.
+ 2. Select **Workbook** in the menu.
+
+> ℹ️ _**Pro tip:** If you navigate to the workbook resource (2 or 3 above), consider adding the workbook as a favorite using the star icon to the right of the resource name to make it easier to find in the future. Favorite resources can be opened directly from the Resources > Favorite section of the Azure portal default home page._
+
+
+
+`Tags: finops, cost, optimization, Microsoft.Insights/workbooks`
diff --git a/src/workbooks/optimization/createUiDefinition.json b/src/workbooks/optimization/createUiDefinition.json
new file mode 100644
index 00000000..0ee5b2e7
--- /dev/null
+++ b/src/workbooks/optimization/createUiDefinition.json
@@ -0,0 +1,52 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
+ "handler": "Microsoft.Azure.CreateUIDef",
+ "version": "0.1.2-preview",
+ "parameters": {
+ "config": {
+ "basics": {
+ "description": "FinOps hubs are a reliable, trustworthy platform for cost analytics, insights, and optimization. Connect your hub to one or more billing accounts and subscriptions and build custom reports in Power BI or other tools. [Learn more](https://aka.ms/finops/hubs)",
+ "location": {
+ "label": "Location",
+ "resourceTypes": ["Microsoft.DataFactory/factories", "Microsoft.KeyVault/vaults", "Microsoft.Storage/storageAccounts"]
+ }
+ }
+ },
+ "resourceTypes": ["Microsoft.DataFactory/factories", "Microsoft.KeyVault/vaults", "Microsoft.Storage/storageAccounts"],
+ "basics": [
+ {
+ "name": "displayName",
+ "type": "Microsoft.Common.TextBox",
+ "label": "Name",
+ "defaultValue": "Cost optimization",
+ "toolTip": "Name of the workbook.",
+ "constraints": {
+ "required": true,
+ "regex": "^.{1,250}$",
+ "validationMessage": "Name cannot be longer than 250 characters."
+ },
+ "visible": true
+ }
+ ],
+ "steps": [
+ {
+ "name": "tags",
+ "label": "Tags",
+ "elements": [
+ {
+ "name": "tagsByResource",
+ "label": "Tags",
+ "toolTip": "Tags to apply.",
+ "type": "Microsoft.Common.TagsByResource",
+ "resources": ["Microsoft.Insights/workbooks"]
+ }
+ ]
+ }
+ ],
+ "outputs": {
+ "displayName": "[basics('displayName')]",
+ "location": "[location()]",
+ "tags": "[steps('tags').tagsByResource]"
+ }
+ }
+}
diff --git a/src/workbooks/optimization/scaffold.json b/src/workbooks/optimization/scaffold.json
new file mode 100644
index 00000000..8792ef43
--- /dev/null
+++ b/src/workbooks/optimization/scaffold.json
@@ -0,0 +1,12 @@
+{
+ "main.bicep": {
+ "displayName": "Cost optimization",
+ "description": "Reports to help you optimize your cost."
+ },
+ "metadata.json": {
+ "summary": "Create a new cost optimization workbook",
+ "description": "This template creates a new Azure Monitor workbook for cost optimization based on the Well-Architected Framework.",
+ "githubUsername": "arthurclares",
+ "dateUpdated": "2023-05-24"
+ }
+}
diff --git a/src/workbooks/optimization/workbook.json b/src/workbooks/optimization/workbook.json
new file mode 100644
index 00000000..4ec30a1b
--- /dev/null
+++ b/src/workbooks/optimization/workbook.json
@@ -0,0 +1,8159 @@
+{
+ "version": "Notebook/1.0",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "51aa3a9b-14e0-4c22-a60d-abdbf8813f00",
+ "version": "KqlParameterItem/1.0",
+ "name": "Subscription",
+ "type": 6,
+ "isRequired": true,
+ "multiSelect": true,
+ "quote": "'",
+ "delimiter": ",",
+ "typeSettings": {
+ "additionalResourceOptions": [
+ "value::all"
+ ],
+ "includeAll": true,
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "defaultValue": "value::all"
+ },
+ {
+ "id": "27d877de-fd66-4a67-87b4-081894bffe41",
+ "version": "KqlParameterItem/1.0",
+ "name": "RG_Filter",
+ "label": "Filter By",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n { \"value\":\"Resource Group\",\"selected\":\"true\"},\r\n { \"value\":\"Tags\" }\r\n]"
+ },
+ {
+ "id": "3b7465ee-0eb3-419a-abcc-d4569c436df2",
+ "version": "KqlParameterItem/1.0",
+ "name": "Location",
+ "label": "Resource Location",
+ "type": 2,
+ "description": "Select the region where the VMs are located. Different Regions might have different SKUs",
+ "isRequired": true,
+ "query": "Resources\r\n| where type =~ 'Microsoft.Compute/virtualMachines'\r\n| project name, location\r\n| summarize count () by location\r\n| project location\r\n",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "typeSettings": {
+ "additionalResourceOptions": [
+ "value::1"
+ ],
+ "showDefault": false
+ },
+ "defaultValue": "value::1",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ {
+ "id": "2336f06b-ddaa-4a9e-b72f-a2bec1ea84a9",
+ "version": "KqlParameterItem/1.0",
+ "name": "SingleSubHidden",
+ "type": 1,
+ "isRequired": true,
+ "query": "resourcecontainers\r\n| where type==\"microsoft.resources/subscriptions\"\r\n| take 1\r\n| project subscriptionId",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "isHiddenWhenLocked": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "CostInformation"
+ },
+ "name": "parameters - 0"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "6cb303fd-4812-4097-a468-a177d8782913",
+ "version": "KqlParameterItem/1.0",
+ "name": "ResourceGroup",
+ "label": "Resource Group",
+ "type": 2,
+ "multiSelect": true,
+ "quote": "'",
+ "delimiter": ",",
+ "query": "resourceContainers | where type == 'microsoft.resources/subscriptions/resourcegroups'\r\n| project resourceGroup\r\n| sort by resourceGroup asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "typeSettings": {
+ "additionalResourceOptions": [
+ "value::all"
+ ],
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "defaultValue": "value::all",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "value": [
+ "value::all"
+ ]
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "CostInformation"
+ }
+ ],
+ "name": "parameters - 2"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "df2a5339-2dd6-478a-a2b1-2dce7651ed0a",
+ "version": "KqlParameterItem/1.0",
+ "name": "TagName",
+ "label": "Tag Name",
+ "type": 2,
+ "isRequired": true,
+ "query": "Resources\r\n| where tags != '' and tags != '[]'\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| distinct tagName\r\n| sort by tagName asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "value": "ssv2excludevm",
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "customWidth": "20",
+ "conditionalVisibilities": [
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ }
+ ],
+ "name": "parameters - 3"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "d28a3428-b806-4716-a4c5-9f9816224aef",
+ "version": "KqlParameterItem/1.0",
+ "name": "TagValue",
+ "type": 2,
+ "isRequired": true,
+ "query": "Resources\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tags != '' and tags != '[]' and tostring(bag_keys(tags)[0]) == '{TagName}'\r\n| distinct tagValue\r\n| sort by tagValue asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "value": "true",
+ "typeSettings": {
+ "additionalResourceOptions": []
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "customWidth": "20",
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ {
+ "parameterName": "TagName",
+ "comparison": "isNotEqualTo"
+ }
+ ],
+ "name": "parameters - 13"
+ }
+ ],
+ "exportParameters": true
+ },
+ "name": "Parameters"
+ },
+ {
+ "type": 11,
+ "content": {
+ "version": "LinkItem/1.0",
+ "style": "tabs",
+ "links": [
+ {
+ "id": "02e6ccd6-a138-477d-b507-f1ace41b28c6",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Welcome",
+ "subTarget": "Welcome",
+ "style": "link"
+ },
+ {
+ "id": "ca40468d-4518-43bf-ac6e-0a11d7331e12",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Reservations Recommendations",
+ "subTarget": "General",
+ "style": "link"
+ },
+ {
+ "id": "34014531-76a5-4eab-9772-9944fa241fea",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Azure Hybrid Benefit",
+ "subTarget": "AHUB",
+ "style": "link"
+ },
+ {
+ "id": "96d6402c-ff6c-4cf8-961d-8fbe5c98be60",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Compute",
+ "subTarget": "Compute",
+ "preText": "VirtualMachines",
+ "style": "link"
+ },
+ {
+ "id": "4f4786a7-c2df-4788-b5b6-63057bc0c24a",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Disks",
+ "subTarget": "Storage",
+ "style": "link"
+ },
+ {
+ "id": "feefdffe-9b9b-4480-a0dd-3a2751cab365",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Cost Information",
+ "subTarget": "CostInformation",
+ "style": "link"
+ }
+ ]
+ },
+ "name": "links - 4"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Compute Group",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "advisorresources\r\n| where type == \"microsoft.advisor/recommendations\"\r\n| where tostring (properties.category) has \"Cost\"\r\n| where properties.impactedField has \"Compute\" or properties.impactedField has \"Container\" or properties.impactedField has \"Web\"\r\n| project AffectedResource=tostring(properties.resourceMetadata.resourceId),Impact=properties.impact,resourceGroup,AdditionaInfo=properties.extendedProperties,subscriptionId,Recommendation=tostring(properties.shortDescription.problem)\r\n| where resourceGroup in ({ResourceGroup})\r\n",
+ "size": 0,
+ "title": "Azure Advisor Cost recommendations",
+ "noDataMessage": "You are following all of our cost recommendations for Compute",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "rowLimit": 1000,
+ "filter": true,
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "Recommendation"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "name": "query - 0"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where type =~ 'microsoft.compute/virtualmachines' and tostring(properties.extended.instanceView.powerState.displayStatus) != 'VM deallocated' and tostring(properties.extended.instanceView.powerState.displayStatus) != 'VM running'\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend VMname=name, PowerState=tostring(properties.extended.instanceView.powerState.displayStatus), VMLocation=location, VirtualMachineId=id\r\n| order by VirtualMachineId asc\r\n| project VirtualMachineId,VMname, PowerState, VMLocation, resourceGroup, subscriptionId",
+ "size": 0,
+ "title": "Virtual Machines in a Stopped State",
+ "noDataMessage": "You have no VMs in a stopped state",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "query - 3"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isNotEqualTo",
+ "value": "Tags"
+ },
+ "name": "Compute - Subscription"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "advisorresources\r\n| where type == \"microsoft.advisor/recommendations\"\r\n| where tostring (properties.category) has \"Cost\"\r\n| where properties.impactedField has \"Compute\" or properties.impactedField has \"Container\" or properties.impactedField has \"Web\"\r\n| project AffectedResource=tolower(tostring(properties.resourceMetadata.resourceId)),Impact=properties.impact,resourceGroup,AdditionaInfo=properties.extendedProperties,subscriptionId,Recommendation=tostring(properties.shortDescription.problem),AffectedResourceName=tostring(properties.impactedValue)\r\n| join ( resources\r\n | where type has \"Compute\" or type has \"Web\" or type has \"Container\"\r\n | extend AffectedResource=tolower(id)\r\n ) on AffectedResource\r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| project AffectedResource, Impact,resourceGroup,AdditionaInfo, tagName, tagValue, Recommendation, SubscriptionName=subscriptionId\r\n",
+ "size": 0,
+ "title": "Azure advisor Cost recommendations",
+ "noDataMessage": "You are following all Compute Advisor recommendations",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "tagName",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ },
+ {
+ "columnMatch": "tagValue",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ],
+ "rowLimit": 1000,
+ "filter": true,
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "Recommendation"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "name": "query - 0"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where tostring(properties.extended.instanceView.powerState.displayStatus) != 'VM deallocated'\r\n| where tostring(properties.extended.instanceView.powerState.displayStatus) != 'VM running'\r\n| extend VMname=name, PowerState=tostring(properties.extended.instanceView.powerState.displayStatus), VMLocation=location, VMRG=resourceGroup, VirtualMachineId=id, SubscriptionName=subscriptionId\r\n| project VirtualMachineId,VMname, PowerState, VMLocation, tagName,tagValue,VMRG, SubscriptionName\r\n| order by VirtualMachineId asc",
+ "size": 0,
+ "title": "Virtual Machines in a Stopped State",
+ "noDataMessage": "No Virtual Machines found in stopped state",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "query - 3"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ "name": "Compute - Tags"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Compute"
+ },
+ "name": "ComputeGroup",
+ "styleSettings": {
+ "showBorder": true
+ }
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Storage Group",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "StorageGroup",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where type =~ 'microsoft.compute/disks' and managedBy == \"\"\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| extend DiskId=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB), Location=location, TimeCreated=tostring(properties.timeCreated), QuickFix=id\r\n| order by DiskId asc \r\n| project DiskId,DiskName, DiskSizeGB, SKUName, SKUTier, resourceGroup, QuickFix, Location, TimeCreated, subscriptionId\r\n",
+ "size": 0,
+ "title": "Unattached disks",
+ "noDataMessage": "There isn't any unnatached disks!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "QuickFix",
+ "formatter": 7,
+ "formatOptions": {
+ "linkTarget": "ArmTemplate",
+ "linkLabel": "Remove Idle Disk",
+ "linkIsContextBlade": true,
+ "templateRunContext": {
+ "componentIdSource": "column",
+ "componentId": "DiskId",
+ "templateUriSource": "static",
+ "templateUri": "https://raw.githubusercontent.com/sebassem/MS-learn-Workbooks/main/Deploy-Tag.json",
+ "templateParameters": [
+ {
+ "name": "DiskID",
+ "source": "static",
+ "value": "DiskId",
+ "kind": "stringValue"
+ }
+ ],
+ "titleSource": "static",
+ "title": "Remove Idle Disk",
+ "descriptionSource": "static",
+ "description": "# Description\r\nThis ARM Template will remove the selected disk.\r\n\r\n# Actions:\r\n- Click \"Remove Idle Disk\" to remove the selected item.\r\n- Click View Template to examine the template and parameters used during deployment\r\n\r\n\r\n\r\n",
+ "runLabelSource": "static",
+ "runLabel": "Remove Idle Disk"
+ }
+ }
+ }
+ ],
+ "rowLimit": 1000
+ }
+ },
+ "name": "query - 1"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isNotEqualTo",
+ "value": "Tags"
+ },
+ "name": "Storage - subscription"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type =~ 'microsoft.compute/disks'\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| extend DiskID=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB),DiskRG=resourceGroup, Location=location, TimeCreated=tostring(properties.timeCreated), SubscriptionName=subscriptionId \r\n| project DiskID,DiskName, DiskSizeGB, SKUName, SKUTier, DiskRG,tagName,tagValue, Location, TimeCreated, SubscriptionName\r\n| order by DiskID asc ",
+ "size": 0,
+ "title": "Unattached disks",
+ "noDataMessage": "You don't have any unattached disks!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "tagName",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ },
+ {
+ "columnMatch": "tagValue",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ],
+ "rowLimit": 1000
+ }
+ },
+ "name": "query - 5"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ "name": "Storage - Tags"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Storage"
+ },
+ "name": "StorageGroup"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type == 'microsoft.compute/snapshots'\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend TimeCreated = properties.timeCreated\r\n| where TimeCreated < ago(30d)\r\n| order by id asc \r\n| project Resource=id, resourceGroup, location, TimeCreated ,subscriptionId",
+ "size": 0,
+ "title": "Disk Snapshots with + 30 Days",
+ "noDataMessage": "No Snapshots with more than 30 days.",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "OldSnapshots-RG"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type == 'microsoft.compute/snapshots'\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend SnapshotId=id, name, resourceGroup, SnapshotLocation=location, TimeCreated=tostring(properties.timeCreated), SourceDisk=tostring(properties.creationData.sourceResourceId),subscriptionId\r\n| project SnapshotId=id, name, resourceGroup, SnapshotLocation, TimeCreated=tostring(properties.timeCreated), SourceDisk=tostring(properties.creationData.sourceResourceId), subscriptionId \r\n| join kind=leftouter (\r\nresources\r\n| where type =~ 'microsoft.compute/disks'\r\n| extend SourceDisk=id ) on SourceDisk\r\n| where isempty(managedBy)",
+ "size": 0,
+ "title": "Snapshots of disks that doesn't exist anymore",
+ "noDataMessage": "There aren't any idle disk snapshot",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "Idle Snapshots - RG"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Storage"
+ },
+ "name": "StorageGroup",
+ "styleSettings": {
+ "showBorder": true
+ }
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Storage Group",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "StorageGroup",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where type =~ 'microsoft.compute/disks' and managedBy == \"\"\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| extend DiskId=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB), Location=location, TimeCreated=tostring(properties.timeCreated), QuickFix=id\r\n| order by DiskId asc \r\n| project DiskId,DiskName, DiskSizeGB, SKUName, SKUTier, resourceGroup, QuickFix, Location, TimeCreated, subscriptionId\r\n",
+ "size": 0,
+ "title": "Unattached disks",
+ "noDataMessage": "There isn't any unnatached disks!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "QuickFix",
+ "formatter": 7,
+ "formatOptions": {
+ "linkTarget": "ArmTemplate",
+ "linkLabel": "Remove Idle Disk",
+ "linkIsContextBlade": true,
+ "templateRunContext": {
+ "componentIdSource": "column",
+ "componentId": "DiskId",
+ "templateUriSource": "static",
+ "templateUri": "https://raw.githubusercontent.com/sebassem/MS-learn-Workbooks/main/Deploy-Tag.json",
+ "templateParameters": [
+ {
+ "name": "DiskID",
+ "source": "static",
+ "value": "DiskId",
+ "kind": "stringValue"
+ }
+ ],
+ "titleSource": "static",
+ "title": "Remove Idle Disk",
+ "descriptionSource": "static",
+ "description": "# Description\r\nThis ARM Template will remove the selected disk.\r\n\r\n# Actions:\r\n- Click \"Remove Idle Disk\" to remove the selected item.\r\n- Click View Template to examine the template and parameters used during deployment\r\n\r\n\r\n\r\n",
+ "runLabelSource": "static",
+ "runLabel": "Remove Idle Disk"
+ }
+ }
+ }
+ ],
+ "rowLimit": 1000
+ }
+ },
+ "name": "query - 1"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isNotEqualTo",
+ "value": "Tags"
+ },
+ "name": "Storage - subscription"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type =~ 'microsoft.compute/disks'\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| extend DiskID=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB),DiskRG=resourceGroup, Location=location, TimeCreated=tostring(properties.timeCreated), SubscriptionName=subscriptionId \r\n| project DiskID,DiskName, DiskSizeGB, SKUName, SKUTier, DiskRG,tagName,tagValue, Location, TimeCreated, SubscriptionName\r\n| order by DiskID asc ",
+ "size": 0,
+ "title": "Unattached disks",
+ "noDataMessage": "You don't have any unattached disks!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "tagName",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ },
+ {
+ "columnMatch": "tagValue",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Tags",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ],
+ "rowLimit": 1000
+ }
+ },
+ "name": "query - 5"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ "name": "Storage - Tags"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Storage"
+ },
+ "name": "StorageGroup"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type == 'microsoft.compute/snapshots'\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend TimeCreated = properties.timeCreated\r\n| where TimeCreated < ago(30d)\r\n| order by id asc \r\n| project Resource=id, resourceGroup, location, TimeCreated ,subscriptionId",
+ "size": 0,
+ "title": "Disk Snapshots with + 30 Days",
+ "noDataMessage": "No Snapshots with more than 30 days.",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "OldSnapshots-RG"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type == 'microsoft.compute/snapshots'\r\n| where resourceGroup in ({ResourceGroup})\r\n| extend SnapshotId=id, name, resourceGroup, SnapshotLocation=location, TimeCreated=tostring(properties.timeCreated), SourceDisk=tostring(properties.creationData.sourceResourceId),subscriptionId\r\n| project SnapshotId=id, name, resourceGroup, SnapshotLocation, TimeCreated=tostring(properties.timeCreated), SourceDisk=tostring(properties.creationData.sourceResourceId), subscriptionId \r\n| join kind=leftouter (\r\nresources\r\n| where type =~ 'microsoft.compute/disks'\r\n| extend SourceDisk=id ) on SourceDisk\r\n| where isempty(managedBy)",
+ "size": 0,
+ "title": "Snapshots of disks that doesn't exist anymore",
+ "noDataMessage": "There aren't any idle disk snapshot",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "name": "Idle Snapshots - RG"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Storage"
+ },
+ "name": "StorageGroup - Copy",
+ "styleSettings": {
+ "showBorder": true
+ }
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Group General",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "## Azure Advisor Recommendations"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "advisorresources\r\n| where type == \"microsoft.advisor/recommendations\"\r\n| where tostring (properties.category) has \"Cost\"\r\n| where properties.impactedField has \"Microsoft.Subscriptions/subscriptions\" or properties.impactedField has \"Microsoft.ReservedInstances/reservedInstances\"\r\n| project AffectedResource=tostring(properties.resourceMetadata.resourceId),Recommendation=tostring(properties.shortDescription.problem),Impact=tostring(properties.impact),resourceGroup,AdditionaInfo=properties.extendedProperties,subscriptionId\r\n",
+ "size": 0,
+ "title": "Azure Advisor subscriptions recommendations",
+ "noDataMessage": "You are following all of our cost recommendations for Subscriptions",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "Recommendation"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "name": "query - 12"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "General"
+ },
+ "name": "Group General",
+ "styleSettings": {
+ "showBorder": true
+ }
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Welcome",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "# Welcome to the Cost Optimization Workbook"
+ },
+ "name": "text - 6"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Reference: [Microsoft Azure Well-Architected Framework - Cost Optimization Pillar](https://learn.microsoft.com/en-us/azure/architecture/framework/cost/overview)",
+ "style": "upsell"
+ },
+ "name": "text - 5"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "The objective of this workbook is to provide an overview of the Cost posture of your Azure environment. The workbook is to be used as guidance only, and does not represent a guarantee of any Cost Reduction.\r\n\r\n## Overview of the cost optimization pillar\r\n\r\n* The cost optimization pillar provides principles for balancing business goals with budget justification to create a cost-effective workload while avoiding capital-intensive solutions. Cost optimization is about looking at ways to reduce unnecessary expenses and improve operational efficiencies.\r\n\r\n* To assess your workload using the tenets found in the [Microsoft Azure Well-Architected Framework](https://learn.microsoft.com/en-us/azure/architecture/framework/), reference the [Microsoft Azure Well-Architected Review](https://learn.microsoft.com/en-us/assessments/?id=azure-architecture-review&mode=pre-assessment&session=20dc50e4-5b71-4f38-bc49-51cc1d9f205c).\r\n\r\n\r\n\r\n\r\n"
+ },
+ "name": "text - 0"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Indicates an implemented feature that can result in a environment that is following the Cost Optimization & Cost Governance principles.",
+ "style": "success"
+ },
+ "customWidth": "50",
+ "name": "text - 1",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Indicates a feature that has not been implemented, and therefore should be reviewed",
+ "style": "warning"
+ },
+ "customWidth": "50",
+ "name": "text - 2",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## RBAC Needed\r\n\r\nThis workbook will present various cost-related details in the form of governance, networking, storage, VMs, Webapps, SQL, and cost information to educate the business about cost related to various resources.\r\n\r\n\r\n* Consider the following least-privilege (minimum) RBAC permissions when deploying the workbook:\r\n\r\n * **Reader** , **Billing Reader** and **Workbook Contributor** : allows you to import the workbook, view all of the workbook tabs including the *Cost Information* tab and save the workbook in a resource group.\r\n * **Reader** and **Workbook Contributor** : allows you to import the workbook, view all of the workbook tabs except the *Cost Information* tab and save the workbook in a resource group.\r\n * **Reader** : allows you to import the workbook and view all of the workbook tabs except the *Cost Information* tab.\r\n\r\n\r\n"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": " > The **Cost Information** tab only works with one subscription at the time.",
+ "style": "info"
+ },
+ "name": "text - 4"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "Welcome"
+ },
+ "name": "Welcome"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Cost Information",
+ "items": [
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "fffccc1f-fc7d-497c-b45b-29417117b862",
+ "version": "KqlParameterItem/1.0",
+ "name": "Subscription",
+ "type": 6,
+ "isRequired": true,
+ "value": "/subscriptions/1283e053-2e46-449f-87d6-842ef6df3272",
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "includeAll": true
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "name": "parameters - 0"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "1b71c24e-3e21-4598-a1c4-10106dcdfeca",
+ "version": "KqlParameterItem/1.0",
+ "name": "RG_Filter",
+ "label": "Filter By",
+ "type": 2,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n { \"value\":\"Resource Group\",\"selected\":\"true\"},\r\n { \"value\":\"Tags\" }\r\n]",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Tags"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ },
+ "name": "parameters - 5"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "42099afa-2462-4f0e-88be-b87bb1d3c908",
+ "version": "KqlParameterItem/1.0",
+ "name": "ResourceGroup",
+ "label": "Resource Group",
+ "type": 2,
+ "isRequired": true,
+ "multiSelect": true,
+ "quote": "\"",
+ "delimiter": ",",
+ "query": "resourceContainers | where type == 'microsoft.resources/subscriptions/resourcegroups'\r\n| project resourceGroup\r\n| sort by resourceGroup asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "typeSettings": {
+ "additionalResourceOptions": [
+ "value::all"
+ ],
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "defaultValue": "value::all",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ }
+ ],
+ "name": "parameters - 6"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "90a85a21-e4f8-48e6-92cb-87aa64a11f3b",
+ "version": "KqlParameterItem/1.0",
+ "name": "TagName",
+ "label": "Tag Name",
+ "type": 2,
+ "isRequired": true,
+ "query": "Resources\r\n| where tags != '' and tags != '[]'\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| distinct tagName\r\n| sort by tagName asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "value": "ssv2excludevm",
+ "typeSettings": {
+ "additionalResourceOptions": []
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "customWidth": "20",
+ "conditionalVisibilities": [
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ }
+ ],
+ "name": "parameters - 7"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "8bd3bf68-2f67-4bf7-a72a-c87817fc172c",
+ "version": "KqlParameterItem/1.0",
+ "name": "TagValue",
+ "label": "Tag Value",
+ "type": 2,
+ "isRequired": true,
+ "query": "Resources\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tags != '' and tags != '[]' and tostring(bag_keys(tags)[0]) == '{TagName}'\r\n| distinct tagValue\r\n| sort by tagValue asc",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "value": "true",
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "customWidth": "20",
+ "conditionalVisibilities": [
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isNotEqualTo",
+ "value": "General"
+ },
+ {
+ "parameterName": "TagName",
+ "comparison": "isNotEqualTo"
+ }
+ ],
+ "name": "parameters - 8"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "# This Tab will show Information about idle resource that have impact on cost\r\n### Note: The cost information available in this tab relates to the previous month. If the resources was created less than 30 days ago, check the cost management and billing blade.\r\n### *Billing reader permission as a minimum is needed to populate cost information"
+ },
+ "name": "text - 1"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":\"{\\r\\n\\t\\\"type\\\": \\\"Usage\\\",\\r\\n\\t\\\"timeframe\\\": \\\"TheLastBillingMonth\\\",\\r\\n\\t\\\"dataset\\\": {\\r\\n\\t\\t\\\"granularity\\\": \\\"None\\\",\\r\\n\\t\\t\\\"filter\\\": {\\r\\n\\t\\t\\t\\\"and\\\": [\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\\"dimensions\\\": {\\r\\n\\t\\t\\t\\t\\t\\t\\\"name\\\": \\\"resourceType\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"operator\\\": \\\"In\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"values\\\": [\\r\\n\\t\\t\\t\\t\\t\\t\\t\\\"microsoft.compute/disks\\\"\\r\\n\\t\\t\\t\\t\\t\\t]\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t},\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\\"dimensions\\\": {\\r\\n\\t\\t\\t\\t\\t\\t\\\"name\\\": \\\"ResourceGroup\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"operator\\\": \\\"In\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"values\\\": [\\r\\n\\t\\t\\t\\t\\t\\t\\t{ResourceGroup}\\r\\n\\t\\t\\t\\t\\t\\t\\t]\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t]\\r\\n\\t\\t},\\r\\n\\t\\t\\\"aggregation\\\": {\\r\\n\\t\\t\\t\\\"totalCost\\\": {\\r\\n\\t\\t\\t\\t\\\"name\\\": \\\"PreTaxCost\\\",\\r\\n\\t\\t\\t\\t\\\"function\\\": \\\"Sum\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\\\"grouping\\\": [\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\\"type\\\": \\\"Dimension\\\",\\r\\n\\t\\t\\t\\t\\\"name\\\": \\\"ResourceId\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t]\\r\\n\\t}\\r\\n}\",\"headers\":[],\"method\":\"POST\",\"path\":\"/subscriptions/{Subscription:id}/providers/Microsoft.CostManagement/query?\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2019-11-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.properties\",\"columns\":[]}}]}",
+ "size": 0,
+ "title": "GetCostAllDisks",
+ "queryType": 12
+ },
+ "conditionalVisibility": {
+ "parameterName": "isVisible",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - GetAllDisksCost"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where type =~ 'microsoft.compute/disks' and resourceGroup in ({ResourceGroup})\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| extend DiskID=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB),DiskRG=resourceGroup, Location=location, TimeCreated=tostring(properties.timeCreated)\r\n| order by id asc \r\n| project DiskID,DiskName, DiskSizeGB, SKUName, SKUTier, DiskRG, Location, TimeCreated, subscriptionId",
+ "size": 0,
+ "title": "Unattached Disks",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "isVisible",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - GetUnattachedDisks"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\",\"mergeType\":\"innerunique\",\"leftTable\":\"query - GetAllDisksCost\",\"rightTable\":\"query - GetUnattachedDisks\",\"leftColumn\":\"ResourceId\",\"rightColumn\":\"DiskID\"}],\"projectRename\":[{\"originalName\":\"[query - GetUnattachedDisks].DiskID\",\"mergedName\":\"DiskID\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetAllDisksCost].PreTaxCost\",\"mergedName\":\"Last Month Cost\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetAllDisksCost].Currency\",\"mergedName\":\"Currency\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskSizeGB\",\"mergedName\":\"DiskSizeGB\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskRG\",\"mergedName\":\"DiskRG\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].Location\",\"mergedName\":\"Location\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].TimeCreated\",\"mergedName\":\"TimeCreated\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetAllDisksCost].ResourceId\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskName\"}]}",
+ "size": 0,
+ "title": "Unattached Managed Disks cost",
+ "noDataMessage": "There isn't any unnatached disk!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "exportToExcelOptions": "all",
+ "queryType": 7
+ },
+ "showPin": false,
+ "name": "query - Unattaached Disks Cost"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ },
+ "name": "group - CostRG"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":\"{\\r\\n\\t\\\"type\\\": \\\"Usage\\\",\\r\\n\\t\\\"timeframe\\\": \\\"TheLastBillingMonth\\\",\\r\\n\\t\\\"dataset\\\": {\\r\\n\\t\\t\\\"granularity\\\": \\\"None\\\",\\r\\n\\t\\t\\\"filter\\\": {\\r\\n\\t\\t\\t\\t\\t\\\"dimensions\\\": {\\r\\n\\t\\t\\t\\t\\t\\t\\\"name\\\": \\\"resourceType\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"operator\\\": \\\"In\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\\"values\\\": [\\r\\n\\t\\t\\t\\t\\t\\t\\t\\\"microsoft.compute/disks\\\"\\r\\n\\t\\t\\t\\t\\t\\t]\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\\\"aggregation\\\": {\\r\\n\\t\\t\\t\\\"totalCost\\\": {\\r\\n\\t\\t\\t\\t\\\"name\\\": \\\"PreTaxCost\\\",\\r\\n\\t\\t\\t\\t\\\"function\\\": \\\"Sum\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\\\"grouping\\\": [\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\\"type\\\": \\\"Dimension\\\",\\r\\n\\t\\t\\t\\t\\\"name\\\": \\\"ResourceId\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t]\\r\\n\\t}\\r\\n}\",\"headers\":[],\"method\":\"POST\",\"path\":\"/subscriptions/{Subscription:id}/providers/Microsoft.CostManagement/query?\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2019-11-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.properties\",\"columns\":[]}}]}",
+ "size": 0,
+ "title": "GetCostAllDisks",
+ "queryType": 12
+ },
+ "conditionalVisibility": {
+ "parameterName": "isVisible",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - GetAllDisksCost"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources\r\n| where type =~ 'microsoft.compute/disks'\r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy == \"\" and diskState != 'ActiveSAS'\r\nor diskState == 'Unattached' and diskState != 'ActiveSAS'\r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| extend DiskID=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB),DiskRG=resourceGroup, Location=location, TimeCreated=tostring(properties.timeCreated), SubscriptionName=subscriptionId \r\n| project DiskID,DiskName, DiskSizeGB, SKUName, SKUTier, DiskRG,tagName,tagValue, Location, TimeCreated, SubscriptionName\r\n| order by DiskID asc ",
+ "size": 0,
+ "title": "Unattached Disks",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "isVisible",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - GetUnattachedDisks"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\",\"mergeType\":\"innerunique\",\"leftTable\":\"query - GetAllDisksCost\",\"rightTable\":\"query - GetUnattachedDisks\",\"leftColumn\":\"ResourceId\",\"rightColumn\":\"DiskID\"}],\"projectRename\":[{\"originalName\":\"[query - GetUnattachedDisks].DiskID\",\"mergedName\":\"DiskID\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetAllDisksCost].PreTaxCost\",\"mergedName\":\"Last Month Cost\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetAllDisksCost].Currency\",\"mergedName\":\"Currency\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskSizeGB\",\"mergedName\":\"DiskSizeGB\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskRG\",\"mergedName\":\"DiskRG\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - GetUnattachedDisks].Location\",\"mergedName\":\"Location\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].TimeCreated\",\"mergedName\":\"TimeCreated\",\"fromId\":\"890db43d-bfd3-4a7c-94df-e030a0c03093\"},{\"originalName\":\"[query - GetUnattachedDisks].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - GetUnattachedDisks].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - GetAllDisksCost].ResourceId\"},{\"originalName\":\"[query - GetUnattachedDisks].DiskName\"}]}",
+ "size": 0,
+ "title": "Unattached Managed Disks cost",
+ "noDataMessage": "There isn't any unnatached disks!",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "exportToExcelOptions": "all",
+ "queryType": 7
+ },
+ "showPin": false,
+ "name": "query - Unattaached Disks Cost"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ },
+ "name": "group - CostTag"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "CostInformation"
+ },
+ "name": "group - CostInformation"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Azure Hybrid Benefit Overview",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "# Azure Hybrid Benefit\r\nFor customers with Software Assurance, Azure Hybrid Benefit for Windows Server allows you to use your on-premises Windows Server licenses to run Windows virtual machines on Azure at a reduced cost. This article discusses how to deploy new VMs with Azure Hybrid Benefit for Windows Server enabled, and how you can update any existing running VMs. For more information about Azure Hybrid Benefit for Windows Server licensing and cost savings, see the [Azure Hybrid Benefit for Windows Server licensing page](https://azure.microsoft.com/pricing/hybrid-use-benefit/)\r\n\r\n",
+ "style": "upsell"
+ },
+ "name": "text - 5"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "parameters": [
+ {
+ "id": "0c58188b-5c09-45aa-b738-f7122d0e0a19",
+ "version": "KqlParameterItem/1.0",
+ "name": "Location",
+ "type": 2,
+ "description": "Select the region where the VMs are located. Different Regions might have different SKUs",
+ "isRequired": true,
+ "query": "Resources\r\n| where type =~ 'Microsoft.Compute/virtualMachines'\r\n| project name, location\r\n| take 1\r\n| project location\r\n\r\n",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "value": "uksouth"
+ },
+ {
+ "id": "3ee18b0f-2f7b-4a6a-9d1c-526505c7eea2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SingleSubHidden",
+ "type": 1,
+ "isRequired": true,
+ "query": "resourcecontainers\r\n| where type==\"microsoft.resources/subscriptions\"\r\n| take 1\r\n| project subscriptionId",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "isHiddenWhenLocked": true,
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ }
+ ],
+ "style": "pills",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources"
+ },
+ "name": "parameters - 12"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"/subscriptions/{SingleSubHidden}/providers/Microsoft.Compute/skus?$filter=location eq '{Location}'\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2021-07-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.*[?(@.resourceType=='virtualMachines')]\",\"columns\":[{\"path\":\"name\",\"columnid\":\"Name\"},{\"path\":\"capabilities[?(@.name=='vCPUs')].value\",\"columnid\":\"vCPUs\"},{\"path\":\"capabilities[?(@.name=='MemoryGB')].value\",\"columnid\":\"MemoryGB\"},{\"path\":\"capabilities[?(@.name=='MaxNetworkInterfaces')].value\",\"columnid\":\"MaxNetworkInterfaces\"},{\"path\":\"capabilities[?(@.name=='HyperVGenerations')].value\",\"columnid\":\"HyperVGenerations\"},{\"path\":\"capabilities[?(@.name=='vCPUsPerCore')].value\",\"columnid\":\"vCPUsPerCore\"}]}}]}",
+ "size": 0,
+ "title": "Get VM vCPU",
+ "exportParameterName": "ResourceSKU",
+ "showExportToExcel": true,
+ "queryType": 12,
+ "gridSettings": {
+ "rowLimit": 5000
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "API-Get_VM_SKU"
+ },
+ {
+ "type": 11,
+ "content": {
+ "version": "LinkItem/1.0",
+ "style": "tabs",
+ "links": [
+ {
+ "id": "3f12a4b6-b18d-4191-8c1c-6045a7edcb6b",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "VM/VMSS",
+ "subTarget": "VM",
+ "style": "link"
+ },
+ {
+ "id": "78ac1878-4b69-4f32-af1f-a8f095afbed5",
+ "cellValue": "SelectedTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL",
+ "subTarget": "SQL",
+ "style": "link"
+ }
+ ]
+ },
+ "name": "links - 1"
+ },
+ {
+ "type": 11,
+ "content": {
+ "version": "LinkItem/1.0",
+ "style": "tabs",
+ "links": [
+ {
+ "id": "0211f413-9f36-4750-9ef2-d382ba30ba6c",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Windows Virtual Machines",
+ "subTarget": "VM",
+ "preText": "VM",
+ "style": "link"
+ },
+ {
+ "id": "dbe9a7fb-6ab1-4de1-a98b-4ec8a9af906c",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "Linux Virtual Machines",
+ "subTarget": "LinuxVM",
+ "style": "link"
+ },
+ {
+ "id": "79e7a97a-1413-41e8-b4c6-ebd1d0a45e2e",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "VM Scale Set",
+ "subTarget": "VMSS",
+ "style": "link"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ "name": "links - 4"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Virtual Machines",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows' or tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) !has 'Windows' and tostring(properties.virtualMachineProfile.['licenseType']) !has 'Windows'\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - 0"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) has \"Windows\"\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "title": "AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "WindowsAHUBEnabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resourcechanges\r\n| where properties.changeType == \"Update\" and properties.targetResourceType == \"microsoft.compute/virtualmachines\"\r\n| mv-expand changes = properties.changes\r\n| mv-expand LicenseChanges=changes.['properties.licenseType']\r\n| where isnotnull(LicenseChanges)\r\n| where tostring(LicenseChanges.newValue) has \"Windows\"\r\n| project VMID=properties.targetResourceId, NewLicense=tostring(LicenseChanges.newValue), DateofChange=todatetime(properties.changeAttributes.timestamp)\r\n",
+ "size": 0,
+ "title": "VM Latest Change Last 7 days",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "VM Latest Change Last 7 days"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"/subscriptions/{SingleSubHidden}/providers/Microsoft.Compute/skus?$filter=location eq '{Location}'\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2021-07-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.*[?(@.resourceType=='virtualMachines')]\",\"columns\":[{\"path\":\"name\",\"columnid\":\"Name\"},{\"path\":\"capabilities[?(@.name=='vCPUs')].value\",\"columnid\":\"vCPUs\"},{\"path\":\"capabilities[?(@.name=='MemoryGB')].value\",\"columnid\":\"MemoryGB\"},{\"path\":\"capabilities[?(@.name=='MaxNetworkInterfaces')].value\",\"columnid\":\"MaxNetworkInterfaces\"},{\"path\":\"capabilities[?(@.name=='HyperVGenerations')].value\",\"columnid\":\"HyperVGenerations\"},{\"path\":\"capabilities[?(@.name=='vCPUsPerCore')].value\",\"columnid\":\"vCPUsPerCore\"}]}}]}",
+ "size": 0,
+ "title": "Get VM vCPU",
+ "exportParameterName": "ResourceSKU",
+ "showExportToExcel": true,
+ "queryType": 12,
+ "gridSettings": {
+ "rowLimit": 5000
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - Get VM vCPU"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## Windows Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "text - 15 - Copy"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Each two-processor license or each set of 16-core licenses, either Datacenter or Standard editions, are entitled to two instances of up to 8 cores, or one instance of up to 16 cores.\r\n\r\nThe virtual machines (VMs) with less than 8 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 1",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBWindows = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets', iif((properties.['licenseType'])\r\n !has 'Windows' and (properties.virtualMachineProfile.['licenseType']) !has 'Windows' , \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Windows\"\r\n )\r\n) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckAHUBWindows",
+ "size": 0,
+ "title": "Summary of Windows VMs with or without AHUB per Subscription",
+ "showRefreshButton": true,
+ "showExportToExcel": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "gridSettings": {
+ "sortBy": [
+ {
+ "itemKey": "SubscriptionName",
+ "sortOrder": 1
+ }
+ ]
+ },
+ "sortBy": [
+ {
+ "itemKey": "SubscriptionName",
+ "sortOrder": 1
+ }
+ ],
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckAHUBWindows",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of Windows VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBWindows = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets', iif((properties.['licenseType'])\r\n !has 'Windows' and (properties.virtualMachineProfile.['licenseType']) !has 'Windows' , \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Windows\"\r\n )\r\n| summarize count() by CheckAHUBWindows",
+ "size": 0,
+ "title": "Summary of Windows VMs with or without AHUB",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary of Windows VMs with or without AHUB"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of Windows licenses cores consumed by all Windows virtual machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable Windows Azure Hybrid Benefit\r\nNumber of cores required to enable AHUB across the entire environment.",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15 - Copy"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabled\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[WindowsAHUBEnabled].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"[\\\"vCPUs\\\"]\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per AHUB Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per AHUB Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26130\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabled\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"ConsumedCores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"[\\\"vCPUs\\\"]\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per VM",
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "ConsumedCores",
+ "formatter": 0,
+ "formatOptions": {
+ "aggregation": "Sum"
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {},
+ "leftContent": {
+ "columnMatch": "ConsumedCores",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "blue"
+ }
+ },
+ "showBorder": false
+ },
+ "graphSettings": {
+ "type": 0
+ },
+ "chartSettings": {
+ "yAxis": [
+ "ConsumedCores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"query - 0\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"[\\\"vCPUs\\\"]\"}}]},{\"originalName\":\"[query - 0].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Cores NOT enabled per AHUB Priority"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "AHUBEnabled",
+ "label": "See VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "AHUBDisabled",
+ "label": "See VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ },
+ {
+ "id": "20a00706-a89b-42aa-8dea-9c44c93e8014",
+ "version": "KqlParameterItem/1.0",
+ "name": "LastAHUB",
+ "label": "See VMs AHUB enabled in the last 7 days",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Windows VMs without Hybrid Benefit groupped by Subscription.",
+ "style": "info"
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 18"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"query - 0\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[query - 0].WindowsId\",\"mergedName\":\"VM Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMRG\",\"mergedName\":\"Resource Group\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMSize\",\"mergedName\":\"SKU\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[query - 0].LicenseType\",\"mergedName\":\"License Type\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMLocation\",\"mergedName\":\"Location\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].OSType\",\"mergedName\":\"OS Type\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].OsVersion\",\"mergedName\":\"OS Version\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"}]}",
+ "size": 0,
+ "title": "VMs without AHUB",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VM+SKU+vCores"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Windows VMs with Hybrid Benefit groupped by Subscription.",
+ "style": "info"
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 19"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabled\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\",\"mergedName\":\"VM Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\",\"mergedName\":\"Resource Group\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSize\",\"mergedName\":\"VM SKU\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\",\"mergedName\":\"License Type\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\",\"mergedName\":\"Location\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\",\"mergedName\":\"OS Type\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\",\"mergedName\":\"OS Version\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"},{\"originalName\":\"[WindowsAHUBEnabled].VMName\"}]}",
+ "size": 0,
+ "title": "VMs with AHUB",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "2",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ },
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Subscription Name",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VM+SKU+vCores-AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"VM Latest Change Last 7 days\",\"rightTable\":\"VM+SKU+vCores-AHUB\",\"leftColumn\":\"VMID\",\"rightColumn\":\"VM Name\"}],\"projectRename\":[{\"originalName\":\"[VM Latest Change Last 7 days].VMID\",\"mergedName\":\"VMID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].VM Name\",\"mergedName\":\"VM Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Resource Group\",\"mergedName\":\"Resource Group\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].VM SKU\",\"mergedName\":\"VM SKU\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Prioritize AHUB?\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].License Type\",\"mergedName\":\"License Type\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Consumed Cores per VM\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Location\",\"mergedName\":\"Location\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Type\",\"mergedName\":\"OS Type\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Version\",\"mergedName\":\"OS Version\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"}]}",
+ "size": 0,
+ "title": "Total Cores Enabled last 7 Days",
+ "noDataMessage": "Windows AHUB hasn't been enabled in the last 7 days",
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "barchart",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "name": "Total Cores Enabled last 7 Days"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"VM Latest Change Last 7 days\",\"rightTable\":\"VM+SKU+vCores-AHUB\",\"leftColumn\":\"VMID\",\"rightColumn\":\"VM Name\"}],\"projectRename\":[{\"originalName\":\"[VM+SKU+vCores-AHUB].VM Name\",\"mergedName\":\"VM Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Resource Group\",\"mergedName\":\"Resource Group\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].VM SKU\",\"mergedName\":\"VM SKU\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Consumed Cores per VM\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Prioritize AHUB?\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].Location\",\"mergedName\":\"Location\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VM Latest Change Last 7 days].VMID\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Type\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Version\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].License Type\"}]}",
+ "size": 0,
+ "title": "Total Cores Enabled last 7 Days - Detailed view",
+ "noDataMessage": "No AHUB has been enabled in the last 7 days",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "visualization": "table",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LastAHUB",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "Total Cores Enabled last 7 Days - Details"
+ }
+ ]
+ },
+ "name": "VM"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ }
+ ],
+ "name": "VM/VMSS-RGFilter"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Virtual Machines",
+ "items": [
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows' or tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) !has 'Windows' and tostring(properties.virtualMachineProfile.['licenseType']) !has 'Windows'\r\n| extend WindowsId=id, VMName=name,tagName,tagValue, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,tagName,tagValue,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "AHUBDisabled-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) has \"Windows\"\r\n| extend WindowsId=id, VMName=name,tagName,tagValue, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG, tagName,tagValue,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "title": "AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "WindowsAHUBEnabledTagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resourcechanges\r\n| where properties.changeType == \"Update\" and properties.targetResourceType == \"microsoft.compute/virtualmachines\"\r\n| mv-expand changes = properties.changes\r\n| mv-expand LicenseChanges=changes.['properties.licenseType']\r\n| where isnotnull(LicenseChanges)\r\n| where tostring(LicenseChanges.newValue) has \"Windows\"\r\n| project VMID=properties.targetResourceId, NewLicense=tostring(LicenseChanges.newValue), DateofChange=todatetime(properties.changeAttributes.timestamp)\r\n",
+ "size": 0,
+ "title": "VM Latest Change Last 7 days",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "VM Latest Change Last 7 days-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"/subscriptions/{SingleSubHidden}/providers/Microsoft.Compute/skus?$filter=location eq '{Location}'\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2021-07-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.*[?(@.resourceType=='virtualMachines')]\",\"columns\":[{\"path\":\"name\",\"columnid\":\"Name\"},{\"path\":\"capabilities[?(@.name=='vCPUs')].value\",\"columnid\":\"vCPUs\"},{\"path\":\"capabilities[?(@.name=='MemoryGB')].value\",\"columnid\":\"MemoryGB\"},{\"path\":\"capabilities[?(@.name=='MaxNetworkInterfaces')].value\",\"columnid\":\"MaxNetworkInterfaces\"},{\"path\":\"capabilities[?(@.name=='HyperVGenerations')].value\",\"columnid\":\"HyperVGenerations\"},{\"path\":\"capabilities[?(@.name=='vCPUsPerCore')].value\",\"columnid\":\"vCPUsPerCore\"}]}}]}",
+ "size": 0,
+ "title": "Get VM vCPU",
+ "exportParameterName": "ResourceSKU",
+ "showExportToExcel": true,
+ "queryType": 12,
+ "gridSettings": {
+ "rowLimit": 5000
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "query - Get VM vCPU"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## Windows Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "text - 15 - Copy"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Each two-processor license or each set of 16-core licenses, either Datacenter or Standard editions, are entitled to two instances of up to 8 cores, or one instance of up to 16 cores.\r\n\r\nThe virtual machines (VMs) with less than 8 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 1",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBWindows = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets', iif((properties.['licenseType'])\r\n !has 'Windows' and (properties.virtualMachineProfile.['licenseType']) !has 'Windows' , \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Windows\"\r\n )\r\n) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckAHUBWindows",
+ "size": 0,
+ "title": "Summary of Windows VMs with or without AHUB per Subscription",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "tiles",
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckAHUBWindows",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of Windows VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows'\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBWindows = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets', iif((properties.['licenseType'])\r\n !has 'Windows' and (properties.virtualMachineProfile.['licenseType']) !has 'Windows' , \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Windows\"\r\n )\r\n| summarize count() by CheckAHUBWindows",
+ "size": 0,
+ "title": "Summary of Windows VMs with or without AHUB",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary of Windows VMs with or without AHUB"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of Windows licenses cores consumed by all Windows virtual machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "Consumed Licenses-TagFilter"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable Windows Azure Hybrid Benefit\r\nNumber of cores required to enable AHUB across the entire environment.",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "Number of required Cores to enable Windows Azure Hybrid Benefit-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabledTagFilter\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per AHUB Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per AHUB Priority-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26130\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabledTagFilter\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"ConsumedCores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per VM",
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "ConsumedCores",
+ "formatter": 0,
+ "formatOptions": {
+ "aggregation": "Sum"
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {},
+ "leftContent": {
+ "columnMatch": "ConsumedCores",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "blue"
+ }
+ },
+ "showBorder": false
+ },
+ "graphSettings": {
+ "type": 0
+ },
+ "chartSettings": {
+ "yAxis": [
+ "ConsumedCores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per VM-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"AHUBDisabled-TagFilter\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"unknown\"},{\"originalName\":\"[AHUBDisabled-TagFilter].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Cores NOT enabled per AHUB Priority-TagFilter"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "AHUBEnabled",
+ "label": "See VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "AHUBDisabled",
+ "label": "See VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ },
+ {
+ "id": "20a00706-a89b-42aa-8dea-9c44c93e8014",
+ "version": "KqlParameterItem/1.0",
+ "name": "LastAHUB",
+ "label": "See VMs AHUB enabled in the last 7 days",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Windows VMs without Hybrid Benefit groupped by Subscription.",
+ "style": "info"
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "List of Windows VMs without Hybrid Benefit-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"AHUBDisabled-TagFilter\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[AHUBDisabled-TagFilter].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[AHUBDisabled-TagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"}]}",
+ "size": 0,
+ "title": "VMs without AHUB",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VM+SKU+vCores-AHUBDisabled-TagFilter"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Windows VMs with Hybrid Benefit groupped by Subscription.",
+ "style": "info"
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 19"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"WindowsAHUBEnabledTagFilter\",\"rightTable\":\"query - Get VM vCPU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[WindowsAHUBEnabledTagFilter].WindowsId\",\"mergedName\":\"VM Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"},{\"originalName\":\"[WindowsAHUBEnabled].VMName\"}]}",
+ "size": 0,
+ "title": "VMs with AHUB",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "2",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ },
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Subscription Name",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VM+SKU+vCores-AHUB-TagFilter"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"VM Latest Change Last 7 days-TagFilter\",\"rightTable\":\"WindowsAHUBEnabledTagFilter\",\"leftColumn\":\"VMID\",\"rightColumn\":\"VMName\"}],\"projectRename\":[{\"originalName\":\"[VM+SKU+vCores-AHUB].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].VMID\",\"mergedName\":\"VMID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[WindowsAHUBEnabledTagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"}]}",
+ "size": 0,
+ "title": "Total Cores Enabled last 7 Days",
+ "noDataMessage": "Windows AHUB hasn't been enabled in the last 7 days",
+ "queryType": 7,
+ "visualization": "barchart",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "name": "Total Cores Enabled last 7 Days"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"VM Latest Change Last 7 days-TagFilter\",\"rightTable\":\"VM+SKU+vCores-AHUB-TagFilter\",\"leftColumn\":\"VMID\",\"rightColumn\":\"VM Name\"}],\"projectRename\":[{\"originalName\":\"[VM+SKU+vCores-AHUB].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].VMID\",\"mergedName\":\"VMID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days-TagFilter].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VM Name\",\"mergedName\":\"VM Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].Prioritize AHUB?\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].Consumed Cores per VM\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].tagName\",\"mergedName\":\"tagName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].tagValue\",\"mergedName\":\"tagValue\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM+SKU+vCores-AHUB-TagFilter].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[VM Latest Change Last 7 days].VMID\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Type\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].OS Version\"},{\"originalName\":\"[VM+SKU+vCores-AHUB].License Type\"}]}",
+ "size": 0,
+ "title": "Total Cores Enabled last 7 Days - Detailed view",
+ "noDataMessage": "No AHUB has been enabled in the last 7 days",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "visualization": "table",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LastAHUB",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "Total Cores Enabled last 7 Days - Details"
+ }
+ ]
+ },
+ "name": "VM"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ }
+ ],
+ "name": "VM/VMSS-TagsFilter"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Overview",
+ "items": [
+ {
+ "type": 11,
+ "content": {
+ "version": "LinkItem/1.0",
+ "style": "tabs",
+ "links": [
+ {
+ "id": "0211f413-9f36-4750-9ef2-d382ba30ba6c",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL Server VMs",
+ "subTarget": "SQLVM",
+ "preText": "VM",
+ "style": "link"
+ },
+ {
+ "id": "79e7a97a-1413-41e8-b4c6-ebd1d0a45e2e",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL DB",
+ "subTarget": "SQLDB",
+ "style": "link"
+ },
+ {
+ "id": "1f381e5b-7071-41ce-a354-c2df93445cae",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL Managed Instances",
+ "subTarget": "SQLMI",
+ "style": "link"
+ }
+ ]
+ },
+ "name": "links - 4"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and tostring(properties.['sqlServerLicenseType']) != 'AHUB' and resourceGroup in ({ResourceGroup})\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n ) on subscriptionId \r\n| join (\r\n resources\r\n | where type =~ 'Microsoft.Compute/virtualmachines'\r\n | project VMName = tolower(name), VMSize = tostring(properties.hardwareProfile.vmSize)\r\n ) on VMName\r\n| order by id asc \r\n| project SQLID,VMName,VMRG, VMLocation, VMSize, SQLVersion, SQLSKU, SQLAgentType, LicenseType, SubscriptionName\r\n| where SQLSKU != \"Developer\" and SQLSKU != \"Express\"",
+ "size": 0,
+ "title": "SQL VM AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Get-SQL-AHUB-Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and tostring(properties.['sqlServerLicenseType']) == 'AHUB' and resourceGroup in ({ResourceGroup})\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n ) on subscriptionId \r\n| join (\r\n resources\r\n | where type =~ 'Microsoft.Compute/virtualmachines'\r\n | project VMName = tolower(name), VMSize = tostring(properties.hardwareProfile.vmSize)\r\n ) on VMName\r\n| order by id asc \r\n| project SQLID,VMName,VMRG, VMLocation, VMSize, SQLVersion, SQLSKU, SQLAgentType, LicenseType, SubscriptionName\r\n| where SQLSKU != \"Developer\" and SQLSKU != \"Express\"",
+ "size": 0,
+ "title": "SQL VM AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 5,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Get-SQL-AHUB-Enabled"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## SQL Virtual Machines Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "SQL Text"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "SQL License Info",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL on VMs with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 15"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load SQL Info",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and resourceGroup in ({ResourceGroup})\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n | where SQLSKU != \"Developer\" and SQLSKU != \"Express\"\r\n | extend CheckSQLVMAHUB = case(\r\n type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines', iif((properties.['sqlServerLicenseType'])\r\n !has 'AHUB', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckSQLVMAHUB",
+ "size": 0,
+ "title": "Summary of SQL on VMs with or without AHUB per Subscription",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLVMAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL on VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and resourceGroup in ({ResourceGroup})\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n | extend CheckSQLVMAHUB = case(\r\n type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines', iif((properties.['sqlServerLicenseType'])\r\n !has 'AHUB', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by CheckSQLVMAHUB",
+ "size": 0,
+ "title": "Summary SQL Enabled and Disabled",
+ "noDataMessage": "You don't have any SQL VM",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary SQL Enabled and Disabled"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL running on Virtual Machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15 - Copy"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQL+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMName\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "showPin": false,
+ "name": "Summary SQL+SKU AHUB Enabled -"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640b5\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Disabled\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "warning",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "success",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "sortBy": [],
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "showMetrics": false,
+ "showLegend": true
+ }
+ },
+ "customWidth": "33",
+ "showPin": false,
+ "name": " Summary - SQL Cores AHUB Disabled "
+ }
+ ]
+ },
+ "name": "SQL Overview RG"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLAVMHUBEnabled",
+ "label": "See SQL VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLVMAHUBDisabled",
+ "label": "See SQL VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640b5\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Disabled\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLID\",\"mergedName\":\"VM Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLID\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMName\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMRG\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMLocation\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLVersion\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLSKU\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLAgentType\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].LicenseType\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SubscriptionName\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMSize\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "warning",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "success",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ },
+ "sortBy": []
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLVMAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "SQL+SKU AHUB Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMName\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ },
+ {
+ "columnMatch": "Subscription",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLAVMHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "SQL+SKU AHUB Enabled"
+ }
+ ]
+ },
+ "name": "SQL Detailed Info"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLVM"
+ },
+ "name": "SQL VM"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Database",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\"\r\n| extend SubscriptionName=name | join (resources | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master' and tostring(properties.['licenseType']) == 'LicenseIncluded' \r\n| extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=tostring(sku.name), SKUTier=tostring(sku.tier), vCores=tostring(sku.capacity), SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n| extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n )\r\n) on subscriptionId \r\n| project SQLDBID,SQLName,SQLRG, SKUName, SKUTier, vCores, CheckSQLDBAHUB,SQLLocation, LicenseType, StorageAccountType, SubscriptionName\r\n",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLDB AHUB Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\"\r\n| extend SubscriptionName=name | join (resources | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master' and tostring(properties.['licenseType']) != 'LicenseIncluded' and kind !has 'serverless'\r\n| extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, vCores=tostring(sku.capacity), LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])) on subscriptionId \r\n| project SQLDBID,SQLName,SQLRG, SKUName, SKUTier, vCores, SQLLocation, LicenseType, StorageAccountType, SubscriptionName\r\n",
+ "size": 0,
+ "title": "AHUB Enabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLDB AHUB Enabled"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## SQL Databases Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "text - 2"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL Databases with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 15"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load SQL DB Info",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master'\r\n | extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n | extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL DB\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckSQLDBAHUB",
+ "size": 0,
+ "title": "Summary of SQL Databases with or without AHUB per Subscription",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLDBAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL DBs with or without AHUB per subs"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" | extend SubscriptionName=name \r\n| join (\r\n resources | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master'\r\n | extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n | extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL DB\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by CheckSQLDBAHUB",
+ "size": 0,
+ "title": "Summary of SQL Databases with or without AHUB",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLDBAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL DBs with or without AHUB "
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL Databases\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "Text SQL DB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "SQLName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Enabled - per Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Disabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Disabled].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].CheckSQLDBAHUB\",\"mergedName\":\"CheckSQLDBAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Disabled - per Priority"
+ }
+ ]
+ },
+ "name": "SQL DB Info"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLDBHUBEnabled",
+ "label": "See SQL DBs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLDBAHUBDisabled",
+ "label": "See SQL DBs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071ed\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Disabled\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Disabled].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].CheckSQLDBAHUB\",\"mergedName\":\"CheckSQLDBAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Disabled",
+ "noDataMessage": "All of your SQL DBs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "SubscriptionName",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLDBAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL DB Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071f9\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Enabled].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Enabled",
+ "noDataMessage": "None of you SQL DBs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLDBHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL DB AHUB Enabled"
+ }
+ ]
+ },
+ "name": "Load SQL DB Detailed Info"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLDB"
+ },
+ "name": "SQLDBGroup"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Managed Instance",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\"\r\n | extend SubscriptionName=name \r\n | join (resources | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n | project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n | where SQLRG in ({ResourceGroup})",
+ "size": 0,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLMIAHUBDisabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\"\r\n | extend SubscriptionName=name \r\n | join (resources | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) != 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n | project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n | where SQLRG in ({ResourceGroup})",
+ "size": 0,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLMIAHUBEnabled"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "# SQL Managed Instances Azure Hybrid Benefit (AHUB) Overview\r\n"
+ },
+ "name": "text - 2"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL Databases with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 4"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load SQL MI Info",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\"\r\n | extend SubscriptionName=name \r\n | join (resources | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n| project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n| summarize count() by SubscriptionName, CheckSQLMIAHUB",
+ "size": 0,
+ "title": "Summary of SQL MI with or without AHUB per Subscription",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "table",
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLMIAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName"
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ },
+ "showBorder": false
+ },
+ "chartSettings": {
+ "yAxis": [
+ "count_"
+ ],
+ "group": "CheckSQLMIAHUB",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL MI with or without AHUB per subs"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | where tostring (properties.subscriptionPolicies.quotaId) !has \"MSDNDevTest_2014-09-01\" \r\n | extend SubscriptionName=name \r\n | join (resources | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n| project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n| summarize count() by SubscriptionName, CheckSQLMIAHUB",
+ "size": 0,
+ "title": "Summary of SQL Managed Instance with or without AHUB",
+ "showRefreshButton": true,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart",
+ "chartSettings": {
+ "yAxis": [
+ "count_"
+ ],
+ "group": "CheckSQLMIAHUB",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL MI with or without AHUB "
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL Managed Instances.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 7"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 8"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "SQLName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Enabled - per Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBDisabled\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"round([\\\"vCPUs\\\"] / 4) * 4\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLMIAHUBDisabled].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instances AHUB Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Disabled - per Priority"
+ }
+ ]
+ },
+ "name": "SQL MI Info"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLMIAHUBEnabled",
+ "label": "See SQL MIs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLMIAHUBDisabled",
+ "label": "See SQL MIs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 136"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071ed\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBDisabled\"}],\"projectRename\":[{\"originalName\":\"[SQLMIAHUBDisabled].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Disabled",
+ "noDataMessage": "All of your SQL MIs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "SubscriptionName",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLMIAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL MI Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071f9\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Enabled",
+ "noDataMessage": "None of you SQL MIs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLMIAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL MI AHUB Enabled"
+ }
+ ]
+ },
+ "name": "SQL MI Detailed"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLMI"
+ },
+ "name": "SQL MI"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "SQL"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ }
+ ],
+ "name": "SQLAHUB"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Overview",
+ "items": [
+ {
+ "type": 11,
+ "content": {
+ "version": "LinkItem/1.0",
+ "style": "tabs",
+ "links": [
+ {
+ "id": "0211f413-9f36-4750-9ef2-d382ba30ba6c",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL Server VMs",
+ "subTarget": "SQLVM",
+ "preText": "VM",
+ "style": "link"
+ },
+ {
+ "id": "79e7a97a-1413-41e8-b4c6-ebd1d0a45e2e",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL DB",
+ "subTarget": "SQLDB",
+ "style": "link"
+ },
+ {
+ "id": "1f381e5b-7071-41ce-a354-c2df93445cae",
+ "cellValue": "SelectedSubTab",
+ "linkTarget": "parameter",
+ "linkLabel": "SQL Managed Instances",
+ "subTarget": "SQLMI",
+ "style": "link"
+ }
+ ]
+ },
+ "name": "links - 4"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'| where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and tostring(properties.['sqlServerLicenseType']) != 'AHUB'\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n ) on subscriptionId \r\n| join (\r\n resources\r\n | where type =~ 'Microsoft.Compute/virtualmachines'\r\n | project VMName = tolower(name), VMSize = tostring(properties.hardwareProfile.vmSize)\r\n ) on VMName\r\n| order by id asc \r\n| project SQLID,VMName,VMRG, VMLocation, VMSize, SQLVersion, SQLSKU, SQLAgentType, LicenseType, SubscriptionName\r\n| where SQLSKU != \"Developer\" and SQLSKU != \"Express\"",
+ "size": 0,
+ "title": "SQL VM AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Get-SQL-AHUB-Disabled-Tags"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and tostring(properties.['sqlServerLicenseType']) == 'AHUB'\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n ) on subscriptionId \r\n| join (\r\n resources\r\n | where type =~ 'Microsoft.Compute/virtualmachines'\r\n | project VMName = tolower(name), VMSize = tostring(properties.hardwareProfile.vmSize)\r\n ) on VMName\r\n| order by id asc \r\n| project SQLID,VMName,VMRG, VMLocation, VMSize, SQLVersion, SQLSKU, SQLAgentType, LicenseType, SubscriptionName\r\n| where SQLSKU != \"Developer\" and SQLSKU != \"Express\"",
+ "size": 0,
+ "title": "SQL VM AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 5,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Get-SQL-AHUB-Enabled-Tags"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## SQL Virtual Machines Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "SQL Text"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "SQL License Info",
+ "styleSettings": {
+ "margin": "10px",
+ "showBorder": true
+ }
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL on VMs with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 15"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines'\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n | extend CheckSQLVMAHUB = case(\r\n type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines', iif((properties.['sqlServerLicenseType'])\r\n !has 'AHUB', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckSQLVMAHUB",
+ "size": 0,
+ "title": "Summary of SQL on VMs with or without AHUB per Subscription",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "tiles",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLVMAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL on VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'| where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines'\r\n | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])\r\n | extend CheckSQLVMAHUB = case(\r\n type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines', iif((properties.['sqlServerLicenseType'])\r\n !has 'AHUB', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by CheckSQLVMAHUB",
+ "size": 0,
+ "title": "Summary SQL Enabled and Disabled",
+ "noDataMessage": "You don't have any SQL VM",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary SQL Enabled and Disabled"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL running on Virtual Machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15 - Copy"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled-Tags\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQL+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled-Tags\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMName\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "showPin": false,
+ "name": "Summary SQL+SKU AHUB Enabled -"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640b5\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Disabled-Tags\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLID\",\"mergedName\":\"SQLID\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "warning",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "success",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "sortBy": [],
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "showMetrics": false,
+ "showLegend": true
+ }
+ },
+ "customWidth": "33",
+ "showPin": false,
+ "name": " Summary - SQL Cores AHUB Disabled "
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLAVMHUBEnabled",
+ "label": "See SQL VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLVMAHUBDisabled",
+ "label": "See SQL VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640b5\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Disabled-Tags\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLID\",\"mergedName\":\"SQL Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640b5\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLID\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMName\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMRG\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMLocation\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLVersion\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLSKU\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SQLAgentType\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].LicenseType\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].SubscriptionName\"},{\"originalName\":\"[Get-SQL-AHUB-Disabled].VMSize\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Disabled",
+ "noDataMessage": "All of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "warning",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "success",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ },
+ "sortBy": []
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLVMAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "SQL+SKU AHUB Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"cd7477ac-acd6-4894-b929-53348c7640e8\",\"mergeType\":\"inner\",\"leftTable\":\"API-Get_VM_SKU\",\"rightTable\":\"Get-SQL-AHUB-Enabled-Tags\",\"leftColumn\":\"Name\",\"rightColumn\":\"VMSize\"}],\"projectRename\":[{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLID\",\"mergedName\":\"SQL Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLVersion\",\"mergedName\":\"SQLVersion\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLSKU\",\"mergedName\":\"SQLSKU\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SQLAgentType\",\"mergedName\":\"SQLAgentType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"cd7477ac-acd6-4894-b929-53348c7640e8\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[Get-SQL-AHUB-Enabled].VMName\"}]}",
+ "size": 0,
+ "title": "SQL VM AHUB Enabled",
+ "noDataMessage": "None of your VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ },
+ {
+ "columnMatch": "Subscription",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLAVMHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "showPin": false,
+ "name": "SQL+SKU AHUB Enabled"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLVM"
+ },
+ "name": "SQL VM"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Database",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| extend SubscriptionName=name | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'| where type =~ 'Microsoft.Sql/servers/databases' and name != 'master' and tostring(properties.['licenseType']) == 'LicenseIncluded' \r\n| extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=tostring(sku.name), SKUTier=tostring(sku.tier), vCores=tostring(sku.capacity), SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n| extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n )\r\n) on subscriptionId \r\n| project SQLDBID,SQLName,SQLRG, SKUName, SKUTier, vCores, CheckSQLDBAHUB,SQLLocation, LicenseType, StorageAccountType, SubscriptionName\r\n",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLDB AHUB Disabled-Tag"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| extend SubscriptionName=name | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master' and tostring(properties.['licenseType']) != 'LicenseIncluded' \r\n| extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, vCores=tostring(sku.capacity), LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])) on subscriptionId \r\n| project SQLDBID,SQLName,SQLRG, SKUName, SKUTier, vCores, SQLLocation, LicenseType, StorageAccountType, SubscriptionName\r\n",
+ "size": 0,
+ "title": "AHUB Enabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLDB AHUB Enabled-Tag"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "## SQL Databases Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "text - 2"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL Databases with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 15"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master'\r\n | extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n | extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL DB\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by SubscriptionName, CheckSQLDBAHUB",
+ "size": 0,
+ "title": "Summary of SQL Databases with or without AHUB per Subscription",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "tiles",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLDBAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL DBs with or without AHUB per subs"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\n resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master'\r\n | extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])\r\n | extend CheckSQLDBAHUB = case(\r\n type =~ 'Microsoft.Sql/servers/databases', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not SQL DB\"\r\n )\r\n ) on subscriptionId \r\n| summarize count() by CheckSQLDBAHUB",
+ "size": 0,
+ "title": "Summary of SQL Databases with or without AHUB",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLDBAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ }
+ },
+ "showBorder": false,
+ "size": "auto"
+ },
+ "chartSettings": {
+ "xAxis": "SubscriptionName"
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL DBs with or without AHUB "
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL Databases\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 15"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "Text SQL DB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled-Tag\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "SQLName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled-Tag\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Enabled - per Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Disabled-Tag\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].CheckSQLDBAHUB\",\"mergedName\":\"CheckSQLDBAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your SQL DB have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLDB+SKU AHUB Disabled - per Priority"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLDBHUBEnabled",
+ "label": "See SQL DBs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLDBAHUBDisabled",
+ "label": "See SQL DBs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071ed\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Disabled-Tag\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].CheckSQLDBAHUB\",\"mergedName\":\"CheckSQLDBAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLDB AHUB Disabled-Tag].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Disabled",
+ "noDataMessage": "All of your SQL DBs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "SubscriptionName",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLDBAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL DB Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071f9\",\"mergeType\":\"table\",\"leftTable\":\"SQLDB AHUB Enabled-Tag\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLDBID\",\"mergedName\":\"SQLDBID\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLName\",\"mergedName\":\"SQLName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUName\",\"mergedName\":\"SKUName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SKUTier\",\"mergedName\":\"SKUTier\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].StorageAccountType\",\"mergedName\":\"StorageAccountType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLDB AHUB Enabled-Tag].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"}]}",
+ "size": 0,
+ "title": "SQL DB AHUB Enabled",
+ "noDataMessage": "None of you SQL DBs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLDBHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL DB AHUB Enabled"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLDB"
+ },
+ "name": "SQLDBGroup"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "SQL Managed Instance",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n | where type =~ 'Microsoft.Resources/subscriptions' \r\n | extend SubscriptionName=name \r\n | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n | project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName",
+ "size": 0,
+ "title": "SQLMIAHUBDisabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLMIAHUBDisabled-Tags"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n | where type =~ 'Microsoft.Resources/subscriptions' \r\n | extend SubscriptionName=name \r\n | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) != 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n | project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n",
+ "size": 0,
+ "title": "SQLMIAHUBEnabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "SQLMIAHUBEnabled-Tags"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "# SQL Managed Instances Azure Hybrid Benefit (AHUB) Overview\r\n"
+ },
+ "name": "text - 2"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure SQL Database general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.\r\n\r\nThe SQL virtual machines (VMs) with less than 4 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### AHUB Overview\r\nSummary of all SQL Databases with and without SQL AHUB.",
+ "style": "info"
+ },
+ "name": "text - 4"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n | where type =~ 'Microsoft.Resources/subscriptions' \r\n | extend SubscriptionName=name \r\n | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n| project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n| summarize count() by SubscriptionName, CheckSQLMIAHUB",
+ "size": 0,
+ "title": "Summary of SQL MI with or without AHUB per Subscription",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "tiles",
+ "tileSettings": {
+ "titleContent": {
+ "columnMatch": "CheckSQLMIAHUB",
+ "formatter": 1
+ },
+ "subtitleContent": {
+ "columnMatch": "SubscriptionName"
+ },
+ "leftContent": {
+ "columnMatch": "count_",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ },
+ "showBorder": false
+ },
+ "chartSettings": {
+ "yAxis": [
+ "count_"
+ ],
+ "group": "CheckSQLMIAHUB",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL MI with or without AHUB per subs"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers\r\n | where type =~ 'Microsoft.Resources/subscriptions' \r\n | extend SubscriptionName=name \r\n | join (resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}' | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, vCores=tostring(sku.capacity),LicenseType = tostring(properties.['licenseType'])\r\n | extend CheckSQLMIAHUB = case(\r\n type =~ 'Microsoft.Sql/managedInstances', iif((properties.['licenseType'])\r\n has 'LicenseIncluded', \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n\"Not SQL DB\"\r\n ) \r\n ) on subscriptionId \r\n| project ManagedInstance,SQLRG, SQLLocation, CheckSQLMIAHUB, vCores, LicenseType, SubscriptionName\r\n| summarize count() by SubscriptionName, CheckSQLMIAHUB",
+ "size": 0,
+ "title": "Summary of SQL Managed Instance with or without AHUB",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart",
+ "chartSettings": {
+ "yAxis": [
+ "count_"
+ ],
+ "group": "CheckSQLMIAHUB",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "50",
+ "name": "Summary of SQL MI with or without AHUB "
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of SQL licenses cores consumed by all SQL Managed Instances.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 7"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable SQL Azure Hybrid Benefit\r\nNumber of cores required to enable SQL AHUB across the entire environment.\r\n\r\n\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 8"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled-Tags\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Consumed Cores per VM",
+ "noDataMessage": "None of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "SQLName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Enabled - per VM"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled-Tags\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Consumed Cores per Priority",
+ "noDataMessage": "None of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Enabled - per Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071c2\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBDisabled-Tags\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"4\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCores\\\"] +3) & ~3\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCores\",\"operator\":\"<\",\"rightValType\":\"static\",\"rightVal\":\"4\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}}]},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071c2\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instances AHUB Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your SQL MI have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "==",
+ "thresholdValue": "Low Priority",
+ "representation": "2",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "unknown",
+ "text": "{0}{1}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Summary SQLMI+SKU AHUB Disabled - per Priority"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLMIAHUBEnabled",
+ "label": "See SQL MIs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "SQLMIAHUBDisabled",
+ "label": "See SQL MIs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 136"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071ed\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBDisabled-Tags\"}],\"projectRename\":[{\"originalName\":\"[SQLMIAHUBDisabled-Tags].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"},{\"originalName\":\"[SQLMIAHUBDisabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071ed\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Disabled",
+ "noDataMessage": "All of your SQL MIs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "SubscriptionName",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "SubscriptionName"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLMIAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL MI Disabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"f65bea23-bb49-4498-b331-c20c618071f9\",\"mergeType\":\"table\",\"leftTable\":\"SQLMIAHUBEnabled-Tags\"}],\"projectRename\":[{\"originalName\":\"[SQLDB AHUB Enabled].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"unknown\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].ManagedInstance\",\"mergedName\":\"ManagedInstance\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLRG\",\"mergedName\":\"SQLRG\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SQLLocation\",\"mergedName\":\"SQLLocation\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].CheckSQLMIAHUB\",\"mergedName\":\"CheckSQLMIAHUB\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].vCores\",\"mergedName\":\"vCores\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"},{\"originalName\":\"[SQLMIAHUBEnabled-Tags].SubscriptionName\",\"mergedName\":\"SubscriptionName\",\"fromId\":\"f65bea23-bb49-4498-b331-c20c618071f9\"}]}",
+ "size": 0,
+ "title": "SQL Managed Instance AHUB Enabled",
+ "noDataMessage": "None of you SQL MIs have AHUB enabled.",
+ "showExportToExcel": true,
+ "queryType": 7
+ },
+ "conditionalVisibility": {
+ "parameterName": "SQLMIAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "SQL MI AHUB Enabled"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "SQLMI"
+ },
+ "name": "SQL MI"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "SQL"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ }
+ ],
+ "name": "SQLAHUB - Tag"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Linux Hybrid Benefit",
+ "loadType": "explicit",
+ "loadButtonText": "Load Linux Recommendations",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "## Linux Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "Linux Text"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"/subscriptions/{SingleSubHidden}/providers/Microsoft.Compute/skus?$filter=location eq '{Location}'\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2021-07-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.*[?(@.resourceType=='virtualMachines')]\",\"columns\":[{\"path\":\"name\",\"columnid\":\"Name\"},{\"path\":\"capabilities[?(@.name=='vCPUs')].value\",\"columnid\":\"vCPUs\"},{\"path\":\"capabilities[?(@.name=='MemoryGB')].value\",\"columnid\":\"MemoryGB\"},{\"path\":\"capabilities[?(@.name=='MaxNetworkInterfaces')].value\",\"columnid\":\"MaxNetworkInterfaces\"},{\"path\":\"capabilities[?(@.name=='HyperVGenerations')].value\",\"columnid\":\"HyperVGenerations\"},{\"path\":\"capabilities[?(@.name=='vCPUsPerCore')].value\",\"columnid\":\"vCPUsPerCore\"}]}}]}",
+ "size": 0,
+ "title": "Get VM vCPU",
+ "exportParameterName": "ResourceSKU",
+ "showExportToExcel": true,
+ "queryType": 12,
+ "gridSettings": {
+ "rowLimit": 5000
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "API-Get_VMLinux_SKU"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| where isnull ((properties.['licenseType']))\r\n| extend LinuxId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.publisher), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n| order by type asc \r\n| project LinuxId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "LinuxAHUBDisabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| where isnotnull ((properties.['licenseType']))\r\n| extend LinuxId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.publisher), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n| order by type asc \r\n| project LinuxId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType",
+ "size": 0,
+ "title": "AHUB Enabled",
+ "noDataMessage": "All of your Linux VMs have AHUB enabled.",
+ "noDataMessageStyle": 3,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "LinuxAHUBRGEnabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBLinux = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets',\r\n iff(isnull((properties.['licenseType'])),\r\n \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Linux\"\r\n )\r\n| summarize count() by CheckAHUBLinux",
+ "size": 0,
+ "title": "Summary of Linux VMs with or without AHUB",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary of Linux VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resourcechanges\r\n| where properties.changeType == \"Update\" and properties.targetResourceType == \"microsoft.compute/virtualmachines\"\r\n| mv-expand changes = properties.changes\r\n| mv-expand LicenseChanges=changes.['properties.licenseType']\r\n| where isnotnull(LicenseChanges)\r\n| where tostring(LicenseChanges.newValue) has \"SLES_BYOS\" or tostring(LicenseChanges.newValue) has \"RHEL_BYOS\"\r\n| project VMID=properties.targetResourceId, NewLicense=tostring(LicenseChanges.newValue), DateofChange=tostring(properties.changeAttributes.timestamp)\r\n",
+ "size": 0,
+ "title": "Linux VM Latest Change Last 7 days",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Linux VM Latest Change Last 7 days"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxAHUBEnabled",
+ "label": "See Linux VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "439c7c8d-4119-4328-b4ca-2b1e676ede28",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxEnabledPast7D",
+ "label": "See Linux VMs enabled last 7 days",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "4c3ff9fa-d9c8-4d35-94d4-48ba3a1547fd",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxAHUBDisabled",
+ "label": "See Linux VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": []
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Linux VMs with Hybrid Benefit groupped by Subscription."
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 8"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\",\"mergeType\":\"inner\",\"leftTable\":\"LinuxAHUBRGEnabled\",\"rightTable\":\"API-Get_VMLinux_SKU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[LinuxAHUBRGEnabled].LinuxId\",\"mergedName\":\"VM ID\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBRGEnabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled].VMName\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[LinuxAHUBEnabled].VMSSize\"},{\"originalName\":\"[LinuxAHUBRGEnabled].VMName\"},{\"originalName\":\"[LinuxAHUBRGEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Linux VMs with AHUB",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux-VM+SKU+vCores-AHUB"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Linux VMs without Hybrid Benefit groupped by Subscription."
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 8 - Copy"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\",\"mergeType\":\"inner\",\"leftTable\":\"LinuxAHUBDisabled\",\"rightTable\":\"API-Get_VMLinux_SKU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[LinuxAHUBDisabled].LinuxId\",\"mergedName\":\"LinuxId\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VMLinux_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled].VMName\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[LinuxAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Linux VMs without AHUB",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux-VM+SKU+vCores-AHUBDisabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"Linux VM Latest Change Last 7 days\",\"rightTable\":\"Linux-VM+SKU+vCores-AHUB\",\"leftColumn\":\"VMID\",\"rightColumn\":\"VM ID\"}],\"projectRename\":[{\"originalName\":\"[Linux VM Latest Change Last 7 days].VMID\",\"mergedName\":\"VMID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VM ID\",\"mergedName\":\"VM ID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].VMID\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUs\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OSType\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OsVersion\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].LicenseType\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUsPerCore\"}]}",
+ "size": 0,
+ "title": "Linux Total Cores Enabled last 7 Days",
+ "noDataMessage": "There wasn't any Linux AHUB was enabled in the last 7 days.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "visualization": "table",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxEnabledPast7D",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux Total Cores Enabled last 7 Days"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "LinuxVM"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ }
+ ],
+ "name": "Linux"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "Linux Hybrid Benefit",
+ "loadType": "explicit",
+ "loadButtonText": "Load Linux Recommendations",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "## Linux Azure Hybrid Benefit (AHUB) Overview"
+ },
+ "name": "Linux Text"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| where isnotnull ((properties.['licenseType']))\r\n| extend LinuxId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.publisher), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n| order by type asc \r\n| project LinuxId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType",
+ "size": 0,
+ "title": "AHUB Enabled-Tag",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "LinuxAHUBEnabled-Tag"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| where isnull ((properties.['licenseType']))\r\n| extend LinuxId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.publisher), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']), VMSSize=tostring(sku.name)\r\n| order by type asc \r\n| project LinuxId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType",
+ "size": 0,
+ "title": "AHUB Disabled",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled.",
+ "noDataMessageStyle": 4,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "LinuxAHUBDisabled-Tag"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| extend LicenseType = tostring(properties.['licenseType'])\r\n| extend CheckAHUBLinux = case(\r\n type == 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets',\r\n iff(isnull((properties.['licenseType'])),\r\n \"AHUB Not Enabled\", \"AHUB Enabled\"),\r\n \"Not Linux\"\r\n )\r\n| summarize count() by CheckAHUBLinux",
+ "size": 0,
+ "title": "Summary of Linux VMs with or without AHUB",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ],
+ "visualization": "piechart"
+ },
+ "customWidth": "50",
+ "name": "Summary of Linux VMs with or without AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "resourcechanges\r\n| where properties.changeType == \"Update\" and properties.targetResourceType == \"microsoft.compute/virtualmachines\"\r\n| mv-expand changes = properties.changes\r\n| mv-expand LicenseChanges=changes.['properties.licenseType']\r\n| where isnotnull(LicenseChanges)\r\n| where tostring(LicenseChanges.newValue) has \"SLES_BYOS\" or tostring(LicenseChanges.newValue) has \"RHEL_BYOS\"\r\n| project VMID=properties.targetResourceId, NewLicense=tostring(LicenseChanges.newValue), DateofChange=tostring(properties.changeAttributes.timestamp)\r\n",
+ "size": 0,
+ "title": "Linux VM Latest Change Last 7 days",
+ "noDataMessage": "There wasn't any AHUB enabled in the last 7 days.",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "Linux VM Latest Change Last 7 days"
+ },
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxAHUBEnabled",
+ "label": "See Linux VMs with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "439c7c8d-4119-4328-b4ca-2b1e676ede28",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxEnabledPast7D",
+ "label": "See Linux VMs enabled last 7 days",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "4c3ff9fa-d9c8-4d35-94d4-48ba3a1547fd",
+ "version": "KqlParameterItem/1.0",
+ "name": "LinuxAHUBDisabled",
+ "label": "See Linux VMs without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": []
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Linux VMs with Hybrid Benefit groupped by Subscription."
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 8"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\",\"mergeType\":\"inner\",\"leftTable\":\"LinuxAHUBEnabled-Tag\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[LinuxAHUBEnabled-Tag].LinuxId\",\"mergedName\":\"LinuxId\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled].VMName\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[LinuxAHUBEnabled].VMSSize\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].VMName\"},{\"originalName\":\"[LinuxAHUBEnabled-Tag].VMSSize\"}]}",
+ "size": 0,
+ "title": "Linux VMs with AHUB",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux-VM+SKU+vCores-AHUB"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "List of Linux VMs without Hybrid Benefit groupped by Subscription."
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "text - 8 - Copy"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\",\"mergeType\":\"inner\",\"leftTable\":\"LinuxAHUBDisabled-Tag\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[LinuxAHUBDisabled-Tag].LinuxId\",\"mergedName\":\"LinuxId\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"8a27a7d8-5ea8-4408-ac20-2fc4e65ca095\"},{\"originalName\":\"[LinuxAHUBEnabled].VMName\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\"},{\"originalName\":\"[API-Get_VM_SKU].Name\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\"},{\"originalName\":\"[LinuxAHUBEnabled].VMSSize\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].VMName\"},{\"originalName\":\"[LinuxAHUBDisabled-Tag].VMSSize\"}]}",
+ "size": 0,
+ "title": "Linux VMs without AHUB",
+ "noDataMessage": "None of your Linux VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "xAxis": "VM Name",
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux-VM+SKU+vCores-AHUBDisabled"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26168\",\"mergeType\":\"inner\",\"leftTable\":\"Linux VM Latest Change Last 7 days\",\"rightTable\":\"Linux-VM+SKU+vCores-AHUB\",\"leftColumn\":\"VMID\",\"rightColumn\":\"LinuxId\"}],\"projectRename\":[{\"originalName\":\"[Linux VM Latest Change Last 7 days].VMID\",\"mergedName\":\"VMID\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].NewLicense\",\"mergedName\":\"NewLicense\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].DateofChange\",\"mergedName\":\"DateofChange\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].LinuxId\",\"mergedName\":\"LinuxId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26168\"},{\"originalName\":\"[Linux VM Latest Change Last 7 days].VMID\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUs\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OSType\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].OsVersion\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].LicenseType\"},{\"originalName\":\"[Linux-VM+SKU+vCores-AHUB].vCPUsPerCore\"}]}",
+ "size": 0,
+ "title": "Linux Total Cores Enabled last 7 Days",
+ "noDataMessage": "No AHUB has been enabled in the last 7 days.",
+ "showExportToExcel": true,
+ "queryType": 7,
+ "visualization": "table",
+ "tileSettings": {
+ "showBorder": false,
+ "titleContent": {
+ "columnMatch": "NewLicense",
+ "formatter": 1
+ },
+ "leftContent": {
+ "columnMatch": "vCPUs",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "auto"
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "maximumSignificantDigits": 3,
+ "maximumFractionDigits": 2
+ }
+ }
+ }
+ },
+ "chartSettings": {
+ "group": null,
+ "createOtherGroup": 0,
+ "seriesLabelSettings": [
+ {
+ "seriesName": "Consumed Cores per VM",
+ "color": "grayBlue"
+ }
+ ]
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "LinuxEnabledPast7D",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "Linux Total Cores Enabled last 7 Days"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "LinuxVM"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ }
+ ],
+ "name": "Linux - Tag "
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "VMSS",
+ "loadType": "explicit",
+ "loadButtonText": "Load VMSS Recommendations",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "## Windows Azure Hybrid Benefit (AHUB) Overview - VM Scale Set"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Each two-processor license or each set of 16-core licenses, either Datacenter or Standard editions, are entitled to two instances of up to 8 cores, or one instance of up to 16 cores.\r\n\r\nThe virtual machines (VMs) with less than 8 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 4"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows' or tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) !has 'Windows' and tostring(properties.virtualMachineProfile.['licenseType']) !has 'Windows'\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType), OsVersion = tostring(properties.virtualMachineProfile.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.virtualMachineProfile.licenseType), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "title": "VMSS-AHUB-Disabled",
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "VMSS-AHUB-Disabled-Tag"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where isnotempty(tags) and isnotnull(tags)\r\n| mvexpand tags\r\n| extend tagName = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagName])\r\n| where tagName has '{TagName}' and tagValue has '{TagValue}'\r\n| where type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows' and tostring(properties.virtualMachineProfile.licenseType) == \"Windows_Server\"\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType), OSVersion = tostring(properties.virtualMachineProfile.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.virtualMachineProfile.licenseType), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OSVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "VMSSAHUBEnabled-Tag"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"ARMEndpoint/1.0\",\"data\":null,\"headers\":[],\"method\":\"GET\",\"path\":\"/subscriptions/{SingleSubHidden}/providers/Microsoft.Compute/skus?$filter=location eq '{Location}'\",\"urlParams\":[{\"key\":\"api-version\",\"value\":\"2021-07-01\"}],\"batchDisabled\":false,\"transformers\":[{\"type\":\"jsonpath\",\"settings\":{\"tablePath\":\"$.*[?(@.resourceType=='virtualMachines')]\",\"columns\":[{\"path\":\"name\",\"columnid\":\"Name\"},{\"path\":\"capabilities[?(@.name=='vCPUs')].value\",\"columnid\":\"vCPUs\"},{\"path\":\"capabilities[?(@.name=='MemoryGB')].value\",\"columnid\":\"MemoryGB\"},{\"path\":\"capabilities[?(@.name=='MaxNetworkInterfaces')].value\",\"columnid\":\"MaxNetworkInterfaces\"},{\"path\":\"capabilities[?(@.name=='HyperVGenerations')].value\",\"columnid\":\"HyperVGenerations\"},{\"path\":\"capabilities[?(@.name=='vCPUsPerCore')].value\",\"columnid\":\"vCPUsPerCore\"}]}}]}",
+ "size": 0,
+ "title": "Get VM vCPU",
+ "exportParameterName": "ResourceSKU",
+ "showExportToExcel": true,
+ "queryType": 12,
+ "gridSettings": {
+ "rowLimit": 5000
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "true"
+ },
+ "name": "API-Get_VMSS_SKU"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of Windows licenses cores consumed by all Windows virtual machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 6"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable Windows Azure Hybrid Benefit\r\nNumber of cores required to enable AHUB across the entire environment.",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 7"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load VMSS Info",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-Tag\",\"rightTable\":\"API-Get_VMSS_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Cores NOT enabled per AHUB Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-Tag\",\"rightTable\":\"API-Get_VMSS_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per AHUB Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per AHUB Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26130\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-Tag\",\"rightTable\":\"API-Get_VMSS_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"ConsumedCores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per VMSS",
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "ConsumedCores",
+ "formatter": 0,
+ "formatOptions": {
+ "aggregation": "Sum"
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {},
+ "leftContent": {
+ "columnMatch": "ConsumedCores",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "blue"
+ }
+ },
+ "showBorder": false
+ },
+ "graphSettings": {
+ "type": 0
+ },
+ "chartSettings": {
+ "yAxis": [
+ "ConsumedCores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per VMSS"
+ }
+ ]
+ },
+ "name": "VMSS RG Overview"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load VMSS AHUB Details",
+ "items": [
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "VMSSAHUBEnabled",
+ "label": "See VMSS with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ },
+ "value": "Yes"
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "VMSSAHUBDisabled",
+ "label": "See VMSS without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "value": "Yes"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-Tag\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[VMSSAHUBEnabled-Tag].WindowsId\",\"mergedName\":\"VMSS Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"},{\"originalName\":\"[WindowsAHUBEnabled].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled].VMSize\"},{\"originalName\":\"[VMSSAHUBEnabled].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSize\"}]}",
+ "size": 0,
+ "title": "VMSS with AHUB",
+ "noDataMessage": "None of your VMSS have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "2",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ },
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Subscription Name",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "VMSSAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VMSS+SKU+vCores-AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSS-AHUB-Disabled-Tag\",\"rightTable\":\"API-Get_VMSS_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VMSS_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[VMSS-AHUB-Disabled].VMName\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMSize\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMName\"}]}",
+ "size": 0,
+ "title": "VMSS without AHUB",
+ "noDataMessage": "All of your VMSS have AHUB enabled",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "VMSSAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VMSS+SKU+vCores"
+ }
+ ]
+ },
+ "name": "VMSS RG Details"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "VMSS"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Tags"
+ }
+ ],
+ "name": "VMSS-Tag"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "title": "VMSS",
+ "items": [
+ {
+ "type": 1,
+ "content": {
+ "json": "## Windows Azure Hybrid Benefit (AHUB) Overview - VM Scale Set"
+ },
+ "name": "text - 3"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "Each two-processor license or each set of 16-core licenses, either Datacenter or Standard editions, are entitled to two instances of up to 8 cores, or one instance of up to 16 cores.\r\n\r\nThe virtual machines (VMs) with less than 8 cores are categorized as **Low Priority**, while those with 8 or more cores are classified as **High Priority**. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.",
+ "style": "info"
+ },
+ "name": "text - 4"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows' and tostring(properties.virtualMachineProfile.licenseType) == \"Windows_Server\"\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType), OSVersion = tostring(properties.virtualMachineProfile.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.virtualMachineProfile.licenseType), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OSVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "LoadVMSSTab",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "True"
+ }
+ ],
+ "name": "VMSSAHUBEnabled-RG"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name \r\n| join (\r\nresources \r\n| where resourceGroup in ({ResourceGroup})\r\n| where type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows' or tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) !has 'Windows' and tostring(properties.virtualMachineProfile.['licenseType']) !has 'Windows'\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType), OsVersion = tostring(properties.virtualMachineProfile.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.virtualMachineProfile.licenseType), VMSSize=tostring(sku.name)\r\n ) on subscriptionId \r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMSSize, VMLocation,OSType, OsVersion,LicenseType, subscriptionId",
+ "size": 0,
+ "queryType": 1,
+ "resourceType": "microsoft.resourcegraph/resources",
+ "crossComponentResources": [
+ "{Subscription}"
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "LoadVMSSTab",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ {
+ "parameterName": "AlwaysHidden",
+ "comparison": "isEqualTo",
+ "value": "True"
+ }
+ ],
+ "name": "VMSSAHUBDisabled-RG"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Consumed Licenses\r\nTotal number of Windows licenses cores consumed by all Windows virtual machines.\r\n",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 6"
+ },
+ {
+ "type": 1,
+ "content": {
+ "json": "### Number of required Cores to enable Windows Azure Hybrid Benefit\r\nNumber of cores required to enable AHUB across the entire environment.",
+ "style": "info"
+ },
+ "customWidth": "50",
+ "name": "text - 7"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "loadType": "explicit",
+ "loadButtonText": "Load VMSS Info",
+ "items": [
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-RG\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"unknown\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"unknown\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Cores not enabled per AHUB Priority",
+ "noDataMessage": "All of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ },
+ "chartSettings": {
+ "yAxis": [
+ "Consumed Cores per VM"
+ ],
+ "group": "Prioritize AHUB?",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Cores NOT enabled per AHUB Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-RG\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"High Priority\\\"\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"\\\"Low Priority\\\"\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\" ([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[WindowsAHUBEnabled].WindowsId\"},{\"originalName\":\"[WindowsAHUBEnabled].VMRG\"},{\"originalName\":\"[WindowsAHUBEnabled].VMLocation\"},{\"originalName\":\"[WindowsAHUBEnabled].OSType\"},{\"originalName\":\"[WindowsAHUBEnabled].OsVersion\"},{\"originalName\":\"[WindowsAHUBEnabled].LicenseType\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per AHUB Priority",
+ "noDataMessage": "None of your VMs have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per AHUB Priority"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"d8deb22b-a596-43ee-acc4-180849d26130\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-RG\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[Added column]\",\"mergedName\":\"ConsumedCores\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"d8deb22b-a596-43ee-acc4-180849d26130\"}]}",
+ "size": 0,
+ "title": "Consumed Cores per VMSS",
+ "showRefreshButton": true,
+ "queryType": 7,
+ "visualization": "piechart",
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "ConsumedCores",
+ "formatter": 0,
+ "formatOptions": {
+ "aggregation": "Sum"
+ }
+ }
+ ]
+ },
+ "tileSettings": {
+ "titleContent": {},
+ "leftContent": {
+ "columnMatch": "ConsumedCores",
+ "formatter": 12,
+ "formatOptions": {
+ "palette": "blue"
+ }
+ },
+ "showBorder": false
+ },
+ "graphSettings": {
+ "type": 0
+ },
+ "chartSettings": {
+ "yAxis": [
+ "ConsumedCores"
+ ],
+ "group": "VMName",
+ "createOtherGroup": null
+ }
+ },
+ "customWidth": "33",
+ "name": "Consumed Cores per VMSS"
+ }
+ ]
+ },
+ "name": "VMSS RG Overview"
+ },
+ {
+ "type": 12,
+ "content": {
+ "version": "NotebookGroup/1.0",
+ "groupType": "editable",
+ "items": [
+ {
+ "type": 9,
+ "content": {
+ "version": "KqlParameterItem/1.0",
+ "parameters": [
+ {
+ "id": "ae5e8765-47ef-46a6-803b-6b7124c098d2",
+ "version": "KqlParameterItem/1.0",
+ "name": "VMSSAHUBEnabled",
+ "label": "See VMSS with AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n",
+ "timeContext": {
+ "durationMs": 86400000
+ }
+ },
+ {
+ "id": "f1ac5e53-253c-4afb-8bc5-b1ba2efea3eb",
+ "version": "KqlParameterItem/1.0",
+ "name": "VMSSAHUBDisabled",
+ "label": "See VMSS without AHUB",
+ "type": 2,
+ "isRequired": true,
+ "typeSettings": {
+ "additionalResourceOptions": [],
+ "showDefault": false
+ },
+ "jsonData": "[\r\n {\"value\":\"Yes\"},\r\n {\"value\":\"No\", \"selected\":true}\r\n]\r\n\r\n"
+ }
+ ],
+ "style": "pills",
+ "queryType": 0,
+ "resourceType": "microsoft.operationalinsights/workspaces"
+ },
+ "name": "parameters - 13"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBEnabled-RG\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[WindowsAHUBEnabled].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[Added column]\",\"mergedName\":\"Consumed Cores per VM\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\"<=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"expression\",\"resultVal\":\"8\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"expression\",\"resultVal\":\"([\\\"vCPUs\\\"] + 7) & ~7\"}}]},{\"originalName\":\"[VMSSAHUBEnabled-RG].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].OSVersion\",\"mergedName\":\"OSVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBEnabled-RG].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[WindowsAHUBEnabled].VMSSize\"},{\"originalName\":\"[WindowsAHUBEnabled].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled].VMSize\"},{\"originalName\":\"[VMSSAHUBEnabled].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMName\"},{\"originalName\":\"[VMSSAHUBEnabled-Tag].VMSize\"}]}",
+ "size": 0,
+ "title": "VMSS with AHUB",
+ "noDataMessage": "None of your VMSS have AHUB enabled",
+ "noDataMessageStyle": 4,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "2",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ },
+ {
+ "columnMatch": "subscriptionId",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Subscription Name",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "VMSSAHUBEnabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VMSS+SKU+vCores-AHUB"
+ },
+ {
+ "type": 3,
+ "content": {
+ "version": "KqlItem/1.0",
+ "query": "{\"version\":\"Merge/1.0\",\"merges\":[{\"id\":\"50d79765-aad4-437e-a90b-8cc7865e7081\",\"mergeType\":\"inner\",\"leftTable\":\"VMSSAHUBDisabled-RG\",\"rightTable\":\"API-Get_VM_SKU\",\"leftColumn\":\"VMSSize\",\"rightColumn\":\"Name\"}],\"projectRename\":[{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[query - 0].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"unknown\"},{\"originalName\":\"[Added column]\",\"mergedName\":\"Prioritize AHUB?\",\"fromId\":null,\"isNewItem\":true,\"newItemData\":[{\"criteriaContext\":{\"leftOperand\":\"vCPUs\",\"operator\":\">=\",\"rightValType\":\"static\",\"rightVal\":\"8\",\"resultValType\":\"static\",\"resultVal\":\"High Priority\"}},{\"criteriaContext\":{\"operator\":\"Default\",\"rightValType\":\"column\",\"resultValType\":\"static\",\"resultVal\":\"Low Priority\"}}]},{\"originalName\":\"[VMSSAHUBDisabled-RG].WindowsId\",\"mergedName\":\"WindowsId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].VMName\",\"mergedName\":\"VMName\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].VMRG\",\"mergedName\":\"VMRG\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].VMSize\",\"mergedName\":\"VMSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].VMSSize\",\"mergedName\":\"VMSSize\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].VMLocation\",\"mergedName\":\"VMLocation\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].OSType\",\"mergedName\":\"OSType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].OsVersion\",\"mergedName\":\"OsVersion\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].LicenseType\",\"mergedName\":\"LicenseType\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[VMSSAHUBDisabled-RG].subscriptionId\",\"mergedName\":\"subscriptionId\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].Name\",\"mergedName\":\"Name\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUs\",\"mergedName\":\"vCPUs\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MemoryGB\",\"mergedName\":\"MemoryGB\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].MaxNetworkInterfaces\",\"mergedName\":\"MaxNetworkInterfaces\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].HyperVGenerations\",\"mergedName\":\"HyperVGenerations\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[API-Get_VM_SKU].vCPUsPerCore\",\"mergedName\":\"vCPUsPerCore\",\"fromId\":\"50d79765-aad4-437e-a90b-8cc7865e7081\"},{\"originalName\":\"[query - 0].VMName\"},{\"originalName\":\"[query - 0].VMSSize\"},{\"originalName\":\"[query - Get VM vCPU].Name\"},{\"originalName\":\"[query - Get VM vCPU].MemoryGB\"},{\"originalName\":\"[query - Get VM vCPU].MaxNetworkInterfaces\"},{\"originalName\":\"[query - Get VM vCPU].HyperVGenerations\"},{\"originalName\":\"[query - Get VM vCPU].vCPUsPerCore\"},{\"originalName\":\"[VMSS-AHUB-Disabled].VMName\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMSize\"},{\"originalName\":\"[VMSS-AHUB-Disabled-Tag].VMName\"}]}",
+ "size": 0,
+ "title": "VMSS without AHUB",
+ "noDataMessage": "All of your VMSS have AHUB enabled",
+ "noDataMessageStyle": 3,
+ "showExportToExcel": true,
+ "queryType": 7,
+ "gridSettings": {
+ "formatters": [
+ {
+ "columnMatch": "$gen_group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Group",
+ "formatter": 15,
+ "formatOptions": {
+ "linkTarget": null,
+ "showIcon": true
+ }
+ },
+ {
+ "columnMatch": "Prioritize AHUB?",
+ "formatter": 18,
+ "formatOptions": {
+ "thresholdsOptions": "icons",
+ "thresholdsGrid": [
+ {
+ "operator": "==",
+ "thresholdValue": "High Priority",
+ "representation": "Sev0",
+ "text": "{0}{1}"
+ },
+ {
+ "operator": "Default",
+ "thresholdValue": null,
+ "representation": "Sev4",
+ "text": "{0}{1}"
+ }
+ ]
+ },
+ "numberFormat": {
+ "unit": 17,
+ "options": {
+ "style": "decimal"
+ }
+ }
+ }
+ ],
+ "hierarchySettings": {
+ "treeType": 1,
+ "groupBy": [
+ "subscriptionId"
+ ],
+ "expandTopLevel": true
+ }
+ }
+ },
+ "conditionalVisibility": {
+ "parameterName": "VMSSAHUBDisabled",
+ "comparison": "isEqualTo",
+ "value": "Yes"
+ },
+ "name": "VMSS+SKU+vCores"
+ }
+ ]
+ },
+ "name": "VMSS RG Details"
+ }
+ ]
+ },
+ "conditionalVisibilities": [
+ {
+ "parameterName": "SelectedSubTab",
+ "comparison": "isEqualTo",
+ "value": "VMSS"
+ },
+ {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "VM"
+ },
+ {
+ "parameterName": "RG_Filter",
+ "comparison": "isEqualTo",
+ "value": "Resource Group"
+ }
+ ],
+ "name": "VMSS-RG"
+ }
+ ]
+ },
+ "conditionalVisibility": {
+ "parameterName": "SelectedTab",
+ "comparison": "isEqualTo",
+ "value": "AHUB"
+ },
+ "name": "AHUB Overview"
+ }
+ ],
+ "fallbackResourceIds": [
+ "Azure Monitor"
+ ],
+ "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
+}