Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
wyunchi-ms authored Apr 26, 2020
2 parents df34ade + c21b196 commit 6fee950
Show file tree
Hide file tree
Showing 158 changed files with 8,507 additions and 5,793 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## `Prerequisite`
## Prerequisite
API for `Get` private link resource and private endpoint connection need to be ready at:

#### Private Link Resource API
Expand All @@ -9,30 +9,37 @@ API for `Get` private link resource and private endpoint connection need to be r
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Level-Resource}/{Top-Level-Resource-Name}/privateLinkResources/{PrivateLinkResource-Name}"
```

#### Private Endpoint Connection API
#### Get Private Endpoint Connection API
```
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Level-Resource}/{Top-Level-Resource-Name}/privateEndpointConnections/{PrivateEndpointConnection-Name}"
```
#### List Private Endpoint Connection API
```
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Level-Resource}/{Top-Level-Resource-Name}/privateEndpointConnections"
```

## `Code Changes Needed`
if "List Private Endpoint Connection API" is not available, `Private Endpoint Connection` will be retrieved from top resource
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Level-Resource}/{Top-Level-Resource-Name}"
`privateEndpointConnections` need to be defined under this API

## Code Changes Needed
Add corresponding {Provider}, {Top-Level-Resource} and {API-Version} into [ProviderConfiguration.cs](https://github.com/Azure/azure-powershell/blob/master/src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/ProviderConfiguration.cs#L12)
in following pattern:
```
RegisterConfiguration("{Provider}/{Top-Level-Resource}", "{API-Version}")
```
For example:

if "List Private Endpoint Connection API" is [available](https://github.com/Azure/azure-powershell/blob/master/src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs#L74),
```
RegisterConfiguration("Microsoft.Sql/servers", "2018-06-01-preview")
```
if "Private Endpoint Connection API" is not available, provide extra bool parameter 'false'
if "List Private Endpoint Connection API" is [not available](https://github.com/Azure/azure-powershell/blob/master/src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs#L93), provide extra bool parameter 'false'
```
RegisterConfiguration("Microsoft.Storage/storageAccounts", "2019-06-01", false)
```

## `End-To-End Test`
## End-To-End Test

### Item Needed

Expand Down Expand Up @@ -71,14 +78,16 @@ New-AzPrivateEndpoint -ResourceGroupName {rg_name} -Name {endpoint_name} -Locati
```

### step-by-step
1. Create listed items above
* Add `Network.csproj` to {Module}.sln, and `Microsoft.Azure.Management.Network` to {Module}.Test.csproj

* Create listed items above

2. To get the connection, if `list` for private endpoint connection was supported,
* To get the connection, if `list` for private endpoint connection was supported,
```
$connection = Get-AzPrivateEndpointConnection -PrivateLinkResourceId $TopLevelResource.Id
```

3. To get the connection, if `list` for private endpoint connection was not supported,
* To get the connection, if `list` for private endpoint connection was not supported,
```
$TopLevelResource = Get-Az{Top-Level-Resource} -ResourceGroupName {rg_name} -Name {top_level_resource_name}
Expand All @@ -87,7 +96,7 @@ $ConnectionId = $TopLevelResource.PrivateEndpointConnection[0].Id
$Connection = Get-AzPrivateEndpointConnection -ResourceId $ConnectionId
```

4. Approve/Deny the connection
* Approve/Deny the connection
```
Approve-AzPrivateEndpointConnection -ResourceId $ConnectionId
Expand All @@ -96,6 +105,6 @@ or
Deny-AzPrivateEndpointConnection -ResourceId $ConnectionId
```

5. Connection cannot be approved after rejection
* Connection cannot be approved after rejection

6. One top level resource can have maximum 3 private end point connection
* One top level resource can have maximum 3 private end point connection
40 changes: 24 additions & 16 deletions src/Accounts/Accounts/help/Disable-AzDataCollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ schema: 2.0.0
# Disable-AzDataCollection

## SYNOPSIS
Opts out of collecting data to improve the AzurePowerShell cmdlets.
Data is not collected unless you explicitly opt in.
Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default
unless you explicitly opt out.

## SYNTAX

Expand All @@ -18,27 +18,30 @@ Disable-AzDataCollection [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-
```

## DESCRIPTION
You can improve the experience of using the Microsoft Cloud and Azure PowerShell by opting in to data collection.
Azure PowerShell does not collect data without your consent - you must explicitly opt in by executing Enable-AzDataCollection, or by answering yes when Azure PowerShell prompts you about collecting data the first time you execute a cmdlet.
Microsoft aggregates collected data to identify patterns of usage, to identify common issues and to improve the experience of using Azure PowerShell.
Microsoft Azure PowerShell does not collect any private data, or any personally identifiable information.
Run the Disable-AzDataCollection cmdlet to disable data collection for the current user.
This will prevent the current user from being prompted about data collection the first time cmdlets are executed.
To enable data collection for the current user, run the Enable-AzDataCollection cmdlet.

The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell
automatically collects telemetry data by default. To disable data collection, you must explicitly
opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common
issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't
collect any private or personal data. If you've previously opted out, run the
`Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current
machine.

## EXAMPLES

### Example 1: Disabling data collection for the current user
```
PS C:\> Disable-AzDataCollection
```

This example shows how to disable data collection for the current user.
The following example shows how to disable data collection for the current user.

```powershell
Disable-AzDataCollection
```

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant and subscription used for communication with azure.

The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Expand All @@ -53,6 +56,7 @@ Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Expand All @@ -68,6 +72,7 @@ Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Expand All @@ -83,7 +88,11 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
## INPUTS
Expand All @@ -98,4 +107,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## RELATED LINKS
[Enable-AzDataCollection](./Enable-AzDataCollection.md)
40 changes: 23 additions & 17 deletions src/Accounts/Accounts/help/Enable-AzDataCollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ schema: 2.0.0
# Enable-AzDataCollection

## SYNOPSIS
Enables Azure PowerShell to collect data to improve the user experience with AzurePowerShell cmdlets.
Executing this cmdlet opts in to data collection for the current user on the current machine.
No data is collected unless you explicitly opt in.
Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell
cmdlets. Executing this cmdlet opts in to data collection for the current user on the current
machine. Data is collected by default unless you explicitly opt out.

## SYNTAX

Expand All @@ -19,27 +19,28 @@ Enable-AzDataCollection [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-C
```

## DESCRIPTION
You can improve the experience of using the Microsoft Cloud and Azure PowerShell by opting in to data collection.
Azure PowerShell does not collect data without your consent - you must explicitly opt in by executing Enable-AzDataCollection, or by answering yes when Azure PowerShell prompts you about collecting data the first time you execute a cmdlet.
Microsoft aggregates collected data to identify patterns of usage, to identify common issues and to improve the experience of using Azure PowerShell.
Microsoft Azure PowerShell does not collect any private data, or any personally identifiable information.
Run the Enable-AzDataCollection cmdlet to enable data collection for the current user on the current machine.
This will prevent the current user from being prompted about data collection the first time cmdlets are executed.
To disable data collection for the current user, run the Disable-AzDataCollection cmdlet.

The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell
automatically collects telemetry data by default. Microsoft aggregates collected data to identify
patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell.
Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection,
you must explicitly opt out by executing `Disable-AzDataCollection`.

## EXAMPLES

### Example 1: Enabling data collection for the current user
```
PS C:\> Enable-AzDataCollection
```

This example shows how to enable data collection for the current user.
The following example shows how to enable data collection for the current user.

```powershell
Enable-AzDataCollection
```

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant and subscription used for communication with azure.

The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Expand All @@ -54,6 +55,7 @@ Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Expand All @@ -69,6 +71,7 @@ Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Expand All @@ -84,7 +87,11 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
## INPUTS
Expand All @@ -99,4 +106,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## RELATED LINKS
[Disable-AzDataCollection](./Disable-AzDataCollection.md)
16 changes: 16 additions & 0 deletions src/Blueprint/Blueprint/Blueprint.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@
<Label>LockMode</Label>
<ScriptBlock>$_.Locks.Mode.ToString()</ScriptBlock>
</ListItem>
<ListItem>
<Label>ExcludedActions</Label>
<ScriptBlock>
If (-not ([string]::IsNullOrEmpty($_.Locks.ExcludedActions))){
$_.Locks.ExcludedActions
}
</ScriptBlock>
</ListItem>
<ListItem>
<Label>ExcludedPrincipals</Label>
<ScriptBlock>
If (-not ([string]::IsNullOrEmpty($_.Locks.ExcludedPrincipals))){
$_.Locks.ExcludedPrincipals
}
</ScriptBlock>
</ListItem>
<ListItem>
<Label>ProvisioningState</Label>
<PropertyName>ProvisioningState</PropertyName>
Expand Down
4 changes: 4 additions & 0 deletions src/Blueprint/Blueprint/Models/PSAssignmentLockSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Blueprint.Models
{
public class PSAssignmentLockSettings
{
public PSLockMode Mode { get; set; }
public List<string> ExcludedPrincipals;
public List<string> ExcludedActions;
}
}
24 changes: 23 additions & 1 deletion src/Blueprint/Blueprint/Models/PSBlueprintAssignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Azure.Management.Blueprint.Models;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Microsoft.Azure.Commands.Blueprint.Models
{
Expand Down Expand Up @@ -59,7 +60,12 @@ internal static PSBlueprintAssignment FromAssignment(Assignment assignment)
BlueprintId = assignment.BlueprintId,
ProvisioningState = PSAssignmentProvisioningState.Unknown,
Status = new PSAssignmentStatus(),
Locks = new PSAssignmentLockSettings {Mode = PSLockMode.None},
Locks = new PSAssignmentLockSettings
{
Mode = PSLockMode.None,
ExcludedActions = new List<string>(),
ExcludedPrincipals = new List<string>()
},
Parameters = new Dictionary<string, PSParameterValue>(),
ResourceGroups = new Dictionary<string, PSResourceGroupValue>()
};
Expand All @@ -86,6 +92,22 @@ internal static PSBlueprintAssignment FromAssignment(Assignment assignment)
psAssignment.Locks.Mode = PSLockMode.None;
}

if (assignment.Locks.ExcludedActions != null)
{
foreach (var item in assignment.Locks.ExcludedActions)
{
psAssignment.Locks.ExcludedActions.Add(item);
}
}

if (assignment.Locks.ExcludedPrincipals != null)
{
foreach (var item in assignment.Locks.ExcludedPrincipals)
{
psAssignment.Locks.ExcludedPrincipals.Add(item);
}
}

foreach (var item in assignment.Parameters)
{
PSParameterValue parameter = GetAssignmentParameters(item);
Expand Down
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Description for Get-AzVM cmdlet has been updated to better describe it.

## Version 3.7.0
* Added `Set-AzVmssOrchestrationServiceState` cmdlet.
Expand Down
4 changes: 2 additions & 2 deletions src/Compute/Compute/help/Get-AzVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ Get-AzVM [-Status] [-NextLink] <Uri> [-DefaultProfile <IAzureContextContainer>]
```

## DESCRIPTION
The **Get-AzVM** cmdlet gets the model view and instance view of an Azure virtual machine.
The **Get-AzVM** cmdlet gets the model view or the instance view of an Azure virtual machine.
The model view is the user specified properties of the virtual machine.
The instance view is the instance level status of the virtual machine.
Specify the *Status* parameter to get only the instance view of a virtual machine.
Specify the *Status* parameter to get the instance view of a virtual machine instead of the model view which is the default.

## EXAMPLES

Expand Down
2 changes: 1 addition & 1 deletion src/DataShare/DataShare.Test/DataShare.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.DataShare" Version="0.9.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.DataShare" Version="1.0.1" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/DataShare/DataShare.Test/ScenarioTests/AdlsGen1Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function Test-AdlsGen1Crud
$AccountName = getAssetName
$ShareName = getAssetName
$DataSetName = getAssetName
$StorageAccountId = getAssetName
$FolderPath = getAssetName
$FileName = getAssetName
$StorageAccountId = "/subscriptions/e3c4699f-415a-4437-901e-3be6271b5113/resourceGroups/dsktestingstorageRG/providers/Microsoft.DataLakeStore/accounts/psstorage"
$FolderPath = "providerFolder"
$FileName = "psFilePath"
$createdFolderDataset = New-AzDataShareDataSet -ResourceGroupName $resourceGroup -AccountName $AccountName -ShareName $ShareName -Name $DataSetName -StorageAccountResourceId $StorageAccountId -AdlsGen1FolderPath $FolderPath

Assert-NotNull $createdFolderDataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Test-InvitationCrud
$removed = Remove-AzDataShareInvitation -AccountName $AccountName -ResourceGroupName $resourceGroup -ShareName $ShareName -Name $InvitationName -PassThru

Assert-True { $removed }
Assert-ThrowsContains { Get-AzDataShareInvitation -AccountName $AccountName -ResourceGroupName $resourceGroup -ShareName $ShareName -Name $InvitationName} "Resource 'sdktestinginvitation' does not exist"
Assert-ThrowsContains { Get-AzDataShareInvitation -AccountName $AccountName -ResourceGroupName $resourceGroup -ShareName $ShareName -Name $InvitationName} "Resource 'psinvitation' does not exist"
}
finally
{
Expand Down
Loading

0 comments on commit 6fee950

Please sign in to comment.