-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SqlServerDevOpsAuditingSettingData.cs
139 lines (132 loc) · 8.65 KB
/
SqlServerDevOpsAuditingSettingData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
namespace Azure.ResourceManager.Sql
{
/// <summary>
/// A class representing the SqlServerDevOpsAuditingSetting data model.
/// A server DevOps auditing settings.
/// </summary>
public partial class SqlServerDevOpsAuditingSettingData : ResourceData
{
/// <summary>
/// Keeps track of any properties unknown to the library.
/// <para>
/// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
/// </para>
/// <para>
/// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>.
/// </para>
/// <para>
/// Examples:
/// <list type="bullet">
/// <item>
/// <term>BinaryData.FromObjectAsJson("foo")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("\"foo\"")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// </list>
/// </para>
/// </summary>
private IDictionary<string, BinaryData> _serializedAdditionalRawData;
/// <summary> Initializes a new instance of <see cref="SqlServerDevOpsAuditingSettingData"/>. </summary>
public SqlServerDevOpsAuditingSettingData()
{
}
/// <summary> Initializes a new instance of <see cref="SqlServerDevOpsAuditingSettingData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="isAzureMonitorTargetEnabled">
/// Specifies whether DevOps audit events are sent to Azure Monitor.
/// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
///
/// When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should be also created.
///
/// Diagnostic Settings URI format:
/// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
///
/// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
/// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
///
/// </param>
/// <param name="isManagedIdentityInUse"> Specifies whether Managed Identity is used to access blob storage. </param>
/// <param name="state"> Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. </param>
/// <param name="storageEndpoint"> Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. </param>
/// <param name="storageAccountAccessKey">
/// Specifies the identifier key of the auditing storage account.
/// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
/// Prerequisites for using managed identity authentication:
/// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
/// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
/// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
/// </param>
/// <param name="storageAccountSubscriptionId"> Specifies the blob storage subscription Id. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal SqlServerDevOpsAuditingSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isAzureMonitorTargetEnabled, bool? isManagedIdentityInUse, BlobAuditingPolicyState? state, string storageEndpoint, string storageAccountAccessKey, Guid? storageAccountSubscriptionId, IDictionary<string, BinaryData> serializedAdditionalRawData) : base(id, name, resourceType, systemData)
{
IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled;
IsManagedIdentityInUse = isManagedIdentityInUse;
State = state;
StorageEndpoint = storageEndpoint;
StorageAccountAccessKey = storageAccountAccessKey;
StorageAccountSubscriptionId = storageAccountSubscriptionId;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// <summary>
/// Specifies whether DevOps audit events are sent to Azure Monitor.
/// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
///
/// When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should be also created.
///
/// Diagnostic Settings URI format:
/// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
///
/// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
/// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
///
/// </summary>
[WirePath("properties.isAzureMonitorTargetEnabled")]
public bool? IsAzureMonitorTargetEnabled { get; set; }
/// <summary> Specifies whether Managed Identity is used to access blob storage. </summary>
[WirePath("properties.isManagedIdentityInUse")]
public bool? IsManagedIdentityInUse { get; set; }
/// <summary> Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. </summary>
[WirePath("properties.state")]
public BlobAuditingPolicyState? State { get; set; }
/// <summary> Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. </summary>
[WirePath("properties.storageEndpoint")]
public string StorageEndpoint { get; set; }
/// <summary>
/// Specifies the identifier key of the auditing storage account.
/// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
/// Prerequisites for using managed identity authentication:
/// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
/// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
/// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
/// </summary>
[WirePath("properties.storageAccountAccessKey")]
public string StorageAccountAccessKey { get; set; }
/// <summary> Specifies the blob storage subscription Id. </summary>
[WirePath("properties.storageAccountSubscriptionId")]
public Guid? StorageAccountSubscriptionId { get; set; }
}
}