Skip to content

Commit b49e9f8

Browse files
author
Maddie Clayton
authored
Merge pull request Azure#7226 from maddieclayton/AzureRM.Network-preview
Update network preview branch
2 parents b6167a3 + 9dca68f commit b49e9f8

File tree

2,696 files changed

+2468935
-1996216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,696 files changed

+2468935
-1996216
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ before_install:
2525
# https://github.com/travis-ci/travis-ci/issues/1066#issuecomment-383489298
2626
script:
2727
- sudo dotnet msbuild build.proj /t:BuildNetcore /p:Configuration=$CONFIG || travis_terminate 1
28-
- sudo dotnet tools/StaticAnalysis/bin/$CONFIG/netcoreapp2.1/StaticAnalysis.Netcore.dll -p src/Package/$CONFIG -r src/Package -u
28+
- sudo dotnet tools/StaticAnalysis/bin/$CONFIG/netcoreapp2.1/StaticAnalysis.Netcore.dll -p src/Package/$CONFIG -r src/Package -u || travis_terminate 1
2929
- sudo pwsh -NonInteractive -NoLogo -NoProfile -File tools/TestModuleLoading.ps1 || travis_terminate 1
3030
- sudo dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter "AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $CONFIG
3131

NuGet.Config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
77
<add key="powershell-core" value="https://powershell.myget.org/F/powershell-core/api/v3/index.json" />
8+
<add key="myget-azure-powershell" value="https://www.myget.org/F/azure-powershell/api/v3/index.json" />
89
</packageSources>
910
</configuration>

build.proj

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<PropertyGroup>
173173
<NuGetCommand>$(MSBuildProjectDirectory)\tools\NuGet.exe</NuGetCommand>
174174
<LibraryNugetPackageFolder>$(LibrarySourceFolder)\packages</LibraryNugetPackageFolder>
175-
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
175+
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\NuGet.Config</NuGetRestoreConfigFile>
176176
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
177177
<NuGetRestorePackageSetting>-PackagesDirectory $(LibraryNugetPackageFolder)</NuGetRestorePackageSetting>
178178
<NuGetLocalBuildTaskPackages>-PackagesDirectory $(LibraryToolsFolder)\BuildPackagesTask\packages</NuGetLocalBuildTaskPackages>
@@ -191,16 +191,6 @@
191191
-->
192192
<Target Name="RestoreNugetPackages" Condition="$(SkipNugetRestore) == 'false'">
193193
<Message Importance="high" Text="Restore Nuget packages..." />
194-
195-
<Delete Files="$(NuGetRestoreConfigFile)" />
196-
<WriteLinesToFile
197-
File="$(NuGetRestoreConfigFile)"
198-
Lines="&lt;configuration&gt;&lt;/configuration&gt;"
199-
Overwrite="true"
200-
Encoding="Unicode"/>
201-
202-
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(LocalFeedFolder)&quot; $(NuGetRestoreConfigSwitch)"/>
203-
<Exec Command="$(NuGetCommand) sources add -Name nugetRemote -Source &quot;https://api.nuget.org/v3/index.json&quot; $(NuGetRestoreConfigSwitch)"/>
204194
<!-- Restore packages -->
205195
<Exec Command="$(NuGetCommand) restore %(StackSolution.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
206196
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'"
@@ -218,8 +208,6 @@
218208
ContinueOnError="false" />
219209
<!--Restore the xunit runner needed to run unit tests-->
220210
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
221-
222-
<Delete Files="$(NuGetRestoreConfigFile)" />
223211
</Target>
224212

225213
<Target Name="FilterBuild">
@@ -259,16 +247,7 @@
259247
<Message Text=""/>
260248

261249
<!-- Restore packages -->
262-
<Delete Files="$(NuGetRestoreConfigFile)" />
263-
<WriteLinesToFile
264-
File="$(NuGetRestoreConfigFile)"
265-
Lines="&lt;configuration&gt;&lt;/configuration&gt;"
266-
Overwrite="true"
267-
Encoding="Unicode"/>
268-
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(MSBuildProjectDirectory)\tools\LocalFeed&quot; $(NuGetRestoreConfigSwitch)"/>
269-
<Exec Command="$(NuGetCommand) sources add -Name nugetRemote -Source &quot;https://api.nuget.org/v3/index.json&quot; $(NuGetRestoreConfigSwitch)"/>
270250
<Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" ContinueOnError="false" />
271-
<Delete Files="$(NuGetRestoreConfigFile)" />
272251
</Target>
273252

274253
<!-- Build all flavors of the Cmdlets -->
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)