Skip to content

Commit 0a294b6

Browse files
Merge branch 'master' into tc-core-automation
2 parents 128d887 + a2f3905 commit 0a294b6

File tree

1,978 files changed

+516740
-337513
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,978 files changed

+516740
-337513
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

documentation/testing-docs/using-azure-test-framework.md

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
- [New-TestCredential](#new-testcredential)
77
- [Create New Service Principal](#create-new-service-principal)
88
- [Use Existing Service Principal](#use-existing-service-principal)
9-
- [UserId](#userid)
109
- [Set-TestEnvironment](#set-testenvironment)
1110
- [Existing Service Principal](#existing-service-principal)
12-
- [UserId](#userid)
1311
- [Manually Set Environment Variables](#manually-set-environment-variables)
1412
- [Environment Variables](#environment-variables)
1513
- [Playback Test](#playback-test)
@@ -51,11 +49,11 @@ This cmdlet, located in the [`Repo-Tasks` module](/tools/Repo-Tasks.psd1), which
5149
Using a service principal is the preferred option for recording tests because it works with both .NET Framework and .NET Core. In order to create a new service principal, run this command with an unused service principal display name:
5250

5351
```powershell
54-
New-TestCredential -ServicePrincipalDisplayName "ScenarioTestCredentials" -ServicePrincipalSecret `
55-
"testpassword" -SubscriptionId <subscriptionId> -TenantId <tenantId> -RecordMode "Record"
52+
New-TestCredential -ServicePrincipalDisplayName "ScenarioTestCredentials" -SubscriptionId `
53+
<subscriptionId> -TenantId <tenantId> -RecordMode "Record"
5654
```
5755

58-
This command will create a new service principal, set the correct role assignment for this service principal based upon the subscription provided, and place the service principal id and secret into the credentials file.
56+
This command will create a new service principal, set the correct role assignment for this service principal based upon the subscription provided, and place the service principal id and automatically generated secret into the credentials file.
5957

6058
Alternatively, to create a service principal, follow the [Azure AD guide to create a Application Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#create-an-active-directory-application). The application type should be `Web app / API` and the sign-on URL value is irrelevant (you can set any value).
6159

@@ -68,15 +66,6 @@ New-TestCredential -ServicePrincipalDisplayName "Existing Service Principal" -Se
6866
"testpassword" -SubscriptionId <subscriptionId> -TenantId <tenantId> -RecordMode "Record"
6967
```
7068

71-
#### UserId
72-
73-
This is no longer the preferred option because it only works when running on .NET Framework. When running on .NET Core you may get an error like `Interactive Login is supported only in NET45 projects`. Additionally, you will have to manually log in when running the scenario tests rather than being automatically validated.
74-
75-
```powershell
76-
New-TestCredential -UserId "[email protected]" -SubscriptionId <subscriptionId> `
77-
-TenantId <tenantId> -RecordMode "Record"
78-
```
79-
8069
### Set-TestEnvironment
8170

8271
This cmdlet, located in the [`Repo-Tasks` module](/tools/Repo-Tasks.psd1), will directly set the environment variable for the session.
@@ -90,15 +79,6 @@ Set-TestEnvironment -ServicePrincipalId <servicePrincipalId> -ServicePrincipalSe
9079
"testpassword" -SubscriptionId <subscriptionId> -TenantId <tenantId> -RecordMode "Record"
9180
```
9281

93-
#### UserId
94-
95-
This is no longer the preferred option because it only works when running on .NET Framework. When running on .NET Core you may get an error like `Interactive Login is supported only in NET45 projects`.
96-
97-
```powershell
98-
Set-TestEnvironment -UserId "[email protected]" -SubscriptionId <subscriptionId> `
99-
-TenantId <tenantId> -RecordMode "Record"
100-
```
101-
10282
### Manually Set Environment Variables
10383

10484
#### Environment Variables
@@ -118,21 +98,8 @@ TEST_CSM_ORGID_AUTHENTICATION=
11898
AZURE_TEST_MODE=Playback
11999
```
120100

121-
#### Record Test with Interactive login using OrgId
122-
123-
This is no longer the preferred option because it only works when running on .NET Framework. When running on .NET Core you may get an error like `Interactive Login is supported only in NET45 projects`.
124-
125-
To use this option, set the following environment variables before starting Visual Studio:
126-
127-
```
128-
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId={SubId};UserId={orgId};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
129-
AZURE_TEST_MODE=Record
130-
```
131-
132101
#### Record Test with service principal
133102

134-
This is the preferred option for recording tests because it works with both .NET Framework and .NET Core.
135-
136103
After the service principal is created, you will need to give it access to Azure resources. This can be done with the following PowerShell command, with the [Service Principal Application ID](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key) (this is a guid, not the display name of the service principal) substituted in for `{clientId}`.
137104

138105
```powershell

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
}

0 commit comments

Comments
 (0)