Skip to content

Commit 58c0dd0

Browse files
committed
Update help files
1 parent a95dde1 commit 58c0dd0

7 files changed

+103
-28
lines changed

src/Sql/Sql/DataClassification/Cmdlet/GetAzSqlDatabaseSensitivityClassification.cs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,12 @@ protected override SqlDatabaseSensitivityClassificationModel GetEntity()
130130
{
131131
new SensitivityLabel
132132
{
133-
SchemaName = "schema1",
134-
TableName = "table1",
135-
ColumnName = "column1",
136-
LabelName = "label1",
137-
InformationType = "informationType1"
138-
},
139-
new SensitivityLabel
140-
{
141-
SchemaName = "schema2",
142-
TableName = "table2",
143-
ColumnName = "column2",
144-
LabelName = "label2",
145-
InformationType = null
146-
},
147-
new SensitivityLabel
148-
{
149-
SchemaName = "schema3",
150-
TableName = "table3",
151-
ColumnName = "column3",
152-
LabelName = "label3",
153-
InformationType = null
154-
},
133+
SchemaName = "schema",
134+
TableName = "table",
135+
ColumnName = "column",
136+
LabelName = "label",
137+
InformationType = "informationType"
138+
}
155139
}
156140
};
157141

@@ -160,7 +144,7 @@ protected override SqlDatabaseSensitivityClassificationModel GetEntity()
160144

161145
protected override DataClassificationAdapter InitModelAdapter()
162146
{
163-
throw new NotImplementedException();
147+
return new DataClassificationAdapter(DefaultProfile.DefaultContext);
164148
}
165149
}
166150
}

src/Sql/Sql/DataClassification/Cmdlet/GetAzSqlDatabaseSensitivityRecommendations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected override SqlDatabaseSensitivityClassificationModel GetEntity()
9898

9999
protected override DataClassificationAdapter InitModelAdapter()
100100
{
101-
return new DataClassificationAdapter();
101+
return new DataClassificationAdapter(DefaultProfile.DefaultContext);
102102
}
103103
}
104104
}

src/Sql/Sql/DataClassification/Cmdlet/GetAzSqlInstanceDatabaseSensitivityRecommendations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected override ManagedDatabaseSensitivityClassificationModel GetEntity()
7070

7171
protected override DataClassificationAdapter InitModelAdapter()
7272
{
73-
return new DataClassificationAdapter();
73+
return new DataClassificationAdapter(DefaultProfile.DefaultContext);
7474
}
7575
}
7676
}

src/Sql/Sql/DataClassification/Cmdlet/SetAzSqlDatabaseSensitivityClassification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected override SqlDatabaseSensitivityClassificationModel GetEntity()
125125

126126
protected override DataClassificationAdapter InitModelAdapter()
127127
{
128-
return new DataClassificationAdapter();
128+
return new DataClassificationAdapter(DefaultProfile.DefaultContext);
129129
}
130130
}
131131
}

src/Sql/Sql/DataClassification/Model/SensitivityLabel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ public override string ToString()
2828
{
2929
string name = property.Name;
3030
object value = property.GetValue(this);
31-
builder.AppendLine($"\t{name}: {value},");
31+
if (value != null)
32+
{
33+
builder.AppendLine($"\t{name}: {value},");
34+
}
3235
}
3336
builder.Append("}");
3437

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Text;
4+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
45

56
namespace Microsoft.Azure.Commands.Sql.DataClassification.Services
67
{
78
public class DataClassificationAdapter
89
{
10+
private readonly IAzureContext context;
11+
12+
public DataClassificationAdapter(IAzureContext context)
13+
{
14+
this.context = context;
15+
}
916
}
1017
}

src/Sql/Sql/help/Get-AzSqlDatabaseSensitivityClassification.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,87 @@ The Get-AzSqlDatabaseSensitivityClassification cmdlet returns the current sensit
4444

4545
## EXAMPLES
4646

47+
### Example 1: Get current sensitivity classification of an Azure SQL database.
48+
```powershell
49+
PS C:\> Get-AzSqlDatabaseSensitivityClassification -ResourceGroupName resourceGroup -ServerName server -DatabaseName database
50+
51+
ResourceGroupName : resourceGroup
52+
ServerName : server
53+
DatabaseName : database
54+
SensitivityLabels : {{
55+
SchemaName: schema1,
56+
TableName: table1,
57+
ColumnName: column1,
58+
LabelName: label1,
59+
InformationType: informationType1,
60+
}, {
61+
SchemaName: schema2,
62+
TableName: table2,
63+
ColumnName: column2,
64+
LabelName: label2,
65+
}, {
66+
SchemaName: schema3,
67+
TableName: table3,
68+
ColumnName: column3,
69+
LabelName: label3,
70+
}}
71+
```
72+
### Example 2: Get current sensitivity classification of an Azure SQL database.
73+
```powershell
74+
PS C:\> Get-AzSqlDatabase -ResourceGroupName resourceGroup -ServerName server -DatabaseName database | Get-AzSqlDatabaseSensitivityClassification
75+
76+
ResourceGroupName : resourceGroup
77+
ServerName : server
78+
DatabaseName : database
79+
SensitivityLabels : {{
80+
SchemaName: schema1,
81+
TableName: table1,
82+
ColumnName: column1,
83+
LabelName: label1,
84+
InformationType: informationType1,
85+
}, {
86+
SchemaName: schema2,
87+
TableName: table2,
88+
ColumnName: column2,
89+
LabelName: label2,
90+
}, {
91+
SchemaName: schema3,
92+
TableName: table3,
93+
ColumnName: column3,
94+
LabelName: label3,
95+
}}
96+
```
97+
### Example 3: Get current sensitivity classification of a specific column of an Azure SQL database.
98+
```powershell
99+
PS C:\> Get-AzSqlDatabaseSensitivityClassification -ResourceGroupName resourceGroup -ServerName server -DatabaseName database -SchemaName schema -TableName table -ColumnName column
100+
101+
ResourceGroupName : resourceGroup
102+
ServerName : server
103+
DatabaseName : database
104+
SensitivityLabels : {{
105+
SchemaName: schema,
106+
TableName: table,
107+
ColumnName: column,
108+
LabelName: label,
109+
InformationType: informationType,
110+
}}
111+
```
112+
### Example 4: Get current sensitivity classification of a specific column of an Azure SQL database.
113+
```powershell
114+
PS C:\> Get-AzSqlDatabase -ResourceGroupName resourceGroup -ServerName server -DatabaseName database | Get-AzSqlDatabaseSensitivityClassification -SchemaName schema -TableName table -ColumnName column
115+
116+
ResourceGroupName : resourceGroup
117+
ServerName : server
118+
DatabaseName : database
119+
SensitivityLabels : {{
120+
SchemaName: schema,
121+
TableName: table,
122+
ColumnName: column,
123+
LabelName: label,
124+
InformationType: informationType,
125+
}}
126+
```
127+
47128
## PARAMETERS
48129

49130
### -AsJob
@@ -107,7 +188,7 @@ Accept wildcard characters: False
107188
```
108189
109190
### -InputObject
110-
An object representing a SQL Database Sensitivity Classification
191+
The SQL database object.
111192
112193
```yaml
113194
Type: Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel

0 commit comments

Comments
 (0)