-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fixed what-if functionality with -QueryString parameter #14328
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
Fixed what-if functionality with -QueryString parameter #14328
Conversation
|
|
||
| if (!string.IsNullOrEmpty(this.QueryString)) | ||
| { | ||
| properties.TemplateLink.QueryString = this.QueryString; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a test case
shenglol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
shenglol
left a comment
There was a problem hiding this 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.
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. |
|
The credscan issues have been suppressed. |
| { | ||
| helper.RMResourceModule, | ||
| helper.GetRMModulePath("AzureRM.Monitor.psd1") | ||
| helper.GetRMModulePath("AzureRM.Monitor.psd1"), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
|
The checks should be passing now. @wyunchi-ms |
…to xynoclafe/whatIfQueryString
|
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? |
* update readme * Update README.md
|
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. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added