Skip to content

Commit d365b3f

Browse files
Validate the deployment result and azure container registry tag
1 parent 87ffe06 commit d365b3f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Deployment/resourcedeployment.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ function DeployAzureResources([string]$location, [string]$modelLocation) {
182182
# Proceed with the actual deployment
183183
Write-Host "Proceeding with Deployment..." -ForegroundColor Yellow
184184
$deploymentResult = az deployment sub create --template-file .\main.bicep --location $location --name $deploymentName --parameters modeldatacenter=$modelLocation
185-
185+
# Check if deploymentResult is valid
186+
ValidateVariableIsNullOrEmpty -variableValue $deploymentResult -variableName "Deployment Result"
186187
if ($LASTEXITCODE -ne 0) {
187188
Write-Host "Deployment failed. Stopping execution." -ForegroundColor Red
188189
Write-Host $deploymentResult -ForegroundColor Red
@@ -795,7 +796,13 @@ try {
795796
$acrAIServiceTag = "$($deploymentResult.AzContainerRegistryName).azurecr.io/$acrNamespace/aiservice"
796797
$acrKernelMemoryTag = "$($deploymentResult.AzContainerRegistryName).azurecr.io/$acrNamespace/kernelmemory"
797798
$acrFrontAppTag = "$($deploymentResult.AzContainerRegistryName).azurecr.io/$acrNamespace/frontapp"
798-
799+
800+
# Validate AI Service Tag IsNull Or Empty.
801+
ValidateVariableIsNullOrEmpty -variableValue $acrAIServiceTag -variableName "AI Service Tag"
802+
# Validate Kernel Memory Tag IsNull Or Empty.
803+
ValidateVariableIsNullOrEmpty -variableValue $acrKernelMemoryTag -variableName "Kernel Memory Tag"
804+
# Validate Front App Tag IsNull Or Empty.
805+
ValidateVariableIsNullOrEmpty -variableValue $acrFrontAppTag -variableName "Front App Tag"
799806

800807
$deploymentTemplatePlaceholders = @{
801808
'{{ aiservice-imagepath }}' = $acrAIServiceTag

0 commit comments

Comments
 (0)