Skip to content

Commit 23df797

Browse files
authored
Merge pull request #14727 from Azure/release-2021-04-13
[Do not squash] release-2021-04-13
2 parents 8f5843d + 50fe963 commit 23df797

File tree

337 files changed

+93412
-58622
lines changed

Some content is hidden

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

337 files changed

+93412
-58622
lines changed

ChangeLog.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,76 @@
1+
## 5.8.0 - April 2021
2+
#### Az.Accounts
3+
* Fallback to first valid context if current default context key is 'Default' which is invalid
4+
5+
#### Az.Automation
6+
* Added support for Customer Managed Key Encryption with System Assigned Identity
7+
* Fixed issue that disables the schedule for update deployment if schedule was re-created with same name
8+
9+
#### Az.Compute
10+
* Fixed a bug when 1 data disk attached to VMSS for Remove-AzVmssDataDisk [#13368]
11+
* Added new cmdlets to support TrustedLaunch related cmdlets:
12+
- 'Set-AzVmSecurityProfile'
13+
- 'Set-AzVmUefi'
14+
- 'Set-AzVmssSecurityProfile'
15+
- 'Set-AzVmssUefi'
16+
* Edited default value for Size parameter in New-AzVM cmdlet from Standard_DS1_v2 to Standard_D2s_v3.
17+
18+
#### Az.ContainerRegistry
19+
* Fixed bug in 'Get-AzContainerRegistryManifest' showing incorrect image name
20+
21+
#### Az.HDInsight
22+
* Supported getting default vmsize from backend if customer does not provide the related parameters: '-WorkerNodeSize', '-HeadNodeSize', '-ZookeeperNodeSize', '-EdgeNodeSize', '-KafkaManagementNodeSize'.
23+
24+
#### Az.HealthcareApis
25+
* Added support for Acr LoginServers
26+
27+
#### Az.KeyVault
28+
* Fixed a bug for 'Get-AzKeyVaultSecret -AsPlainText' if the secret is not found [#14645]
29+
30+
#### Az.Migrate
31+
* Nullref Bug fixed in get discovered server and initialize replication infrastructure commandlets.
32+
33+
#### Az.Monitor
34+
* Added cmdlet to get diagnostic setting categories for subscription
35+
- 'Get-AzSubscriptionDiagnosticSettingCategory'
36+
* Supported subscription diagnostic setting operations with new parameter: SubscriptionId
37+
- 'Get-AzDiagnosticSetting'
38+
- 'New-AzDiagnosticSetting'
39+
- 'Remove-AzDiagnosticSetting'
40+
* Supported 'AutoMitigate' parameter in metric alert rule properties. The flag indicates whether the alert should be auto resolved or not.
41+
42+
#### Az.Resources
43+
* Added upcoming breaking change warnings on below cmdlets, because the value of 'IdentifierUris' parameter will need verified domain.
44+
- 'New-AzADApplication'
45+
- 'Update-AzADApplication'
46+
- 'New-AzADServicePrincipal'
47+
- 'Update-AzADServicePrincipal'
48+
* Ignored Bicep warning message in error stream if exitcode equals zero.
49+
50+
#### Az.Sql
51+
* Added cmdlet output breaking change warnings to the following:
52+
- 'New-AzSqlDatabase'
53+
- 'Get-AzSqlDatabase'
54+
- 'Set-AzSqlDatabase'
55+
- 'Remove-AzSqlDatabase'
56+
- 'New-AzSqlDatabaseSecondary'
57+
- 'Remove-AzSqlDatabaseSecondary'
58+
- 'Get-AzSqlDatabaseReplicationLink'
59+
- 'New-AzSqlDatabaseCopy'
60+
- 'Set-AzSqlDatabaseSecondary'
61+
62+
#### Az.Storage
63+
* Fixed copy blob fail with source context as Oauth [#14662]
64+
- 'Start-AzStorageBlobCopy'
65+
66+
#### Az.StreamAnalytics
67+
* Added upcoming breaking change warning message to all cmdlets because of upcoming changes on parameters.
68+
69+
### Thanks to our community contributors
70+
* Andrei Zhukouski (@BurgerZ), Fix typo (#14575)
71+
* Mark Allison (@markallisongit), Update Invoke-AzSqlInstanceFailover.md (#14603)
72+
73+
174
## 5.7.0 - March 2021
275
#### Az.Accounts
376
* Fixed incorrect warning message on Windows PowerShell [#14556]

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 - March 2021"
40+
$productName = "Microsoft Azure PowerShell - April 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.2.7'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.8'; })
5555

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

src/Accounts/Accounts/Account/ConnectAzureRmAccount.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ public override void ExecuteCmdlet()
417417
}
418418

419419
profileClient.WarningLog = (message) => _tasks.Enqueue(new Task(() => this.WriteWarning(message)));
420+
profileClient.DebugLog = (message) => _tasks.Enqueue(new Task(() => this.WriteDebugWithTimestamp(message)));
420421
var task = new Task<AzureRmProfile>( () => profileClient.Login(
421422
azureAccount,
422423
_environment,

src/Accounts/Accounts/Az.Accounts.psd1

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

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

1414
# Version number of this module.
15-
ModuleVersion = '2.2.7'
15+
ModuleVersion = '2.2.8'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -143,8 +143,7 @@ PrivateData = @{
143143
# IconUri = ''
144144

145145
# ReleaseNotes of this module
146-
ReleaseNotes = '* Fixed incorrect warning message on Windows PowerShell [#14556]
147-
* Set Azure Environment variable ''AzureKeyVaultServiceEndpointResourceId'' according to the value of ''AzureKeyVaultDnsSuffix'' when discovering environment '
146+
ReleaseNotes = '* Fallback to first valid context if current default context key is ''Default'' which is invalid'
148147

149148
# Prerelease string of this module
150149
# Prerelease = ''

src/Accounts/Accounts/AzureRmAlias/Mappings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@
520520
"Remove-AzVmssDataDisk": "Remove-AzureRmVmssDataDisk",
521521
"Remove-AzVmssNetworkInterfaceConfiguration": "Remove-AzureRmVmssNetworkInterfaceConfiguration",
522522
"Set-AzVmssOsProfile": "Set-AzureRmVmssOsProfile",
523-
"Set-AzVmssSecurityType": "Set-AzureRmVmssSecurityType",
523+
"Set-AzVmssSecurityProfile": "Set-AzureRmVmssSecurityProfile",
524524
"Set-AzVmssUefi": "Set-AzureRmVmssUefi",
525525
"Set-AzVmssStorageProfile": "Set-AzureRmVmssStorageProfile",
526526
"New-AzVmss": "New-AzureRmVmss",

src/Accounts/Accounts/ChangeLog.md

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

2121
## Upcoming Release
22+
23+
## Version 2.2.8
2224
* Fallback to first valid context if current default context key is "Default" which is invalid
2325

2426
## Version 2.2.7

src/Accounts/Accounts/Models/RMProfileClient.cs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class RMProfileClient
3636
private IProfileOperations _profile;
3737
private IAzureTokenCache _cache;
3838
public Action<string> WarningLog;
39+
public Action<string> DebugLog;
3940

4041
private IAzureContext DefaultContext
4142
{
@@ -242,9 +243,10 @@ public AzureRmProfile Login(
242243
token = null;
243244
}
244245
}
245-
catch
246+
catch(Exception e)
246247
{
247-
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenant));
248+
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenant, e.Message));
249+
WriteDebugMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenant, e.ToString()));
248250
}
249251

250252
if (token != null &&
@@ -498,12 +500,13 @@ public IEnumerable<IAzureSubscription> ListSubscriptions(string tenantIdOrDomain
498500
ListAllSubscriptionsForTenant(
499501
(tenant.GetId() == Guid.Empty) ? tenant.Directory : tenant.Id.ToString()));
500502
}
501-
catch (AadAuthenticationException)
503+
catch (AadAuthenticationException e)
502504
{
503505
WriteWarningMessage(string.Format(
504506
ProfileMessages.UnableToLogin,
505507
_profile.DefaultContext.Account,
506508
tenant));
509+
WriteDebugMessage(e.ToString());
507510
}
508511

509512
}
@@ -604,6 +607,7 @@ private bool TryGetTenantSubscription(IAccessToken accessToken,
604607
if (isTenantPresent || !string.Equals(ex.Body?.Code, "InvalidAuthenticationTokenTenant", StringComparison.OrdinalIgnoreCase))
605608
{
606609
WriteWarningMessage(ex.Message);
610+
WriteDebugMessage(ex.ToString());
607611
}
608612
}
609613

@@ -652,9 +656,10 @@ private List<AzureTenant> ListAccountTenants(
652656

653657
result = SubscriptionAndTenantClient?.ListAccountTenants(commonTenantToken, environment);
654658
}
655-
catch
659+
catch(Exception e)
656660
{
657-
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, commonTenant));
661+
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, commonTenant, e.Message));
662+
WriteDebugMessage(string.Format(ProfileMessages.UnableToAqcuireToken, commonTenant, e.ToString()));
658663
if (account.IsPropertySet(AzureAccount.Property.Tenants))
659664
{
660665
result =
@@ -698,9 +703,10 @@ private IEnumerable<AzureSubscription> ListAllSubscriptionsForTenant(
698703
{
699704
accessToken = AcquireAccessToken(account, environment, tenantId, password, promptBehavior, null);
700705
}
701-
catch
706+
catch(Exception e)
702707
{
703-
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenantId));
708+
WriteWarningMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenantId, e.Message));
709+
WriteDebugMessage(string.Format(ProfileMessages.UnableToAqcuireToken, tenantId, e.ToString()));
704710
return new List<AzureSubscription>();
705711
}
706712

@@ -715,6 +721,14 @@ private void WriteWarningMessage(string message)
715721
}
716722
}
717723

724+
private void WriteDebugMessage(string message)
725+
{
726+
if(DebugLog != null)
727+
{
728+
DebugLog(message);
729+
}
730+
}
731+
718732
public ISubscriptionClientWrapper SubscriptionAndTenantClient = null;
719733
}
720734
}

src/Accounts/Accounts/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
// You can specify all the values or you can default the Build and Revision Numbers
4444
// by using the '*' as shown below:
4545

46-
[assembly: AssemblyVersion("2.2.7")]
47-
[assembly: AssemblyFileVersion("2.2.7")]
46+
[assembly: AssemblyVersion("2.2.8")]
47+
[assembly: AssemblyFileVersion("2.2.8")]
4848
#if !SIGN
4949
[assembly: InternalsVisibleTo("Microsoft.Azure.PowerShell.Cmdlets.Accounts.Test")]
5050
#endif

src/Accounts/Accounts/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Accounts/Accounts/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
<value>To create an access token credential, you must provide an access token account.</value>
340340
</data>
341341
<data name="UnableToAqcuireToken" xml:space="preserve">
342-
<value>Unable to acquire token for tenant '{0}'</value>
342+
<value>Unable to acquire token for tenant '{0}' with error '{1}'</value>
343343
</data>
344344
<data name="UnableToLogin" xml:space="preserve">
345345
<value>Could not authenticate user account '{0}' with tenant '{1}'. Subscriptions in this tenant will not be listed. Please login again using Connect-AzAccount to view the subscriptions in this tenant.</value>

src/Accounts/Authentication.Test/Mocks/MockMsalAccessTokenAcquirer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MockMsalAccessTokenAcquirer : MsalAccessTokenAcquirer
3232

3333
public TokenRequestContext TokenRequestContext { get; set; }
3434

35-
internal override async Task<IAccessToken> GetAccessTokenAsync(TokenCredential tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken, string tenantId = null, string userId = null, string homeAccountId = "")
35+
internal override async Task<IAccessToken> GetAccessTokenAsync(string callerClassName, string parametersLog, TokenCredential tokenCredential, TokenRequestContext requestContext, CancellationToken cancellationToken, string tenantId = null, string userId = null, string homeAccountId = "")
3636
{
3737
TokenCredential = tokenCredential;
3838
TokenRequestContext = requestContext;

src/Accounts/Authentication/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
// You can specify all the values or you can default the Build and Revision Numbers
4444
// by using the '*' as shown below:
4545
// [assembly: AssemblyVersion("1.0.*")]
46-
[assembly: AssemblyVersion("2.2.7")]
47-
[assembly: AssemblyFileVersion("2.2.7")]
46+
[assembly: AssemblyVersion("2.2.8")]
47+
[assembly: AssemblyFileVersion("2.2.8")]

src/Accounts/Authenticators/AccessTokenAuthenticator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
4646
resourceId.EqualsInsensitively(environment.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId)))
4747
&& account.IsPropertySet(AzureAccount.Property.KeyVaultAccessToken))
4848
{
49-
TracingAdapter.Information(string.Format("[AccessTokenAuthenticator] Creating KeyVault access token - Tenant: '{0}', ResourceId: '{1}', UserId: '{2}'", tenant, resourceId, account.Id));
49+
TracingAdapter.Information($"{DateTime.Now:T} - [AccessTokenAuthenticator] Creating KeyVault access token - Tenant: '{tenant}', ResourceId: '{resourceId}', UserId: '{account.Id}'");
5050
rawToken.AccessToken = account.GetProperty(AzureAccount.Property.KeyVaultAccessToken);
5151
}
5252
else if ((resourceId.EqualsInsensitively(environment.GraphEndpointResourceId) ||
@@ -55,7 +55,7 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
5555
resourceId.EqualsInsensitively(environment.GetEndpoint(AzureEnvironment.Endpoint.GraphEndpointResourceId)))
5656
&& account.IsPropertySet(AzureAccount.Property.GraphAccessToken))
5757
{
58-
TracingAdapter.Information(string.Format("[AccessTokenAuthenticator] Creating Graph access token - Tenant: '{0}', ResourceId: '{1}', UserId: '{2}'", tenant, resourceId, account.Id));
58+
TracingAdapter.Information($"{DateTime.Now:T} - [AccessTokenAuthenticator] Creating Graph access token - Tenant: '{tenant}', ResourceId: '{resourceId}', UserId: '{account.Id}'");
5959
rawToken.AccessToken = account.GetProperty(AzureAccount.Property.GraphAccessToken);
6060
}
6161
else if ((resourceId.EqualsInsensitively(environment.ActiveDirectoryServiceEndpointResourceId) ||
@@ -64,7 +64,7 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
6464
resourceId.EqualsInsensitively(environment.GetEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)))
6565
&& account.IsPropertySet(AzureAccount.Property.AccessToken))
6666
{
67-
TracingAdapter.Information(string.Format("[AccessTokenAuthenticator] Creating access token - Tenant: '{0}', ResourceId: '{1}', UserId: '{2}'", tenant, resourceId, account.Id));
67+
TracingAdapter.Information($"{DateTime.Now:T} - [AccessTokenAuthenticator] Creating access token - Tenant: '{tenant}', ResourceId: '{resourceId}', UserId: '{account.Id}'");
6868
rawToken.AccessToken = account.GetAccessToken();
6969
}
7070
else

src/Accounts/Authenticators/DeviceCodeAuthenticator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
using Azure.Core;
2020
using Azure.Identity;
2121

22+
using Hyak.Common;
23+
2224
using Microsoft.Azure.Commands.Common.Authentication;
2325
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2426
using Microsoft.Azure.Commands.ResourceManager.Common;
@@ -53,6 +55,7 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
5355
};
5456
var codeCredential = new DeviceCodeCredential(options);
5557

58+
TracingAdapter.Information($"{DateTime.Now:T} - [DeviceCodeAuthenticator] Calling DeviceCodeCredential.AuthenticateAsync - TenantId:'{options.TenantId}', Scopes:'{string.Join(",", scopes)}', AuthorityHost:'{options.AuthorityHost}'");
5659
var authTask = codeCredential.AuthenticateAsync(requestContext, cancellationToken);
5760
return MsalAccessToken.GetAccessTokenAsync(
5861
authTask,

src/Accounts/Authenticators/InteractiveUserAuthenticator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using System.Diagnostics;
1617
using System.Net;
1718
using System.Net.Sockets;
1819
using System.Threading;
@@ -21,6 +22,8 @@
2122
using Azure.Core;
2223
using Azure.Identity;
2324

25+
using Hyak.Common;
26+
2427
using Microsoft.Azure.Commands.Common.Authentication;
2528
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2629

@@ -65,6 +68,8 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
6568
RedirectUri = GetReplyUrl(onPremise, interactiveParameters),
6669
};
6770
var browserCredential = new InteractiveBrowserCredential(options);
71+
72+
TracingAdapter.Information($"{DateTime.Now:T} - [InteractiveUserAuthenticator] Calling InteractiveBrowserCredential.AuthenticateAsync with TenantId:'{options.TenantId}', Scopes:'{string.Join(",", scopes)}', AuthorityHost:'{options.AuthorityHost}', RedirectUri:'{options.RedirectUri}'");
6873
var authTask = browserCredential.AuthenticateAsync(requestContext, cancellationToken);
6974

7075
return MsalAccessToken.GetAccessTokenAsync(

src/Accounts/Authenticators/ManagedServiceIdentityAuthenticator.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System;
1516
using System.Text.RegularExpressions;
1617
using System.Threading;
1718
using System.Threading.Tasks;
1819

1920
using Azure.Core;
2021
using Azure.Identity;
2122

23+
using Hyak.Common;
24+
2225
using Microsoft.Azure.Commands.Common.Authentication;
2326
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2427
using Microsoft.Azure.PowerShell.Authenticators.Factories;
@@ -47,8 +50,15 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
4750

4851
var identityCredential = azureCredentialFactory.CreateManagedIdentityCredential(userAccountId);
4952
var msalAccessTokenAcquirer = msalAccessTokenAcquirerFactory.CreateMsalAccessTokenAcquirer();
50-
return msalAccessTokenAcquirer.GetAccessTokenAsync(identityCredential, requestContext, cancellationToken,
51-
msiParameters.TenantId, msiParameters.Account.Id);
53+
var parametersLog = $"- TenantId:'{msiParameters.TenantId}', Scopes:'{string.Join(",", scopes)}', UserId:'{userAccountId}'";
54+
return msalAccessTokenAcquirer.GetAccessTokenAsync(
55+
nameof(ManagedServiceIdentityAuthenticator),
56+
parametersLog,
57+
identityCredential,
58+
requestContext,
59+
cancellationToken,
60+
msiParameters.TenantId,
61+
msiParameters.Account.Id);
5262
}
5363

5464
public override bool CanAuthenticate(AuthenticationParameters parameters)

0 commit comments

Comments
 (0)