Skip to content

Conversation

@Xynoclafe
Copy link
Contributor

@Xynoclafe Xynoclafe commented Feb 24, 2021

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • 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 -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@Xynoclafe Xynoclafe requested a review from shenglol February 24, 2021 21:16

if (!string.IsNullOrEmpty(this.QueryString))
{
properties.TemplateLink.QueryString = this.QueryString;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a test case

@Xynoclafe Xynoclafe marked this pull request as draft February 26, 2021 17:56
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

shenglol
shenglol previously approved these changes Feb 26, 2021
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

Looks good to me but still need reviews from the PS team.

@Xynoclafe
Copy link
Contributor Author

Looks good to me but still need reviews from the PS team.

There are some credscan failures that I am trying to fix

@Xynoclafe
Copy link
Contributor Author

Looks good to me but still need reviews from the PS team.

There are some credscan failures that I am trying to fix

The credscan issues are false positives as the credentials are invalid and are for non existent resources.

@Xynoclafe Xynoclafe marked this pull request as ready for review March 2, 2021 22:14
@Xynoclafe
Copy link
Contributor Author

The credscan issues have been suppressed.
Unsure of the reason for test failures. The test fails claiming "Remove-AzStorageAccount" is not recognized as a cmdlet, which is weird. It is a valid cmdlet (https://docs.microsoft.com/en-us/powershell/module/az.storage/Remove-azStorageAccount?view=azps-5.5.0) and I was able to record the test successfully as well. So I don't know why a successful test record is failing during the checks. I would appreciate it if the reviewers could help if they've seen behavior like this before.

{
helper.RMResourceModule,
helper.GetRMModulePath("AzureRM.Monitor.psd1")
helper.GetRMModulePath("AzureRM.Monitor.psd1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Add helper.GetRMModulePath("AzureRM.Storage.psd1"), here to use cmdlets in Storage when running test cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wyunchi-ms I made the suggested changes, but now it fails with "Device not configured"

$token = New-AzStorageAccountSASToken -Service File -ResourceType Service,Container,Object -Permission "r" -Context $context -ExpiryTime (Get-Date).AddMinutes(3)

#Create deployment
$deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this URL valid? I cannot access it in my environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same reasoning as the comment below

Assert-AreEqual Succeeded $deployment.ProvisioningState

#Run What-if
$result = New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1) -WhatIf
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this URL valid? I cannot access it in my environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same reasoning as the comment below


#Create deployment
$deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringtesting.blob.core.windows.net/testqsblob/linkedTemplateParent.json" -QueryString "foo"
$deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this URL valid? I cannot access it in my environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are urls for a storage account created during the test and deleted after it is completed. So you will not be able to access it outside of the test. But at the time of the test execution (recording), the urls are valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wyunchi-ms any idea on what is happening with this error?

@Xynoclafe Xynoclafe marked this pull request as draft March 11, 2021 23:12
@Xynoclafe
Copy link
Contributor Author

The checks should be passing now. @wyunchi-ms

@Xynoclafe Xynoclafe marked this pull request as ready for review March 12, 2021 01:42
@Xynoclafe
Copy link
Contributor Author

The checks are either not starting or just getting stuck in running (even though the actual pipelines for them seem to have run successfully). Is there something wrong with the checks/pipeline?
Also, I see that credscan is failing. It seems like it is coming from this file - https://github.com/Xynoclafe/azure-powershell/blob/xynoclafe/whatIfQueryString/src/CloudService/test/New-AzCloudService.Recording.json, based on https://dev.azure.com/azure-sdk/internal/_build/results?buildId=780021&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=a4822bc1-f3a9-5984-c941-6c1b7aa2ab81&l=18.
This was last modified in this PR - #14360 and was not modified in the current PR.
cc- @wyunchi-ms

@Xynoclafe
Copy link
Contributor Author

The earlier check failures were due to some merge issues with the credScanSuppression file. The checks are passing now, we should be able to merge this.

@Xynoclafe Xynoclafe changed the title Fixed what-if funcationality with -QueryString parameter Fixed what-if functionality with -QueryString parameter Mar 16, 2021
@wyunchi-ms wyunchi-ms changed the base branch from master to release-2021-03-23 March 17, 2021 05:05
@wyunchi-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel isra-fel merged commit 3907ba0 into Azure:release-2021-03-23 Mar 17, 2021
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