public bool SetAuditingPolicy(string resourceGroupName, string serverName,
                                      ServerBlobAuditingPolicy policy)
        {
            SqlManagementClient client = GetCurrentSqlClient();
            AzureOperationResponse <ServerBlobAuditingPolicy> response =
                client.ServerBlobAuditingPolicies.BeginCreateOrUpdateWithHttpMessagesAsync(
                    resourceGroupName, serverName, policy).Result;

            return(client.GetLongRunningOperationResultAsync(response, null, CancellationToken.None).Result.Response.IsSuccessStatusCode);
        }
Beispiel #2
0
        public bool SetDevOpsAuditingPolicy(string resourceGroupName, string serverName,
                                            ServerDevOpsAuditingSettings policy)
        {
            return(SetAuditingPolicyInternal(() =>
            {
                SqlManagementClient client = GetCurrentSqlClient();
                IServerDevOpsAuditSettingsOperations serverDevOpsAuditSettings = client.ServerDevOpsAuditSettings;

                AzureOperationResponse <ServerDevOpsAuditingSettings> response =
                    serverDevOpsAuditSettings.BeginCreateOrUpdateWithHttpMessagesAsync(
                        resourceGroupName, serverName, "default", policy).Result;
                return client.GetLongRunningOperationResultAsync(response, null, CancellationToken.None).Result.Response.IsSuccessStatusCode;
            }));
        }