Created
December 13, 2017 23:17
-
-
Save IlyaFinkelshteyn/8db37a44cc78126ba86d9075f020a947 to your computer and use it in GitHub Desktop.
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
# on local computer: | |
# Add-AzureRmAccount | |
# Save-AzureRmContext -Path .\AzureRmProfileContext.txt | |
# nuget install secure-file -ExcludeVersion | |
# .\secure-file\tools\secure-file -encrypt .\AzureRmProfileContext.txt -secret <my_secret> | |
# upload AzureRmProfileContext.txt.enc to the repo root | |
# more info https://www.appveyor.com/docs/how-to/secure-files/ | |
environment: | |
my_secret: | |
secure: rASZ+NtZbIUR3L01B1FjUA== | |
install: | |
- nuget install secure-file -ExcludeVersion | |
- secure-file\tools\secure-file -decrypt AzureRmProfileContext.txt.enc -secret %my_secret% | |
build_script: | |
# idea from https://arcanecode.com/2017/04/19/what-happened-to-save-azurermprofile/ | |
# additional workaround from https://github.com/Azure/azure-powershell/issues/3954#issuecomment-309190303 | |
- ps: $ctx = Import-AzureRmContext -Path $env:APPVEYOR_BUILD_FOLDER\AzureRmProfileContext.txt | |
- ps: $ctx.Context.TokenCache.Deserialize($ctx.Context.TokenCache.CacheData) | |
# just to test I am authenticated | |
- ps: Get-AzureRmAppServicePlan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment