Skip to content

Commit f4b7685

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents ea02f47 + 04e24df commit f4b7685

File tree

11 files changed

+44
-46
lines changed

11 files changed

+44
-46
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
This repository contains a set of PowerShell cmdlets for developers and administrators to develop, deploy and manage Microsoft Azure applications.
55

6-
* For documentation on how to build and deploy applications to Microsoft Azure please see the [Microsoft Azure Documentation Center](http://azure.microsoft.com/en-us/documentation/).
7-
* For comprehensive documentation on the developer cmdlets see [How to install and configure Azure PowerShell](http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
6+
* For documentation on how to build and deploy applications to Microsoft Azure please see the [Microsoft Azure Documentation Center](https://azure.microsoft.com/en-us/documentation/).
7+
* For comprehensive documentation on the developer cmdlets see [How to install and configure Azure PowerShell](https://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
88
* For comprehensive documentation on the full set of Microsoft Azure cmdlets see [Microsoft Azure Management Center](http://go.microsoft.com/fwlink/?linkID=254459&clcid=0x409).
99

1010
## Features
@@ -55,17 +55,17 @@ For detail descriptions and examples of the cmdlets, type
5555

5656
## Supported Environments
5757

58-
* [Microsoft Azure](http://www.azure.microsoft.com)
58+
* [Microsoft Azure](https://azure.microsoft.com)
5959
* [Azure Stack](https://azure.microsoft.com/en-us/overview/azure-stack/)
60-
* [Windows Azure Pack](http://www.microsoft.com/en-us/server-cloud/windows-azure-pack.aspx)
61-
* [Microsoft Azure China](http://www.windowsazure.cn/)
60+
* [Windows Azure Pack](https://www.microsoft.com/en-us/server-cloud/windows-azure-pack.aspx)
61+
* [Microsoft Azure China](https://www.azure.cn/)
6262
* [USGovernment](https://azure.microsoft.com/en-us/features/gov/)
6363

6464
## Installation
6565

6666
### Microsoft Web Platform Installer
6767

68-
1. Install [Microsoft Web Platform Installer](http://www.microsoft.com/web/downloads/platform.aspx).
68+
1. Install [Microsoft Web Platform Installer](https://www.microsoft.com/web/downloads/platform.aspx).
6969
2. Open Microsoft Web Platform Installer and search for __Microsoft Azure PowerShell__.
7070
3. Install.
7171

@@ -84,15 +84,15 @@ You can also find the standalone installers for all the versions at [Downloads](
8484

8585
### Supported PowerShell Versions
8686

87-
* [Windows Management Framework 3] (http://www.microsoft.com/en-us/download/details.aspx?id=34595)
87+
* [Windows Management Framework 3] (https://www.microsoft.com/en-us/download/details.aspx?id=34595)
8888
* [Windows Management Framework 4] (https://www.microsoft.com/en-us/download/details.aspx?id=40855)
8989
* [Windows Management Framework 5] (https://www.microsoft.com/en-us/download/details.aspx?id=50395)
9090

9191
## Get Started
9292

9393
In general, following are the steps to start using Microsoft Azure PowerShell
9494

95-
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
95+
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](https://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
9696
* Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
9797
* Starting from 1.0.0, you can use ```Add-AzureRmAccount -Credential``` to avoid the browser pop up for Organizational account.
9898
* To use RDFE cmdlets, use ```Add-AzureAccount```
@@ -120,7 +120,7 @@ New-AzureRmResourceGroup -Name myresourceGroup -Location "West US"
120120
Add-AzureRmAccount -EnvironmentName AzureChinaCloud
121121
122122
# use the cmdlets to manage your services/applications
123-
New-AzureRmResourceGroup -Name myresourceGroup -Location "Chine East"
123+
New-AzureRmResourceGroup -Name myresourceGroup -Location "China East"
124124
```
125125

126126
### Windows Azure Pack
@@ -181,10 +181,10 @@ Be sure to check out the [Microsoft Azure Developer Forums on Stack Overflow](ht
181181

182182
## Contribute Code or Provide Feedback
183183

184-
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
184+
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://azure.github.io/guidelines/).
185185

186186
If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-powershell/issues) section of the project.
187187

188188
# Learn More
189189

190-
* [Microsoft Azure Script Center](http://www.azure.microsoft.com/en-us/documentation/scripts/)
190+
* [Microsoft Azure Script Center](https://azure.microsoft.com/en-us/documentation/scripts/)

src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupTestBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Net.Security;
2525
using System.Reflection;
2626
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
27+
using System.Collections.Generic;
2728

2829
namespace Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests
2930
{
@@ -58,6 +59,14 @@ protected void SetupManagementClients()
5859

5960
protected void RunPowerShellTest(params string[] scripts)
6061
{
62+
Dictionary<string, string> d = new Dictionary<string, string>();
63+
d.Add("Microsoft.Resources", null);
64+
d.Add("Microsoft.Features", null);
65+
d.Add("Microsoft.Authorization", null);
66+
d.Add("Microsoft.Compute", null);
67+
var providersToIgnore = new Dictionary<string, string>();
68+
providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
69+
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
6170
using (UndoContext context = UndoContext.Current)
6271
{
6372
context.Start(TestUtilities.GetCallingClass(2), TestUtilities.GetCurrentMethodName(2));

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Components/Constants.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public static class Constants
5454
/// </summary>
5555
public static readonly string DefaultApiVersion = "2015-01-01";
5656

57+
/// <summary>
58+
/// The default policy API version.
59+
/// </summary>
60+
public static readonly string PolicyApiVersion = "2015-10-01-preview";
61+
5762
/// <summary>
5863
/// The move action.
5964
/// </summary>

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/GetAzurePolicyAssignment.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,13 @@ private async Task<ResponseWithContinuation<JObject[]>> GetResources()
100100
{
101101
string resourceId = this.Id ?? this.GetResourceId();
102102

103-
var apiVersion = await this
104-
.DetermineApiVersion(resourceId: resourceId)
105-
.ConfigureAwait(continueOnCapturedContext: false);
106-
107103
if (IsResourceGet(resourceId))
108104
{
109105
var resource = await this
110106
.GetResourcesClient()
111107
.GetResource<JObject>(
112108
resourceId: resourceId,
113-
apiVersion: apiVersion,
109+
apiVersion: Constants.PolicyApiVersion,
114110
cancellationToken: this.CancellationToken.Value,
115111
odataQuery: null)
116112
.ConfigureAwait(continueOnCapturedContext: false);
@@ -126,7 +122,7 @@ private async Task<ResponseWithContinuation<JObject[]>> GetResources()
126122
.GetResourcesClient()
127123
.ListObjectColleciton<JObject>(
128124
resourceCollectionId: resourceId,
129-
apiVersion: apiVersion,
125+
apiVersion: Constants.PolicyApiVersion,
130126
cancellationToken: this.CancellationToken.Value,
131127
odataQuery: filter)
132128
.ConfigureAwait(continueOnCapturedContext: false);
@@ -141,7 +137,7 @@ private async Task<ResponseWithContinuation<JObject[]>> GetResources()
141137
.GetResourcesClient()
142138
.ListObjectColleciton<JObject>(
143139
resourceCollectionId: resourceId,
144-
apiVersion: apiVersion,
140+
apiVersion: Constants.PolicyApiVersion,
145141
cancellationToken: this.CancellationToken.Value,
146142
odataQuery: filter)
147143
.ConfigureAwait(continueOnCapturedContext: false);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/GetAzurePolicyDefinition.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,13 @@ private async Task<ResponseWithContinuation<JObject[]>> GetResources()
8585
{
8686
string resourceId = this.Id ?? this.GetResourceId();
8787

88-
var apiVersion = await this
89-
.DetermineApiVersion(resourceId: resourceId)
90-
.ConfigureAwait(continueOnCapturedContext: false);
91-
9288
if (!string.IsNullOrEmpty(ResourceIdUtility.GetResourceName(resourceId)))
9389
{
9490
var resource = await this
9591
.GetResourcesClient()
9692
.GetResource<JObject>(
9793
resourceId: resourceId,
98-
apiVersion: apiVersion,
94+
apiVersion: Constants.PolicyApiVersion,
9995
cancellationToken: this.CancellationToken.Value)
10096
.ConfigureAwait(continueOnCapturedContext: false);
10197
ResponseWithContinuation<JObject[]> retVal;
@@ -109,7 +105,7 @@ private async Task<ResponseWithContinuation<JObject[]>> GetResources()
109105
.GetResourcesClient()
110106
.ListObjectColleciton<JObject>(
111107
resourceCollectionId: resourceId,
112-
apiVersion: apiVersion,
108+
apiVersion: Constants.PolicyApiVersion,
113109
cancellationToken: this.CancellationToken.Value)
114110
.ConfigureAwait(continueOnCapturedContext: false);
115111
}

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/NewAzurePolicyAssignment.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ protected override void OnProcessRecord()
6868
throw new PSInvalidOperationException("The supplied PolicyDefinition object is invalid.");
6969
}
7070
string resourceId = GetResourceId();
71-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
7271

7372
var operationResult = this.GetResourcesClient()
7473
.PutResource(
7574
resourceId: resourceId,
76-
apiVersion: apiVersion,
75+
apiVersion: Constants.PolicyApiVersion,
7776
resource: this.GetResource(),
7877
cancellationToken: this.CancellationToken.Value,
7978
odataQuery: null)
@@ -82,7 +81,7 @@ protected override void OnProcessRecord()
8281
var managementUri = this.GetResourcesClient()
8382
.GetResourceManagementRequestUri(
8483
resourceId: resourceId,
85-
apiVersion: apiVersion,
84+
apiVersion: Constants.PolicyApiVersion,
8685
odataQuery: null);
8786

8887
var activity = string.Format("PUT {0}", managementUri.PathAndQuery);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/NewAzurePolicyDefinition.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ protected override void OnProcessRecord()
6666
{
6767
base.OnProcessRecord();
6868
string resourceId = GetResourceId();
69-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
7069

7170
var operationResult = this.GetResourcesClient()
7271
.PutResource(
7372
resourceId: resourceId,
74-
apiVersion: apiVersion,
73+
apiVersion: Constants.PolicyApiVersion,
7574
resource: this.GetResource(),
7675
cancellationToken: this.CancellationToken.Value,
7776
odataQuery: null)
@@ -80,7 +79,7 @@ protected override void OnProcessRecord()
8079
var managementUri = this.GetResourcesClient()
8180
.GetResourceManagementRequestUri(
8281
resourceId: resourceId,
83-
apiVersion: apiVersion,
82+
apiVersion: Constants.PolicyApiVersion,
8483
odataQuery: null);
8584

8685
var activity = string.Format("PUT {0}", managementUri.PathAndQuery);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/RemoveAzurePolicyAssignment.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,18 @@ private void RunCmdlet()
8585
resourceId,
8686
() =>
8787
{
88-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
89-
9088
var operationResult = this.GetResourcesClient()
9189
.DeleteResource(
9290
resourceId: resourceId,
93-
apiVersion: apiVersion,
91+
apiVersion: Constants.PolicyApiVersion,
9492
cancellationToken: this.CancellationToken.Value,
9593
odataQuery: null)
9694
.Result;
9795

9896
var managementUri = this.GetResourcesClient()
9997
.GetResourceManagementRequestUri(
10098
resourceId: resourceId,
101-
apiVersion: apiVersion,
99+
apiVersion: Constants.PolicyApiVersion,
102100
odataQuery: null);
103101

104102
var activity = string.Format("DELETE {0}", managementUri.PathAndQuery);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/RemoveAzurePolicyDefinition.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,18 @@ private void RunCmdlet()
7878
resourceId,
7979
() =>
8080
{
81-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
82-
8381
var operationResult = this.GetResourcesClient()
8482
.DeleteResource(
8583
resourceId: resourceId,
86-
apiVersion: apiVersion,
84+
apiVersion: Constants.PolicyApiVersion,
8785
cancellationToken: this.CancellationToken.Value,
8886
odataQuery: null)
8987
.Result;
9088

9189
var managementUri = this.GetResourcesClient()
9290
.GetResourceManagementRequestUri(
9391
resourceId: resourceId,
94-
apiVersion: apiVersion,
92+
apiVersion: Constants.PolicyApiVersion,
9593
odataQuery: null);
9694

9795
var activity = string.Format("DELETE {0}", managementUri.PathAndQuery);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/SetAzurePolicyAssignment.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,20 @@ protected override void OnProcessRecord()
7676
{
7777
base.OnProcessRecord();
7878
string resourceId = this.Id ?? this.GetResourceId();
79-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
8079

8180
var operationResult = this.GetResourcesClient()
8281
.PutResource(
8382
resourceId: resourceId,
84-
apiVersion: apiVersion,
85-
resource: this.GetResource(resourceId, apiVersion),
83+
apiVersion: Constants.PolicyApiVersion,
84+
resource: this.GetResource(resourceId, Constants.PolicyApiVersion),
8685
cancellationToken: this.CancellationToken.Value,
8786
odataQuery: null)
8887
.Result;
8988

9089
var managementUri = this.GetResourcesClient()
9190
.GetResourceManagementRequestUri(
9291
resourceId: resourceId,
93-
apiVersion: apiVersion,
92+
apiVersion: Constants.PolicyApiVersion,
9493
odataQuery: null);
9594

9695
var activity = string.Format("PUT {0}", managementUri.PathAndQuery);

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Policy/SetAzurePolicyDefinition.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,20 @@ protected override void OnProcessRecord()
8484
{
8585
base.OnProcessRecord();
8686
string resourceId = this.Id ?? this.GetResourceId();
87-
var apiVersion = this.DetermineApiVersion(resourceId: resourceId).Result;
8887

8988
var operationResult = this.GetResourcesClient()
9089
.PutResource(
9190
resourceId: resourceId,
92-
apiVersion: apiVersion,
93-
resource: this.GetResource(resourceId, apiVersion),
91+
apiVersion: Constants.PolicyApiVersion,
92+
resource: this.GetResource(resourceId, Constants.PolicyApiVersion),
9493
cancellationToken: this.CancellationToken.Value,
9594
odataQuery: null)
9695
.Result;
9796

9897
var managementUri = this.GetResourcesClient()
9998
.GetResourceManagementRequestUri(
10099
resourceId: resourceId,
101-
apiVersion: apiVersion,
100+
apiVersion: Constants.PolicyApiVersion,
102101
odataQuery: null);
103102

104103
var activity = string.Format("PUT {0}", managementUri.PathAndQuery);

0 commit comments

Comments
 (0)