Draft
Switch ExecuteAzCommandRobustly calls to Invoke-Az with native array format#144
Conversation
…ct az calls - Convert all ExecuteAzCommandRobustly string-format calls to Invoke-Az with array format - Convert ExecuteAzCommandRobustly -callAzNatively calls to Invoke-Az shorthand - Keep ExecuteAzCommandRobustly only where extra params needed (-noSecretLeakageWarning, -principalId, etc.) - Replace direct az calls in permissions.ps1, app-service.ps1, subscriptions.ps1 with Invoke-Az - Update tests to match new calling patterns Agent-Logs-Url: https://github.com/scepman/scepman-psmodule/sessions/bd1db69c-3b21-4e12-8814-ea3f8f255347 Co-authored-by: bb-froggy <587120+bb-froggy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace ExecuteAzCommandRobustly with -callAzNatively
Switch ExecuteAzCommandRobustly calls to Invoke-Az with native array format
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace all
ExecuteAzCommandRobustlystring-format calls withInvoke-Az(array format, native az execution). Eliminate directazcalls outside of initialization/login contexts.Changes
ExecuteAzCommandRobustly, directazcalls, and-callAzNativelycalls →Invoke-Azwith array params. RetainExecuteAzCommandRobustly -callAzNativelyonly where-principalId/-appRoleId/-GraphBaseUriparams are needed.azcalls inCreateSCEPmanDeploymentSlot. RetainExecuteAzCommandRobustlyonly for two calls needing-noSecretLeakageWarning.az ad app listcall inRegisterAzureADApp.keyvault set-policy+ 1 REST call).role assignment createcall.az account setwithInvoke-Az.ad app updatecall.Before:
After:
Test updates
GetDeploymentSlotscall to use correct parameter names (-appServiceName/-resourceGroup) — previously masked by string interpolation of nulls.account sethandler toInvoke-Azmock since this call now routes throughInvoke-Azinstead of bareaz.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli extension add --name resource-graph --only-show-errors ader(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli extension add --name resource-graph --only-show-errors(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli extension add --name resource-graph --only-show-errors user.email(dns block)azcliprod.blob.core.windows.net/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli ad app list --filter displayname eq 'new-app' --query [0] --only-show-errors(dns block)If you need me to access, download, or install something from one of these locations, you can either: