Cmdlets to provide and manage SQL servers for tests.
Creates an Azure SQL Server and returns its connection parameters.
New-SqlTestAzureInstance [[-Subscription] <String>] [[-FirewallRule] <String>] [[-Location] <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Creates a server in the PsSqlTestServer resource group and returns an object with connection metadata. If no location is specified, the existing resource group’s location is used. A location is required when the resource group does not exist. Requires Az modules, an authenticated Azure context, and permission to create Azure SQL resources.
Connect-AzAccount
PS> $instance = New-SqlTestAzureInstance -FirewallRule justme
Creates an Azure SQL Server in the existing PsSqlTestServer resource group, allowing connections only from your current
IPv4 address.
Captured output (temporary server name redacted):
ResourceGroupName : PsSqlTestServer ServerName : <redacted> FullyQualifiedDomainName : <redacted>.database.windows.net DataSource : <redacted>.database.windows.net ConnectTimeout : 30 ConnectionString : Data Source=<redacted>.database.windows.net;Connect Timeout=30;Authentication=Active Directory Integrated PS> $instance | Remove-SqlTestAzureInstance Removes the Azure SQL Server created by this example. The resource group remains and is not removed by this command.
Specifies the Azure Subscription name.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify which firewall rule to create.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
Specifies the Azure region for the server and, if necessary, the new resource group.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://abbgrade.github.io/PsSqlTestServer/docs/New-SqlTestAzureInstance.html