Skip to content

Fix issue with Properties property of PSResource #6218

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

Merged
merged 4 commits into from
May 24, 2018

Conversation

cormacpayne
Copy link
Member

@cormacpayne cormacpayne commented May 15, 2018

Description

The Properties property of PSResource was changed from a PSObject to JToken in version 6.0.0 of AzureRM.Resources. This change made it difficult for users to access the key-value pairs in Properties and broke existing scripts trying to update generic resources (such as this script).

This pull request changes Properties to a PSObject by converting the JToken appropriately.

Checklist

@MiYanni
Copy link
Contributor

MiYanni commented May 15, 2018

@cormacpayne cormacpayne changed the base branch from preview to release-6.1.0 May 16, 2018 21:59
@cormacpayne
Copy link
Member Author

@cormacpayne
Copy link
Member Author

Need test coverage -- will ship this out of band

@cormacpayne cormacpayne changed the base branch from release-6.1.0 to preview May 17, 2018 01:19
twitchax
twitchax previously approved these changes May 21, 2018
@@ -62,7 +65,7 @@ public PSResource(GenericResource resource)
this.ManagedBy = resource.ManagedBy;
this.Name = resource.Name;
this.Plan = resource.Plan;
this.Properties = resource.Properties;
this.Properties = ((JToken)resource.Properties).ToPsObject();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Also, argh PowerShell, haha.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is it ever possible for resource.Properties to not be convertible to JToken?

…urces-fix

# Conflicts:
#	tools/StaticAnalysis/Exceptions/BreakingChangeIssues.csv
markcowl
markcowl previously approved these changes May 23, 2018
@markcowl
Copy link
Member

markcowl commented May 23, 2018

@markcowl markcowl removed their assignment May 23, 2018
@maddieclayton maddieclayton merged commit 06925b7 into Azure:preview May 24, 2018
maddieclayton pushed a commit that referenced this pull request May 29, 2018
* #1443089: New Powershell commandlets for feature:P2S Ipsec custom policy set on Gateway. and fix build merge errors.

* #1443089: Update change log

* fix in AzureRM.Network.psd1

* Fix for issue #5365
Moved the Websites dependency of LogicApp into commons

* Add websites dll to required assemblies part of Profile

* Fic sln files to include the dependencies

* Fic dependency paths and projects

* Fix dll name

* Add/update help files for PS command lets

* Incorporate code review comments

*  Add csproj files for the new common module to Profile

* Fix build

* Fix dll name (WebSites -> Websites) in the pofile psd1

* Record failing tests

* [Maps] Rename folders and files from LocationBasedServices

* [Maps] Rename help file names

* [Maps] Renaming variables, strings, descriptions, etc.

* Recorded and enabled skipped tests

* Add StaticAnalysis checks for
- No output type
- Optional positional parameters
- Parameter set names containing a space
- Cmdlets with no default parameter set name and multiple sets

* Add tests for new static analysis checks

* [Maps] Use Maps SDK over LocationBasedServices SDK

* Record and enable skipped Brooklyn tests to have test coverage

* fix test

* move from on demand to regular build

* #Fix help file error

* Fix static analysis errors

* Fix cred scan errors

* Fix cred scan errors

* Add dependence in the ServiceManagement sln to fix the sign job

* Update SignatureIssues.csv

* Incorporate code review comments

* Updating Networking tests with owner attributes

* Fix command output

* Revert "Fix command output"

This reverts commit a4bace3.

* Suppress signature issues as they are approved by Powershell team

* Strategies library: Version 4, new WriteWarning method.

* Websites.Strategies are replaced by Common.Strategies library.

* Added comments with full team names

* Cleanup dependencies and assembly references

* remove one more reference

* Fix for empty examples.

* [Maps] Add legacy ResourceManager & update test recordings

* [Maps] Add legacy ResourceManager & update test recordings

* Add example to Stop-AzureRmResourceGroupDeployment.md

* [Maps] Resolving merge revision requests

* [Maps] Resolving merge revision requests (2)

* Remove spaces in location before comparision

* Revert default role assignment in New-AzureRmADServicePrincipal, update help with examples

* Update Stack.sln

* [Maps] Add PassThru to Remove method, resolve build failure

* Update azure-powershell-developer-guide.md

* [Maps] Update help files to reflect -PassThru param addition

* [Maps] Fix trailing yaml string for PassThru

* address comments

* Fix sign job, add tests for service principal creation with role or scope

* Fix local build issues because of a netcore sln file introduced
accidentally

* Update azure-powershell-developer-guide.md

* Update test for test-ConnectivityTroubleshoot

* Fix AKS doc

* Update Get-AzureRmAks.md

* Dependency fix : ServiceFabric (#5971)

* Fix for #535
Dependency fixes for ServiceFabric in this commit

*  Add signing stuff and netcode projects to fix netcore build.

* Added exception for breaking changes

* Update all the sln projects with the newest Keyvault common project

* Took care of Cormac's comments

* Fix bad merge

* Fix breaking build as oer comments from Cormac

* Fix file name

* Fix sln files for new dependencies

* Fix netcore csproj

* Fic netcode proj for storage.management

* Fix dependency paths and project names

* Fix assembly name in assembluInfo

* Fix KEyVault guid

* Add csproj fils for the new common modules to profile

* Fix names of csproj files

* Netcore projects are case sensitive, and when i changed Keyvault to
KeyVault, none of the folder names or file names reflected the change in
git... git still sees them as Keyvault

* Fix caseing in one more netcore project

* Fix casing on the namespace...

* Fix the folder name mixup. Step 1 of 2

* Fix the foldername mixup, Step 2 of 2

* Fix project references to point to the correct location

* Fix namespace casing in test projet

* Fix bad merge

* Fix mad merge

* Fix project dependencies

* As poer feedback, add 2018_04_01 version for compute

* Update sevice fabric dependency on the common compute code

* Suppress warnings about passwords in generated code.

* Credscan can not hanndle secrets in comments.. just removing the
offending comments

* Fix tests to be able to record them and other small changes

* Fix bad merge

* Remove UTF8 BOM encoding from file

* Fix bad merge in profile psd1 file

* Took care of Maddie's comment

* iFix assembly name in profile csproj

* Add common projects to the stack solution as well

* Fix Issue 5545 - Set Auth Values on UpdateAzureSchedulerServiceBusQueueJobCommand (#6196)

* 5545 - Set Auth to value from PSServiceBusAuthenticationParams

* Change log updates

* Update versions for release of AzureRM.Resources

* Fix issue with Properties property of PSResource (#6218)

* Fix issue with Properties property of PSResource

* Add test coverage for Properties property

* Release Maps (#6287)

* Update VMSS VM feature (#6170)

* Add test coverage for no role assignment in default SP creation scenario

* Update AzureRM.psm1

* adding right powershell command

Add-AzureApplicationGatewayRequestRoutingRule      <-- incorrect
Add-AzureRmApplicationGatewayRequestRoutingRule <--corrected command

* removing adding space causing powershell error in example

$ AppGw is not a valid powershell variable
$AppGw has been proposed instead

* Typo in powershell command

Get-AzureRmApplicationGatewayFrontendIPort is no a valid command
Get-AzureRmApplicationGatewayFrontendPort proposed as the corrected powershell command

* Fixes inconsistent slot name in example

The example and description's slot names should match.

* Merging RecoveryServices.Backup code into RecoveryServices (#6263)

* Merged RecoveryServices.Backup code in to RecoveryServices

* Updating change log

* Adding ignored file

* Updating test targets and mappings

* Moving changelog and documentation files of RS and RS.Backup to their respective module folders

* Add ManagementGroups to AzureRM.Resources and Update to use latest SDK for GA (#6271)

* Initial migration commit

* Move ManagementGroups to AzureRM.Resources

* Update powershell to use the latest SDK and API, minor changes to responses and help files

* Add installer file

* Revert "Add installer file"

This reverts commit 0d9b92c.

* Update tests and run tests again

* Update Help

* Update helpfiles

* more changes to help files

* Changes to Netcore.psd1

* Changes to Netcore.csproj

* Update help file

* Regenerate all help files

* Move help files to AzureRM.Resource help files

* Update package version

* Update local feed and rerun tests

* Remove local feed
@cormacpayne cormacpayne deleted the resources-fix branch October 15, 2018 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants