Hi I am trying to login Azure with powershell workflow and I get this result after authentication.
When i run this command in a powershell workflow and login withthe popup window I get the below empty subscription info.
When I do a normal powershell without workflow I get the subscription information back correctly.
I even tried saving the context outside the workflow and tried to use the context but got the error.
How can i get this to return the subscription info using powershell workflow? Could someone help please.
When i run this command in a powershell workflow and login withthe popup window I get the below empty subscription info.
When I do a normal powershell without workflow I get the subscription information back correctly.
Code:
Environment : Account : TenantId : SubscriptionId : SubscriptionName : CurrentStorageAccount : PSComputerName : localhost
Code:
# Setup – First login manually Add-AzureRmAccount # Now save your context locally (Force will overwrite if there) $ContextLocation=C:\Context\test $path = "$ContextLocation\ProfileContext.ctx" Save-AzureRmContext -Path $path -Force #Once that’s done, from then on you can use the Import-AzureRmContext to automate the login. # Once the above two steps are done, you can simply import Import-AzureRmContext -Path $path I got this error: Run Login-AzureRmAccount to login. + CategoryInfo : InvalidOperation: (:) [Remove-AzureRmResourceGroup], PSInvalidOperationException + FullyQualifiedErrorId : InvalidOperation,Microsoft.Azure.Commands.Resources.RemoveAzureResourceGroupCmdlet + PSComputerName : [localhost]