Sync eng/common directory with azure-sdk-tools for PR 1548 (#2098)

* 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>
This commit is contained in:
Azure SDK Bot 2021-04-09 18:10:44 -07:00 committed by GitHub
parent 1ab49d17d0
commit 14cc77a963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -212,12 +212,12 @@ try {
if ($currentSubcriptionId -ne $SubscriptionId) {
Log "Selecting subscription '$SubscriptionId'"
$null = Select-AzSubscription -Subscription $SubscriptionId
$exitActions += {
Log "Selecting previous subscription '$currentSubcriptionId'"
$null = Select-AzSubscription -Subscription $currentSubcriptionId
}
# Update the context.
$context = Get-AzContext
}
@ -459,7 +459,7 @@ try {
if ($CI) {
$DebugPreference = 'Continue'
}
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters -Mode Complete -Force:$Force
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters -Force:$Force
} catch {
Write-Output @'
#####################################################

View File

@ -38,7 +38,7 @@ param (
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner', Mandatory = $true)]
[string] $ProvisionerApplicationSecret,
[Parameter(ParameterSetName = 'Default', Mandatory = $true, Position = 0)]
[Parameter(ParameterSetName = 'Default', Position = 0)]
[Parameter(ParameterSetName = 'Default+Provisioner')]
[Parameter(ParameterSetName = 'ResourceGroup')]
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner')]

View File

@ -10,7 +10,7 @@
[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter(ParameterSetName = 'Default', Mandatory = $true, Position = 0)]
[Parameter(ParameterSetName = 'Default', Position = 0)]
[string] $ServiceDirectory,
[Parameter(ParameterSetName = 'Default')]