Skip to content

Commit 02ada0a

Browse files
committed
Merge branch 'fromFM1-avrai' of https://github.com/AsrArmOneSdk/azure-powershell into fromFM1-avrai
2 parents 2a519a0 + f1d5bb5 commit 02ada0a

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

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

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ Please provide a storage account with the same location as that of the vault.</v
307307
<data name="PassingPolicyMandatoryForEnablingDR" xml:space="preserve">
308308
<value>Passing policy is mandatory for enabling protection.</value>
309309
</data>
310+
<data name="PassingStorageMandatoryForEnablingDRInAzureScenarios" xml:space="preserve">
311+
<value>Passing Azure storage account is mandatory for enabling protection in Enterprise to Azure and Hoster to Azure scenarios.</value>
312+
</data>
310313
<data name="SiteRecoveryVaultTypeWillBeDeprecatedSoon" xml:space="preserve">
311314
<value>SiteRecovery vault type will be deprecated soon. Please use RecoveryServices vault type instead.</value>
312315
</data>

src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/SetAzureSiteRecoveryProtectionEntity.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ protected override void ProcessRecord()
159159
providerSettings.VmName = this.ProtectionEntity.FriendlyName;
160160

161161
// Id disk details are missing in input PE object, get the latest PE.
162-
// As get PE by name is failing before protection, get all & filter.
163-
// Once after we fix get pe by name, change the logic to use the same.
164162
if (string.IsNullOrEmpty(this.ProtectionEntity.OS))
165163
{
166164
// Just checked for OS to see whether the disk details got filled up or not
@@ -205,6 +203,12 @@ protected override void ProcessRecord()
205203

206204
input.Properties.ProviderSpecificDetails = providerSettings;
207205
}
206+
else if (this.Policy != null &&
207+
0 == string.Compare(this.Policy.ReplicationProvider, Constants.HyperVReplicaAzure, StringComparison.OrdinalIgnoreCase) &&
208+
0 == string.Compare(this.ParameterSetName, ASRParameterSets.EnterpriseToEnterprise, StringComparison.OrdinalIgnoreCase))
209+
{
210+
throw new PSArgumentException(Properties.Resources.PassingStorageMandatoryForEnablingDRInAzureScenarios);
211+
}
208212

209213
this.response =
210214
RecoveryServicesClient.EnableProtection(

0 commit comments

Comments
 (0)