diff --git a/samples/databases/northwind-pubs/instnwnd (Azure SQL Database).sql b/samples/databases/northwind-pubs/instnwnd (Azure SQL Database).sql index e4a045ca..f9121728 100644 --- a/samples/databases/northwind-pubs/instnwnd (Azure SQL Database).sql +++ b/samples/databases/northwind-pubs/instnwnd (Azure SQL Database).sql @@ -9056,4 +9056,295 @@ AS SELECT ProductName, UnitPrice=ROUND(Od.UnitPrice, 2), Quantity, - Discount=CONVERT(int, Discount * 100), \ No newline at end of file + Discount=CONVERT(int, Discount * 100), + ExtendedPrice=ROUND(CONVERT(money, Quantity * (1 - Discount) * Od.UnitPrice), 2) +FROM Products P, [Order Details] Od +WHERE Od.ProductID = P.ProductID and Od.OrderID = @OrderID +go + + +if exists (select * from sysobjects where id = object_id('dbo.CustOrdersOrders')) + drop procedure dbo.CustOrdersOrders +GO + +CREATE PROCEDURE CustOrdersOrders @CustomerID nchar(5) +AS +SELECT OrderID, + OrderDate, + RequiredDate, + ShippedDate +FROM Orders +WHERE CustomerID = @CustomerID +ORDER BY OrderID +GO + + +if exists (select * from sysobjects where id = object_id('dbo.CustOrderHist') and sysstat & 0xf = 4) + drop procedure dbo.CustOrderHist +GO +CREATE PROCEDURE CustOrderHist @CustomerID nchar(5) +AS +SELECT ProductName, Total=SUM(Quantity) +FROM Products P, [Order Details] OD, Orders O, Customers C +WHERE C.CustomerID = @CustomerID +AND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID +GROUP BY ProductName +GO + +if exists (select * from sysobjects where id = object_id('dbo.SalesByCategory') and sysstat & 0xf = 4) + drop procedure dbo.SalesByCategory +GO +CREATE PROCEDURE SalesByCategory + @CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998' +AS +IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998' +BEGIN + SELECT @OrdYear = '1998' +END + +SELECT ProductName, + TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0) +FROM [Order Details] OD, Orders O, Products P, Categories C +WHERE OD.OrderID = O.OrderID + AND OD.ProductID = P.ProductID + AND P.CategoryID = C.CategoryID + AND C.CategoryName = @CategoryName + AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear +GROUP BY ProductName +ORDER BY ProductName +GO + + +/* The follwing adds tables to the Northwind database */ + + +CREATE TABLE [dbo].[CustomerCustomerDemo] + ([CustomerID] nchar (5) NOT NULL, + [CustomerTypeID] [nchar] (10) NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[CustomerDemographics] + ([CustomerTypeID] [nchar] (10) NOT NULL , + [CustomerDesc] [ntext] NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[Region] + ( [RegionID] [int] NOT NULL , + [RegionDescription] [nchar] (50) NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[Territories] + ([TerritoryID] [nvarchar] (20) NOT NULL , + [TerritoryDescription] [nchar] (50) NOT NULL , + [RegionID] [int] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[EmployeeTerritories] + ([EmployeeID] [int] NOT NULL, + [TerritoryID] [nvarchar] (20) NOT NULL +) ON [PRIMARY] + +-- The following adds data to the tables just created. + +Insert Into Region Values (1,'Eastern') +Insert Into Region Values (2,'Western') +Insert Into Region Values (3,'Northern') +Insert Into Region Values (4,'Southern') +Go + +Insert Into Territories Values ('01581','Westboro',1) +Insert Into Territories Values ('01730','Bedford',1) +Insert Into Territories Values ('01833','Georgetow',1) +Insert Into Territories Values ('02116','Boston',1) +Insert Into Territories Values ('02139','Cambridge',1) +Insert Into Territories Values ('02184','Braintree',1) +Insert Into Territories Values ('02903','Providence',1) +Insert Into Territories Values ('03049','Hollis',3) +Insert Into Territories Values ('03801','Portsmouth',3) +Insert Into Territories Values ('06897','Wilton',1) +Insert Into Territories Values ('07960','Morristown',1) +Insert Into Territories Values ('08837','Edison',1) +Insert Into Territories Values ('10019','New York',1) +Insert Into Territories Values ('10038','New York',1) +Insert Into Territories Values ('11747','Mellvile',1) +Insert Into Territories Values ('14450','Fairport',1) +Insert Into Territories Values ('19428','Philadelphia',3) +Insert Into Territories Values ('19713','Neward',1) +Insert Into Territories Values ('20852','Rockville',1) +Insert Into Territories Values ('27403','Greensboro',1) +Insert Into Territories Values ('27511','Cary',1) +Insert Into Territories Values ('29202','Columbia',4) +Insert Into Territories Values ('30346','Atlanta',4) +Insert Into Territories Values ('31406','Savannah',4) +Insert Into Territories Values ('32859','Orlando',4) +Insert Into Territories Values ('33607','Tampa',4) +Insert Into Territories Values ('40222','Louisville',1) +Insert Into Territories Values ('44122','Beachwood',3) +Insert Into Territories Values ('45839','Findlay',3) +Insert Into Territories Values ('48075','Southfield',3) +Insert Into Territories Values ('48084','Troy',3) +Insert Into Territories Values ('48304','Bloomfield Hills',3) +Insert Into Territories Values ('53404','Racine',3) +Insert Into Territories Values ('55113','Roseville',3) +Insert Into Territories Values ('55439','Minneapolis',3) +Insert Into Territories Values ('60179','Hoffman Estates',2) +Insert Into Territories Values ('60601','Chicago',2) +Insert Into Territories Values ('72716','Bentonville',4) +Insert Into Territories Values ('75234','Dallas',4) +Insert Into Territories Values ('78759','Austin',4) +Insert Into Territories Values ('80202','Denver',2) +Insert Into Territories Values ('80909','Colorado Springs',2) +Insert Into Territories Values ('85014','Phoenix',2) +Insert Into Territories Values ('85251','Scottsdale',2) +Insert Into Territories Values ('90405','Santa Monica',2) +Insert Into Territories Values ('94025','Menlo Park',2) +Insert Into Territories Values ('94105','San Francisco',2) +Insert Into Territories Values ('95008','Campbell',2) +Insert Into Territories Values ('95054','Santa Clara',2) +Insert Into Territories Values ('95060','Santa Cruz',2) +Insert Into Territories Values ('98004','Bellevue',2) +Insert Into Territories Values ('98052','Redmond',2) +Insert Into Territories Values ('98104','Seattle',2) +Go + +Insert Into EmployeeTerritories Values (1,'06897') +Insert Into EmployeeTerritories Values (1,'19713') +Insert Into EmployeeTerritories Values (2,'01581') +Insert Into EmployeeTerritories Values (2,'01730') +Insert Into EmployeeTerritories Values (2,'01833') +Insert Into EmployeeTerritories Values (2,'02116') +Insert Into EmployeeTerritories Values (2,'02139') +Insert Into EmployeeTerritories Values (2,'02184') +Insert Into EmployeeTerritories Values (2,'40222') +Insert Into EmployeeTerritories Values (3,'30346') +Insert Into EmployeeTerritories Values (3,'31406') +Insert Into EmployeeTerritories Values (3,'32859') +Insert Into EmployeeTerritories Values (3,'33607') +Insert Into EmployeeTerritories Values (4,'20852') +Insert Into EmployeeTerritories Values (4,'27403') +Insert Into EmployeeTerritories Values (4,'27511') +Insert Into EmployeeTerritories Values (5,'02903') +Insert Into EmployeeTerritories Values (5,'07960') +Insert Into EmployeeTerritories Values (5,'08837') +Insert Into EmployeeTerritories Values (5,'10019') +Insert Into EmployeeTerritories Values (5,'10038') +Insert Into EmployeeTerritories Values (5,'11747') +Insert Into EmployeeTerritories Values (5,'14450') +Insert Into EmployeeTerritories Values (6,'85014') +Insert Into EmployeeTerritories Values (6,'85251') +Insert Into EmployeeTerritories Values (6,'98004') +Insert Into EmployeeTerritories Values (6,'98052') +Insert Into EmployeeTerritories Values (6,'98104') +Insert Into EmployeeTerritories Values (7,'60179') +Insert Into EmployeeTerritories Values (7,'60601') +Insert Into EmployeeTerritories Values (7,'80202') +Insert Into EmployeeTerritories Values (7,'80909') +Insert Into EmployeeTerritories Values (7,'90405') +Insert Into EmployeeTerritories Values (7,'94025') +Insert Into EmployeeTerritories Values (7,'94105') +Insert Into EmployeeTerritories Values (7,'95008') +Insert Into EmployeeTerritories Values (7,'95054') +Insert Into EmployeeTerritories Values (7,'95060') +Insert Into EmployeeTerritories Values (8,'19428') +Insert Into EmployeeTerritories Values (8,'44122') +Insert Into EmployeeTerritories Values (8,'45839') +Insert Into EmployeeTerritories Values (8,'53404') +Insert Into EmployeeTerritories Values (9,'03049') +Insert Into EmployeeTerritories Values (9,'03801') +Insert Into EmployeeTerritories Values (9,'48075') +Insert Into EmployeeTerritories Values (9,'48084') +Insert Into EmployeeTerritories Values (9,'48304') +Insert Into EmployeeTerritories Values (9,'55113') +Insert Into EmployeeTerritories Values (9,'55439') +GO + + + +-- The following adds constraints to the Northwind database + +ALTER TABLE CustomerCustomerDemo + ADD CONSTRAINT [PK_CustomerCustomerDemo] PRIMARY KEY NONCLUSTERED + ( + [CustomerID], + [CustomerTypeID] + ) ON [PRIMARY] +GO + +ALTER TABLE CustomerDemographics + ADD CONSTRAINT [PK_CustomerDemographics] PRIMARY KEY NONCLUSTERED + ( + [CustomerTypeID] + ) ON [PRIMARY] +GO + +ALTER TABLE CustomerCustomerDemo + ADD CONSTRAINT [FK_CustomerCustomerDemo] FOREIGN KEY + ( + [CustomerTypeID] + ) REFERENCES [dbo].[CustomerDemographics] ( + [CustomerTypeID] + ) +GO + +ALTER TABLE CustomerCustomerDemo + ADD CONSTRAINT [FK_CustomerCustomerDemo_Customers] FOREIGN KEY + ( + [CustomerID] + ) REFERENCES [dbo].[Customers] ( + [CustomerID] + ) +GO + +ALTER TABLE Region + ADD CONSTRAINT [PK_Region] PRIMARY KEY NONCLUSTERED + ( + [RegionID] + ) ON [PRIMARY] +GO + +ALTER TABLE Territories + ADD CONSTRAINT [PK_Territories] PRIMARY KEY NONCLUSTERED + ( + [TerritoryID] + ) ON [PRIMARY] +GO + +ALTER TABLE Territories + ADD CONSTRAINT [FK_Territories_Region] FOREIGN KEY + ( + [RegionID] + ) REFERENCES [dbo].[Region] ( + [RegionID] + ) +GO + +ALTER TABLE EmployeeTerritories + ADD CONSTRAINT [PK_EmployeeTerritories] PRIMARY KEY NONCLUSTERED + ( + [EmployeeID], + [TerritoryID] + ) ON [PRIMARY] +GO + +ALTER TABLE EmployeeTerritories + ADD CONSTRAINT [FK_EmployeeTerritories_Employees] FOREIGN KEY + ( + [EmployeeID] + ) REFERENCES [dbo].[Employees] ( + [EmployeeID] + ) +GO + + +ALTER TABLE EmployeeTerritories + ADD CONSTRAINT [FK_EmployeeTerritories_Territories] FOREIGN KEY + ( + [TerritoryID] + ) REFERENCES [dbo].[Territories] ( + [TerritoryID] + ) +GO diff --git a/samples/databases/northwind-pubs/instnwnd.sql b/samples/databases/northwind-pubs/instnwnd.sql index 971368fd..ae61e563 100644 Binary files a/samples/databases/northwind-pubs/instnwnd.sql and b/samples/databases/northwind-pubs/instnwnd.sql differ diff --git a/samples/databases/wide-world-importers/wwi-app/wwwroot/lib/webcomponentsjs/package-lock.json b/samples/databases/wide-world-importers/wwi-app/wwwroot/lib/webcomponentsjs/package-lock.json index 36f4f2d1..991dfcbe 100644 --- a/samples/databases/wide-world-importers/wwi-app/wwwroot/lib/webcomponentsjs/package-lock.json +++ b/samples/databases/wide-world-importers/wwi-app/wwwroot/lib/webcomponentsjs/package-lock.json @@ -11774,9 +11774,9 @@ } }, "socket.io-parser": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.2.tgz", - "integrity": "sha512-QFZBaZDNqZXeemwejc7D39jrq2eGK/qZuVDiMPKzZK1hLlNvjGilGt4ckfQZeVX4dGmuPzCytN9ZW1nQlEWjgA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.3.tgz", + "integrity": "sha512-1rE4dZN3kCI/E5wixd393hmbqa78vVpkKmnEJhLeWoS/C5hbFYAbcSfnWoaVH43u9ToUVtzKjguxEZq+1XZfCQ==", "dev": true, "requires": { "component-emitter": "1.2.1", diff --git a/samples/features/azure-arc/dashboard/README.md b/samples/features/azure-arc/dashboard/README.md new file mode 100644 index 00000000..fac2d7e3 --- /dev/null +++ b/samples/features/azure-arc/dashboard/README.md @@ -0,0 +1,20 @@ +![](../media/solutions-microsoft-logo-small.png) + +# How to Enable Azure Dashboard for ARC SQL +This article will show you how to use the [SQL Server Instances.json](SQL%20Server%20Instances.json) file to create a custom dashboard in the [Azure portal](https://learn.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards). + +![](./img/Dashboard.png) + +### Steps to Follow + +1. Log in to [Azure Portal](https://portal.azure.com/) +2. Click on **Dashboard** from the Azure Portal menu. You may already see the dashboard view by default. +![](https://learn.microsoft.com/en-us/azure/azure-portal/media/azure-portal-dashboards/portal-menu-dashboard.png) +3. Choose **Upload**. +![](https://learn.microsoft.com/en-us/azure/azure-portal/media/azure-portal-dashboards/create-new-dashboard.png) +4. If you want to edit the dashboard, please refer to this [link](https://learn.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards#edit-a-dashboard). + + + +## Disclaimers +The code included in this sample is not intended to be a set of best practices on how to build scalable enterprise grade applications. This is beyond the scope of this quick start sample. diff --git a/samples/features/azure-arc/dashboard/SQL Server Instances.json b/samples/features/azure-arc/dashboard/SQL Server Instances.json new file mode 100644 index 00000000..dbd4e446 --- /dev/null +++ b/samples/features/azure-arc/dashboard/SQL Server Instances.json @@ -0,0 +1,717 @@ +{ + "properties": { + "lenses": { + "0": { + "order": 0, + "parts": { + "0": { + "position": { + "x": 0, + "y": 0, + "colSpan": 3, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\"\n| summarize Servers=count()\n", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile", + "settings": {}, + "partHeader": { + "title": "Number of Servers", + "subtitle": "" + } + } + }, + "1": { + "position": { + "x": 3, + "y": 0, + "colSpan": 6, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\"\n| summarize ResourceCount=count() by iff( type==\"microsoft.sql/managedinstances\",\"Azure SQL Manage Instance\"\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))\n", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Sql Server Type Distributions", + "subtitle": "" + } + } + }, + "2": { + "position": { + "x": 9, + "y": 0, + "colSpan": 3, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\"\n| count ", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile", + "settings": {}, + "partHeader": { + "title": "Number of Databases", + "subtitle": "" + } + } + }, + "3": { + "position": { + "x": 12, + "y": 0, + "colSpan": 7, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "// top ten resource types by number of resources\n// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\"\n| summarize ResourceCount=count() by iff( type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance/databases\"\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Databases per Type", + "subtitle": "" + } + } + }, + "4": { + "position": { + "x": 0, + "y": 5, + "colSpan": 19, + "rowSpan": 4 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "resources\r\n| where type == \"microsoft.sql/managedinstances/databases\" or \r\n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \r\n type == \"microsoft.sql/servers/databases\"\r\n| summarize Dbs=count(),Offline=sum(toint(iif(tostring(properties[\"state\"])!=\"Online\",1,0)))\r\n,SizeMB=sum(toint(iif(tostring(properties[\"sizeMB\"])!=\"\",properties[\"sizeMB\"],0)))\r\n,Type=max(iff( type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance\"\r\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers/databases\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))) by Instances = tostring(split(tostring(id),\"/\")[8])\r\n| order by Offline", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", + "settings": {}, + "partHeader": { + "title": "Dbs per Servers", + "subtitle": "" + } + } + }, + "5": { + "position": { + "x": 0, + "y": 9, + "colSpan": 6, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 2", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "// If distinct count is small (e.g. < 1000)\n// run next query to get count of each value\nresources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sqlvirtualmachine/sqlvirtualmachines\"\n| summarize Count=count() by iif(type==\"microsoft.azurearcdata/sqlserverinstances\"\n,tostring(properties['edition'])\n, iif(type==\"microsoft.sql/managedinstances\", tostring(sku['tier'])\n,tostring(properties['sqlImageSku'])))\n| order by Count desc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Servers per SQL Server Editions", + "subtitle": "" + } + } + }, + "6": { + "position": { + "x": 6, + "y": 9, + "colSpan": 7, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| summarize Count=sum(toint(properties['vCore'])) by tostring(properties['edition'])\r\n| order by Count desc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Cores Per Editions", + "subtitle": "" + } + } + }, + "7": { + "position": { + "x": 13, + "y": 9, + "colSpan": 6, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 2", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "// If distinct count is small (e.g. < 1000)\n// run next query to get count of each value\nresources\n| where type == \"microsoft.azurearcdata/sqlserverinstances/databases\"\n|summarize Count=count() by tostring(properties['compatibilityLevel'])\n| order by Count desc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Compatibility Mode", + "subtitle": "" + } + } + }, + "8": { + "position": { + "x": 0, + "y": 15, + "colSpan": 6, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 2", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\n| summarize Count=count() by iff(tostring(properties['azureDefenderStatus'])==\"Unknown\", \"Not Protected\",tostring(properties['azureDefenderStatus']))\n| order by Count desc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Defender for SQL", + "subtitle": "" + } + } + }, + "9": { + "position": { + "x": 6, + "y": 15, + "colSpan": 6, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where ['type'] ==\"microsoft.azurearcdata/sqlserverinstances/databases\"\n| summarize Count=count() by Encrypte=iif(tostring(properties['databaseOptions'].isEncrypted)==\"false\",\"No\", \"Yes\")", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Encrypted", + "subtitle": "" + } + } + }, + "10": { + "position": { + "x": 12, + "y": 15, + "colSpan": 7, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\n| summarize Count=count() by tostring(properties['version'])", + "isOptional": true + }, + { + "name": "chartType", + "value": 1, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "SQL Server Versions", + "subtitle": "" + } + } + }, + "11": { + "position": { + "x": 0, + "y": 21, + "colSpan": 6, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where type == \"microsoft.azurearcdata/sqlserverinstances/databases\"\n| where name != \"tempdb\"\n| extend prop_db=parse_xml(properties) \n| extend prop_db_recoveryMode = prop_db.recoveryMode\n| extend prop_db_databaseCreationDate = todatetime(prop_db.databaseCreationDate)\n| extend prop_db_backupInformation = prop_db.backupInformation\n| extend prop_db_backupInformation_lastFullBackup = todatetime(prop_db.backupInformation.lastFullBackup)\n| extend calc_lastBackupAgeDays = iff(isnull(prop_db_backupInformation_lastFullBackup),\n datetime_diff('Day',now(),prop_db_databaseCreationDate),\n datetime_diff('Day',now(),prop_db_backupInformation_lastFullBackup)\n )\n| extend Backup_1day = iif( calc_lastBackupAgeDays <=1 , 1 , 0)\n| extend Backup_7day = iif( calc_lastBackupAgeDays >1 and calc_lastBackupAgeDays <=7 , 1 , 0)\n| extend Backup_over7day = iif( calc_lastBackupAgeDays >7 , 1 , 0)\n| extend Backup_desc = case(\n isnull(prop_db_backupInformation_lastFullBackup), \"no backups at all\", \n datetime_diff('Day',now(),prop_db_backupInformation_lastFullBackup) <= 1, \"1 day\", \n datetime_diff('Day',now(),prop_db_backupInformation_lastFullBackup) <= 7, \"7 days\", \n datetime_diff('Day',now(),prop_db_backupInformation_lastFullBackup) <= 30, \"1 Month\", \n \"older than a month\")\n| project database_name = name, RecoveryModel = prop_db_recoveryMode, Last_Full_Backup = prop_db_backupInformation_lastFullBackup , Backup_Age_Days = calc_lastBackupAgeDays ,Backup_1day ,Backup_7day ,Backup_over7day, Backup_desc\n| summarize Count=count() by Backup_desc", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "SQL Server Backups Intervals", + "subtitle": "" + } + } + }, + "12": { + "position": { + "x": 6, + "y": 21, + "colSpan": 6, + "rowSpan": 5 + }, + "metadata": { + "inputs": [ + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\n| where type == \"microsoft.azurearcdata/sqlserverinstances/databases\"\n| where name != \"tempdb\"\n| where name != \"model\"\n| where name != \"master\"\n| where name != \"msdb\"\n| extend prop_db=parse_xml(properties) \n| extend Recovery_Model = prop_db.recoveryMode\n| summarize Count = count() by tostring(Recovery_Model)", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "SQL Server Recovery Mode", + "subtitle": "" + } + } + } + } + } + }, + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } + }, + "name": "SQL Server Instances", + "type": "Microsoft.Portal/dashboards", + "location": "INSERT LOCATION", + "tags": { + "hidden-title": "SQL Server Instances" + }, + "apiVersion": "2015-08-01-preview" +} \ No newline at end of file diff --git a/samples/features/azure-arc/dashboard/img/Dashboard.png b/samples/features/azure-arc/dashboard/img/Dashboard.png new file mode 100644 index 00000000..152b835f Binary files /dev/null and b/samples/features/azure-arc/dashboard/img/Dashboard.png differ diff --git a/samples/features/reporting-services/ssrs-migration-rss/ssrs_migration.rss b/samples/features/reporting-services/ssrs-migration-rss/ssrs_migration.rss index 5c100cb2..49cb0d63 100644 --- a/samples/features/reporting-services/ssrs-migration-rss/ssrs_migration.rss +++ b/samples/features/reporting-services/ssrs-migration-rss/ssrs_migration.rss @@ -223,7 +223,16 @@ Sub Main() Console.ReadLine() - + ' Create destination folder if not present + Try + RsSnk.CreateFolder(SnkFolder.Substring(1), "/", Nothing) + Catch ex As Exception + If (ex.Message.Contains("Microsoft.ReportingServices.Diagnostics.Utilities.ItemAlreadyExistsException")) + Console.WriteLine("Folder already exists.") + Else + Console.WriteLine(ex.Message + Environment.NewLine) + End If + End Try Try 'Roles & Policies @@ -604,7 +613,7 @@ Sub RelinkItemReferences(snkItem As CatalogItem, srcItem As CatalogItem) Dim type As String = RsSrc.GetItemType(srcRef.Reference) Dim snkRef As ItemReference = New ItemReference snkRef.Name = srcRef.Name - snkRef.Reference = GetSnkFilename(GetSnkPath(srcRef.Reference), type) + snkRef.Reference = GetSnkFilename(GetSnkPathRef(srcRef.Reference), type) snkReferences.Add(snkRef) Next @@ -923,6 +932,12 @@ End Sub '''''''''''''' Helper Functions ''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''' +'Helper function to link snk reference with relative paths +Function GetSnkPathRef(srcPath As String) As String + Dim snkPath = srcPath.Remove(0, srcSiteUrl.LastIndexOf("/")) + Return snkPath +End Function + 'Helper function to construct correctly formatted path Function GetSnkPath(srcPath As String) As String If Not SrcIsNative Then diff --git a/samples/features/security/always-encrypted-with-secure-enclaves/src/ContosoClinic/packages.config b/samples/features/security/always-encrypted-with-secure-enclaves/src/ContosoClinic/packages.config index 07995626..6d06075c 100644 --- a/samples/features/security/always-encrypted-with-secure-enclaves/src/ContosoClinic/packages.config +++ b/samples/features/security/always-encrypted-with-secure-enclaves/src/ContosoClinic/packages.config @@ -1,10 +1,10 @@ - + - - + + diff --git a/samples/features/security/contoso-clinic/src/ContosoClinic/packages.config b/samples/features/security/contoso-clinic/src/ContosoClinic/packages.config index 3ffd574c..3556c0ed 100644 --- a/samples/features/security/contoso-clinic/src/ContosoClinic/packages.config +++ b/samples/features/security/contoso-clinic/src/ContosoClinic/packages.config @@ -1,10 +1,10 @@ - + - - + + diff --git a/samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/requirements.txt b/samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/requirements.txt index 5175f90e..f16f9f00 100644 --- a/samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/requirements.txt +++ b/samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/requirements.txt @@ -1,6 +1,6 @@ pycrypto==2.6.1 pycryptodome==3.10.1 -cryptography==39.0.1 +cryptography==41.0.0 hvac==0.10.11 azure-identity==1.6.0 azure-keyvault-keys==4.3.1 diff --git a/samples/manage/azure-sql-db-elastic-pools-custom-dashboard/Contoso ShopKeeper/MonitoringWebApp/packages.config b/samples/manage/azure-sql-db-elastic-pools-custom-dashboard/Contoso ShopKeeper/MonitoringWebApp/packages.config index d817bdb4..7e9488bf 100644 --- a/samples/manage/azure-sql-db-elastic-pools-custom-dashboard/Contoso ShopKeeper/MonitoringWebApp/packages.config +++ b/samples/manage/azure-sql-db-elastic-pools-custom-dashboard/Contoso ShopKeeper/MonitoringWebApp/packages.config @@ -1,11 +1,11 @@ - + - - + +