Microsoft Azure SQL Database Cloud Service Advanced Properties Discovery
Microsoft.SqlServer.Azure.Discovery.ServerProperties (Discovery)
This workflow discovers advanced properties of Microsoft Azure SQL Database Cloud Service.
Knowledge Base article:
Element properties:
Object Discovery Details:
Member Modules:
Source Code:
<Discovery ID="Microsoft.SqlServer.Azure.Discovery.ServerProperties" Target="Microsoft.SqlServer.Azure.Server" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.SqlServer.Azure.Server">
<Property TypeID="Microsoft.SqlServer.Azure.Server" PropertyID="Version"/>
<Property TypeID="Microsoft.SqlServer.Azure.Server" PropertyID="Edition"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Microsoft.SqlServer.Azure.Module.SingleQueryDiscoveryDataSource">
<IntervalSeconds>14400</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<DiscoveryName>ServerDiscovery</DiscoveryName>
<ServerName>$Target/Property[Type="Microsoft.SqlServer.Azure.Server"]/ServerName$</ServerName>
<DatabaseName>master</DatabaseName>
<Query>SET NOCOUNT ON;
SELECT SERVERPROPERTY('Edition') AS [Edition], SERVERPROPERTY('ProductVersion') AS [Version], SERVERPROPERTY('ServerName') AS [Name]</Query>
<ProcessingScript>function DoDiscovery {
if (-not $Reader.Read()) { return; }
$server = $DiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.SqlServer.Azure.Server']$")
$server.AddProperty("$MPElement[Name='Microsoft.SqlServer.Azure.Server']/ServerName$", $ServerName)
$server.AddProperty("$MPElement[Name='Microsoft.SqlServer.Azure.Server']/Version$", $Reader.get_Item('Version'))
$server.AddProperty("$MPElement[Name='Microsoft.SqlServer.Azure.Server']/Edition$", $Reader.get_Item('Edition'))
$server.AddProperty("$MPElement[Name='Microsoft.SqlServer.Azure.Server']/Name$", $Reader.get_Item('Name'))
$DiscoveryData.AddInstance($server)
}
DoDiscovery
</ProcessingScript>
</DataSource>
</Discovery>