Skip to content

Sync with latest #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
89b7856
Revert "Show "NotPolice" legal terms for Face. (#12618)" (#12645)
yangyuan Aug 12, 2020
2ab1287
[Synapse] Add Support for SqlPoolsV3 and SqlDatabases (#12600)
idear1203 Aug 12, 2020
c222b6e
authenticate token each time client is sending request (#12454)
VeryEarly Aug 12, 2020
4f95a11
Add Kusto Module. (#12648)
LucasYao93 Aug 12, 2020
20cf8ea
Bug fix- when getting metric alert from pipeline, the actions are del…
sivanguetta Aug 12, 2020
99df761
Add new examples to Relay (#12640)
aladdindoc Aug 12, 2020
51216ff
Support .NET Framework 4.x (#12650)
dingmeng-xue Aug 13, 2020
1e839fc
preload newtonsoft.json 12.0.3 (#12620)
isra-fel Aug 13, 2020
6a94502
Add breaking change notification (#12649)
wyunchi-ms Aug 13, 2020
1bbc20b
Adding CPlat SDK PowerShell team as Code owners (#12652)
madewithsmiles Aug 13, 2020
e9aed41
[Storage] Force overwrite Query result file (#12639)
blueww Aug 13, 2020
b81de1a
Merge modification of Az.MySql in generation to master (#12653)
msJinLei Aug 13, 2020
015c51a
Updated Az.Resources .NET SDK reference to 3.10.0-preview (#12656)
eladperets Aug 13, 2020
b9cdda1
Correct ImageBuilder MonitoringSolutions cmdlet and doc mapping (#12661)
dingmeng-xue Aug 13, 2020
6daf098
Aladdin generated examples for Automation (#12657)
aladdindoc Aug 13, 2020
e6c9641
Remove log4dotnet lib (#12662)
dingmeng-xue Aug 14, 2020
5f19e78
New cmdlet Invoke-AzVmPatchAssessment (#12658)
grizzlytheodore Aug 14, 2020
6638449
[Storage] Support ORS (#12668)
blueww Aug 14, 2020
a75f4c2
[Synapse] - Support ShouldProcess for 3 cmdlets (#12670)
idear1203 Aug 15, 2020
bbe51f8
Add new examples to OperationalInsights (#12674)
aladdindoc Aug 16, 2020
821adc9
Support creating cluster with encryption at host. (#12671)
aim-for-better Aug 17, 2020
49d95fd
[Synapse] Add integration runtime management cmdlets (#12647)
wonner Aug 17, 2020
f8dfc85
[KeyVault]Provide Warning Messages for SecretVaultText (#12676)
BethanyZhou Aug 17, 2020
3e9ac7a
[KeyVault] Provide Warning Messages for soft delete (#12672)
BethanyZhou Aug 17, 2020
7324352
Adding schedule fields to NewAzMaintenance Configuration cmdlet and n…
sotaneja Aug 18, 2020
775d267
Added runOn parameter to Set-AzAutomationWebhook (#12677)
anwather Aug 18, 2020
ef6a2ae
Add breaking changes warnings in preparation for October 27th milesto…
skayani Aug 18, 2020
4e5b718
[HanaOnAzure] Fix issue in powershell <7 (#12685)
isra-fel Aug 18, 2020
1fdb953
Polish changelog for release-2020-08-25 (#12686)
dingmeng-xue Aug 18, 2020
8c41bbd
Added AllowAll & ClientIpAddress Modes to firewall rule cmdlets (#12689)
msJinLei Aug 18, 2020
ddaf855
Load and merge all public cloud environments (#12688)
dingmeng-xue Aug 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# To make sure Network PRs go to the right branch, e.g. network-april
/src/Network/ @number213

/src/Compute/ @bilaakpan-ms @sandido @dkulkarni-ms @haagha @madewithsmiles @MS-syh2qs @grizzlytheodore
Binary file modified setup/InstallerChecks.CA.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion setup/InstallerChecks/InstallerChecks/InstallerChecks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Content Include="InstallerChecks.config" />
<Content Include="CustomAction.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
Expand Down
4 changes: 2 additions & 2 deletions src/Accounts/Accounts.Test/AzureRMProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,15 +1081,15 @@ public void CanRenewTokenLogin()
Assert.Equal(keyVaultToken2, account.GetProperty(AzureAccount.Property.KeyVaultAccessToken));
var factory = new ClientFactory();
var rmClient = factory.CreateArmClient<MockServiceClient>(profile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager);
var rmCred = rmClient.Credentials as TokenCredentials;
var rmCred = rmClient.Credentials as RenewingTokenCredential;
Assert.NotNull(rmCred);
var message = new HttpRequestMessage(HttpMethod.Get, rmClient.BaseUri.ToString());
rmCred.ProcessHttpRequestAsync(message, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
Assert.NotNull(message.Headers.Authorization);
Assert.NotNull(message.Headers.Authorization.Parameter);
Assert.Contains(accessToken2, message.Headers.Authorization.Parameter);
var graphClient = factory.CreateArmClient<MockServiceClient>(profile.DefaultContext, AzureEnvironment.Endpoint.Graph);
var graphCred = graphClient.Credentials as TokenCredentials;
var graphCred = graphClient.Credentials as RenewingTokenCredential;
Assert.NotNull(graphCred);
var graphMessage = new HttpRequestMessage(HttpMethod.Get, rmClient.BaseUri.ToString());
graphCred.ProcessHttpRequestAsync(graphMessage, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
Expand Down
11 changes: 10 additions & 1 deletion src/Accounts/Accounts/Account/ConnectAzureRmAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ConnectAzureRmAccountCommand : AzureContextModificationCmdlet, IMod
public const int DefaultMaxContextPopulation = 25;
public const string DefaultMaxContextPopulationString = "25";

private IAzureEnvironment _environment = AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud];
private IAzureEnvironment _environment;

[Parameter(Mandatory = false, HelpMessage = "Name of the environment containing the account to log into")]
[Alias("EnvironmentName")]
Expand Down Expand Up @@ -188,6 +188,15 @@ protected override IAzureContext DefaultContext
protected override void BeginProcessing()
{
base.BeginProcessing();
if (AzureEnvironment.PublicEnvironments.ContainsKey(EnvironmentName.AzureCloud))
{
_environment = AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud];
}
else
{
WriteWarning($"Default environment {EnvironmentName.AzureCloud} cannot be found from PublicEnvironment list. ");
WriteWarning("You can get current list via [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureEnvironment]::PublicEnvironments");
}
if (MyInvocation.BoundParameters.ContainsKey(nameof(Environment)))
{
var profile = GetDefaultProfile();
Expand Down
1 change: 1 addition & 0 deletions src/Accounts/Accounts/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Loaded all public cloud environments when discovery endpoint doesn't return default AzureCloud or other public environments [#12633]
* Exposed SubscriptionPolicies in `Get-AzSubscription` [#12551]

## Version 1.9.2
Expand Down
43 changes: 43 additions & 0 deletions src/Accounts/Authentication/Authentication/ExternalAccessToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Azure.Commands.Common.Authentication.Authentication
{
public class ExternalAccessToken : IAccessToken
{
public string AccessToken
{
get; set;
}

public string LoginType
{
get; set;
}

public string TenantId
{
get; set;
}

public string UserId
{
get; set;
}

private readonly Func<string> _refresh;

public ExternalAccessToken(string token, Func<string> refresh = null)
{
this.AccessToken = token;
this._refresh = refresh;
}

public void AuthorizeRequest(Action<string, string> authTokenSetter)
{
AccessToken = (_refresh == null) ? AccessToken : _refresh();
authTokenSetter("Bearer", AccessToken);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
using System.Security;
using Microsoft.Azure.Commands.Common.Authentication.Properties;
using System.Threading.Tasks;
using Microsoft.Azure.Commands.Common.Authentication.Authentication;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Common.Authentication.Factories
{
Expand Down Expand Up @@ -302,7 +304,7 @@ public ServiceClientCredentials GetServiceClientCredentials(IAzureContext contex
case AzureAccount.AccountType.Certificate:
throw new NotSupportedException(AzureAccount.AccountType.Certificate.ToString());
case AzureAccount.AccountType.AccessToken:
return new TokenCredentials(GetEndpointToken(context.Account, targetEndpoint));
return new RenewingTokenCredential(new ExternalAccessToken (GetEndpointToken(context.Account, targetEndpoint), () => GetEndpointToken(context.Account, targetEndpoint)));
}


Expand Down
4 changes: 4 additions & 0 deletions src/Aks/Aks/Commands/NewKubeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
using Microsoft.Azure.Management.ContainerService.Models;
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.Azure.Commands.Aks
{
public abstract class NewKubeBase : CreateOrUpdateKubeBase
{
[CmdletParameterBreakingChange("NodeVmSetType", ChangeDescription = "Default value will be changed from AvailabilitySet to VirtualMachineScaleSets.")]
[Parameter(Mandatory = false, HelpMessage = "Represents types of an node pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'")]
[PSArgumentCompleter("AvailabilitySet", "VirtualMachineScaleSets")]
public string NodeVmSetType { get; set; }
Expand All @@ -37,6 +39,7 @@ public abstract class NewKubeBase : CreateOrUpdateKubeBase
[Parameter(Mandatory = false, HelpMessage = "Maximum number of pods that can run on node.")]
public int NodeMaxPodCount { get; set; }

[CmdletParameterBreakingChange("NodeOsType", ChangeDescription = "NodeOsType will be removed as it supports only one value Linux.")]
[Parameter(Mandatory = false, HelpMessage = "OsType to be used to specify os type, currently support 'Linux' only here.")]
[PSArgumentCompleter("Linux")]
public string NodeOsType { get; set; }
Expand Down Expand Up @@ -92,6 +95,7 @@ public abstract class NewKubeBase : CreateOrUpdateKubeBase
+ "At least one lower case, one upper case, one special character !@#$%^&*(), the minimum lenth is 12.")]
public SecureString WindowsProfileAdminUserPassword { get; set; }

[CmdletParameterBreakingChange("NetworkPlugin", ChangeDescription = "Default value will be changed from None to azure.")]
[Parameter(Mandatory = false, HelpMessage = "Network plugin used for building Kubernetes network.")]
[PSArgumentCompleter("azure", "kubenet")]
public string NetworkPlugin { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@ public void SetAzureAutomationWebhookToDisabledSuccessful()
string name = "webhookName";

this.mockAutomationClient.Setup(
f => f.UpdateWebhook(resourceGroupName, accountName, name, null, false));
f => f.UpdateWebhook(resourceGroupName, accountName, name, null, false, "TestHybridGroup"));

// Test
this.cmdlet.ResourceGroupName = resourceGroupName;
this.cmdlet.AutomationAccountName = accountName;
this.cmdlet.Name = name;
this.cmdlet.IsEnabled = false;
this.cmdlet.Parameters = null;
this.cmdlet.RunOn = "TestHybridGroup";
this.cmdlet.ExecuteCmdlet();

// Assert
this.mockAutomationClient.Verify(
f => f.UpdateWebhook(resourceGroupName, accountName, name, null, false),
f => f.UpdateWebhook(resourceGroupName, accountName, name, null, false, "TestHybridGroup"),
Times.Once());
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Automation/Automation/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added `-RunOn` parameters to `Set-AzAutomationWebhook` to specify a Hybrid Worker Group

## Version 1.3.7
* Fixed the issue that string with escape chars cannot be converted into json object.
Expand Down
11 changes: 10 additions & 1 deletion src/Automation/Automation/Cmdlet/SetAzureAutomationWebhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public class SetAzureAutomationWebhook : AzureAutomationBaseCmdlet
HelpMessage = "The Runbook parameters name/value.")]
public IDictionary Parameters { get; set; }

/// <summary>
/// Gets or sets the optional hybrid agent friendly name upon which the runbook should be executed.
/// </summary>
[Parameter(Mandatory = false,
HelpMessage = "Optional name of the hybrid agent which should execute the runbook")]
[Alias("HybridWorker")]
public string RunOn { get; set; }

/// <summary>
/// Execute this cmdlet.
/// </summary>
Expand All @@ -60,7 +68,8 @@ protected override void AutomationProcessRecord()
this.AutomationAccountName,
this.Name,
this.Parameters,
this.IsEnabled);
this.IsEnabled,
this.RunOn);
this.WriteObject(updatedWebhook);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public Model.Webhook UpdateWebhook(
string automationAccountName,
string name,
IDictionary parameters,
bool? isEnabled)
bool? isEnabled,
string RunOn)
{
Requires.Argument("ResourceGroupName", resourceGroupName).NotNull();
Requires.Argument("AutomationAccountName", automationAccountName).NotNull();
Expand All @@ -168,6 +169,11 @@ public Model.Webhook UpdateWebhook(
webhookPatchParameters.Parameters =
this.ProcessRunbookParameters(resourceGroupName, automationAccountName, webhookModel.Runbook.Name, parameters);
}
if (RunOn != null)
{
webhookPatchParameters.RunOn = RunOn;

}
}

var webhook =
Expand Down
2 changes: 1 addition & 1 deletion src/Automation/Automation/Common/IAutomationPSClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Model.Webhook CreateWebhook(

IEnumerable<Model.Webhook> ListWebhooks(string resourceGroupName, string automationAccountName, string runbooName, ref string nextLink);

Model.Webhook UpdateWebhook(string resourceGroupName, string automationAccountName, string name, IDictionary parameters, bool? isEnabled);
Model.Webhook UpdateWebhook(string resourceGroupName, string automationAccountName, string name, IDictionary parameters, bool? isEnabled, string runOn);

void DeleteWebhook(string resourceGroupName, string automationAccountName, string name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@ for the source control VSTSNative.
```powershell
PS C:\> Get-AzAutomationSourceControlSyncJob -ResourceGroupName "rg1" `
-AutomationAccountName "devAccount" `
-Name "VSTSNative"
-Id "08d6d266-27b6-463c-beea-bc48a67ace15"
-Name "VSTSNative" `
-JobId "08d6d266-27b6-463c-beea-bc48a67ace15"

Status SyncType Exception
------ -------- ---------
Failed FullSync There were errors while syncing the user runbooks. Please see error streams for more information. (T...
```

### Example 3

Gets Azure Automation source control sync jobs. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Get-AzAutomationSourceControlSyncJob -AutomationAccountName 'devAccount' -JobId 00000000-0000-0000-0000-00000000000000000 -ResourceGroupName 'rg1' -SourceControlName 'VSTSNative'
```

## PARAMETERS

### -AutomationAccountName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,23 @@ Specify the path of an APS script that contains a single DSC configuration.
## EXAMPLES

### Example 1: Import a DSC configuration into Automation
```
PS C:\>Import-AzAutomationDscConfiguration -AutomationAccountName "Contoso17"-ResourceGroupName "ResourceGroup01" -SourcePath "C:\DSC\client.ps1" -Force
```powershell
PS C:\>Import-AzAutomationDscConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -SourcePath "C:\DSC\client.ps1" -Force
```

This command imports the DSC configuration in the file named client.ps1 into the Automation account
named Contoso17. The command specifies the *Force* parameter. If there is an existing DSC
configuration, this command replaces it.

### Example 2

Imports a DSC configuration into Automation. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Import-AzAutomationDscConfiguration -AutomationAccountName 'Contoso17' -Published -ResourceGroupName 'ResourceGroup01' -SourcePath 'C:\DSC\client.ps1'
```

## PARAMETERS

### -AutomationAccountName
Expand Down
11 changes: 10 additions & 1 deletion src/Automation/Automation/help/Import-AzAutomationRunbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For wps_2 Workflow runbooks, the script must contain a single wps_2 Workflow def
## EXAMPLES

### Example 1: Import a runbook from a file
```
```powershell
PS C:\> $Tags = @{"tag01"="value01"; "tag02"="value02"}
PS C:\> Import-AzAutomationRunbook -Path .\GraphicalRunbook06.graphrunbook -Tags $Tags -ResourceGroup "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -Type GraphicalPowershell
```
Expand All @@ -38,6 +38,15 @@ The first command assigns two key/value pairs to the $Tags variable.
The second command imports a graphical runbook called GraphicalRunbook06 into the Automation account named AutomationAccount01.
The command also assigns the tags stored in $Tags.

### Example 2

Imports an Automation runbook. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Import-AzAutomationRunbook -AutomationAccountName 'AutomationAccount01' -Name 'Configuration01' -Path .\GraphicalRunbook06.graphrunbook -Published -ResourceGroupName 'ResourceGroup01' -Type PowerShell
```

## PARAMETERS

### -AutomationAccountName
Expand Down
11 changes: 10 additions & 1 deletion src/Automation/Automation/help/New-AzAutomationAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ of other Automation accounts. Automation resources include runbooks, Desired Sta
## EXAMPLES

### Example 1: Create an automation account
```
```powershell
PS C:\> New-AzAutomationAccount -Name "ContosoAutomationAccount" -Location "East US" -ResourceGroupName "ResourceGroup01"
```

This command creates a new automation account named ContosoAutomationAccount in the East US region.

### Example 2

Creates an Automation account. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
New-AzAutomationAccount -Location 'East US' -Name 'ContosoAutomationAccount' -ResourceGroupName 'ResourceGroup01' -Tags <IDictionary>
```

## PARAMETERS

### -DefaultProfile
Expand Down
11 changes: 10 additions & 1 deletion src/Automation/Automation/help/New-AzAutomationRunbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ Specify a name for the runbook.
## EXAMPLES

### Example 1: Create a runbook
```
```powershell
PS C:\>New-AzAutomationRunbook -AutomationAccountName "Contoso17" -Name "Runbook02" -ResourceGroupName "ResourceGroup01"
```

This command creates a runbook named Runbook02 in the Azure Automation account named Contoso17.

### Example 2

Creates an Automation runbook. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
New-AzAutomationRunbook -AutomationAccountName 'Contoso17' -Name 'Runbook02' -ResourceGroupName 'ResourceGroup01' -Type PowerShell
```

## PARAMETERS

### -AutomationAccountName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@ The runbook starts based on the schedule you specify using the *ScheduleName* pa
## EXAMPLES

### Example 1: Associate a runbook with a schedule
```
```powershell
PS C:\>Register-AzAutomationScheduledRunbook -AutomationAccountName "Contoso17" -Name "Runbk01" -ScheduleName "Sched01" -ResourceGroupName "ResourceGroup01"
```

This command associates the runbook named Runbk01 with the schedule named Sched01 in the Azure Automation account named Contoso17.

### Example 2

Associates a runbook to a schedule. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Register-AzAutomationScheduledRunbook -AutomationAccountName 'Contoso17' -Parameters <IDictionary> -ResourceGroupName 'ResourceGroup01' -RunbookName 'Runbk01' -ScheduleName 'Sched01'
```

## PARAMETERS

### -AutomationAccountName
Expand Down
Loading