Skip to content

Commit 589ff48

Browse files
authored
Merge pull request #16073 from wastoresh/mergestorage
[Do not Squash][storage] merge the latest change of main to storage preview branch
2 parents 9229398 + 42b7484 commit 589ff48

File tree

366 files changed

+110753
-162512
lines changed

Some content is hidden

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

366 files changed

+110753
-162512
lines changed

ChangeLog.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,108 @@
1+
## 6.5.0 - October 2021
2+
#### Az.Accounts
3+
* Supported getting the access token for Microsoft Graph.
4+
* Added AuthorizeRequestDelegate to allow service module to adjust token audience.
5+
* Utilized [AssemblyLoadContext](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext) to resolve assembly conflict issues in PowerShell.
6+
* Updated Azure.Core from 1.16.0 to 1.19.0.
7+
8+
#### Az.Attestation
9+
* General availability of 'Az.Attestation' module
10+
11+
#### Az.Cdn
12+
* Fixed null reference exception and typos in 'New-AzFrontDoorCdnRule' cmdlet
13+
14+
#### Az.Compute
15+
* Updated Compute .NET SDK package reference to version 49.1.0
16+
* Fixed a bug in 'Get-AzVM' that caused incorrect power status output.
17+
18+
#### Az.DataFactory
19+
* Added a DataFlowEnableQuickReuse argument for the 'Set-AzDataFactoryV2IntegrationRuntime' cmdlet to enable quick reuse of clusters in next pipeline activities.
20+
* Updated ADF .Net SDK version to 4.25.0
21+
* Added a VNetInjectionMethod argument for the 'Set-AzDataFactoryV2IntegrationRuntime' cmdlet to support the express virtual network injection of Azure-SSIS Integration Runtime.
22+
23+
#### Az.FrontDoor
24+
* Allowed rule engine action creation without RouteConfigurationOverride for 'New-AzFrontDoorRulesEngineActionObject'.
25+
* Fixed DynamicCompression parameter being ignored issue of 'New-AzFrontDoorRulesEngineActionObject'.
26+
27+
#### Az.KeyVault
28+
* Supported custom role definitions on managed HSM:
29+
- Create via 'New-AzKeyVaultRoleDefinition',
30+
- Delete via 'Remove-AzKeyVaultRoleDefinition',
31+
- Filter all custom roles via 'Get-AzKeyVaultRoleDefinition -Custom'.
32+
* Supported Encrypt/Decrypt/Wrap/Unwrap using keys [#15679]
33+
* Enabled managing resources in other subscriptions without switching the context by adding '-Subscription <String>'.
34+
35+
#### Az.Maintenance
36+
* Added Guest patch maintenance support.
37+
38+
#### Az.Network
39+
* Support for Sku, ScaleUnits parameters of BastionHost resource.
40+
- 'New-AzBastion'
41+
- 'Set-AzBastion'
42+
* Onboard Azure Resource Manager to Private Link Common Cmdlets
43+
* Updated cmdlets to add properties to enable/disable BgpRouteTranslationForNat for VpnGateway.
44+
- 'New-AzVpnGateway'
45+
- 'Update-AzVpnGateway'
46+
* Updated cmdlet to add property to disable InternetSecurity for P2SVpnGateway.
47+
- 'New-AzP2sVpnGateway'
48+
* Added new cmdlets for HubBgpConnection child resource of VirtualHub.
49+
- 'Get-AzVirtualHubBgpConnection'
50+
- 'New-AzVirtualHubBgpConnection'
51+
- 'Update-AzVirtualHubBgpConnection'
52+
- 'Remove-AzVirtualHubBgpConnection'
53+
* Onboard Azure HDInsight to Private Link Common Cmdlets
54+
55+
#### Az.RecoveryServices
56+
* Azure Site Recovery bug fixes for VMware to Azure Reprotect, Update policy and Disable scenarios.
57+
* Azure Backup added the support for UserAssigned MSI in RecoveryServices Vault.
58+
59+
#### Az.Resources
60+
* Added a clearer error message for a case in which TemplateUri do not accept bicep file.
61+
* Fixed typos with ManagementGroups breaking change descriptions [#15819].
62+
* Fixed resource tags casing issue - resource tags casing not being preserved.
63+
* Updated to Microsoft.Azure.Management.Authorization 2.13.0-preview.
64+
65+
#### Az.Sql
66+
* Fixed 'Get-AzSqlDatabaseImportExportStatus' to report the error encountered
67+
68+
#### Az.Storage
69+
* Upgraded Azure.Storage.Blobs to 12.10.0
70+
* Upgraded Azure.Storage.Files.Shares to 12.8.0
71+
* Upgraded Azure.Storage.Files.DataLake to 12.8.0
72+
* Upgraded Azure.Storage.Queues to 12.8.0
73+
* Supported upgrade storage account to enable HierarchicalNamespace
74+
- 'Invoke-AzStorageAccountHierarchicalNamespaceUpgrade'
75+
- 'Stop-AzStorageAccountHierarchicalNamespaceUpgrade'
76+
* Supported AccessTierInferred, Tags in blob inventory policy schema
77+
- 'New-AzStorageBlobInventoryPolicyRule'
78+
* Supported create/update storage account with PublicNetworkAccess enabled/disabled
79+
- 'New-AzStorageAccount'
80+
- 'Set-AzStorageAccount'
81+
* Supported create/update storage blob container with RootSquash
82+
- 'New-AzRmStorageContainer'
83+
- 'Update-AzRmStorageContainer'
84+
* Supported AllowProtectedAppendWriteAll in set container Immutability Policy, and add container LegalHold
85+
- 'Set-AzRmStorageContainerImmutabilityPolicy'
86+
- 'Add-AzRmStorageContainerLegalHold'
87+
88+
#### Az.StorageSync
89+
* Fixed a bug where not all properties of PSSyncSessionStatus and PSSyncActivityStatus objects were being populated properly.
90+
* This affected the 'Get-AzStorageSyncServerEndpoint' cmdlet when trying to access the following properties of the output:
91+
- SyncStatus.UploadStatus
92+
- SyncStatus.DownloadStatus
93+
- SyncStatus.UploadActivity
94+
- SyncStatus.DownloadActivity
95+
96+
#### Az.Websites
97+
* Updated 'Import-AzWebAppKeyVaultCertificate1' to set the default name with combination of keyvault name and cert name
98+
99+
### Thanks to our community contributors
100+
* @DSakura207, Use last PowerState instance in Statuses for power status (#15941)
101+
* Yannic Graber (@grabery), Recode Example2 (#15808)
102+
* @joelmforsyth, Fix multi-regional examples (#15918)
103+
* Adam Coffman (@SysAdminforCoffee), Update Set-AzNetworkInterfaceIpConfig.md (#15846)
104+
* Michael Howard (@x509cert), Reworded sentence to make it clear that a specific key version must be provided (#15886)
105+
1106
## 6.4.0 - September 2021
2107
#### Az.Accounts
3108
* Corrected the URLs to Azure Portal in the results of 'Get-AzEnvironment' and 'Get-AzContext'. [#15429]

setup/generate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if( (-not (get-command -ea 0 light)) -or (-not (get-command -ea 0 heat)) -or (-n
3737
$outputName ="Az-Cmdlets"
3838

3939
# generate the product name from the current month/year.
40-
$productName = "Microsoft Azure PowerShell - September 2021"
40+
$productName = "Microsoft Azure PowerShell - October 2021"
4141

4242
# where to put temp files
4343
$tmp = Join-Path $env:temp azure-cmdlets-tmp

src/ADDomainServices/Az.ADDomainServices.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.5.3'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.5.4'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = './bin/Az.ADDomainServices.private.dll'

src/Accounts/Accounts/Az.Accounts.psd1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 9/1/2021
6+
# Generated on: 10/4/2021
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.5.3'
15+
ModuleVersion = '2.5.4'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -57,7 +57,7 @@ DotNetFrameworkVersion = '4.7.2'
5757

5858
# Assemblies that must be loaded prior to importing this module
5959
RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll',
60-
'Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll',
60+
'Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll',
6161
'Microsoft.Azure.PowerShell.Authentication.dll',
6262
'Microsoft.Azure.PowerShell.Authenticators.dll',
6363
'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll',
@@ -146,9 +146,10 @@ PrivateData = @{
146146
# IconUri = ''
147147

148148
# ReleaseNotes of this module
149-
ReleaseNotes = '* Corrected the URLs to Azure Portal in the results of ''Get-AzEnvironment'' and ''Get-AzContext''. [#15429]
150-
* Made infrastructural changes to support overriding default subscription via a ''-SubscriptionId <String>'' parameter.
151-
- [Az.Aks](https://docs.microsoft.com/powershell/module/az.aks/get-azakscluster) is the first module that supports it.'
149+
ReleaseNotes = '* Supported getting the access token for Microsoft Graph.
150+
* Added AuthorizeRequestDelegate to allow service module to adjust token audience.
151+
* Utilized [AssemblyLoadContext](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext) to resolve assembly conflict issues in PowerShell.
152+
* Updated Azure.Core from 1.16.0 to 1.19.0.'
152153

153154
# Prerelease string of this module
154155
# Prerelease = ''

src/Accounts/Accounts/ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
-->
2020

2121
## Upcoming Release
22+
23+
## Version 2.5.4
24+
* Supported getting the access token for Microsoft Graph.
25+
* Added AuthorizeRequestDelegate to allow service module to adjust token audience.
26+
* Utilized [AssemblyLoadContext](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext) to resolve assembly conflict issues in PowerShell.
2227
* Updated Azure.Core from 1.16.0 to 1.19.0.
2328

2429
## Version 2.5.3

src/Accounts/Accounts/CommonModule/ContextAdapter.cs

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace Microsoft.Azure.Commands.Common
3232
using NextDelegate = Func<HttpRequestMessage, CancellationToken, Action, Func<string, CancellationToken, Func<EventArgs>, Task>, Task<HttpResponseMessage>>;
3333
using SignalDelegate = Func<string, CancellationToken, Func<EventArgs>, Task>;
3434
using PipelineChangeDelegate = Action<Func<HttpRequestMessage, CancellationToken, Action, Func<string, CancellationToken, Func<EventArgs>, Task>, Func<HttpRequestMessage, CancellationToken, Action, Func<string, CancellationToken, Func<EventArgs>, Task>, Task<HttpResponseMessage>>, Task<HttpResponseMessage>>>;
35+
using TokenAudienceConverterDelegate = Func<string, string, string, string, Uri, string>;
3536

3637
/// <summary>
3738
/// Perform authentication and parameter completion based on the value of the context
@@ -74,6 +75,51 @@ public void OnNewRequest(InvocationInfo invocationInfo, string correlationId, st
7475
appendStep(this.SendHandler(GetDefaultContext(_provider, invocationInfo), AzureEnvironment.Endpoint.ResourceManager));
7576
}
7677

78+
internal void AddRequestUserAgentHandler(
79+
InvocationInfo invocationInfo,
80+
string correlationId,
81+
string processRecordId,
82+
PipelineChangeDelegate prependStep,
83+
PipelineChangeDelegate appendStep)
84+
{
85+
appendStep(new UserAgent(invocationInfo).SendAsync);
86+
}
87+
88+
internal void AddPatchRequestUriHandler(
89+
InvocationInfo invocationInfo,
90+
string correlationId,
91+
string processRecordId,
92+
PipelineChangeDelegate prependStep,
93+
PipelineChangeDelegate appendStep)
94+
{
95+
appendStep(
96+
async (request, cancelToken, cancelAction, signal, next) =>
97+
{
98+
var context = GetDefaultContext(_provider, invocationInfo);
99+
PatchRequestUri(context, request);
100+
return await next(request, cancelToken, cancelAction, signal);
101+
});
102+
}
103+
104+
internal void AddAuthorizeRequestHandler(
105+
InvocationInfo invocationInfo,
106+
string endpointResourceIdKey,
107+
string endpointSuffixKey,
108+
PipelineChangeDelegate prependStep,
109+
PipelineChangeDelegate appendStep,
110+
TokenAudienceConverterDelegate tokenAudienceConverter,
111+
IDictionary<string, object> extensibleParameters = null)
112+
{
113+
appendStep(
114+
async (request, cancelToken, cancelAction, signal, next) =>
115+
{
116+
endpointResourceIdKey = endpointResourceIdKey ?? AzureEnvironment.Endpoint.ResourceManager;
117+
var context = GetDefaultContext(_provider, invocationInfo);
118+
await AuthorizeRequest(context, request, cancelToken, endpointResourceIdKey, endpointSuffixKey, tokenAudienceConverter);
119+
return await next(request, cancelToken, cancelAction, signal);
120+
});
121+
}
122+
77123
/// <summary>
78124
/// Called for well-known parameters that require argument completers
79125
/// </summary>
@@ -156,7 +202,7 @@ internal Func<HttpRequestMessage, CancellationToken, Action, SignalDelegate, Nex
156202
return async (request, cancelToken, cancelAction, signal, next) =>
157203
{
158204
PatchRequestUri(context, request);
159-
await AuthorizeRequest(context, resourceId, request, cancelToken);
205+
await AuthorizeRequest(context, request, cancelToken, resourceId, resourceId);
160206
return await next(request, cancelToken, cancelAction, signal);
161207
};
162208
}
@@ -165,11 +211,12 @@ internal Func<HttpRequestMessage, CancellationToken, Action, SignalDelegate, Nex
165211
/// Pipeline step for authenticating requests
166212
/// </summary>
167213
/// <param name="context"></param>
168-
/// <param name="resourceId"></param>
214+
/// <param name="endpointResourceIdKey"></param>
169215
/// <param name="request"></param>
170216
/// <param name="outerToken"></param>
171217
/// <returns></returns>
172-
internal async Task AuthorizeRequest(IAzureContext context, string resourceId, HttpRequestMessage request, CancellationToken outerToken)
218+
internal async Task AuthorizeRequest(IAzureContext context, HttpRequestMessage request, CancellationToken outerToken, string endpointResourceIdKey,
219+
string endpointSuffixKey, TokenAudienceConverterDelegate tokenAudienceConverter = null, IDictionary<string, object> extensibleParamters = null)
173220
{
174221
if (context == null || context.Account == null || context.Environment == null)
175222
{
@@ -178,12 +225,29 @@ internal async Task AuthorizeRequest(IAzureContext context, string resourceId, H
178225

179226
await Task.Run(() =>
180227
{
181-
resourceId = context?.Environment?.GetAudienceFromRequestUri(request.RequestUri) ?? resourceId;
182-
var authToken = _authenticator.Authenticate(context.Account, context.Environment, context.Tenant.Id, null, "Never", null, resourceId);
228+
if (tokenAudienceConverter != null)
229+
{
230+
var info = GetEndpointInfo(context.Environment, endpointResourceIdKey, endpointSuffixKey);
231+
var tokenAudience = tokenAudienceConverter.Invoke(info.CurEnvEndpointResourceId, info.CurEnvEndpointSuffix, info.BaseEnvEndpointResourceId, info.BaseEnvEndpointSuffix, request.RequestUri);
232+
endpointResourceIdKey = tokenAudience ?? endpointResourceIdKey;
233+
}
234+
var authToken = _authenticator.Authenticate(context.Account, context.Environment, context.Tenant.Id, null, "Never", null, endpointResourceIdKey);
183235
authToken.AuthorizeRequest((type, token) => request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(type, token));
184236
}, outerToken);
185237
}
186238

239+
private (string CurEnvEndpointResourceId, string CurEnvEndpointSuffix, string BaseEnvEndpointResourceId, string BaseEnvEndpointSuffix) GetEndpointInfo(IAzureEnvironment environment, string endpointResourceIdKey, string endpointSuffixKey)
240+
{
241+
var baseEnvironment = AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud];
242+
243+
string curEnvEndpointResourceId = environment?.GetEndpoint(endpointResourceIdKey);
244+
string curEnvEndpointSuffix = environment?.GetEndpoint(endpointSuffixKey);
245+
string baseEnvEndpointResourceId = baseEnvironment?.GetEndpoint(endpointResourceIdKey);
246+
string baseEnvEndpointSuffix = baseEnvironment?.GetEndpoint(endpointSuffixKey);
247+
248+
return (curEnvEndpointResourceId, curEnvEndpointSuffix, baseEnvEndpointResourceId, baseEnvEndpointSuffix); ;
249+
}
250+
187251
internal void PatchRequestUri(IAzureContext context, HttpRequestMessage request)
188252
{
189253
var requestUri = context?.Environment?.GetUriFromBaseRequestUri(request.RequestUri);

src/Accounts/Accounts/CommonModule/EnvironmentExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public static Uri GetUriFromBaseRequestUri(this IAzureEnvironment environment, U
103103
return baseEndpoint;
104104
}
105105

106+
////TODO: Update to support all data plane audience
106107
/// <summary>
107108
/// Determien the inteneded audience of a request
108109
/// </summary>

src/Accounts/Accounts/CommonModule/RegisterAzModule.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ protected override void ProcessRecord()
5454
// this gets called before the generated cmdlet makes a call across the wire (allows you to change the HTTP pipeline)
5555
OnNewRequest = ContextAdapter.Instance.OnNewRequest,
5656

57+
//OnNewRequest = AddRequestUserAgentHandler + AddPatchRequestUriHandler + AddAuthorizeRequestHandler
58+
AddRequestUserAgentHandler = ContextAdapter.Instance.AddRequestUserAgentHandler,
59+
60+
AddPatchRequestUriHandler = ContextAdapter.Instance.AddPatchRequestUriHandler,
61+
62+
AddAuthorizeRequestHandler = ContextAdapter.Instance.AddAuthorizeRequestHandler,
63+
5764
// Called for well-known parameters that require argument completers
5865
ArgumentCompleter = ContextAdapter.Instance.CompleteArgument,
5966

0 commit comments

Comments
 (0)