/// <summary> /// Checks whether the server is applicable for dynamic data masking /// </summary> private bool IsRightServerVersionForDataMasking(string resourceGroupName, string serverName, string clientId) { AzureSqlServerCommunicator dbCommunicator = new AzureSqlServerCommunicator(Context); Management.Sql.Models.Server server = dbCommunicator.Get(resourceGroupName, serverName, clientId); return(server.Version == "12.0"); }
/// <summary> /// Checks whether the server is applicable for threat detection /// </summary> private bool IsRightServerVersionForThreatDetection(string resourceGroupName, string serverName) { AzureSqlServerCommunicator dbCommunicator = new AzureSqlServerCommunicator(Context); Management.Sql.Models.Server server = dbCommunicator.Get(resourceGroupName, serverName); return(server.Version == "12.0"); }
/// <summary> /// Gets the Location of the server. Throws an exception if the server does not support Azure SQL Database Agents. /// </summary> /// <param name="resourceGroupName">The resource group the server is in</param> /// <param name="serverName">The name of the server</param> /// <param name="clientId">The client identifier.</param> /// <returns></returns> /// <remarks> /// These 2 operations (get location, throw if not supported) are combined in order to minimize round trips. /// </remarks> public string GetServerLocationAndThrowIfAgentNotSupportedByServer(string resourceGroupName, string serverName) { AzureSqlServerCommunicator serverCommunicator = new AzureSqlServerCommunicator(Context); var server = serverCommunicator.Get(resourceGroupName, serverName); return(server.Location); }