Skip to content

Commit e12a085

Browse files
authored
Merge branch 'master' into master
2 parents 7457ba1 + fda9c19 commit e12a085

File tree

1,875 files changed

+451762
-336944
lines changed

Some content is hidden

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

1,875 files changed

+451762
-336944
lines changed

ChangeLog.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
1+
## 1.1.0 - January 2019
2+
#### Az.Accounts
3+
* Add 'Local' Scope to Enable-AzureRmAlias
4+
5+
#### Az.Compute
6+
* Name is now optional in ID parameter set for Restart/Start/Stop/Remove/Set-AzVM and Save-AzVMImage
7+
* Updated the description of ID in help files
8+
* Fix backward compatibility issue with Az.Accounts module
9+
10+
#### Az.DataLakeStore
11+
* Update the sdk version of dataplane to 1.1.14 for SDK fixes.
12+
- Fix handling of negative acesstime and modificationtime for getfilestatus and liststatus, Fix async cancellation token
13+
14+
#### Az.EventGrid
15+
* Updated to use the 2019-01-01 API version.
16+
* Update the following cmdlets to support new scenario in 2019-01-01 API version
17+
- New-AzureRmEventGridSubscription: Add new optional parameters for specifying:
18+
- Event Time-To-Live,
19+
- Maximum number of delivery attempts for the events,
20+
- Dead letter endpoint.
21+
- Update-AzureRmEventGridSubscription: Add new optional parameters for specifying:
22+
- Event Time-To-Live,
23+
- Maximum number of delivery attempts for the events,
24+
- Dead letter endpoint.
25+
* Add new enum values (namely, storageQueue and hybridConnection) for EndpointType option in New-AzureRmEventGridSubscription and Update-AzureRmEventGridSubscription cmdlets.
26+
* Show warning message if creating or updating the event subscription is expected to entail manual action from user.
27+
28+
#### Az.IotHub
29+
* Updated to the latest version of the IotHub SDK
30+
31+
#### Az.LogicApp
32+
* Get-AzLogicApp lists all without specified Name
33+
34+
#### Az.Resources
35+
* Fix parameter set issue when providing '-ODataQuery' and '-ResourceId' parameters for 'Get-AzResource'
36+
- More information here: https://github.com/Azure/azure-powershell/issues/7875
37+
* Fix handling of the -Custom parameter in New/Set-AzPolicyDefinition
38+
* Fix typo in New-AzDeployment documentation
39+
* Made '-MailNickname' parameter mandatory for 'New-AzADUser'
40+
- More information here: https://github.com/Azure/azure-powershell/issues/8220
41+
42+
#### Az.SignalR
43+
* Fix backward compatibility issue with Az.Accounts module
44+
45+
#### Az.Sql
46+
* Converted the Storage management client dependency to the common SDK implementation.
47+
48+
#### Az.Storage
49+
* Set the StorageAccountName of Storage context as the real Storage Account Name, when it's created with Sas Token, OAuth or Anonymous
50+
- New-AzStorageContext
51+
* Create Sas Token of Blob Snapshot Object with '-FullUri' parameter, fix the returned Uri to be the sanpshot Uri
52+
- New-AzStorageBlobSASToken
53+
54+
#### Az.Websites
55+
* Fixed a date parsing bug in 'Get-AzDeletedWebApp'
56+
* Fix backward compatibility issue with Az.Accounts module
57+
158
## Version 1.0.0 - December 2018
259

360
#### General
461

562
* General availability of `Az` module
6-
* For more information about the `Az` module, please visit the following: https://aka.ms/azps-announce
63+
* For more information about the `Az` module, please visit the following: https://aka.ms/azps-announce

CodeSign.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
<Message Text="----> Dlls signing section" Importance="high"/>
2020
<!-- Azure -->
2121
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'">
22-
<DelaySignedAssembliesToSign Include="$(PackageDirectory)\$(Configuration)\**\Microsoft*Azure*PowerShell*Cmdlets*.dll" />
22+
<DelaySignedAssembliesToSign Include="$(PackageDirectory)\$(Configuration)\**\Microsoft*Azure*PowerShell*Cmdlets*.dll;
23+
$(PackageDirectory)\$(Configuration)\Az.Accounts\Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll;
24+
$(PackageDirectory)\$(Configuration)\Az.Accounts\Microsoft.Azure.PowerShell.Authentication.dll" />
2325
</ItemGroup>
2426

2527
<Message Importance="high" Text="$(PackageDirectory)\$(Configuration) does not contains any files to sign. Code sign will skip." Condition="'@(DelaySignedAssembliesToSign)' == ''" />

build.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
</ModuleCsprojFilesRelative>
389389
</ItemGroup>
390390
<Exec Command="dotnet sln Azure.PowerShell.sln add @(ModuleCsprojFilesRelative->'%(RelativePath)', ' ')" />
391+
<Exec Command="dotnet sln Azure.PowerShell.sln add $(LibraryRoot)tools/ScenarioTest.ResourceManager/ScenarioTest.ResourceManager.csproj $(LibraryRoot)tools/TestFx/TestFx.csproj" />
391392
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->
392393
<!-- https://github.com/xunit/xunit/issues/1154#issuecomment-405366373 -->
393394
<Exec Command="dotnet test Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework netcoreapp2.0 --logger trx" />

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ After the solution file is updated, save and close it. Now, open the solution fi
174174
<PsModuleName>Cdn</PsModuleName>
175175
</PropertyGroup>
176176
```
177-
- Remove the entry:
177+
- **Remove the entry**:
178178
```xml
179179
<PropertyGroup>
180180
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)</RootNamespace>
181181
</PropertyGroup>
182182
```
183-
This is not needed since this is a new project.
183+
**Note**: This is not needed since this is a new project and does not use legacy namespace conventions.
184184

185185
- Update this entry to use your SDK:
186186
```xml
@@ -244,8 +244,11 @@ Please see our guide on [Using Azure TestFramework](../testing-docs/using-azure-
244244

245245
### Adding Scenario Tests
246246

247-
- Create a new class in `Commands.<SERVICE>.Test`
248-
- Create a ps1 file in the same folder that contains the actual tests ([see sample](../../src/Media/Commands.Media.Test/ScenarioTests))
247+
- Create a new class in `<SERVICE>.Test`
248+
- Add `[Fact]` as an attribute to every test
249+
- Add `[Trait(Category.AcceptanceType, Category.CheckIn)]` as an attribute to any test that should be run during CI in Playback mode.
250+
- Add `[Trait(Category.AcceptanceType, Category.LiveOnly)]` as an attribute to any test that cannot be run in Playback mode (for example, if a test depends on a Dataplane SDK).
251+
- Create a ps1 file in the same folder that contains the actual tests ([see sample](../../src/Media/Media.Test/ScenarioTests))
249252
- Use `Assert-AreEqual x y` to verify that values are the same
250253
- Use `Assert-AreNotEqual x y` to verify that values are not the same
251254
- Use `Assert-Throws scriptblock message` to verify an exception is being thrown
@@ -256,7 +259,7 @@ Please see our guide on [Using Azure TestFramework](../testing-docs/using-azure-
256259
- Use `Assert-Null object` to verify that an object is null
257260
- Use `Assert-NotNull object` to verify that an object is not null
258261
- Use `Assert-Exists path` to verify that a file exists
259-
- Use `Assert-AreEqualArray a1 a2` to verify that arrays are the sam
262+
- Use `Assert-AreEqualArray a1 a2` to verify that arrays are the same
260263

261264
### Using Active Directory
262265

@@ -270,14 +273,8 @@ Please see our guide on [Using Azure TestFramework](../testing-docs/using-azure-
270273
271274
### AD Scenario Tests
272275

273-
Create these environment variables for the AD scenario tests:
276+
Create this environment variables for the AD scenario tests:
274277

275-
- `AZURE_LIVEID` should be UserId and Password for a valid LiveId account.
276-
- `AZURE_LIVEID=UserId=<[email protected]>;Password=<Password>`
277-
- `AZURE_ORGID_FPO` should be an orgid and password for an account that does not have any subscriptions or role assignments associated with it. It is supposed to be a foreign principal in your current tenant.
278-
- `AZURE_ORGID_FPO=UserId=<[email protected]>;Password=<Password>`
279-
- `AZURE_ORGID_ONE_TENANT_ONE_SUBSCRIPTION` should be an account that is in a single tenant and has access to the subscription managed by that AD tenant.
280-
- `AZURE_ORGID_ONE_TENANT_ONE_SUBSCRIPTION=UserId=<[email protected]>;Password=<Password>;SubscriptionId=<SubscriptionId>;AADAuthEndpoint=https://login.windows.net/`
281278
- `AZURE_SERVICE_PRINCIPAL` should be a service principal - an application defined in the subscription's tenant - that has management access to the subscription (or at least to a resource group in the tenant)
282279
- `AZURE_SERVICE_PRINCIPAL=UserId=<UserGuid>;Password=<Password>;AADTenant=<TenantGuid>;SubscriptionId=<SubscriptionId>`
283280

@@ -287,7 +284,7 @@ Create these environment variables for the AD scenario tests:
287284
- Run the test in Visual Studio in the Test Explorer window and make sure you got a generated JSON file that matches the test name in the bin folder under the `SessionRecords` folder
288285
- Copy this `SessionRecords` folder and place it inside the test project
289286
- Inside Visual Studio, add all of the generated JSON files, making sure to change the "Copy to Output Directory" property for each one to "Copy if newer"
290-
- Make sure that all of these JSON files appear in your `Commands.<SERVICE>.Test.csproj` file
287+
- Make sure that all of these JSON files appear in your `<SERVICE>.Test.csproj` file
291288

292289
# After Development
293290

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >
33
<Product Id="*"
44
Name="$(var.productName)"

src/Accounts/Accounts.Test/Accounts.Test.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\Accounts\Accounts.csproj" />
15+
<ProjectReference Include="..\Authentication.ResourceManager\Authentication.ResourceManager.csproj" />
16+
<ProjectReference Include="..\Authentication\Authentication.csproj" />
1517
</ItemGroup>
1618

1719
<ItemGroup>

src/Accounts/Accounts.Test/ArgumentCompleterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ public ArgumentCompleterTests(ITestOutputHelper output)
2525
{
2626
}
2727

28-
[Fact(Skip = "Failure needs investigated. Not returning list of locations.")]
28+
[Fact]
2929
[Trait(Category.AcceptanceType, Category.CheckIn)]
3030
public void TestLocationCompleter()
3131
{
3232
TestRunner.RunTestScript("Test-LocationCompleter");
3333
}
3434

35-
[Fact(Skip = "Failure needs investigated. Cannot bind argument to parameter 'DifferenceObject' because it is null.")]
35+
[Fact]
3636
[Trait(Category.AcceptanceType, Category.CheckIn)]
3737
public void TestResourceGroupCompleter()
3838
{
3939
TestRunner.RunTestScript("Test-ResourceGroupCompleter");
4040
}
4141

42-
[Fact(Skip = "AzureRM.Resources.ps1 needs Get-AzureRmResource to be implemented")]
42+
[Fact]
4343
[Trait(Category.AcceptanceType, Category.CheckIn)]
4444
public void TestResourceIdCompleter()
4545
{

src/Accounts/Accounts.Test/ArgumentCompleterTests.ps1

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ Tests location completer
1818
#>
1919
function Test-LocationCompleter
2020
{
21-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.PowerShell.ResourceManager.dll"
22-
if (!(Test-Path $filePath)) {
23-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.Commands.ResourceManager.Common.dll"
24-
}
25-
$assembly = [System.Reflection.Assembly]::LoadFrom($filePath)
2621
$resourceTypes = @("Microsoft.Batch/operations")
2722
$locations = [Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.LocationCompleterAttribute]::FindLocations($resourceTypes, -1)
28-
$expectedResourceType = Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.Batch" | Where-Object {$_.ResourceTypes.ResourceTypeName -eq "operations"}
23+
$expectedResourceType = (Get-AzResourceProvider -ProviderNamespace "Microsoft.Batch").ResourceTypes | Where-Object {$_.ResourceType -eq "operations"}
2924
$expectedLocations = $expectedResourceType.Locations | ForEach-Object {"`'" + $_ + "`'"}
3025
Assert-AreEqualArray $locations $expectedLocations
3126
}
@@ -37,13 +32,8 @@ Tests resource group completer
3732
#>
3833
function Test-ResourceGroupCompleter
3934
{
40-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.PowerShell.ResourceManager.dll"
41-
if (!(Test-Path $filePath)) {
42-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.Commands.ResourceManager.Common.dll"
43-
}
44-
$assembly = [System.Reflection.Assembly]::LoadFrom($filePath)
4535
$resourceGroups = [Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceGroupCompleterAttribute]::GetResourceGroups(-1)
46-
$expectResourceGroups = Get-AzureRmResourceGroup | ForEach-Object {$_.ResourceGroupName}
36+
$expectResourceGroups = Get-AzResourceGroup | ForEach-Object {$_.Name}
4737
Assert-AreEqualArray $resourceGroups $expectResourceGroups
4838
}
4939

@@ -53,13 +43,8 @@ Tests resource id completer
5343
#>
5444
function Test-ResourceIdCompleter
5545
{
56-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.PowerShell.ResourceManager.dll"
57-
if (!(Test-Path $filePath)) {
58-
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "\Microsoft.Azure.Commands.ResourceManager.Common.dll"
59-
}
60-
[System.Reflection.Assembly]::LoadFrom($filePath)
6146
$resourceType = "Microsoft.Storage/storageAccounts"
62-
$expectResourceIds = Get-AzureRmResource -ResourceType $resourceType | ForEach-Object {$_.Id}
47+
$expectResourceIds = Get-AzResource -ResourceType $resourceType | ForEach-Object {$_.Id}
6348
# take data from Azure and put to cache
6449
$resourceIds = [Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceIdCompleterAttribute]::GetResourceIds($resourceType)
6550
Assert-AreEqualArray $resourceIds $expectResourceIds
@@ -71,4 +56,4 @@ function Test-ResourceIdCompleter
7156
# take data from Azure again and put to cache
7257
$resourceIds = [Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.ResourceIdCompleterAttribute]::GetResourceIds($resourceType)
7358
Assert-AreEqualArray $resourceIds $expectResourceIds
74-
}
59+
}
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,24 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.ServiceManagement.Common.Models;
1615
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1716
using Xunit;
1817
using Xunit.Abstractions;
1918

20-
namespace Commands.Network.Test.ScenarioTests
19+
namespace Microsoft.Azure.Commands.Profile.Test
2120
{
22-
public class ExpressRouteCrossConnectionTests : Microsoft.WindowsAzure.Commands.Test.Utilities.Common.RMTestBase
21+
public class AzureRmAliasTests : AccountsTestRunner
2322
{
24-
public XunitTracingInterceptor _logger;
25-
26-
public ExpressRouteCrossConnectionTests(ITestOutputHelper output)
23+
public AzureRmAliasTests(ITestOutputHelper output)
24+
: base(output)
2725
{
28-
_logger = new XunitTracingInterceptor(output);
29-
XunitTracingInterceptor.AddToContext(_logger);
3026
}
3127

3228
[Fact]
3329
[Trait(Category.AcceptanceType, Category.CheckIn)]
34-
[Trait(Category.Owner, NrpTeamAlias.pgtm)]
35-
public void TestExpressRouteCrossConnectionApis()
30+
public void AzureRmAliasCRUD()
3631
{
37-
NetworkResourcesController.NewInstance.RunPsTest(_logger, "Test-ExpressRouteCrossConnectionApis");
32+
TestRunner.RunTestScript("Test-AzureRmAlias");
3833
}
3934
}
4035
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Tests Enable-AzureRmAlias and Disable-AzureRmAlias
18+
#>
19+
function Test-AzureRmAlias
20+
{
21+
Disable-AzureRmAlias
22+
Assert-Throws { Get-AzureRmSubscription }
23+
Enable-AzureRmAlias
24+
Get-AzureRmSubscription
25+
26+
Disable-AzureRmAlias -Scope "Process" -Module Az.Accounts
27+
Assert-Throws { Get-AzureRmSubscription }
28+
Enable-AzureRmAlias -Module Az.Compute, Az.Resources
29+
Assert-Throws { Get-AzureRmSubscription }
30+
Enable-AzureRmAlias -Scope "Process" -Module Az.Accounts
31+
Get-AzureRmSubscription
32+
33+
$PROFILE = New-Object PSObject -Property @{
34+
CurrentUserAllHosts = Join-Path $PSScriptRoot "CurrentUserProfile.ps1";
35+
AllUsersAllHosts = Join-Path $PSScriptRoot "AllUsersProfile.ps1"
36+
}
37+
38+
Disable-AzureRmAlias
39+
Assert-Throws { Get-AzureRmSubscription }
40+
Enable-AzureRmAlias -Scope "CurrentUser" -Module Az.Accounts
41+
Get-AzureRmSubscription
42+
$azureSession = [Microsoft.Azure.Commands.Common.Authentication.AzureSession]::Instance
43+
$file = $azureSession.DataStore.ReadFileAsText($PROFILE.CurrentUserAllHosts)
44+
45+
$expected =
46+
"*#Begin Azure PowerShell alias import*Import-Module Az.Accounts -ErrorAction SilentlyContinue -ErrorVariable importError"+
47+
"*if (`$importerror.Count -eq 0) { * Enable-AzureRmAlias -Module Az.Accounts -ErrorAction SilentlyContinue; *}*#End Azure PowerShell alias import"
48+
49+
if ($file -notlike $expected)
50+
{
51+
throw "Incorrect string written to file."
52+
}
53+
54+
Enable-AzureRmAlias -Scope "LocalMachine" -Module Az.Accounts
55+
$file = $azureSession.DataStore.ReadFileAsText($PROFILE.AllUsersAllHosts)
56+
if ($file -notlike $expected)
57+
{
58+
throw "Incorrect string written to file."
59+
}
60+
}

0 commit comments

Comments
 (0)