Fix variable reference for agent IP in key vault access#14383
Fix variable reference for agent IP in key vault access#14383BalintBanyasz wants to merge 1 commit into
Conversation
|
@BalintBanyasz : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
@BalintBanyasz : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
Pull request overview
Fixes an Azure Pipelines YAML sample in the Key Vault access documentation where the agent IP address was being stored and later referenced incorrectly, preventing the cleanup step from removing the temporary Key Vault network rule.
Changes:
- Update the
task.setvariablelogging command to store the actual$ipvalue instead of the literal stringip. - Update the cleanup script to reference the pipeline variable (
$(agentIP)) when constructing the/32CIDR range.
The sample currently sets the agentIP variable incorrectly:
echo "##vso[task.setvariable variable=agentIP]ip"This stores the literal string ip instead of the value of $ip. As a result, the later Remove-AzKeyVaultNetworkRule step cannot remove the rule that was added, leaving the agent IP in the Key Vault network rules.
The sample should only use:
echo "##vso[task.setvariable variable=agentIP]$ip"Likewise, the removal step should reference the pipeline variable:
$ipRange = "$(agentIP)/32"This ensures the example works end-to-end.