Skip to content
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

Fix issue where error is thrown when passing context to Set-AzureRmResource #6804

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

cormacpayne
Copy link
Member

@cormacpayne cormacpayne commented Jul 27, 2018

Description

Fix for #5705

Tested with the below setup:

Prerequisites

Disable-AzureRmContextAutosave -Scope CurrentUser
Clear-AzureRmContext -Scope CurrentUser

testingjobs.ps1

param($resource, $ctx)

Set-AzureRmResource -ResourceId $resource.ResourceId -Tag $resource.Tags -DefaultProfile $ctx -Force

Command line

Connect-AzureRmAccount
Select-AzureRmContext -Name {{contextName}}
$resource = Get-AzureRmResource -ResourceId {{resourceId}}
Start-Job -FilePath .\testingjobs.ps1 -ArgumentList ($resource, (Get-AzureRmContext))
Get-Job | Wait-Job
Get-Job | Receive-Job

Checklist

@markcowl markcowl merged commit d49e6f3 into Azure:preview Aug 1, 2018
@cormacpayne cormacpayne deleted the resource-context-fix branch September 12, 2018 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants