Created
October 26, 2020 02:57
-
-
Save PlagueHO/0651ff41e8e6a800a438bbfbe9225717 to your computer and use it in GitHub Desktop.
Execute a command on an Azure Container Instance and return a terminal
This file contains 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
$SubscriptionId = '<subscription id>' | |
$ResourceGroupName = 'my-container-rg' | |
$AciName = 'my-container-aci' | |
$resourceId = "/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroupName)/providers/Microsoft.ContainerInstance/containerGroups/$($AciName)/containers/$($AciName)" | |
$command = "/zap/zap-baseline.py -t 'https://myapplication.net' -x OWASP-ZAP-Report.xml" | |
Invoke-AzResourceAction ` | |
-ResourceId $resourceId ` | |
-Action 'exec' ` | |
-ApiVersion '2019-12-01' ` | |
-Parameters @{ | |
command = $command | |
terminalSize = @{ | |
rows = 80 | |
cols = 80 | |
} | |
} ` | |
-Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment