Skip to content

Commit 8e8b809

Browse files
Merge branch 'vnext' into environmentname
2 parents 9aa5d08 + 6379795 commit 8e8b809

8 files changed

Lines changed: 2264 additions & 94 deletions

File tree

CanaryValidator/Canary.Tests.ps1

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ param (
7272
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
7373
[ValidateNotNullOrEmpty()]
7474
[string]$ResourceLocation = "local",
75-
[parameter(HelpMessage="Flag to cleanup resources after exception")]
75+
[parameter(HelpMessage="Flag to indicate whether to continue Canary after an exception")]
7676
[Parameter(ParameterSetName="default", Mandatory=$false)]
7777
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
7878
[bool] $ContinueOnFailure = $false,
@@ -95,7 +95,7 @@ param (
9595
[Parameter(ParameterSetName="default", Mandatory=$false)]
9696
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
9797
[ValidateNotNullOrEmpty()]
98-
[string]$CanaryLogFileName
98+
[string]$CanaryLogFileName = "Canary-Basic-$((Get-Date).Ticks).log"
9999
)
100100

101101
#Requires -Modules AzureRM
@@ -118,6 +118,7 @@ $linuxImageOffer = "UbuntuServer"
118118
$linuxImageVersion = "1.0.0"
119119

120120
$runCount = 1
121+
$tmpLogname = $CanaryLogFileName
121122
while ($runCount -le $NumberOfIterations)
122123
{
123124
if (Test-Path -Path $canaryUtilPath)
@@ -128,12 +129,9 @@ while ($runCount -le $NumberOfIterations)
128129

129130
#
130131
# Start Canary
131-
#
132-
if (-not $CanaryLogFileName)
133-
{
134-
$CanaryLogFileName = "Canary-Basic-$runCount-$((Get-Date).Ticks).log"
135-
}
136-
$CanaryLogFile = $CanaryLogPath + "\$CanaryLogFileName"
132+
#
133+
$CanaryLogFileName = [IO.Path]::GetFileNameWithoutExtension($tmpLogname) + "-$runCount" + [IO.Path]::GetExtension($tmpLogname)
134+
$CanaryLogFile = Join-Path -Path $CanaryLogPath -ChildPath $CanaryLogFileName
137135

138136
Start-Scenario -Name 'Canary' -Type 'Basic' -LogFilename $CanaryLogFile -ContinueOnFailure $ContinueOnFailure
139137

@@ -207,7 +205,7 @@ while ($runCount -le $NumberOfIterations)
207205
catch
208206
{
209207
Remove-Item -Path $CanaryCustomImageFolder -Force -Recurse
210-
throw [System.Exception]"Failed to upload the linux image to PIR. `n$_.Exception.Message"
208+
throw [System.Exception]"Failed to upload the linux image to PIR. `n$($_.Exception.Message)"
211209
}
212210
}
213211

@@ -217,7 +215,7 @@ while ($runCount -le $NumberOfIterations)
217215
$tenantPlanName = "ascantenantplan" + [Random]::new().Next(1,999)
218216
$tenantOfferName = "ascantenantoffer" + [Random]::new().Next(1,999)
219217
$tenantSubscriptionName = "ascanarytenantsubscription" + [Random]::new().Next(1,999)
220-
$canaryDefaultTenantSubscription = "canarytenantdefaultsubscription"
218+
$canaryDefaultTenantSubscription = "canarytenantdefaultsubscription" + [Random]::new().Next(1,999)
221219

222220
if (-not $TenantArmEndpoint)
223221
{

ComputeAdmin/AzureStack.ComputeAdmin.psm1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,42 @@
33

44
#requires -Modules AzureStack.Connect
55

6+
function Add-AzureStackVMSSGalleryItem {
7+
8+
$rgName = "vmss.gallery"
9+
10+
New-AzureRmResourceGroup -Name $rgName -Location local -Force
11+
12+
$saName = "vmssgallery"
13+
14+
$sa = New-AzureRmStorageAccount -ResourceGroupName $rgName -Location local -Name $saName -Type Standard_LRS
15+
16+
$cName = "gallery"
17+
18+
Set-AzureRmCurrentStorageAccount -StorageAccountName $saName -ResourceGroupName $rgName
19+
20+
$container = Get-AzureStorageContainer -Name $cName -ErrorAction SilentlyContinue
21+
if (-not ($container)) {
22+
New-AzureStorageContainer -Name $cName -Permission Blob
23+
}
24+
25+
$fileName = "microsoft.vmss.1.3.6.azpkg"
26+
27+
$blob = $container| Set-AzureStorageBlobContent –File ([System.IO.Path]::GetDirectoryName($PSCommandPath) + "\" + $fileName) –Blob $fileName -Force
28+
29+
$uri = $blob.Context.BlobEndPoint + $container.Name + "/" + $blob.Name
30+
31+
Add-AzureRMGalleryItem -GalleryItemUri $uri
32+
}
33+
34+
function Remove-AzureStackVMSSGalleryItem {
35+
$item = Get-AzureRMGalleryItem -Name "microsoft.vmss.1.3.6"
36+
if($item) {
37+
$request = $item | Remove-AzureRMGalleryItem
38+
$item
39+
}
40+
}
41+
642
<#
743
.SYNOPSIS
844
Contains 6 functions.

ComputeAdmin/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ $path = "<Path to vm extension zip>"
119119
Add-VMExtension -publisher "Publisher" -type "Type" -version $version -extensionLocalPath $path -osType Windows -tenantID $aadTenant -azureStackCredentials $azureStackCredentials -EnvironmentName "AzureStackAdmin"
120120
```
121121

122+
122123
# Remove a VM extension with PowerShell
123124

124125
You will need to reference your Azure Stack Administrator environment. To create an administrator environment use the below. The ARM endpoint below is the administrator default for a one-node environment.
@@ -130,4 +131,39 @@ Run the below command to remove an uploaded VM extension.
130131

131132
```powershell
132133
Remove-VMExtension -publisher "Publisher" -type "Type" -version "1.0.0.0" -osType Windows -tenantID $tenantId -azureStackCredentials $azureStackCredentials -EnvironmentName "AzureStackAdmin"
133-
```
134+
```
135+
136+
## VM Scale Set gallery item
137+
138+
VM Scale Set allows deployment of multi-VM collections. To add a gallery item with VM Scale Set:
139+
140+
1. Add evaluation Windows Server 2016 image using New-Server2016VMImage as described above.
141+
142+
2. For linux support, download Ubuntu Server 16.04 and add it using Add-VmImage with the following parameters -publisher "Canonical" -offer "UbuntuServer" -sku "16.04-LTS"
143+
144+
3. Add VM Scale Set gallery item as follows
145+
146+
```powershell
147+
$Tenant = "<AAD Tenant Id used to connect to AzureStack>"
148+
$Arm = "<AzureStack administrative Azure Resource Manager endpoint URL>"
149+
150+
Add-AzureStackAzureRmEnvironment -Name AzureStackAdmin -ArmEndpoint $Arm -AadTenant $Tenant
151+
152+
$Password = ConvertTo-SecureString -AsPlainText -Force "<your AzureStack admin user password>"
153+
$User = "<your AzureStack admin user name>"
154+
$Creds = New-Object System.Management.Automation.PSCredential $User, $Password
155+
156+
Login-AzureRmAccount -EnvironmentName AzureStackAdmin -Credential $Creds -TenantId $Tenant
157+
158+
Select-AzureRmSubscription -SubscriptionName "Default Provider Subscription"
159+
160+
Add-AzureStackVMSSGalleryItem
161+
```
162+
To remove VM Scale Set gallery item run the following command:
163+
164+
```powershell
165+
Remove-AzureStackVMSSGalleryItem
166+
```
167+
168+
Note that gallery item is not removed immediately. You could run the above command several times to determine when the item is actually gone.
169+
127 KB
Binary file not shown.

Connect/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Import-Module .\AzureStack.Connect.psm1
1919
The [Connect to Azure Stack](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-connect-azure-stack) document describes ways to connect to your Azure Stack Proof of Concept environment.
2020

2121
One method is to establish a split tunnel VPN connection to an Azure Stack PoC.
22-
This allows your client computer to become part of the Azure Stack PoC network system and therefore resolve [https://portal.azurestack.local](https://portal.azurestack.local), api.azurestack.local, *.blob.azurestack.local and so on.
22+
This allows your client computer to become part of the Azure Stack PoC network system and therefore resolve Azure Stack endpoints.
2323

2424
The tool will also download root certificate of the targeted Azure Stack PoC instance locally to your client computer.
2525
This will ensure that SSL sites of the target Azure Stack installation are trusted by your client when accessed from the browser or from the command-line tools.

0 commit comments

Comments
 (0)