forked from Azure/azure-quickstart-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from VaijanathB/master
Getting the branch uptodate.
- Loading branch information
Showing
22 changed files
with
270 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#Requires -Version 3.0 | ||
#Requires -Module Azure.Storage | ||
#Requires -Module @{ModuleName="AzureRm.Profile";ModuleVersion="3.0"} | ||
|
||
#use this script to side-load a createUIDefinition.json file in the Azure portal | ||
|
||
[cmdletbinding()] | ||
param( | ||
$createUIDefFile='createUIDefinition.json', | ||
$storageContainerName='createuidef', | ||
[switch] $Gov | ||
) | ||
|
||
try { | ||
|
||
$StorageAccountName = 'stage' + ((Get-AzureRmContext).Subscription.Id).Replace('-', '').substring(0, 19) | ||
$StorageAccount = (Get-AzureRmStorageAccount | Where-Object{$_.StorageAccountName -eq $StorageAccountName}) | ||
|
||
# Create the storage account if it doesn't already exist | ||
if ($StorageAccount -eq $null) { | ||
$StorageResourceGroupName = 'ARM_Deploy_Staging' | ||
New-AzureRmResourceGroup -Location "$ResourceGroupLocation" -Name $StorageResourceGroupName -Force | ||
$StorageAccount = New-AzureRmStorageAccount -StorageAccountName $StorageAccountName -Type 'Standard_LRS' -ResourceGroupName $StorageResourceGroupName -Location "$ResourceGroupLocation" | ||
} | ||
|
||
New-AzureStorageContainer -Name $StorageContainerName -Context $StorageAccount.Context -ErrorAction SilentlyContinue *>&1 | ||
|
||
|
||
Set-AzureStorageBlobContent -Container $StorageContainerName -File $createUIDefFile -Context $storageAccount.Context -Force | ||
|
||
$uidefurl = New-AzureStorageBlobSASToken -Container $StorageContainerName -Blob (Split-Path $createUIDefFile -leaf) -Context $storageAccount.Context -FullUri -Permission r | ||
$encodedurl = [uri]::EscapeDataString($uidefurl) | ||
|
||
if ($Gov) { | ||
|
||
$target=@" | ||
https://portal.azure.us/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{"initialData":{},"providerConfig":{"createUiDefinition":"$encodedurl"}} | ||
"@ | ||
|
||
} | ||
else { | ||
|
||
$target=@" | ||
https://portal.azure.com/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{"initialData":{},"providerConfig":{"createUiDefinition":"$encodedurl"}} | ||
"@ | ||
|
||
} | ||
|
||
Write-Host `n"File: "$uidefurl `n | ||
Write-Host "Target URL: "$target | ||
|
||
start $target | ||
|
||
} | ||
catch { | ||
throw $_ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.