Merge pull request #93 from Azure/azuresovereigncloud

GitHub Actions Beta Preview for deploying to Azure Stack Hub
This commit is contained in:
Arjun Gupta
2020-12-31 11:16:51 +05:30
parent 778198471b
commit 594ec8f52e
8 changed files with 146 additions and 17 deletions

View File

@@ -20,6 +20,9 @@ class ScriptBuilder {
let command = `Clear-AzContext -Scope Process;
Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue;`;
if (scheme === Constants_1.default.ServicePrincipal) {
if (args.environment.toLowerCase() == "azurestack") {
command += `Add-AzEnvironment -Name ${args.environment} -ARMEndpoint ${args.resourceManagerEndpointUrl} | out-null;`;
}
command += `Connect-AzAccount -ServicePrincipal -Tenant '${tenantId}' -Credential \
(New-Object System.Management.Automation.PSCredential('${args.servicePrincipalId}',(ConvertTo-SecureString '${args.servicePrincipalKey.replace("'", "''")}' -AsPlainText -Force))) \
-Environment '${args.environment}' | out-null;`;