-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Remove DefaultProfile usage from constructor in ResourceManipulationCmdletBase #5705
Comments
Found a workaround for the moment. Add the following to the testingjobs.ps1 script causes the context to be saved for the process / session so that each command does not need to be authenticated.
|
@huntr01 Good catch - it looks like this particular cmdlet is trying to usethe context before the parameter is bound here: https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/CmdletBase/ResourceManipulationCmdletBase.cs#L123 Need to move this code into BeginProcessing or ProcessRecord |
This has been fixed |
Description
Passing in context using the AzureRmContext (DefaultProfile) optional variable does not work for Set-AzureRmResource. This works for other *-AzureRmResource commands (eg get-azurermresource).
I am calling the cmdlet via a powershell job which needs authentication/tenant details provided by the context object as described here: https://docs.microsoft.com/en-us/powershell/azure/context-persistence?view=azurermps-5.4.0
As mentioned, this works for other *-AzureRmResource commands and the documentation suggested it accepts the AzureRMContext parameter
Script/Steps for Reproduction
Create a script to run as a job called testingjobs.ps1
Then call the script via a job, passing in the Azure Context so the cmdlets can use it to authenticate to azure. Ensure a valid ResourceID is specified in the Get-AzureRmResource
Module Version
Environment Data
Debug Output
The text was updated successfully, but these errors were encountered: