Skip to content

Commit cd40d5d

Browse files
committed
fix merge conflicts
2 parents f07cd19 + 20e4a17 commit cd40d5d

File tree

9,697 files changed

+2675919
-3489701
lines changed

Some content is hidden

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

9,697 files changed

+2675919
-3489701
lines changed

.azure-pipelines/daily-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ jobs:
9797
Release/**/Microsoft.Azure.PowerShell.Authentication.dll
9898
Release/**/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll
9999
Release/**/Microsoft.Azure.PowerShell.Authenticators.dll
100+
Release/**/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll
101+
Release/**/Microsoft.Azure.Commands.*.AlcWrapper.dll
100102
!Release/**/Microsoft*Azure*PowerShell*Cmdlets*.Test.dll
101103
UseMinimatch: true
102104
signConfigType: 'inlineSignParams'

.azure-pipelines/util/sync-tools-folder-template.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ steps:
1313
cp src/lib src/lib-tmp -r
1414
1515
cp tools tools-tmp -r
16+
17+
cp build.proj build-tmp.proj
1618
pwsh: true
1719
- task: PowerShell@2
1820
displayName: Config git
@@ -25,6 +27,17 @@ steps:
2527
2628
git checkout -b syncToolsFolder-${{ parameters.BranchName }} origin/${{ parameters.BranchName }}
2729
pwsh: true
30+
- task: PowerShell@2
31+
displayName: Sync build.proj folder from main to ${{ parameters.BranchName }}
32+
inputs:
33+
targetType: inline
34+
script: >-
35+
rm build.proj
36+
37+
mv build-tmp.proj build.proj
38+
39+
git add build.proj
40+
pwsh: true
2841
- task: PowerShell@2
2942
displayName: Sync .azure-pipelines folder from main to ${{ parameters.BranchName }}
3043
inputs:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,6 @@ launchSettings.json
235235

236236
# Added due to scan
237237
src/DataFactory/DataFactoryV2.Test/SessionRecords/Microsoft.Azure.Commands.DataFactoryV2.Test.RunTests/TestRunV2.json
238+
239+
# GitHub codespaces
240+
.venv

ChangeLog.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,158 @@
1+
## 6.4.0 - September 2021
2+
#### Az.Accounts
3+
* Corrected the URLs to Azure Portal in the results of 'Get-AzEnvironment' and 'Get-AzContext'. [#15429]
4+
* Made infrastructural changes to support overriding default subscription via a '-SubscriptionId <String>' parameter.
5+
- [Az.Aks](https://docs.microsoft.com/powershell/module/az.aks/get-azakscluster) is the first module that supports it.
6+
7+
#### Az.Aks
8+
* Made '-Subscription <String>' available in all Aks cmdlets. You can manage Aks resources in other subscriptions without switching the context.
9+
10+
#### Az.ApiManagement
11+
* Added new 'Sync-AzApiManagementKeyVaultSecret' cmdlet.
12+
* Added new 'New-AzApiManagementKeyVaultObject' cmdlet.
13+
* Added new optional [-useFromLocation] parameter to the 'Get-ApiManagementCache' 'New-ApiManagementCache''Update-ApiManagementCache' cmdlet.
14+
* Updated cmdlet **New-AzApiManagement** to manage ApiManagement service
15+
- Added support for the new 'Isolated' SKU
16+
- Added support for managing Availability Zones using 'Zone' property
17+
- Added support for Disabling Gateway in a Region using 'DisableGateway' property
18+
- Added support for managing the minimum Api Version to allow for Control Plane using 'MinimalControlPlaneApiVersion' property.
19+
* Updated cmdlet **New-AzApiManagementRegion** to manage ApiManagement service
20+
- Added support for managing Availability Zones using 'Zone' property
21+
- Added support for Disabling Gateway in a Region using 'DisableGateway' property
22+
* Updated cmdlet **Add-AzApiManagementRegion** to manage ApiManagement service
23+
- Added support for managing Availability Zones using 'Zone' property
24+
- Added support for Disabling Gateway in a Region using 'DisableGateway' property
25+
* Updated cmdlet **Update-AzApiManagementRegion** to manage ApiManagement service
26+
- Added support for managing Availability Zones using 'Zone' property
27+
- Added support for Disabling Gateway in a Region using 'DisableGateway' property
28+
* Updated cmdlet **New-AzApiManagementCustomHostnameConfiguration** to manage Custom Hostname Configuration
29+
- Added support for specifying 'IdentityClientId' to provide Managed Identity User Assigned ClientId to use with KeyVault
30+
31+
#### Az.Automation
32+
* Fixed bug: Closing in input file handle in Import-AzAutomationRunbook
33+
34+
#### Az.Cdn
35+
* Fixed mandatory parameters issue in 'Get-AzCdnEndpointResourceUsage' cmdlet
36+
37+
#### Az.Compute
38+
* Added new parameters '-LinuxConfigurationPatchMode', '-WindowsConfigurationPatchMode', and '-LinuxConfigurationProvisionVMAgent' to 'Set-AzVmssOSProfile'
39+
* Added new parameters '-SshKeyName' and '-GenerateSshKey' to 'New-AzVM' to create a VM with SSH
40+
* Fixed a bug in 'Add-AzVHD' on Linux that caused uploads to fail for certain destination URI
41+
* Added new cmdlets for Restore Points and Restore Point Collection:
42+
- 'New-AzRestorePoint'
43+
- 'New-AzRestorePointCollection'
44+
- 'Get-AzRestorePoint'
45+
- 'Get-AzRestorePointCollection'
46+
- 'Update-AzRestorePointCollection'
47+
- 'Remove-AzRestorePoint'
48+
- 'Remove-AzRestorePointCollection'
49+
* Added new parameters '-EnableSpotRestore' and '-SpotRestoreTimeout' to 'New-AzVMSSConfig' to enable Spot Restore Policy
50+
* Added new cmdlets: 'Update-AzCapacityReservationGroup' and 'Update-AzCapacityReservation'
51+
52+
#### Az.CosmosDB
53+
* Fixed a bug where the restore of deleted database accounts fail.
54+
55+
#### Az.DataFactory
56+
* Added a subnetId argument for the 'Set-AzDataFactoryV2IntegrationRuntime' cmdlet to support RBAC checking for VNet injection against the subnet resource ID instead of the VNet resource ID.
57+
* Added the 'Get-AzDataFactoryV2IntegrationRuntimeOutboundNetworkDependenciesEndpoint' cmdlet to provide a list of outbound network dependencies for SSIS integration runtime in Azure Data Factory that joins a virtual network.
58+
* Added PublicNetworkAccess to Data Factory.
59+
* Updated ADF .Net SDK version to 4.23.0
60+
61+
#### Az.KeyVault
62+
* Supported adding EC keys in key vault [#15699]
63+
64+
#### Az.Migrate
65+
* Supported duplicate disk UUID in source disk.
66+
* Supported subnets in same VNet for AVSet.
67+
* Supported runAsAccount fetching for multiple Vcenters in same site.
68+
69+
#### Az.Network
70+
* Updated cmdlet to add 'Subnet' property for IP based load balancer backend address pool.
71+
- 'New-AzLoadBalancerBackendAddressConfig'
72+
* Updated cmdlet to add 'TunnelInterface' property for backend pool related operations.
73+
- 'New-AzLoadBalancerBackendAddressPool'
74+
- 'Set-AzLoadBalancerBackendAddressPool'
75+
76+
#### Az.RecoveryServices
77+
* Azure Site Recovery multi appliance support for VMware to Azure disaster recovery scenarios using RCM as the control plane.
78+
* Azure Backup fixed targetPhysicalPath issue with SQL CRR
79+
* Azure Backup fixed disable protection for SQL workload
80+
* Azure Backup resolved bug in setting CMK properties in latest release
81+
* Azure Backup removed special characters from register-azrecoveryservicesbackupcontainer command help text
82+
83+
#### Az.Resources
84+
* Use JsonExtensions to serialize deserialize JSON objects to ensure the use of custom serialization settings [#15552]
85+
* Added support for 'Unsupported' and 'NoEffect' change types to deployment What-If cmdlets.
86+
87+
#### Az.SecurityInsights
88+
* Updated to 'Get-AzSentinelIncident' parameters
89+
- Added '-Filter' to support OData filter
90+
- Added '-OrderBy' to support OData ordering
91+
- Added '-Max' to support retrieving more than the default of 1000 incidents.
92+
93+
#### Az.Sql
94+
* Changed the underlying implementation of 'Get-AzSqlDatabase' to support a paginated response from the server
95+
* Added 'ZoneRedundant' parameter to 'New-AzSqlInstance' and 'Set-AzSqlInstance' to enable the creation and the update of zone - redundant instances.
96+
* Added ZoneRedundant field to the model of the managed instance so that it displays information about zone - redundancy for instance that are returned by 'Get-AzSqlInstance'.
97+
* Extended AuditActionGroups enum in server & database audit. Added DBCC_GROUP, DATABASE_OWNERSHIP_CHANGE_GROUP and DATABASE_CHANGE_GROUP.
98+
* Added 'AsJob' flag to 'Remove-AzSqlInstance'
99+
* Added 'SubnetId' parameter to 'Set-AzSqlInstance' to support the cross-subnet update SLO
100+
* Upgraded to newest SDK version
101+
102+
#### Az.Storage
103+
* Supported get/set blob tags on a specific blob
104+
- 'Get-AzStorageBlobTag'
105+
- 'Set-AzStorageBlobTag'
106+
* Supported create destination blob with specific blob tags while upload/copy Blob
107+
- 'Set-AzStorageBlobContent'
108+
- 'Start-AzStorageBlobCopy'
109+
* Supported list blobs across containers with a blob tag filter sql expression
110+
- 'Get-AzStorageBlobByTag'
111+
* Supported list blobs inside a container and include Blob Tags
112+
- 'Get-AzStorageBlob'
113+
* Supported run blob operation with blob tag condition, and fail the cmdlet when blob tag condition not match
114+
- 'Get-AzStorageBlob'
115+
- 'Get-AzStorageBlobContent'
116+
- 'Get-AzStorageBlobTag'
117+
- 'Remove-AzStorageBlob'
118+
- 'Set-AzStorageBlobContent'
119+
- 'Set-AzStorageBlobTag'
120+
- 'Start-AzStorageBlobCopy'
121+
- 'Stop-AzStorageBlobCopy'
122+
* Generate blob sas token with new API version
123+
- 'New-AzStorageBlobSASToken'
124+
- 'New-AzStorageContainerSASToken'
125+
- 'New-AzStorageAccountSASToken'
126+
* Fixed blob copy failure with OAuth credential when client and server has time difference [#15644]
127+
- 'Copy-AzStorageBlob'
128+
* Fixed remove Data Lake Gen2 item fail with readonly SAS token
129+
- 'Remove-AzDataLakeGen2Item'
130+
* Revised destination existing check in move Data Lake Gen2 item
131+
- 'Move-AzDataLakeGen2Item'
132+
133+
#### Az.StorageSync
134+
* Added parameter sets to 'Invoke-AzStorageSyncChangeDetection'
135+
- Can call the cmdlet without -DirectoryPath and -Path parameters to trigger change detection on an entire file share
136+
* Added support for authoritative upload as part of New-AzStorageSyncServerEndpoint.
137+
* Added cloud change enumeration status information in Cloud Endpoint object.
138+
* Updated Server Endpoint object with various health properties
139+
* Added 'ServerName' property in Server Endpoint and Registered Server objects to support showing the current FQDN of a server.
140+
141+
#### Az.Websites
142+
* Fixed 'Set-AzWebApp' to return a valid warning message when fails to add -Hostname #9316
143+
* Fixed 'Get-AzWebApp' to return CustomDomainVerificationId in the response. #9316
144+
145+
### Thanks to our community contributors
146+
* Andrew Sears (@asears)
147+
* Fix spelling of accountname (#15779)
148+
* Fix Spelling, examples (#15780)
149+
* @cawrites, Update New-AzDataMigrationService.md (#15646)
150+
* @harpaul-gill, Adding support for pagination in Sql Get Databases (#15772)
151+
* @jeepingben, Create mutex names that are safe for Linux (fixes #15653) (#15666)
152+
* @LosManos, Docs: Parameter is ignored when listing secrets (#15788)
153+
* Mats Estensen (@matsest), docs: add examples for Update-AzSubscription (#15748)
154+
* Mauricio Arroyo (@mauricio-msft), Fix typo in cmdlet example (#15719)
155+
1156
## 6.3.0 - August 2021
2157
#### Az.Accounts
3158
* Disabled context auto saving when token cache persistence fails on Windows and macOS

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
<RuntimeDllsIncludeList>Microsoft.Powershell.*.dll,System*.dll,Microsoft.VisualBasic.dll,Microsoft.CSharp.dll,Microsoft.CodeAnalysis.dll,Microsoft.CodeAnalysis.CSharp.dll</RuntimeDllsIncludeList>
200200
<RuntimeDllsExcludeList>System.Security.Cryptography.ProtectedData.dll,System.Configuration.ConfigurationManager.dll,System.Runtime.CompilerServices.Unsafe.dll,System.IO.FileSystem.AccessControl.dll,System.Buffers.dll,System.Text.Encodings.Web.dll,System.CodeDom.dll,System.Management.dll,System.Text.Json.dll,System.Threading.Tasks.Extensions.dll</RuntimeDllsExcludeList>
201201
</PropertyGroup>
202-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*'} | Remove-Item -Force&quot;"/>
202+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*' -and $_.FullName -notlike '*AzSharedAlcAssemblies*' -and $_.FullName -notlike '*ModuleAlcAssemblies*'} | Remove-Item -Force&quot;"/>
203203
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force&quot;" Condition="'$(CodeSign)' == 'true'" />
204204

205205
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope)&quot;"/>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Autogen Directives for Azure Powershell
2+
## Directive Scenarios
3+
- [Resource Group Append](#Resource-Group-Append)
4+
### Resource Group Append
5+
To provide `ResourceGroupName` in returned object, set `resourcegroup-append` as true in readme.md
6+
```
7+
resourcegroup-append: true
8+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# How to: Enable Overriding Subscription ID in Your Module
2+
3+
- [Background](#background)
4+
- [Limitation](#limitation)
5+
- [Steps](#steps)
6+
- [Add `SupportsSubscriptionId` Attribute](#add-supportssubscriptionid-attribute)
7+
- [Regenerate Help Documents](#regenerate-help-documents)
8+
- [Notes / Troubleshooting](#notes--troubleshooting)
9+
- [Your Cmdlet Implements `IDynamicParameters`](#your-cmdlet-implements-idynamicparameters)
10+
- [Static Analysis Fails: Parameters are Removed](#static-analysis-fails-parameters-are-removed)
11+
12+
## Background
13+
14+
Working with **multiple Azure subscriptions** can be inconvenient in Azure PowerShell, because users has to keep switching the context, which is why we introduced a mechanism that can easily turn your module **multiple-subscription-friendly** in [Az v6.4.0](https://github.com/Azure/azure-powershell/blob/isra-fel-patch-1/ChangeLog.md#640---september-2021). For example
15+
16+
```powershell
17+
# Legacy (switch subscription first)
18+
Select-AzSubscription -SubscriptionId "00000000-0000-0000-0000-000000000000"
19+
New-AzAksCluster ...
20+
21+
# New (just -SubscriptionId)
22+
New-AzAksCluster ... -SubscriptionId "00000000-0000-0000-0000-000000000000"
23+
```
24+
25+
The new design does not only simplify scripts, but also runs more efficiently, as it saves 1 cmdlet execution per subscription switching.
26+
27+
## Limitation
28+
29+
The feature was designed to balance between "supporting more login scenarios" and "being easy to use". Here are the limitations:
30+
31+
- **One subscription, multiple accounts**: when you login Azure PowerShell with multiple user accounts, and there is one subscription owned by more than one of them, it is obvious that `-SubscriptionId` is not enough to tell which context you wish to use, but we do not want to introduce more parameters, so this is not supported.
32+
- Work-around is to log in with only 1 user account.
33+
- **Management-plane only**: as subscription may not make as much sense in data-plane as in management-plane, this feature is suggested to be applied to management-plane cmdlets only.
34+
35+
## Steps
36+
37+
Here are the two simple steps to enable this for your module:
38+
39+
### Add `SupportsSubscriptionId` Attribute
40+
41+
You can either add it to the cmdlet base class, which applies to all the derived cmdlets; or to individual cmdlets.
42+
43+
```csharp
44+
[SupportsSubscriptionId] // Adding to base class: all cmdlets that inherit `KubeCmdletBase` will benefit
45+
public abstract class KubeCmdletBase : AzureRMCmdlet { /* ... */ }
46+
47+
[SupportsSubscriptionId] // Adding to cmdlet class: only this cmdlet will benefit
48+
public class NewAzureRmAks : CreateOrUpdateKubeBase { /* ... */ }
49+
```
50+
51+
### Regenerate Help Documents
52+
53+
By adding the attribute your cmdlet(s) get a `[-Subscription <String>]` parameter, so the help documents need to be regenerated.
54+
Please refer to [Azure PowerShell Help Generation](https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/help-generation.md) for more details.
55+
56+
57+
## Notes / Troubleshooting
58+
59+
This design is compatible with most modules, however, there are some uncommon case you should be careful.
60+
61+
### Your Cmdlet Implements `IDynamicParameters`
62+
63+
The `-SubscriptionId` parameter is added via `IDynamicParameters` interface, so if your cmdlet has already implemented it, make sure:
64+
65+
1. `GetDynamicParameters()` is decorated with [`new` modifier](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/new-modifier).
66+
1. Call `base.GetDynamicParameters()` and combine the results in your `GetDynamicParameters()`.
67+
68+
A sample implementation:
69+
70+
```csharp
71+
public new object GetDynamicParameters()
72+
{
73+
var parameters = base.GetDynamicParameters() as RuntimeDefinedParameterDictionary;
74+
// here should be customized logic to construct `RuntimeDefinedParameter` objects,
75+
// and call `parameters.Add()`
76+
return parameters;
77+
}
78+
```
79+
80+
### Static Analysis Fails: Parameters are Removed
81+
82+
This happens when the constructor of your cmdlet throws an exception -- normally constructors are not called during static analysis, but things are different if this feature is enabled.
83+
Make sure you use `BeginProcessing()` for heavy work.
84+
85+
```csharp
86+
// DO NOT
87+
public StorageSyncClientCmdletBase()
88+
{
89+
InitializeComponent(); // do stuff that throws exception in test environment, like an API call
90+
}
91+
92+
// DO
93+
public StorageSyncClientCmdletBase()
94+
{
95+
}
96+
97+
protected override void BeginProcessing()
98+
{
99+
base.BeginProcessing();
100+
InitializeComponent();
101+
}
102+
```

documentation/internal/authinrdfe.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Authentication and Authorization in RDFE (Azure) and ARM (Az/AzureRM)
2+
## RDFE Authorization
3+
In RDFE, users are authorized on a per-subscription basis. Users who are authorized to access a subscription may perform any action within that subscription - on the subscription itself, or on any resources in the subscription. There is no mechanism for limiting the access of an authorized user within a subscription.
4+
## RDFE Authentication Mechanisms
5+
- Management Certificate Authentication
6+
- User Authentication
7+
### RDFE Management Certificate Authentication
8+
Management certificate authentication is the most popular mechanism for authenticating RDFE calls for automation. In this authentication mechanism, the public key of a management certificate is associated with one or more subscriptions. Users in possession of the certificate private key use standard Http certificate authentication to negotiate an SSL session with the RDFE endpoint, and all subsequent calls in that session have access to any subscriptions associated with the certificate.
9+
10+
To acquire management certificate credentials, you must download a PublishingProfile from the portal (using Get-AzurePublishSettingsFile, or direct download from the portal), and import it using Import-AzurePublishSettingsFile. This downloads a file containing management certificates for selected subscriptions. Importing will automatically add each certificate as an account.
11+
12+
### RDFE User Authentication
13+
The Add-AzureAccount command can be used to acquire a token based on user credentials, and if the associated user is authorized for RDFE access to a subscription (they must be a classic administrator or co-admin of the subscription), they will have access to those subscriptions authorized to their account for classic administrator access
14+
15+
## General Notes
16+
- Managemnt certificate authentication lasts for an entire TCP session. User authentication is self-renewing, just as it is in ARM.
17+
18+
## Programmatic Authentication for PowerShell clients
19+
- Clients are still authenticated using an IAuthenticationFactory, and the following overload:
20+
21+
```c#
22+
SubscriptionCloudCredentials GetSubscriptionCloudCredentials(IAzureContext context)
23+
```
24+
Note that, the ARM token audience is different than the token audience used for RDFE, although the RDFE tolken audience is accepted by both endpoints.
25+
26+
Similarly, RDFE clients can be created using the IClientFactory interface:
27+
28+
```c#
29+
TClient CreateClient<TClient>(IAzureContext context, string endpoint) where TClient : ServiceClient<TClient>;
30+
```
31+
32+
Also note that, for management certificate authentication, authentication is performed as part of creating the http client - the ```ServiceClientCredentials``` returned above automatically apply the certificate to the http connection, which automatically performs HTTP certificate authentication using the certificate private key. You can see this implementation here: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/mgmtcommon/ClientRuntime/ClientRuntime/CertificateCredentials.cs

0 commit comments

Comments
 (0)