* Remove passing -Mode Complete to deployment
When passing Complete it will remove any resources
already in the resource group that weren't part
of the current deployment. That removal breaks a
lot of assumptions, like multiple deployments when
testing things like smoke-tests or if you are reusing
an existing resource group. We don't want that to happen.
* Remove ServiceDirectory as required parameter for remove/update
When this was made mandatory it broke some usages which didn't
pass the value. Those usages don't need to pass it because
the pass required information in other ways so removing the
requirement for the parameter to be passed.
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Initializing the BaseName with a ServiceDirectory that contains
a "/", because it is a multiple level path, causes the BaseName
initialization code to fail because it doesn't support the
validation pattern.
In all the known cases we already pass the ResourceGroupName
explicitly so don't need to set the BaseName so we can
skip the initialization in those cases.
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
* Use SubscriptionId throughout TestResources
Fixes#1454
* Resolve PR feedback
* Default DeleteAfterHours to 48 for SDK team
Also makes a few other adjustments for subscriptions, like restoring the previous one if available and another was specified.
* Resolve PR feedback
* Change deployment mode to Complete
Also fixes an issue where if the user opted not to deploy to the same resource group, the script would continue execution anyway.
* Use consistent aka links to satisfy link checker
Only need it for the new Update-TestResources.ps1 script, but I wanted them to look consistent.
Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Improve TestResources docs and logging
Resolves#1388Resolves#1407
Also ignores cached service principal if it no longer exists. I ran into this while testing since I cleaned up old SPs.
* Add ADP test sub to look-up
Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Cache created service principal for iteration
Useful when testing changes over and over again without passing your own -TestApplicationId and -TestApplicationSecret.
* Restore initial AzContext for New-TestResources
* Make sure PSBoundParameters is correct
Fixes#1177
Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Add debugging link on resource deployment failures to log output
* Update aka link for live test help docs. Use here string and empty throw.
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Add debug flag to arm deployment command
* Only set debug preference when $CI is true
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Update subscription configuration schema to include new parameters
* Support platform specific arm template parameters and legacy hashtable format
* Update arm template parameter comment to include top level key
* Restore AdditionalParameters. Merge ArmTemplateParameters from stringified hash literal
* Handle duplicate keys more explicitly for arm and env vars
* Regenerate New-TestResources.ps1 markdown
* revert variable name to environmentVariables to fix post-scripts
* Handle empty arm template parameters better
* Remove arm template parameter merge logic from deploy template
* Add merge hashes function to New-TestResources.ps1
* Add merge hashes function to New-TestResources.ps1
* Add env variable overwrite warning. Use ContainsKey checks
* Temporarily manually fix invalid generated markdown links
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This also adds previously-required parameters back into
@PSBoundParameters to pass down to pre- and post-scripts.
Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Remove resource group asynchronously and do not wait for completion
* Verify resource group has reached Deleting state before exiting script
* Use $_ instead of $Error[0] for resource group removal handling
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Simplify Net-TestResources usage
* docs and windows check
* Update eng/common/TestResources/New-TestResources.ps1
Co-authored-by: Heath Stewart <heaths@outlook.com>
* update markdown
* make service directory the default parameter
* Fix links
* Doc change
Co-authored-by: Pavel Krymets <pavel@krymets.com>
Co-authored-by: Heath Stewart <heaths@outlook.com>