Skip to content

Commit 062ea1f

Browse files
author
Maddie Clayton
authored
Merge branch 'preview' into preview
2 parents 485b626 + 25f2a12 commit 062ea1f

File tree

26 files changed

+4511
-27
lines changed

26 files changed

+4511
-27
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
In the new Az Netstandard module, the default prefix for all cmdlets is "Az". However, in order to prevent massive breaking changes that require scripts to be immediately rewritten, we have created a new cmdlet "Enable-AzureRmAlias" that will enable aliases to the old "AzureRm" prefix. This is a guide on how to add aliases for new cmdlets added to any module.
2+
3+
1.) Ensure your cmdlet attribute is formatted correctly to include the AzureRMPrefix. This will make the cmdlet prefix "Az" for Netstandard and "AzureRM" for the legacy desktop module (while the desktop module continues to be maintained). Example can be found [here](https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Profile/Commands.Profile/Default/GetAzureRmDefault.cs#L29).
4+
5+
2.) Ensure both AzureRm.\<moduleName>.psd1 and Az.\<moduleName>.psd1 are updated with all new cmdlets. The prefix for cmdlets in AzureRM.\<moduleName>.psd1 should be AzureRm, and the prefix for cmdlets in Az.\<moduleName>.psd1 should be Az.
6+
7+
3.) Run the script to create alias mapping. This can be found in [tools/CreateAliasMappings.ps1](https://github.com/Azure/azure-powershell/blob/preview/tools/CreateAliasMapping.ps1).
8+
9+
4.) Copy the output contents from [tools/AliasMappings.json](https://github.com/Azure/azure-powershell/blob/preview/tools/AliasMapping.json) into the mapping variable in [src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.cs](https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.cs#L36).

src/ResourceManager/Cdn/Commands.Cdn.Test/Commands.Cdn.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@
125125
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.ProfileTests\TestProfileGetResourceUsage.json">
126126
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
127127
</None>
128+
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.ProfileTests\TestSkuCreate.json">
129+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
130+
</None>
128131
<None Include="SessionRecords\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.EndpointTests\TestEndpointResourceUsage.json">
129132
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
130133
</None>

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/ProfileTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public void TestProfileCrud()
3535
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ProfileCrud");
3636
}
3737

38+
[Fact]
39+
[Trait(Category.AcceptanceType, Category.CheckIn)]
40+
public void TestSkuCreate()
41+
{
42+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-SkuCreate");
43+
}
44+
3845
[Fact]
3946
[Trait(Category.AcceptanceType, Category.CheckIn)]
4047
public void TestProfileCrudWithPiping()

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/ProfileTests.ps1

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,49 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
<#
16+
.SYNOPSIS
17+
Create Profile with different Sku
18+
#>
19+
function Test-SkuCreate
20+
{
21+
$profileName = getAssetName
22+
$resourceGroup = TestSetup-CreateResourceGroup
23+
$profileLocation = "EastUS"
24+
$profileSku = "Standard_Microsoft"
25+
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku
26+
27+
Assert-NotNull $createdProfile
28+
Assert-AreEqual $profileName $createdProfile.Name
29+
Assert-AreEqual $resourceGroup.ResourceGroupName $createdProfile.ResourceGroupName
30+
Assert-AreEqual $profileSku $createdProfile.Sku.Name
31+
32+
$profileSku = "Standard_Verizon"
33+
$profileName = getAssetName
34+
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku
35+
Assert-NotNull $createdProfile
36+
Assert-AreEqual $profileName $createdProfile.Name
37+
Assert-AreEqual $resourceGroup.ResourceGroupName $createdProfile.ResourceGroupName
38+
Assert-AreEqual $profileSku $createdProfile.Sku.Name
39+
40+
$profileSku = "Premium_Verizon"
41+
$profileName = getAssetName
42+
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku
43+
Assert-NotNull $createdProfile
44+
Assert-AreEqual $profileName $createdProfile.Name
45+
Assert-AreEqual $resourceGroup.ResourceGroupName $createdProfile.ResourceGroupName
46+
Assert-AreEqual $profileSku $createdProfile.Sku.Name
47+
48+
$profileSku = "Standard_Akamai"
49+
$profileName = getAssetName
50+
$createdProfile = New-AzureRmCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $profileLocation -Sku $profileSku
51+
Assert-NotNull $createdProfile
52+
Assert-AreEqual $profileName $createdProfile.Name
53+
Assert-AreEqual $resourceGroup.ResourceGroupName $createdProfile.ResourceGroupName
54+
Assert-AreEqual $profileSku $createdProfile.Sku.Name
55+
56+
Remove-AzureRmResourceGroup -Name $resourceGroup.ResourceGroupName -Force
57+
}
1558
<#
1659
.SYNOPSIS
1760
Full Profile CRUD cycle

0 commit comments

Comments
 (0)