Skip to content

Commit 3fb25d1

Browse files
authored
Merge branch 'master' into get-azure-resource-cmdlet-cs
2 parents c7450ed + 0c3118b commit 3fb25d1

File tree

117 files changed

+10015
-4173
lines changed

Some content is hidden

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

117 files changed

+10015
-4173
lines changed

.azure-pipelines/powershell-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ variables:
44
LinuxName: linux
55
LinuxImage: ubuntu-18.04
66
MacOSName: macOS
7-
MacOSImage: macOS-10.13
7+
MacOSImage: macOS-10.14
88
TestFramework: netcoreapp2.2
99
TestTarget: Test
1010
Configuration: Debug

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please follow [Docker's official instructions][install] to install `docker` corr
1515

1616
## Release
1717

18-
The release containers derive from the [Powershell image][powershell image], and then install the current Az package.
18+
The release containers derive from the [Powershell image][powershell image], and then install the current Az package. The current images are using PowerShell 6.2.4, we are planning to add support for PowerShell 7 in the near future.
1919

2020
[powershell image]: https://hub.docker.com/_/microsoft-powershell
2121

@@ -99,4 +99,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open
9999

100100
[conduct-code]: http://opensource.microsoft.com/codeofconduct/
101101
[conduct-FAQ]: http://opensource.microsoft.com/codeofconduct/faq/
102-
[conduct-email]: mailto:[email protected]
102+
[conduct-email]: mailto:[email protected]

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

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

33
The Azure PowerShell Developer Guide was created to help with the development and testing of Azure PowerShell cmdlets. This guide contains information on how to set up your environment, create a new project, implement cmdlets, record and run tests, and more.
44

5+
**Note: Except for the way described in this page, There is a new way to generate PowerShell modules through AutoRest PowerShell generator. And related links are attached in the end.**
6+
57
# Table of Contents
68

79
- [Prerequisites](#prerequisites)
@@ -36,6 +38,7 @@ The Azure PowerShell Developer Guide was created to help with the development an
3638
- [After Development](#after-development)
3739
- [Misc](#misc)
3840
- [Publish to PowerShell Gallery](#publish-to-powershell-gallery)
41+
- [Autorest PowerShell Generator](#autorest-powershell-generator)
3942

4043
# Prerequisites
4144

@@ -317,3 +320,7 @@ Whenever you make updates to a project, please make sure to update the correspon
317320
## Publish to PowerShell Gallery
318321

319322
To publish your module to the [official PowerShell gallery](http://www.powershellgallery.com/) or the test gallery site, contact the Azure PowerShell team
323+
324+
# AutoRest PowerShell Generator
325+
- [autorest.powershell documentation](https://github.com/Azure/autorest.powershell/tree/master/docs)
326+
- [examples](https://github.com/Azure/azure-powershell/tree/generation/src)

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fix Get-AzTenant/Get-AzDefault/Set-AzDefault throw NullReferenceException when not login
2122

2223
## Version 1.7.3
2324
* Open Azure PowerShell survey page in `Send-Feedback` [#11020]

src/Accounts/Accounts/Default/ClearAzureRmDefault.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override void ExecuteCmdlet()
4646
throw new Exception("Default Resource Group cannot be set on CloudShell");
4747
}
4848

49-
IAzureContext context = AzureRmProfileProvider.Instance.Profile.DefaultContext;
49+
IAzureContext context = DefaultContext;
5050
// If no parameters are specified, clear all defaults
5151
if (!ResourceGroup)
5252
{

src/Accounts/Accounts/Default/GetAzureRmDefault.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class GetAzureRMDefaultCommand : AzureRMCmdlet
3737

3838
public override void ExecuteCmdlet()
3939
{
40-
IAzureContext context = AzureRmProfileProvider.Instance.Profile.DefaultContext;
40+
IAzureContext context = DefaultContext;
4141
IResourceManagementClient client = AzureSession.Instance.ClientFactory.CreateCustomArmClient<ResourceManagementClient>(
4242
context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager),
4343
AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ResourceManager),

src/Accounts/Accounts/Default/SetAzureRMDefault.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override void ExecuteCmdlet()
5050
throw new Exception("Default Resource Group cannot be set on CloudShell");
5151
}
5252

53-
IAzureContext context = AzureRmProfileProvider.Instance.Profile.DefaultContext;
53+
IAzureContext context = DefaultContext;
5454
IResourceManagementClient resourceManagementclient = AzureSession.Instance.ClientFactory.CreateCustomArmClient<ResourceManagementClient>(
5555
context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager),
5656
AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ResourceManager),

src/Accounts/Accounts/Models/RMProfileClient.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ public class RMProfileClient
4141
private IAzureTokenCache _cache;
4242
public Action<string> WarningLog;
4343

44+
private IAzureContext DefaultContext
45+
{
46+
get
47+
{
48+
if(_profile == null || _profile.DefaultContext == null || _profile.DefaultContext.Account == null)
49+
{
50+
throw new PSInvalidOperationException(ResourceMessages.RunConnectAccount);
51+
}
52+
return _profile.DefaultContext;
53+
}
54+
}
55+
4456
public RMProfileClient(IProfileOperations profile)
4557
{
4658
_profile = profile;
@@ -368,7 +380,7 @@ public List<AzureTenant> ListTenants(string tenant = "")
368380
return new List<AzureTenant>() { CreateTenant(tenant) };
369381
}
370382

371-
List<AzureTenant> tenants = ListAccountTenants(_profile.DefaultContext.Account, _profile.DefaultContext.Environment, null, ShowDialog.Never, null);
383+
List<AzureTenant> tenants = ListAccountTenants(DefaultContext.Account, DefaultContext.Environment, null, ShowDialog.Never, null);
372384
return tenants.Where(t => string.IsNullOrEmpty(tenant) ||
373385
tenant.Equals(t.Id.ToString(), StringComparison.OrdinalIgnoreCase) ||
374386
tenant.Equals(t.Directory, StringComparison.OrdinalIgnoreCase))

src/DataLakeStore/DataLakeStore.Test/ScenarioTests/AdlsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void TestAdlsAccountTiers()
6666
NewInstance.RunPsTest(_logger, string.Format("Test-DataLakeStoreAccountTiers -location '{0}'", AdlsTestsBase.ResourceGroupLocation));
6767
}
6868

69-
[Fact]
69+
[Fact(Skip="This case has been unstable on Linux for approximately 20% of failure. Needs investigation.")]
7070
[Trait(Category.AcceptanceType, Category.CheckIn)]
7171
public void TestAdlsFileSystem()
7272
{

src/IotCentral/IotCentral.Test/IotCentral.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="2.1.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.IotCentral" Version="2.2.0" />
1515
</ItemGroup>
1616

1717
</Project>

0 commit comments

Comments
 (0)