Skip to content

Commit 7dbdf6b

Browse files
Display warning message that AzureRM will retire (#247)
* add ARM.Storage.Common.2017_10_01 * Display warning message that AzureRM will retire Co-authored-by: Beisi Zhou <[email protected]>
1 parent 21b5b5a commit 7dbdf6b

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

src/Common/AzurePSCmdlet.cs

+27
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using System.Management.Automation;
2828
using System.Text;
2929
using System.Collections.Generic;
30+
using Microsoft.WindowsAzure.Commands.Common.Properties;
3031

3132
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
3233
{
@@ -365,6 +366,32 @@ protected override void BeginProcessing()
365366
//Now see if the cmdlet has any Breaking change attributes on it and process them if it does
366367
//This will print any breaking change attribute messages that are applied to the cmdlet
367368
BreakingChangeAttributeHelper.ProcessCustomAttributesAtRuntime(this.GetType(), this.MyInvocation, WriteWarning);
369+
370+
DisplayAzureRmRetiringMessage();
371+
}
372+
373+
/// <summary>
374+
/// Display warning message that AzureRM will retire unless customers set environment variable 'SuppressAzureRmModulesRetiringWarning' as true.
375+
/// </summary>
376+
private void DisplayAzureRmRetiringMessage()
377+
{
378+
bool supressRetireWarningMessage = false;
379+
380+
try
381+
{
382+
supressRetireWarningMessage = bool.Parse(Environment.GetEnvironmentVariable("SuppressAzureRmModulesRetiringWarning"));
383+
}
384+
catch (Exception)
385+
{
386+
//no action
387+
}
388+
389+
if (supressRetireWarningMessage)
390+
{
391+
return;
392+
}
393+
394+
WriteWarning(Resources.AzureRmWillRetire);
368395
}
369396

370397
/// <summary>

src/Common/Properties/Resources.Designer.cs

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Properties/Resources.resx

+3
Original file line numberDiff line numberDiff line change
@@ -1725,4 +1725,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can
17251725
<data name="BreakingChangeAttributeParameterTypeChange" xml:space="preserve">
17261726
<value> The type of the parameter is changing from '{0}' to '{1}'.</value>
17271727
</data>
1728+
<data name="AzureRmWillRetire" xml:space="preserve">
1729+
<value>Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.</value>
1730+
</data>
17281731
</root>

src/Storage/Storage.nuspec

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<file src="Adapters\ARM.Storage.5\ARMStorageService.cs" target="tools\Adapters\ARM.Storage.5" />
2323
<file src="Adapters\ARM.Storage.6\ARMStorageProvider.cs" target="tools\Adapters\ARM.Storage.6" />
2424
<file src="Adapters\ARM.Storage.6\ARMStorageService.cs" target="tools\Adapters\ARM.Storage.6" />
25+
<file src="Adapters\ARM.Storage.Common.2017_10_01\ARMStorageProvider.cs" target="tools\Adapters\ARM.Storage.Common.2017_10_01" />
26+
<file src="Adapters\ARM.Storage.Common.2017_10_01\ARMStorageService.cs" target="tools\Adapters\ARM.Storage.Common.2017_10_01" />
2527
<file src="Adapters\RDFE.Storage\CloudStorageService.cs" target="tools\Adapters\RDFE.Storage" />
2628
<file src="Adapters\RDFE.Storage\RDFEStorageProvider.cs" target="tools\Adapters\RDFE.Storage" />
2729
<file src="Adapters\WindowsAzure.Storage.6\AzureContextAdapterExtensions.cs" target="tools\Adapters\WindowsAzure.Storage.6" />

0 commit comments

Comments
 (0)