Skip to content

Autoloading the AzureRm module doesn't work in worker - but works fine interactively #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TylerLeonhardt opened this issue Sep 11, 2018 · 0 comments · Fixed by #67
Closed
Labels
bug Something isn't working external

Comments

@TylerLeonhardt
Copy link
Member

Have a function that just runs:

Login-AzureRmAccount

Note the error:

{
    "Exception": {
          "Source": "Microsoft.Azure.Commands.Common.Authentication.Abstractions",
          "StackTrace": "   at Microsoft.Azure.Commands.Common.Authentication.AzureSession.get_Instance()
                            at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing()\n   
                            at System.Management.Automation.Cmdlet.DoBeginProcessing()
                            at System.Management.Automation.CommandProcessorBase.DoBegin()",
          "Message": "The Azure PowerShell session has not been properly initialized.  Please import the module and try again."
    }
}

This same cmdlet works just fine in pwsh:

> Login-AzureRmAccount
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code AASFDASF to authenticate.

We can fix the above error by Import-Module AzureRm.Netcore but we should understand why this is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant