Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Pull request overview
Updates the App Configuration data-plane AutoRest configuration to the 2024-09-01 spec, adds snapshot-related cmdlets, and refreshes the module’s tests/recordings and help content to cover the new surface area.
Changes:
- Update AutoRest input spec + directives (snapshot LRO response handling, model tweaks, parameter description improvements).
- Add/enable Pester tests (and new recordings) for snapshot/key-value/lock operations.
- Regenerate/extend markdown help and examples to include new snapshot cmdlets.
Reviewed changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/AppConfiguration/AppConfigurationdata.Autorest/test/utils.ps1 | Test environment provisioning updated (store creation + RBAC) and recording/env sanitization added. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Update-AzAppConfigurationSnapshot.Tests.ps1 | Adds Update-AzAppConfigurationSnapshot tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Test-AzAppConfigurationSnapshot.Tests.ps1 | Adds Test-AzAppConfigurationSnapshot tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Test-AzAppConfigurationSnapshot.Recording.json | Recording for snapshot existence tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Test-AzAppConfigurationKeyValue.Tests.ps1 | Enables key-value existence tests (previously skipped). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Test-AzAppConfigurationKeyValue.Recording.json | Recording for key-value HEAD tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Set-AzAppConfigurationLock.Tests.ps1 | Enables lock test (previously skipped). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Set-AzAppConfigurationLock.Recording.json | Recording for lock operations. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Set-AzAppConfigurationKeyValue.Tests.ps1 | Enables Set key-value tests (expanded + JSON string). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Set-AzAppConfigurationKeyValue.Recording.json | Recording for key-value PUT/DELETE. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Remove-AzAppConfigurationLock.Tests.ps1 | Enables unlock test (previously skipped). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Remove-AzAppConfigurationLock.Recording.json | Recording for unlock operations. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Remove-AzAppConfigurationKeyValue.Tests.ps1 | Enables delete key-value test (previously skipped). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Remove-AzAppConfigurationKeyValue.Recording.json | Recording for key-value delete flow. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/New-AzAppConfigurationSnapshot.Tests.ps1 | Adds snapshot creation tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationSnapshot.Tests.ps1 | Adds snapshot list/get tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationRevision.Tests.ps1 | Removes LiveOnly tag so revisions test runs with recordings. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationRevision.Recording.json | Recording for revision list. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationOperationDetail.Tests.ps1 | Adds operation-detail (LRO status) tests. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationOperationDetail.Recording.json | Recording for operation-detail flow. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationLabel.Tests.ps1 | Removes LiveOnly tag so label test runs with recordings. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationLabel.Recording.json | Recording for label list. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationKeyValue.Tests.ps1 | Enables key-value get/list tests (previously skipped). |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationKeyValue.Recording.json | Recording for key-value get/list. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationKey.Tests.ps1 | Removes LiveOnly tag so key-list test runs with recordings. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/Get-AzAppConfigurationKey.Recording.json | Recording for key list. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/env.json | Adds sanitized playback environment values. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/AzAppConfigurationLock.Tests.ps1 | Updates recording filename reference and removes LiveOnly tag. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/AzAppConfigurationLock.Recording.json | Recording for combined lock scenario. |
| src/AppConfiguration/AppConfigurationdata.Autorest/test/AzAppConfigurationKeyValue.Tests.ps1 | Updates recording filename reference, fixes endpoint var usage, relaxes paging assertion. |
| src/AppConfiguration/AppConfigurationdata.Autorest/README.md | Updates spec commit/input-file and adds directives for snapshot/model fixes + parameter description improvements. |
| src/AppConfiguration/AppConfigurationdata.Autorest/Properties/AssemblyInfo.cs | Bumps AppConfigurationdata assembly version metadata (source project). |
| src/AppConfiguration/AppConfigurationdata.Autorest/generate-info.json | Updates generation id. |
| src/AppConfiguration/AppConfigurationdata.Autorest/examples/Update-AzAppConfigurationSnapshot.md | Adds examples for archiving/recovering snapshots. |
| src/AppConfiguration/AppConfigurationdata.Autorest/examples/Test-AzAppConfigurationSnapshot.md | Adds examples for snapshot existence checks. |
| src/AppConfiguration/AppConfigurationdata.Autorest/examples/New-AzAppConfigurationSnapshot.md | Adds snapshot creation examples. |
| src/AppConfiguration/AppConfigurationdata.Autorest/examples/Get-AzAppConfigurationSnapshot.md | Adds snapshot list/get examples. |
| src/AppConfiguration/AppConfigurationdata.Autorest/examples/Get-AzAppConfigurationOperationDetail.md | Adds operation-detail example. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Update-AzAppConfigurationSnapshot.md | Adds reference help for Update-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Test-AzAppConfigurationSnapshot.md | Adds reference help for Test-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Test-AzAppConfigurationKeyValue.md | Updates reference help (new parameters/formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Set-AzAppConfigurationLock.md | Updates reference help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Set-AzAppConfigurationKeyValue.md | Updates reference help (ClientRequestId + improved descriptions). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Remove-AzAppConfigurationLock.md | Updates reference help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Remove-AzAppConfigurationKeyValue.md | Updates reference help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/New-AzAppConfigurationSnapshot.md | Adds reference help for New-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Get-AzAppConfigurationSnapshot.md | Adds reference help for Get-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Get-AzAppConfigurationRevision.md | Updates reference help (Tag/ClientRequestId + formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Get-AzAppConfigurationOperationDetail.md | Adds reference help for Get-AzAppConfigurationOperationDetail. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Get-AzAppConfigurationLabel.md | Updates reference help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Get-AzAppConfigurationKey.md | Updates reference help formatting. |
| src/AppConfiguration/AppConfigurationdata.Autorest/docs/Az.AppConfigurationdata.md | Updates module index (new cmdlets + guid). |
| src/AppConfiguration/AppConfiguration/help/Update-AzAppConfigurationStore.md | Updates help content; default value presentation changed. |
| src/AppConfiguration/AppConfiguration/help/Update-AzAppConfigurationSnapshot.md | Adds Az.AppConfiguration help for Update-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfiguration/help/Test-AzAppConfigurationSnapshot.md | Adds Az.AppConfiguration help for Test-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfiguration/help/Test-AzAppConfigurationKeyValue.md | Updates help (Tag/ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/Set-AzAppConfigurationLock.md | Updates help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/Set-AzAppConfigurationKeyValue.md | Updates help (ClientRequestId + improved descriptions). |
| src/AppConfiguration/AppConfiguration/help/Remove-AzAppConfigurationLock.md | Updates help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/Remove-AzAppConfigurationKeyValue.md | Updates help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/New-AzAppConfigurationStore.md | Updates help content; default value presentation changed. |
| src/AppConfiguration/AppConfiguration/help/New-AzAppConfigurationSnapshot.md | Adds Az.AppConfiguration help for New-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfiguration/help/Get-AzAppConfigurationSnapshot.md | Adds Az.AppConfiguration help for Get-AzAppConfigurationSnapshot. |
| src/AppConfiguration/AppConfiguration/help/Get-AzAppConfigurationRevision.md | Updates help (Tag/ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/Get-AzAppConfigurationOperationDetail.md | Adds Az.AppConfiguration help for Get-AzAppConfigurationOperationDetail. |
| src/AppConfiguration/AppConfiguration/help/Get-AzAppConfigurationLabel.md | Updates help (ClientRequestId + formatting). |
| src/AppConfiguration/AppConfiguration/help/Get-AzAppConfigurationKey.md | Updates help formatting. |
| src/AppConfiguration/AppConfiguration/help/Clear-AzAppConfigurationDeletedStore.md | Updates help formatting/defaults and adds complex parameter properties section. |
| src/AppConfiguration/AppConfiguration/help/Az.AppConfiguration.md | Updates module index to include snapshot/operation cmdlets. |
| src/AppConfiguration/AppConfiguration/Az.AppConfiguration.psd1 | Updates module manifest (exports + required Az.Accounts version). |
| src/AppConfiguration/AppConfiguration.sln | Updates solution project entries (including AppConfigurationdata project GUID). |
| # Use Az CLI to create the App Configuration store to avoid assembly version | ||
| # conflicts between Az.AppConfiguration and Az.AppConfigurationdata modules. | ||
| $storeJson = az appconfig create --name $env.appStoreName1 --resource-group $env.resourceGroup --location $env.location --output json | ConvertFrom-Json | ||
| $endpoint = "https://$($env.appStoreName1).azconfig.io" | ||
| $env.Add("endpoint", $endpoint) |
There was a problem hiding this comment.
setupEnv now shells out to az appconfig create without checking that the Azure CLI is installed/authenticated or that the command succeeded. This makes record/live test runs brittle and introduces an extra external dependency that isn’t handled by the existing test-module dependency checks. Consider switching back to the Az PowerShell cmdlet approach or, at minimum, add a clear preflight check/validation and fail fast with a helpful error if az isn’t available or returns a non-zero exit code.
| # HomeAccountId is in "objectId.tenantId" format — extract just the objectId | ||
| $homeAccountId = (Get-AzContext).Account.ExtendedProperties['HomeAccountId'] | ||
| $loginObjectId = ($homeAccountId -split '\.')[0] | ||
| New-AzRoleAssignment -ObjectId $loginObjectId -RoleDefinitionName "App Configuration Data Owner" -Scope $storeJson.id -ErrorAction SilentlyContinue | ||
| # Wait for RBAC propagation | ||
| Start-TestSleep -Seconds 30 |
There was a problem hiding this comment.
The role assignment setup assumes (Get-AzContext).Account.ExtendedProperties['HomeAccountId'] is present and in a dot-separated format, and then suppresses any role-assignment errors with -ErrorAction SilentlyContinue. If the HomeAccountId isn’t available (e.g., non-interactive auth) or the role assignment fails, the tests can proceed and then fail later with confusing authorization errors. Recommend resolving the principal object id more robustly (based on account type) and only ignoring the specific “already exists” case while surfacing other failures.
| ### EXAMPLE 1 | ||
| ``` |
There was a problem hiding this comment.
The EXAMPLES section formatting is inconsistent with the rest of the module help (e.g., other cmdlets use “### Example 1: …” and a ```powershell fenced block plus a short description). The current “### EXAMPLE 1” heading and untyped code fence also dropped the explanatory sentence, which reduces help quality.
| ### EXAMPLE 1 | |
| ``` | |
| ### Example 1: Permanently delete a deleted configuration store | |
| This example permanently deletes the deleted configuration store named `azpstestappstore` in the `eastus` location. | |
| ```powershell |
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Default value: 0 |
There was a problem hiding this comment.
The help text shows Default value: 0 for -DefaultKeyValueRevisionRetentionPeriodInSecond, but the parameter description states defaults are SKU-dependent (e.g., 7/30 days). Showing 0 here is misleading—if the cmdlet treats “not specified” differently than explicitly passing 0, this can confuse users. Recommend adjusting the generated help so the default is shown as “None/not set” (or omit it) rather than 0.
| Default value: 0 | |
| Default value: None (service applies SKU-dependent default when not specified) |
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Default value: 0 |
There was a problem hiding this comment.
Same issue as Update-AzAppConfigurationStore.md: the help indicates Default value: 0 for -DefaultKeyValueRevisionRetentionPeriodInSecond even though the description documents SKU-based defaults. This should be reflected as “not set”/omitted rather than 0 to avoid misleading users.
| Default value: 0 | |
| Default value: None |
| # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. | ||
| FunctionsToExport = 'Clear-AzAppConfigurationDeletedStore', | ||
| 'Get-AzAppConfigurationDeletedStore', 'Get-AzAppConfigurationKey', | ||
| 'Get-AzAppConfigurationKeyValue', 'Get-AzAppConfigurationLabel', | ||
| 'Get-AzAppConfigurationOperationDetail', | ||
| 'Get-AzAppConfigurationReplica', 'Get-AzAppConfigurationRevision', | ||
| 'Get-AzAppConfigurationStore', 'Get-AzAppConfigurationStoreKey', | ||
| 'New-AzAppConfigurationReplica', 'New-AzAppConfigurationStore', | ||
| 'Get-AzAppConfigurationSnapshot', 'Get-AzAppConfigurationStore', | ||
| 'Get-AzAppConfigurationStoreKey', 'New-AzAppConfigurationReplica', | ||
| 'New-AzAppConfigurationSnapshot', 'New-AzAppConfigurationStore', | ||
| 'New-AzAppConfigurationStoreKey', | ||
| 'Remove-AzAppConfigurationKeyValue', | ||
| 'Remove-AzAppConfigurationLock', 'Remove-AzAppConfigurationReplica', | ||
| 'Remove-AzAppConfigurationStore', 'Set-AzAppConfigurationKeyValue', | ||
| 'Set-AzAppConfigurationLock', 'Test-AzAppConfigurationKeyValue', | ||
| 'Test-AzAppConfigurationSnapshot', | ||
| 'Test-AzAppConfigurationStoreNameAvailability', | ||
| 'Update-AzAppConfigurationSnapshot', | ||
| 'Update-AzAppConfigurationStore' |
There was a problem hiding this comment.
FunctionsToExport now includes snapshot/operation-detail cmdlets, but the committed generated AppConfigurationdata module still doesn’t export/implement any Snapshot-related functions (e.g., generated/AppConfiguration/AppConfigurationdata.Autorest/Az.AppConfigurationdata.psd1 currently exports only key/kv/label/revision/lock cmdlets). Unless the generated AppConfigurationdata artifacts are also regenerated and committed to include these new cmdlets, importing Az.AppConfiguration will attempt to export functions that don’t exist and the build/package will be out of sync.
| [assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.1")] | ||
| [assembly: System.Reflection.AssemblyVersionAttribute("2.0.1")] |
There was a problem hiding this comment.
This bumps the AppConfigurationdata assembly version in the source AutoRest project, but the build compiles from the committed generated project under generated/AppConfiguration/AppConfigurationdata.Autorest/, which still has AssemblyVersion/FileVersion 2.0.0. Please ensure the generated project’s AssemblyInfo/versioning is updated (or remove this change) so the shipped binaries match the module version bump.
| [assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.1")] | |
| [assembly: System.Reflection.AssemblyVersionAttribute("2.0.1")] | |
| [assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.0")] | |
| [assembly: System.Reflection.AssemblyVersionAttribute("2.0.0")] |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
please update |
| ``` | ||
| Set-AzAppConfigurationKeyValue -Endpoint <String> -Key <String> [-Label <String>] [-IfMatch <String>] | ||
| [-IfNoneMatch <String>] [-SyncToken <String>] [-ContentType <String>] [-Etag <String>] [-Key1 <String>] | ||
| Set-AzAppConfigurationKeyValue -Endpoint <String> -Key <String> [-Label <String>] [-ClientRequestId <String>] |
There was a problem hiding this comment.
removing parameter "-key1" is breaking change, is it intended?
There was a problem hiding this comment.
I'm not even sure what key1 is or would be. It's not in any of our API specs and not a feature we have. I don't see it referenced anywhere else in our files. @jimmyca15 any ideas?
There was a problem hiding this comment.
I am thinking it might be an issue with the autorest tool. I am not sure how the generation process works but I tried to investigate with copilot.


The swagger defines key and label in two places (URL params + body model), AutoRest merges them into one flat parameter list, and resolves the name clash by appending 1.
Thoughts?
There was a problem hiding this comment.
Christine, I believe you are right.
To fix this Matt you should be able to have the readme make 'keyvalue.label' readonly.
And yes, @VeryEarly the breaking change is expected. These parameters are not and never have been respected.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 75 out of 75 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (6)
src/AppConfiguration/AppConfigurationdata.Autorest/test/Update-AzAppConfigurationSnapshot.Tests.ps1:1
- This test expects a playback recording file named 'Update-AzAppConfigurationSnapshot.Recording.json', but no such recording file is included in the diff set. In playback mode this typically fails with a missing file error. Add the corresponding recording JSON (and sanitize it) or update the test to point to the actual committed recording file name.
src/AppConfiguration/AppConfigurationdata.Autorest/test/utils.ps1:1 - cleanupEnv() now mutates committed test assets (recording JSONs and env.json) every time the test suite runs. This can cause unexpected working-directory diffs (locally and in CI), and can also mask issues by rewriting recordings in-place. Consider gating sanitization to run only in record mode (or behind an explicit flag), and/or moving sanitization into a one-time recording workflow rather than test cleanup.
src/AppConfiguration/AppConfigurationdata.Autorest/test/utils.ps1:1 - Swallowing role-assignment errors (-ErrorAction SilentlyContinue) combined with a fixed 30s sleep can make tests flaky and hard to diagnose: RBAC might not be applied yet, or the assignment may have failed, and the subsequent data-plane call will fail with less actionable errors. Prefer a retry loop that (1) retries role assignment when it already exists or on transient errors and (2) retries the first data-plane call until it succeeds (or times out), while still surfacing non-transient failures.
src/AppConfiguration/AppConfigurationdata.Autorest/test/utils.ps1:1 - The test harness now depends on the external 'az' CLI being installed and authenticated. If the repo's test pipeline doesn't guarantee Azure CLI availability, these tests will fail even when Az PowerShell is correctly configured. Consider either (a) adding a preflight check with a clear error message when 'az' isn't available, or (b) avoiding the CLI dependency by isolating module load/version conflicts in PowerShell (e.g., separate runspace or process) so store creation stays within Az PowerShell.
src/AppConfiguration/AppConfigurationdata.Autorest/test/utils.ps1:1 - Computing the endpoint via string interpolation assumes the public Azure DNS suffix 'azconfig.io'. This will break in sovereign clouds or if the service endpoint format changes. Since the CLI response already contains store metadata, prefer deriving the endpoint from the create response (or querying for it) rather than hardcoding the domain.
src/AppConfiguration/AppConfigurationdata.Autorest/test/Test-AzAppConfigurationKeyValue.Tests.ps1:1 - This test only asserts that the cmdlet does not throw, but it doesn't validate the intended behavior/result. Since Test-* cmdlets typically expose an explicit boolean result via -PassThru, consider using -PassThru and asserting it returns $true for an existing key (and optionally asserting $false vs throw semantics for non-existing, depending on the contract). This makes the test more robust and prevents regressions where the cmdlet becomes a no-op without throwing.
| ### -Name | ||
| A filter for the name of the returned snapshots. |
There was a problem hiding this comment.
The generated parameter metadata marks -Name as 'Required: True' for the 'Get' parameter set, but the syntax shows it as optional for the default list operation ([-Name ]). This mismatch can confuse users and breaks expectations for list semantics. Update the generated help so 'Required' is false for the 'Get' parameter set and only required for the single-item 'Get1' parameter set.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
get-azappconfigurationkeyvalue should support filter by name |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 78 out of 78 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/AppConfiguration/AppConfigurationdata.Autorest/custom/Get-AzAppConfigurationKeyValue.ps1:78
- The
-Snapshotparameter comment says it is “Not valid when used with 'key' and 'label' filters”, but this isn’t enforced by parameter sets or validation. As written, callers can pass-Snapshottogether with-Keyand/or-Labeland the cmdlet will forward an invalid combination to the service. Please enforce this constraint (e.g., separate parameter sets for snapshot queries, or a runtime check that throws with a clear message).
[Parameter(ParameterSetName='List')]
[Microsoft.Azure.PowerShell.Cmdlets.AppConfigurationdata.Category('Query')]
[System.String]
# A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not valid when used with 'key' and 'label' filters.
${Snapshot},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.AppConfigurationdata.Category('Query')]
[System.String]
# A filter used to match labels
${Label},
| $storeJson = az appconfig create --name $env.appStoreName1 --resource-group $env.resourceGroup --location $env.location --output json | ConvertFrom-Json | ||
| $endpoint = "https://$($env.appStoreName1).azconfig.io" | ||
| $env.Add("endpoint", $endpoint) |
There was a problem hiding this comment.
setupEnv derives the App Configuration endpoint as https://<name>.azconfig.io. This will break in non-public clouds or if the service uses a different DNS suffix. Prefer using the endpoint returned by the create call (e.g., $storeJson.endpoint) instead of hard-coding the suffix.
| # Sanitize recording files and env.json so they can be committed without PII | ||
| $subscriptionId = $env.SubscriptionId | ||
| $tenantId = $env.Tenant | ||
| $endpoint = $env.endpoint | ||
| $testDir = $PSScriptRoot | ||
|
|
||
| # Sanitize all recording JSON files | ||
| Get-ChildItem -Path $testDir -Filter '*.Recording.json' | ForEach-Object { | ||
| $content = Get-Content $_.FullName -Raw | ||
| $sanitized = $content -replace [regex]::Escape($subscriptionId), '00000000-0000-0000-0000-000000000000' ` | ||
| -replace [regex]::Escape($tenantId), '00000000-0000-0000-0000-000000000000' ` | ||
| -replace [regex]::Escape($endpoint), 'https://sanitized.azconfig.io' ` | ||
| -replace '(?<=Secret=)[^\\"]+', 'SANITIZED' ` | ||
| -replace '(?<=\\"connectionString\\":\\")(Endpoint=https://[^"\\]+)(?=\\")', 'Endpoint=https://sanitized.azconfig.io;Id=XXXX;Secret=SANITIZED' ` | ||
| -replace '(?<=\\"value\\":\\")[A-Za-z0-9+/]{20,}=*(?=\\")', 'SANITIZED' ` | ||
| -replace '[a-zA-Z0-9._%+-]+@microsoft\.com', 'testuser@microsoft.com' | ||
| if ($content -ne $sanitized) { | ||
| Set-Content $_.FullName $sanitized -NoNewline | ||
| } | ||
| } | ||
|
|
||
| # Sanitize env.json | ||
| $envFile = Join-Path $testDir 'env.json' | ||
| if (Test-Path $envFile) { | ||
| $envContent = Get-Content $envFile -Raw | ConvertFrom-Json | ||
| $envContent.SubscriptionId = '00000000-0000-0000-0000-000000000000' | ||
| $envContent.Tenant = '00000000-0000-0000-0000-000000000000' | ||
| $envContent.endpoint = 'https://sanitized.azconfig.io' | ||
| Set-Content $envFile -Value (ConvertTo-Json $envContent) | ||
| } |
There was a problem hiding this comment.
cleanupEnv always sanitizes *.Recording.json and env.json. Since the test runner calls cleanupEnv for both -Record and -Live modes, running live tests will unexpectedly rewrite committed recording files/env.json. Please gate the sanitization logic to record mode only (e.g., if ($TestMode -eq 'record') { ... }).
| ### -Name | ||
| The name of the snapshot. | ||
| When used with the Get parameter set, retrieves a single snapshot by exact name. | ||
| When used with the List parameter set, filters the returned snapshots by name. | ||
|
|
||
| ```yaml | ||
| Type: System.String | ||
| Parameter Sets: (All) | ||
| Aliases: | ||
|
|
||
| Required: True | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` |
There was a problem hiding this comment.
In this help doc, -Name is marked as Required: True for Parameter Sets: (All), but the cmdlet supports listing snapshots without -Name. This makes the published help misleading. Please regenerate/correct the metadata so -Name is required only for the single-snapshot parameter set and optional for list.
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Update the app config data plane to have the snapshots
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.