Skip to content

Commit 0cf6e9a

Browse files
committed
Azure SQL Database Replication Failover Cmdlet
Failover Cmdlet
1 parent 116a3ab commit 0cf6e9a

11 files changed

+403
-28
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@
6868
<SpecificVersion>False</SpecificVersion>
6969
<HintPath>..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.7.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll</HintPath>
7070
</Reference>
71-
<Reference Include="Microsoft.Azure.Management.Sql">
72-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.37.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
71+
<Reference Include="Microsoft.Azure.Management.Sql, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
72+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.38.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
73+
<Private>True</Private>
7374
</Reference>
7475
<Reference Include="Microsoft.Azure.Management.Storage">
7576
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>

src/ResourceManager/Sql/Commands.Sql.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="0.19.2-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Management.Sql" version="0.37.0-prerelease" targetFramework="net45" />
10+
<package id="Microsoft.Azure.Management.Sql" version="0.38.0-prerelease" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.5687.28567-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5687.28567-prerelease" targetFramework="net45" />

src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<Compile Include="Replication\Cmdlet\NewAzureSqlDatabaseCopy.cs" />
172172
<Compile Include="Replication\Cmdlet\NewAzureSqlDatabaseSecondary.cs" />
173173
<Compile Include="Replication\Cmdlet\RemoveAzureSqlDatabaseSecondary.cs" />
174+
<Compile Include="Replication\Cmdlet\SetAzureSqlDatabaseSecondary.cs" />
174175
<Compile Include="Replication\Model\AllowConnections.cs" />
175176
<Compile Include="Replication\Model\AzureReplicationLinkModel.cs" />
176177
<Compile Include="Replication\Model\AzureSqlDatabaseCopyModel.cs" />
@@ -254,9 +255,9 @@
254255
<SpecificVersion>False</SpecificVersion>
255256
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
256257
</Reference>
257-
<Reference Include="Microsoft.Azure.Management.Sql">
258-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.37.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
259-
<SpecificVersion>False</SpecificVersion>
258+
<Reference Include="Microsoft.Azure.Management.Sql, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
259+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.38.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
260+
<Private>True</Private>
260261
</Reference>
261262
<Reference Include="Microsoft.Azure.Management.Storage">
262263
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>

src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12529,4 +12529,209 @@ Microsoft.Azure.Commands.Sql.Security.Model.DatabaseSecureConnectionPolicyModel<
1252912529
<maml:relatedLinks>
1253012530
</maml:relatedLinks>
1253112531
</command:command>
12532+
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
12533+
<!--Generated by PS Cmdlet Help Editor-->
12534+
<command:details>
12535+
<command:name>Set-AzureSqlDatabaseSecondary</command:name>
12536+
<maml:description>
12537+
<maml:para>Switches a secondary Azure SQL Database to the primary in order to failover.</maml:para>
12538+
</maml:description>
12539+
<maml:copyright>
12540+
<maml:para />
12541+
</maml:copyright>
12542+
<command:verb>Set</command:verb>
12543+
<command:noun>AzureSqlDatabaseSecondary</command:noun>
12544+
<dev:version />
12545+
</command:details>
12546+
<maml:description>
12547+
<maml:para>This cmdlet is designed as a general configuration command, but at the moment it is limited to initiating failover. Use it with the –AllowDataLoss parameter to initiate a force failover during an outage. You don’t have to specify it when performing a planned operation , such as DR drill. In the latter case the secondary databases will be synchronized with the primary before switching.</maml:para>
12548+
<maml:para>Note: This cmdlet can only be executed in Azure Resource Manager mode. To enable Azure Resource Manager mode run the following command:
12549+
Switch-AzureMode –Name AzureResourceManager</maml:para>
12550+
<maml:para>For more information, see Using Windows PowerShell with Resource Manager.</maml:para>
12551+
</maml:description>
12552+
<command:syntax>
12553+
<command:syntaxItem>
12554+
<maml:name>Set-AzureSqlDatabaseSecondary</maml:name>
12555+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="2">
12556+
<maml:name>DatabaseName</maml:name>
12557+
<maml:description>
12558+
<maml:para>The name of the Azure SQL Database Secondary.
12559+
</maml:para>
12560+
</maml:description>
12561+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12562+
</command:parameter>
12563+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
12564+
<maml:name>PartnerResourceGroupName</maml:name>
12565+
<maml:description>
12566+
<maml:para>The name of the Azure Resource Group of the partner Azure SQL Database.
12567+
</maml:para>
12568+
</maml:description>
12569+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12570+
</command:parameter>
12571+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12572+
<maml:name>Failover</maml:name>
12573+
<maml:description>
12574+
<maml:para>Determines if this operation is a failover.</maml:para>
12575+
</maml:description>
12576+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
12577+
</command:parameter>
12578+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12579+
<maml:name>AllowDataLoss</maml:name>
12580+
<maml:description>
12581+
<maml:para>Determines if this failover operation will allow data loss.</maml:para>
12582+
</maml:description>
12583+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
12584+
</command:parameter>
12585+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="1">
12586+
<maml:name>ServerName</maml:name>
12587+
<maml:description>
12588+
<maml:para>The name of the Azure SQL Server of the Azure SQL Database Secondary.
12589+
</maml:para>
12590+
</maml:description>
12591+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12592+
</command:parameter>
12593+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="0">
12594+
<maml:name>ResourceGroupName</maml:name>
12595+
<maml:description>
12596+
<maml:para>The name of the Azure Resource Group of the Azure SQL Database Secondary.
12597+
</maml:para>
12598+
</maml:description>
12599+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12600+
</command:parameter>
12601+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12602+
<maml:name>Profile</maml:name>
12603+
<maml:description>
12604+
<maml:para />
12605+
</maml:description>
12606+
<command:parameterValue required="true" variableLength="false">AzureProfile</command:parameterValue>
12607+
</command:parameter>
12608+
</command:syntaxItem>
12609+
</command:syntax>
12610+
<command:parameters>
12611+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="2">
12612+
<maml:name>DatabaseName</maml:name>
12613+
<maml:description>
12614+
<maml:para>The name of the Azure SQL Database Secondary.
12615+
</maml:para>
12616+
</maml:description>
12617+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12618+
<dev:type>
12619+
<maml:name>String</maml:name>
12620+
<maml:uri/>
12621+
</dev:type>
12622+
<dev:defaultValue></dev:defaultValue>
12623+
</command:parameter>
12624+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
12625+
<maml:name>PartnerResourceGroupName</maml:name>
12626+
<maml:description>
12627+
<maml:para>The name of the Azure Resource Group of the partner Azure SQL Database.
12628+
</maml:para>
12629+
</maml:description>
12630+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12631+
<dev:type>
12632+
<maml:name>String</maml:name>
12633+
<maml:uri/>
12634+
</dev:type>
12635+
<dev:defaultValue></dev:defaultValue>
12636+
</command:parameter>
12637+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12638+
<maml:name>Failover</maml:name>
12639+
<maml:description>
12640+
<maml:para>Determines if this operation is a failover.</maml:para>
12641+
</maml:description>
12642+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
12643+
<dev:type>
12644+
<maml:name>SwitchParameter</maml:name>
12645+
<maml:uri/>
12646+
</dev:type>
12647+
<dev:defaultValue></dev:defaultValue>
12648+
</command:parameter>
12649+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12650+
<maml:name>AllowDataLoss</maml:name>
12651+
<maml:description>
12652+
<maml:para>Determines if this failover operation will allow data loss.</maml:para>
12653+
</maml:description>
12654+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
12655+
<dev:type>
12656+
<maml:name>SwitchParameter</maml:name>
12657+
<maml:uri/>
12658+
</dev:type>
12659+
<dev:defaultValue></dev:defaultValue>
12660+
</command:parameter>
12661+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="1">
12662+
<maml:name>ServerName</maml:name>
12663+
<maml:description>
12664+
<maml:para>The name of the Azure SQL Server of the Azure SQL Database Secondary.
12665+
</maml:para>
12666+
</maml:description>
12667+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12668+
<dev:type>
12669+
<maml:name>String</maml:name>
12670+
<maml:uri/>
12671+
</dev:type>
12672+
<dev:defaultValue></dev:defaultValue>
12673+
</command:parameter>
12674+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="0">
12675+
<maml:name>ResourceGroupName</maml:name>
12676+
<maml:description>
12677+
<maml:para>The name of the Azure Resource Group of the Azure SQL Database Secondary.
12678+
</maml:para>
12679+
</maml:description>
12680+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
12681+
<dev:type>
12682+
<maml:name>String</maml:name>
12683+
<maml:uri/>
12684+
</dev:type>
12685+
<dev:defaultValue></dev:defaultValue>
12686+
</command:parameter>
12687+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
12688+
<maml:name>Profile</maml:name>
12689+
<maml:description>
12690+
<maml:para />
12691+
</maml:description>
12692+
<command:parameterValue required="true" variableLength="false">AzureProfile</command:parameterValue>
12693+
<dev:type>
12694+
<maml:name>AzureProfile</maml:name>
12695+
<maml:uri/>
12696+
</dev:type>
12697+
<dev:defaultValue></dev:defaultValue>
12698+
</command:parameter>
12699+
</command:parameters>
12700+
<command:inputTypes>
12701+
<command:inputType>
12702+
<dev:type>
12703+
<maml:name></maml:name>
12704+
<maml:uri></maml:uri>
12705+
<maml:description/>
12706+
</dev:type>
12707+
<maml:description>
12708+
<maml:para />
12709+
</maml:description>
12710+
</command:inputType>
12711+
</command:inputTypes>
12712+
<command:returnValues>
12713+
<command:returnValue>
12714+
<dev:type>
12715+
<maml:name></maml:name>
12716+
<maml:uri></maml:uri>
12717+
<maml:description/>
12718+
</dev:type>
12719+
<maml:description>
12720+
<maml:para />
12721+
</maml:description>
12722+
</command:returnValue>
12723+
</command:returnValues>
12724+
<command:terminatingErrors></command:terminatingErrors>
12725+
<command:nonTerminatingErrors></command:nonTerminatingErrors>
12726+
<maml:alertSet>
12727+
<maml:title></maml:title>
12728+
<maml:alert>
12729+
<maml:para />
12730+
</maml:alert>
12731+
</maml:alertSet>
12732+
<command:examples>
12733+
</command:examples>
12734+
<maml:relatedLinks>
12735+
</maml:relatedLinks>
12736+
</command:command>
1253212737
</helpItems>

src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,7 @@
255255
<data name="InvalidGraphEndpoint" xml:space="preserve">
256256
<value>Please use Set-AzureEnvironment to set a valid GraphEndpoint for the current AzureEnvironment.</value>
257257
</data>
258+
<data name="SetSecondaryNoOptionProvided" xml:space="preserve">
259+
<value>No Set Options were provided</value>
260+
</data>
258261
</root>

src/ResourceManager/Sql/Commands.Sql/Replication/Cmdlet/RemoveAzureSqlDatabaseSecondary.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
2323
{
2424
[Cmdlet(VerbsCommon.Remove, "AzureSqlDatabaseSecondary",
25-
SupportsShouldProcess = true,
2625
ConfirmImpact = ConfirmImpact.High)]
2726
public class RemoveAzureSqlDatabaseSecondary : AzureSqlDatabaseSecondaryCmdletBase
2827
{

0 commit comments

Comments
 (0)