Last active
February 18, 2016 12:42
-
-
Save stuartleeks/ecaf8f7d9344953df20f to your computer and use it in GitHub Desktop.
Marketplace helper scripts
This file contains hidden or 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 is in place of any real documentation ;-) | |
# upload the template files etc | |
# (run in the folder with the template(s) and ui definition) | |
.\UploadToAzureStorage.ps1 -ResourceGroupName myresourcegroup -StorageAccountName mystorage -ContainerName mycontainer | |
# upload template files etc and open the ui definition in side-load testing | |
.\UploadToAzureStorage.ps1 -ResourceGroupName myresourcegroup -StorageAccountName mystorage -ContainerName mycontainer | .\Open-UiSideLoad.ps1 | |
# upload template files etc and open the ui definition in side-load testing - overriding the default ui definition filename | |
.\UploadToAzureStorage.ps1 -ResourceGroupName myresourcegroup -StorageAccountName mystorage -ContainerName mycontainer | .\Open-UiSideLoad.ps1 -uiDefinitionFilename myuidef.json | |
This file contains hidden or 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
param( | |
[parameter(Mandatory=$true, ValueFromPipeline)] | |
[object[]] $blobs, | |
[parameter()] | |
$uiDefinitionFilename = "createUiDefinition.json" | |
) | |
process{ | |
$uiBlob = $blobs | ?{ $_.Name -eq $uiDefinitionFilename} | select -First 1 | |
if ($uiBlob -ne $null){ | |
$uiUri = $uiBlob.ICloudBlob.Uri.AbsoluteUri | |
$uiUriEscaped = [uri]::EscapeDataString($uiUri) | |
$sideloadUri = "https://portal.azure.com/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{`"initialData`":{},`"providerConfig`":{`"createUiDefinition`":`"$uiUriEscaped`"}}" | |
Start-Process $sideloadUri | |
} | |
} | |
This file contains hidden or 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
param( | |
[parameter(Mandatory=$true)] | |
$ResourceGroupName, | |
[parameter(Mandatory=$true)] | |
$StorageAccountName, | |
[parameter(Mandatory=$true)] | |
$ContainerName) | |
$key = Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAccountName | select -ExpandProperty Key1 | |
$context = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $key | |
$container = Get-AzureStorageContainer -Context $context -Name $ContainerName -ErrorAction SilentlyContinue | |
if($container -eq $null){ | |
Write-Host "Creating container '$ContainerName'" | |
$container = New-AzureStorageContainer -Context $context -Name $ContainerName -Permission Blob | |
} | |
Get-ChildItem * ` | |
| Set-AzureStorageBlobContent -Context $context -Container $ContainerName -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment