Skip to content

Commit

Permalink
Merge branch 'DiskAccess' of https://github.com/Azure/azure-powershell
Browse files Browse the repository at this point in the history
…into DiskAccess
  • Loading branch information
haagha committed Aug 17, 2020
2 parents bfe92ac + ff6e58e commit 017559c
Show file tree
Hide file tree
Showing 797 changed files with 45,516 additions and 14,970 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
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
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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ The **Remove-AzAutomationDscConfiguration** cmdlet removes APS Desired State Con

## EXAMPLES

### Example 1

Removes DSC configurations from Automation. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Remove-AzAutomationDscConfiguration -AutomationAccountName 'AutomationAccount01' -Name 'Configuration01' -ResourceGroupName myresourcegroup
```

## PARAMETERS

### -AutomationAccountName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ Automation stores DSC node configuration as a Managed Object Format (MOF) config

## EXAMPLES

### Example 1

Removes metadata from DSC node configurations in Automation. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Remove-AzAutomationDscNodeConfiguration -AutomationAccountName 'AutomationAccount01' -IgnoreNodeMappings -Name 'Configuration01' -ResourceGroupName myresourcegroup
```

## PARAMETERS

### -AutomationAccountName
Expand Down
11 changes: 10 additions & 1 deletion src/Automation/Automation/help/Set-AzAutomationWebhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ The **Set-AzAutomationWebhook** cmdlet modifies a webhook for an Azure Automatio
## EXAMPLES

### Example 1: Disable a webhook
```
```powershell
PS C:\>Set-AzAutomationWebhook -Name "Webhook01" -ResourceGroup "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -IsEnabled $False
```

This command disables a webhook named Webhook01 in the Automation account named AutomationAccount01.

### Example 2

Modifies a webhook for an Automation runbook. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Set-AzAutomationWebhook -AutomationAccountName 'AutomationAccount01' -IsEnabled $false -Name 'Webhook01' -Parameters <IDictionary> -ResourceGroupName 'ResourceGroup01'
```

## PARAMETERS

### -AutomationAccountName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ Name SourceType Branch FolderPath AutoSync PublishRunbook RepoUrl
VSTSNative VsoTfvc /MyRunbooks False False https://contoso.visualstudio.com/_git/Fin...
```

### Example 2

Updates an Azure Automation source control. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Update-AzAutomationSourceControl -AccessToken <SecureString> -AutomationAccountName 'devAccount' -Name 'VSTSNative' -ResourceGroupName 'rg1'
```

## PARAMETERS

### -AccessToken
Expand Down
1 change: 0 additions & 1 deletion src/CognitiveServices/CognitiveServices/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
- Additional information about change #1
-->
## Upcoming Release
* Show additional legal terms for certain APIs.

## Version 1.5.1
* Used `Deny` specifically as NetworkRules default action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="7.3.0-preview" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -245,24 +245,6 @@ public override void ExecuteCmdlet()
}
}
}

if (Type.Equals("Face", StringComparison.InvariantCultureIgnoreCase))
{
if (Force.IsPresent)
{
WriteWarning(Resources.NewAccount_LegalTerm_NotPolice);
}
else
{
bool yesToAll = false, noToAll = false;
if (!ShouldContinue(Resources.NewAccount_LegalTerm_NotPolice, "Notice", true, ref yesToAll, ref noToAll))
{
return;
}
}
}


try
{
CognitiveServicesAccount createAccountResponse = CognitiveServicesClient.Accounts.Create(
Expand Down
Loading

0 comments on commit 017559c

Please sign in to comment.