Skip to content

Commit e168fd7

Browse files
authored
Merge pull request #25099 from yifanz7/mergepreview
[Storage][Do Not Squash] Merge recent changes from main to Az.Storage-preview
2 parents 68169ec + c1ba98e commit e168fd7

File tree

2,649 files changed

+337644
-174716
lines changed

Some content is hidden

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

2,649 files changed

+337644
-174716
lines changed

.azure-pipelines/live-test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,13 @@ stages:
240240
targetType: filePath
241241
filePath: ./tools/TestFx/Live/SendLiveTestReport.ps1
242242
arguments: -EmailServiceConnectionString '$(EmailServiceConnectionString)' -EmailFrom '$(EmailFrom)'
243+
244+
- task: AzurePowerShell@5
245+
displayName: Save live test results
246+
condition: or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.SourceBranch'], 'refs/heads/internal/release'))
247+
inputs:
248+
pwsh: true
249+
azurePowerShellVersion: latestVersion
250+
azureSubscription: $(KustoServiceConnectionName)
251+
scriptType: filePath
252+
scriptPath: ./tools/TestFx/Live/SaveLiveTestResult.ps1

.azure-pipelines/security-tools.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,21 @@ jobs:
5353
outputFormat: sarif
5454
scanFolder: SecurityTmp
5555
suppressionsFile: tools/SecurityTools/CredScanSuppressions.json
56-
57-
- task: PowerShell@2
58-
displayName: Copy PDB for BinSkim
59-
inputs:
60-
targetType: inline
61-
script: ./src/lib/pdb/CopyPdbToArtifacts.ps1
62-
pwsh: true
6356

6457
- task: PowerShell@2
6558
displayName: Generate a response text file for BinSkim
6659
inputs:
6760
targetType: 'inline'
6861
script: |
69-
New-Item $(Build.SourcesDirectory)/artifacts/MyFileList.rsp -ItemType File -Force
70-
(Get-ChildItem -Path .\artifacts\Debug -Include *.dll,*.exe -Exclude msalruntime.dll,msalruntime_arm64.dll,msalruntime_x86.dll -Recurse).FullName > $(Build.SourcesDirectory)/artifacts/MyFileList.rsp
62+
New-Item $(Build.SourcesDirectory)/artifacts/FilesToScan.rsp -ItemType File -Force
63+
(Get-ChildItem -Path .\artifacts\Debug -Include *.dll,*.exe -Exclude msalruntime.dll,msalruntime_arm64.dll,msalruntime_x86.dll -Recurse).FullName > $(Build.SourcesDirectory)/artifacts/FilesToScan.rsp
7164
pwsh: true
72-
65+
7366
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
7467
displayName: Run BinSkim
7568
inputs:
7669
InputType: 'CommandLine'
77-
arguments: 'analyze @$(Build.SourcesDirectory)/artifacts/MyFileList.rsp --recurse'
70+
arguments: 'analyze @$(Build.SourcesDirectory)/artifacts/FilesToScan.rsp --config default --recurse --statistics'
7871

7972
- task: PowerShell@2
8073
displayName: Cleanup Build
@@ -95,4 +88,3 @@ jobs:
9588
inputs:
9689
artifactName: artifacts
9790
targetPath: artifacts
98-
...

.azure-pipelines/sync-aliases.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,38 @@ schedules:
66
include:
77
- main
88

9+
# The 'resources' and 'uses' below are used to resolve the error 'Repository associated with wiki ID <WikiId> does not exist or you do not have permissions for the operation you are attempting.'
10+
resources:
11+
repositories:
12+
- repository: ServiceContactList
13+
type: git
14+
name: internal.wiki
15+
916
jobs:
1017
- job: UpdateYaml
1118
displayName: Update resourceManagement.yml
1219
pool: pool-windows-2019
20+
uses:
21+
repositories:
22+
- ServiceContactList
1323

1424
steps:
1525
- task: UseDotNet@2
1626
displayName: Install .NET 8 SDK
1727
inputs:
1828
packageType: sdk
1929
version: 8.0.x
20-
- template: util/get-github-pat-steps.yml
2130

2231
- pwsh: |
2332
dotnet --version
2433
dotnet new tool-manifest --force
2534
dotnet tool install powershell --version 7.4.*
2635
displayName: Install PowerShell 7.4.x
2736
28-
- template: util/get-keyvault-secret-steps.yml
29-
parameters:
30-
serviceConnectionName: $(AzureSubscription)
31-
keyVaultName: $(KeyVaultName)
32-
secretName: $(ADOTokenName)
33-
outVar: 'ADOToken'
34-
3537
- pwsh: |
36-
dotnet tool run pwsh -NoLogo -NoProfile -NonInteractive -File "./tools/Github/ParseServiceContactsList.ps1 -ADOToken $(ADOToken)"
38+
dotnet tool run pwsh -NoLogo -NoProfile -NonInteractive -File "./tools/Github/ParseServiceContactsList.ps1 -AccessToken $env:SYSTEM_ACCESSTOKEN"
39+
env:
40+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
3741
displayName: Update resourceManagement.yml file locally
3842
3943
- pwsh: |
@@ -47,6 +51,8 @@ jobs:
4751
}
4852
displayName: Check if Wiki table has any changes
4953
54+
- template: util/get-github-pat-steps.yml
55+
5056
- pwsh: |
5157
git config --global user.email "[email protected]"
5258
git config --global user.name "azure-powershell-bot"

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ trigger:
1111
paths:
1212
include:
1313
- .azure-pipelines
14-
- .github
1514
- tools
1615
- src/lib
1716
- .ci-config.json
@@ -53,4 +52,4 @@ jobs:
5352
$BaseBranch = "$(BranchName)"
5453
$Description = "Migrate Sync tools code from main branch to $(BranchName) branch"
5554
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description
56-
displayName: Create PR to $(BranchName) branch
55+
displayName: Create PR to $(BranchName) branch

.azure-pipelines/test-coverage.yml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
parameters:
2-
- name: dotnet_sdk_6
3-
displayName: .NET 6
2+
- name: dotnet_sdk
3+
displayName: .NET SDK
44
type: string
55
default: 6.0.x
6-
- name: dotnet_sdk_7
7-
displayName: .NET 7
8-
type: string
9-
default: 7.0.x
106
- name: testFramework
117
displayName: Test Framework
128
type: string
@@ -34,10 +30,10 @@ jobs:
3430

3531
steps:
3632
- task: UseDotNet@2
37-
displayName: 'Install .NET 6 SDK'
33+
displayName: 'Install .NET SDK'
3834
inputs:
3935
packageType: sdk
40-
version: ${{ parameters.dotnet_sdk_6 }}
36+
version: ${{ parameters.dotnet_sdk }}
4137

4238
- task: DotNetCoreCLI@2
4339
displayName: Build Azure PowerShell Modules
@@ -61,10 +57,10 @@ jobs:
6157

6258
steps:
6359
- task: UseDotNet@2
64-
displayName: 'Install .NET 6.0 SDK'
60+
displayName: 'Install .NET SDK'
6561
inputs:
6662
packageType: sdk
67-
version: ${{ parameters.dotnet_sdk_6 }}
63+
version: ${{ parameters.dotnet_sdk }}
6864

6965
- task: PowerShell@2
7066
displayName: Initialize Environment
@@ -88,7 +84,7 @@ jobs:
8884
arguments: 'build.proj -t:"Test" -p:"Configuration=Debug;TestFramework=${{ parameters.testFramework }}"'
8985

9086
- task: PowerShell@2
91-
displayName: Test AutoRest-Based Cmdlets
87+
displayName: Test Autorest-Based Cmdlets
9288
condition: succeeded()
9389
inputs:
9490
pwsh: true
@@ -101,7 +97,7 @@ jobs:
10197
$debugDir = Join-Path -Path $rootDir -ChildPath "artifacts" | Join-Path -ChildPath "Debug"
10298
$env:PSModulePath += $delimiter + $debugDir
10399
Get-ChildItem -Path $debugDir -Filter test-module.ps1 -File -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
104-
Write-Host "##[section]Testing $_"
100+
Write-Host "##[section]Executing $_"
105101
& $_
106102
}
107103
@@ -114,22 +110,6 @@ jobs:
114110
filePath: ./tools/TestFx/Coverage/AnalyzeTestCoverage.ps1
115111
arguments: -CalcBaseline
116112

117-
- template: util/get-keyvault-secret-steps.yml
118-
parameters:
119-
serviceConnectionName: $(AzureSubscription)
120-
keyVaultName: $(KustoServicePrincipalKeyVaultName)
121-
secretName: $(KustoServicePrincipalSecretName)
122-
outVar: 'KustoServicePrincipalSecret'
123-
124-
- task: PowerShell@2
125-
displayName: Save Test Coverage Results
126-
condition: succeeded()
127-
inputs:
128-
pwsh: true
129-
targetType: filePath
130-
filePath: ./tools/TestFx/Coverage/SaveTestCoverageResult.ps1
131-
arguments: CITest $(KustoTenantId) $(KustoServicePrincipalId) $(KustoServicePrincipalSecret) $(KustoClusterName) $(KustoClusterRegion)
132-
133113
- template: util/get-github-pat-steps.yml
134114

135115
- task: PowerShell@2

.azure-pipelines/util/live-test-steps.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,6 @@ jobs:
134134
filePath: ./tools/TestFx/Live/InvokeLiveTestCITask.ps1
135135
arguments: -UseWindowsPowerShell ('${{ parameters.psVersion }}' -eq '5.1') -ScriptFile './tools/TestFx/Live/InvokeLiveTestScenarios.ps1 -OSVersion ${{ parameters.vmImage }} -RunPlatform ${{ parameters.osType }} -RunPowerShell ${{ parameters.psVersion }}'
136136

137-
- template: get-keyvault-secret-steps.yml
138-
parameters:
139-
serviceConnectionName: $(KustoServiceConnectionName)
140-
keyVaultName: $(KustoServicePrincipalKeyVaultName)
141-
secretName: $(KustoServicePrincipalSecretName)
142-
outVar: 'KustoServicePrincipalSecret'
143-
execCondition: and(succeeded(), ne(variables['skipLatest'], 'true'))
144-
145-
- task: PowerShell@2
146-
displayName: Save live test results to Kusto
147-
condition: and(succeeded(), ne(variables['skipLatest'], 'true'), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.SourceBranch'], 'refs/heads/internal/release')))
148-
inputs:
149-
pwsh: true
150-
targetType: filePath
151-
filePath: ./tools/TestFx/Live/SaveLiveTestResult.ps1
152-
arguments: $(KustoTenantId) $(KustoServicePrincipalId) $(KustoServicePrincipalSecret) $(KustoClusterName) $(KustoClusterRegion)
153-
154137
- task: PublishPipelineArtifact@1
155138
displayName: Publish live test results to pipeline artifact
156139
condition: and(succeeded(), ne(variables['skipLatest'], 'true'))

src/Accounts/Accounts.Test/EnvironmentCmdletTestsExtension.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public static PSAzureEnvironment GetAzureCloudEndpoints()
7979
env.SetProperty("AzureAppConfigurationEndpointSuffix", "azconfig.io");
8080
env.SetProperty("AzureAppConfigurationEndpointResourceId", "https://azconfig.io");
8181
env.SetProperty("ContainerRegistryEndpointResourceId", "https://management.azure.com");
82+
env.SetProperty("AzureCommunicationEmailEndpointSuffix", "communication.azure.com");
83+
env.SetProperty("AzureCommunicationEmailEndpointResourceId", "https://communication.azure.com");
8284
return env;
8385
}
8486

src/Accounts/Accounts/Rest/InvokeAzRestMethodCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ private string MatchResourceId(IAzureContext context, string authority, out stri
255255
targetResourceIdKey = AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId;
256256
return env.ExtendedProperties[AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId];
257257
}
258+
if (HasSameEndpointSuffix(authority, env.ExtendedProperties[AzureEnvironment.ExtendedEndpoint.AzureCommunicationEmailEndpointSuffix]))
259+
{
260+
targetResourceIdKey = AzureEnvironment.ExtendedEndpoint.AzureCommunicationEmailEndpointResourceId;
261+
return env.ExtendedProperties[AzureEnvironment.ExtendedEndpoint.AzureCommunicationEmailEndpointResourceId];
262+
}
258263
return null;
259264
}
260265

src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class GetAzureRmAccessTokenCommand : AzureRMCmdlet
5454
SupportedResourceNames.Arm,
5555
SupportedResourceNames.Attestation,
5656
SupportedResourceNames.Batch,
57+
SupportedResourceNames.CommunicationEmail,
5758
SupportedResourceNames.DataLake,
5859
SupportedResourceNames.KeyVault,
5960
SupportedResourceNames.ManagedHsm,

src/Accounts/Accounts/Utilities/SupportedResourceNames.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ internal class SupportedResourceNames
3535
public const string Synapse = "Synapse";
3636
public const string ManagedHsm = "ManagedHsm";
3737
public const string AppConfiguration = "AppConfiguration";
38+
public const string CommunicationEmail = "CommunicationEmail";
3839

3940
internal static Dictionary<string, string> ResourceNameMap;
4041
internal static Dictionary<string, string> DataPlaneResourceNameMap;
@@ -56,7 +57,8 @@ static SupportedResourceNames()
5657
{ Storage, "https://storage.azure.com/" }, //OAuth scope/resource id for Storage, does not add it to ExtenedEndpoint to avoid confusion with StorageEndpointSuffix
5758
{ Synapse, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId },
5859
{ ManagedHsm, AzureEnvironment.ExtendedEndpoint.ManagedHsmServiceEndpointResourceId },
59-
{ AppConfiguration, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId }
60+
{ AppConfiguration, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId },
61+
{ CommunicationEmail, AzureEnvironment.ExtendedEndpoint.AzureCommunicationEmailEndpointResourceId }
6062
};
6163

6264
ResourceNameMap = new Dictionary<string, string>(DataPlaneResourceNameMap);

0 commit comments

Comments
 (0)