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 example 10 of Set-AzStorageAccount #21121

Merged
merged 2 commits into from
Mar 9, 2023
Merged

Conversation

yifanz0
Copy link
Contributor

@yifanz0 yifanz0 commented Mar 6, 2023

Description

Fix #21097

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 6, 2023

️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Aks
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Az.ApplicationInsights
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Signature Check
⚠️PowerShell Core - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzApplicationInsightsMyWorkbook Get-AzApplicationInsightsMyWorkbook Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsMyWorkbook Get-AzApplicationInsightsMyWorkbook changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbook Get-AzApplicationInsightsWorkbook Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbook Get-AzApplicationInsightsWorkbook changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbookRevision Get-AzApplicationInsightsWorkbookRevision Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbookRevision Get-AzApplicationInsightsWorkbookRevision changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbookTemplate Get-AzApplicationInsightsWorkbookTemplate Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbookTemplate Get-AzApplicationInsightsWorkbookTemplate changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ New-AzApplicationInsightsWorkbookTemplateGalleryObject New-AzApplicationInsightsWorkbookTemplateGalleryObject Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ New-AzApplicationInsightsWorkbookTemplateGalleryObject New-AzApplicationInsightsWorkbookTemplateGalleryObject changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️Windows PowerShell - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzApplicationInsightsMyWorkbook Get-AzApplicationInsightsMyWorkbook Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsMyWorkbook Get-AzApplicationInsightsMyWorkbook changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbook Get-AzApplicationInsightsWorkbook Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbook Get-AzApplicationInsightsWorkbook changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbookRevision Get-AzApplicationInsightsWorkbookRevision Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbookRevision Get-AzApplicationInsightsWorkbookRevision changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzApplicationInsightsWorkbookTemplate Get-AzApplicationInsightsWorkbookTemplate Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzApplicationInsightsWorkbookTemplate Get-AzApplicationInsightsWorkbookTemplate changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ New-AzApplicationInsightsWorkbookTemplateGalleryObject New-AzApplicationInsightsWorkbookTemplateGalleryObject Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ New-AzApplicationInsightsWorkbookTemplateGalleryObject New-AzApplicationInsightsWorkbookTemplateGalleryObject changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Compute
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Functions
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.KeyVault
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.KubernetersConfiguration
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ManagedServiceIdentity
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Monitor
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Network
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.OperationalInsights
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.PostgreSql
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.PrivateDns
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Purview
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Az.Resources
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Signature Check
⚠️PowerShell Core - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzADOrganization Get-AzADOrganization Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzADOrganization Get-AzADOrganization changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️Windows PowerShell - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzADOrganization Get-AzADOrganization Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzADOrganization Get-AzADOrganization changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Sql
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Storage
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Websites
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows

@yifanz0
Copy link
Contributor Author

yifanz0 commented Mar 6, 2023

@VeryEarly Can you please help take a look at the following failures of static analysis?

  "Module","Cmdlet","Example","Line","RuleName","ProblemId","Severity","Description","Extent","Remediation"
  "Az.Storage","Set-AzStorageAccount","5","4","Invalid_Cmdlet","5000","1","New-AzKeyVault is not a valid command name.","New-AzKeyVault -VaultName 'MyKeyVault' -ResourceGroupName 'MyResourceGroup' -Location 'EastUS2'","Check the spell of New-AzKeyVault."
  "Az.Storage","Set-AzStorageAccount","5","5","Invalid_Cmdlet","5000","1","Add-AzKeyVaultKey is not a valid command name.","Add-AzKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey' -Destination 'Software'","Check the spell of Add-AzKeyVaultKey."
  "Az.Storage","Set-AzStorageAccount","5","6","Invalid_Cmdlet","5000","1","Set-AzKeyVaultAccessPolicy is not a valid command name.","Set-AzKeyVaultAccessPolicy -VaultName 'MyKeyVault' -ObjectId $account.Identity.PrincipalId -PermissionsToKeys wrapkey,unwrapkey,get","Check the spell of Set-AzKeyVaultAccessPolicy."

The cmdlet New-AzKeyVault, Add-AzKeyVaultKey and Set-AzKeyVaultAccessPolicy actually exist in module Az.Network

@VeryEarly VeryEarly self-assigned this Mar 6, 2023
@VeryEarly
Copy link
Contributor

@VeryEarly Can you please help take a look at the following failures of static analysis?

  "Module","Cmdlet","Example","Line","RuleName","ProblemId","Severity","Description","Extent","Remediation"
  "Az.Storage","Set-AzStorageAccount","5","4","Invalid_Cmdlet","5000","1","New-AzKeyVault is not a valid command name.","New-AzKeyVault -VaultName 'MyKeyVault' -ResourceGroupName 'MyResourceGroup' -Location 'EastUS2'","Check the spell of New-AzKeyVault."
  "Az.Storage","Set-AzStorageAccount","5","5","Invalid_Cmdlet","5000","1","Add-AzKeyVaultKey is not a valid command name.","Add-AzKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey' -Destination 'Software'","Check the spell of Add-AzKeyVaultKey."
  "Az.Storage","Set-AzStorageAccount","5","6","Invalid_Cmdlet","5000","1","Set-AzKeyVaultAccessPolicy is not a valid command name.","Set-AzKeyVaultAccessPolicy -VaultName 'MyKeyVault' -ObjectId $account.Identity.PrincipalId -PermissionsToKeys wrapkey,unwrapkey,get","Check the spell of Set-AzKeyVaultAccessPolicy."

The cmdlet New-AzKeyVault, Add-AzKeyVaultKey and Set-AzKeyVaultAccessPolicy actually exist in module Az.Network

please copy these messages into https://github.com/yifanz0/azure-powershell/tree/fixexample/tools/StaticAnalysis/Exceptions/Az.Storage/ExampleIssues.csv

@yifanz0
Copy link
Contributor Author

yifanz0 commented Mar 7, 2023

We had similar issues for #20774 before, and the issue was fixed without adding the lines to ExampleIssues.csv.
Just wanted to double check - do we just add issues like these to ExampleIssues.csv from now on?

@VeryEarly
Copy link
Contributor

We had similar issues for #20774 before, and the issue was fixed without adding the lines to ExampleIssues.csv. Just wanted to double check - do we just add issues like these to ExampleIssues.csv from now on?

yes please.

@VeryEarly VeryEarly merged commit 96b5f67 into Azure:main Mar 9, 2023
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.

[Doc]: Example 10: Incorrect
3 participants