diff --git a/.pipelines/templates/MockOB.yml b/.pipelines/templates/MockOB.yml index a656b3d7a..ecbbc9224 100644 --- a/.pipelines/templates/MockOB.yml +++ b/.pipelines/templates/MockOB.yml @@ -111,4 +111,7 @@ stages: - publish: ${{ variables.ob_outputDirectory }} artifact: ${{ variables.ob_customArtifactName }} - condition: always() + condition: succeeded() + - publish: ${{ variables.ob_outputDirectory }} + artifact: ${{ variables.ob_customArtifactName }}_failed_$(System.JobAttempt) + condition: not(succeeded()) diff --git a/tools/storm/servicing/utils/azure/azure.go b/tools/storm/servicing/utils/azure/azure.go index ed2339860..521097e89 100644 --- a/tools/storm/servicing/utils/azure/azure.go +++ b/tools/storm/servicing/utils/azure/azure.go @@ -91,6 +91,25 @@ func (cfg AzureConfig) DeployAzureVM(vmName string, user string, buildId string) return fmt.Errorf("failed to create Azure resource group: %w", err) } + if cfg.SubnetId != "" { + // Loop until subnet resource is available + for { + vnetResourceArgs := []string{ + "resource", "show", + "--ids", cfg.SubnetId, + } + out, err := cfg.CallAzCli(vnetResourceArgs, true) + if err == nil { + // Subnet found, continue with test + logrus.Tracef("Subnet (%v) found to be available: %v", cfg.SubnetId, out) + break + } + // Log and retry + logrus.Tracef("Waiting for subnet (%v) to be available: %v", cfg.SubnetId, out) + time.Sleep(time.Second) + } + } + imageVersion := cfg.GetImageVersion(buildId, false) // Create the VM