Bug fix: Fixed issue with deploy scripts not honoring existing SKU se… (#372)
* Bug fix: Fixed issue with deploy scripts not honoring existing SKU settings * Removing test defaults from deploy script * Adding backcompat check for ResourceGroupName
This commit is contained in:
Родитель
626d1855e1
Коммит
b0f1735494
|
@ -953,6 +953,26 @@ function FixWebJobZip()
|
|||
$zip.Dispose()
|
||||
}
|
||||
|
||||
function ResourceObjectExists
|
||||
{
|
||||
Param(
|
||||
[Parameter(Mandatory=$true,Position=0)] [string] $resourceGroupName,
|
||||
[Parameter(Mandatory=$true,Position=1)] [string] $resourceName,
|
||||
[Parameter(Mandatory=$true,Position=2)] [string] $type
|
||||
)
|
||||
return (GetResourceObject -resourceGroupName $resourceGroupName -resourceName $resourceName -type $type | ?{$_.Name -eq $resourceName}) -ne $null
|
||||
}
|
||||
|
||||
function GetResourceObject
|
||||
{
|
||||
Param(
|
||||
[Parameter(Mandatory=$true,Position=0)] [string] $resourceGroupName,
|
||||
[Parameter(Mandatory=$true,Position=1)] [string] $resourceName,
|
||||
[Parameter(Mandatory=$true,Position=2)] [string] $type
|
||||
)
|
||||
return Get-AzureRmResource -ResourceName $resourceName -ResourceGroupName $resourceGroupName -ResourceType $type
|
||||
}
|
||||
|
||||
# Variable initialization
|
||||
[int]$global:envSettingsChanges = 0;
|
||||
$global:timeStampFormat = "o"
|
||||
|
|
|
@ -98,7 +98,7 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
$suiteExists = (Find-AzureRmResourceGroup -Tag @{Name="IotSuiteType";Value=$suiteType} | ?{$_.ResourceGroupName -eq $suiteName}) -ne $null
|
||||
$suiteExists = (Find-AzureRmResourceGroup -Tag @{Name="IotSuiteType";Value=$suiteType} | ?{$_.name -eq $suiteName -or $_.ResourceGroupName -eq $suiteName}) -ne $null
|
||||
$resourceGroupName = (GetResourceGroup -Name $suiteName -Type $suiteType).ResourceGroupName
|
||||
$storageAccount = GetAzureStorageAccount $suiteName $resourceGroupName $cloudDeploy
|
||||
$iotHubName = GetAzureIotHubName $suitename $resourceGroupName $cloudDeploy
|
||||
|
@ -132,7 +132,7 @@ if ($suiteExists)
|
|||
if (ResourceObjectExists $suitename $storageAccount.StorageAccountName Microsoft.Storage/storageAccounts)
|
||||
{
|
||||
$storageSku = GetResourceObject $suitename $storageAccount.StorageAccountName Microsoft.Storage/storageAccounts
|
||||
$params += @{storageAccountSku=$($storageSku.Properties.AccountType)}
|
||||
$params += @{storageAccountSku=$($storageSku.Sku.Name)}
|
||||
}
|
||||
if (ResourceObjectExists $suitename $iotHubName Microsoft.Devices/IotHubs)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче