Skip to content

[RS Backup] Azure SQL workload support and new features in Azure VM workload #2519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cf10d6f
1.Added backup support for Azure SQL workload
pragrawa Jun 27, 2016
5618713
Removing SubType in csproj, format ps1 xml indent Correction and addi…
pragrawa Jun 27, 2016
12c9695
Adding summary to public functions for Azure sql
swatimadhukargit Jun 29, 2016
c7de968
Indentation in RecoveryPointConversion.cs and summary fix in AzureSq…
swatimadhukargit Jun 29, 2016
4920654
Merge pull request #343 from MabOneSdk/swatim-release01
swatimadhukargit Jun 29, 2016
47084a0
Uncommenting RecoveryServices.Backup test assembly, update error mess…
pragrawa Jun 29, 2016
a675b57
[RS Backup] Addressed review comments, fixed a few minor bugs
Jun 29, 2016
92778a7
[RS Backup] Adding csproj reference to Commands.RecoveryServices in T…
Jun 29, 2016
bb1489c
[RS Backup] Onboarding RS Backup Tests project onto test targets
Jun 29, 2016
b5cdf94
[RS Backup] Added RecoveryServices module to test setup
Jun 30, 2016
183cc60
Resolved merge conflicts - taken current changes againt the rbac hotf…
Jun 30, 2016
4ec4e3b
[RS Backup] Universal time fix in test
Jun 30, 2016
8f604a8
[RS Backup] Universal time fix in job tests
Jun 30, 2016
7373974
Excluding change for blocking blob storage account for restore
pragrawa Jun 30, 2016
75e0965
Merge branch 'release-01' of https://github.com/MabOneSdk/azure-power…
pragrawa Jun 30, 2016
31a8ab0
[RS Backup] Removed hardcoded location in vault tests
Jun 30, 2016
88d5e4d
Merge branch 'release-01' of https://github.com/MabOneSdk/azure-power…
Jun 30, 2016
d3a0349
[RS Backup] Returning single location instead of array of locations i…
Jun 30, 2016
f25a74c
[RS Backup] Making the vault location parameter local to test functions
Jun 30, 2016
268dd34
[RS Backup] Fixing a test issue - using absolute path when doing path…
Jun 30, 2016
7788f02
[RS Backup] bug fix - Get Recovery Point Id is returning incorrect Co…
Jul 1, 2016
9031dae
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
pragrawa Jul 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions AzurePowershell.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ScenarioTestDebug>.\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll</ScenarioTestDebug>
<CommonTestDebug>.\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
<BackupTestDebug>.\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll</BackupTestDebug>
<RecoveryServicesBackupTestDebug>.\src\ResourceManager\AzureBackup\Commands.RecoveryServices.Backup.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.dll</RecoveryServicesBackupTestDebug>
<SiteRecoveryTestDebug>.\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll</SiteRecoveryTestDebug>
<SqlTestDebug>.\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll</SqlTestDebug>
<ComputeDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.dll</ComputeDebug>
Expand Down Expand Up @@ -98,8 +99,8 @@
<XUnitTests Include=".\src\ResourceManager\DevTestLabs\Commands.DevTestLabs.Test\bin\Debug\Microsoft.Azure.Commands.DevTestLabs.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\HDInsight\Commands.HDInsight.Test\bin\Debug\Commands.HDInsight.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\Insights\Commands.Insights.Test\bin\Debug\Microsoft.Azure.Commands.Insights.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServicesArm.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\RecoveryServices.Backup\Commands.RecoveryServices.Backup.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.dll"/> -->
<XUnitTests Include=".\src\ResourceManager\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServicesArm.Test.dll"/> -->
<XUnitTests Include=".\src\ResourceManager\RecoveryServices.Backup\Commands.RecoveryServices.Backup.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\RedisCache\Commands.RedisCache.Test\bin\Debug\Microsoft.Azure.Commands.RedisCache.Test.dll"/>
<!--<XUnitTests Include=".\src\ResourceManager\ServerManagement\Commands.ServerManagement.Test\bin\Debug\Microsoft.Azure.Commands.ServerManagement.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\Storage\Commands.Management.Storage.Test\bin\Debug\Microsoft.Azure.Commands.Management.Storage.Test.dll"/>-->
Expand Down Expand Up @@ -282,6 +283,13 @@
IncludeTraits="$(XUnitIncludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
</Target>

<!-- Run the Recovery Services backup tests -->
<Target Name="RecoveryServicesBackupTests">
<Message Importance="high" Text="Running Recovery Services Backup tests" />
<Xunit.Runner.MSBuild.xunit Assemblies="$(RecoveryServicesBackupTestDebug)" Html="$(TestOutputDirectory)\RecoveryServicesBackupTests.xunit.dll.html" Verbose="false"
IncludeTraits="$(XUnitIncludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
</Target>

<!-- Run the common tests -->
<Target Name="CommonTests">
<Message Importance="high" Text="Running Common tests" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Management.RecoveryServices.Backup, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.Backup.0.1.1-preview\lib\net40\Microsoft.Azure.Management.RecoveryServices.Backup.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.Backup.0.1.2\lib\net40\Microsoft.Azure.Management.RecoveryServices.Backup.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -57,6 +57,7 @@
<Compile Include="Conversions\JobConversions.cs" />
<Compile Include="Conversions\RecoveryPointConversions.cs" />
<Compile Include="HelperUtils.cs" />
<Compile Include="TrackingHelpers.cs" />
<Compile Include="Validations\PolicyValidations.cs" />
<Compile Include="Conversions\SchedulePolicyConversions.cs" />
<Compile Include="Conversions\RetentionPolicyConversions.cs" />
Expand All @@ -80,7 +81,8 @@
</ItemGroup>
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
<None Include="packages.config">
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionConta
{
containerModel = new MabContainer(protectionContainer);
}
else if (protectionContainer.Properties.GetType() ==
typeof(ServiceClientModel.AzureSqlProtectionContainer))
{
containerModel = new AzureSqlContainer(protectionContainer);
}
}

return containerModel;
Expand Down Expand Up @@ -153,6 +158,31 @@ public static PolicyBase GetPolicyModel(ServiceClientModel.ProtectionPolicyResou
iaasPolicyModel.SchedulePolicy = PolicyHelpers.GetPSSimpleSchedulePolicy((ServiceClientModel.SimpleSchedulePolicy)
((ServiceClientModel.AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).SchedulePolicy);
}
else if (serviceClientResponse.Properties.GetType() ==
typeof(ServiceClientModel.AzureSqlProtectionPolicy))
{
ServiceClientModel.AzureSqlProtectionPolicy azureSqlPolicy =
(ServiceClientModel.AzureSqlProtectionPolicy)serviceClientResponse.Properties;

if (azureSqlPolicy.RetentionPolicy.GetType() !=
typeof(ServiceClientModel.SimpleRetentionPolicy))
{
Logger.Instance.WriteDebug("Unknown RetentionPolicy object received: " +
azureSqlPolicy.RetentionPolicy.GetType());
Logger.Instance.WriteWarning(Resources.UpdateToNewAzurePowershellWarning);
return null;
}

policyModel = new AzureSqlPolicy();
AzureSqlPolicy sqlPolicyModel = policyModel as AzureSqlPolicy;
sqlPolicyModel.WorkloadType = CmdletModels.WorkloadType.AzureSQLDatabase;
sqlPolicyModel.BackupManagementType = CmdletModels.BackupManagementType.AzureSQL;

ServiceClientModel.SimpleRetentionPolicy azureSqlRetentionPolicy =
(ServiceClientModel.SimpleRetentionPolicy)azureSqlPolicy.RetentionPolicy;
sqlPolicyModel.RetentionPolicy =
PolicyHelpers.GetPSSimpleRetentionPolicy(azureSqlRetentionPolicy);
}
else
{
// we will enter this case when service supports new workload and customer
Expand Down Expand Up @@ -233,6 +263,31 @@ public static ItemBase GetItemModel(ServiceClientModel.ProtectedItemResource pro
Cmdlets.Models.ContainerType.AzureVM,
policyName);
}

if (protectedItem.Properties.GetType() ==
typeof(ServiceClientModel.AzureSqlProtectedItem))
{
ServiceClientModel.AzureSqlProtectedItem azureSqlProtectedItem =
(ServiceClientModel.AzureSqlProtectedItem)protectedItem.Properties;
string policyName = null;
string policyId = azureSqlProtectedItem.PolicyId;
if (!String.IsNullOrEmpty(policyId))
{
Dictionary<UriEnums, string> keyVauleDict =
HelperUtils.ParseUri(policyId);
policyName = HelperUtils.GetPolicyNameFromPolicyId(keyVauleDict, policyId);
}

string containerUri = HelperUtils.GetContainerUri(
HelperUtils.ParseUri(protectedItem.Id),
protectedItem.Id);

itemModel = new AzureSqlItem(
protectedItem,
IdUtils.GetNameFromUri(containerUri),
Cmdlets.Models.ContainerType.AzureSQL,
policyName);
}
}

return itemModel;
Expand Down
Loading