-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 websocket related tasks in InvokeAzContainerInstanceCommand_ExecuteExpanded.cs #22486
Fixed websocket related tasks in InvokeAzContainerInstanceCommand_ExecuteExpanded.cs #22486
Conversation
…nd_ExecuteExpanded.cs
️✔️Az.Accounts
|
Type | Cmdlet | Description | Remediation |
---|---|---|---|
Get-AzContainerGroup | Get-AzContainerGroup 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-AzContainerGroup | Get-AzContainerGroup 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-AzContainerInstanceCachedImage | Get-AzContainerInstanceCachedImage 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-AzContainerInstanceCachedImage | Get-AzContainerInstanceCachedImage 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-AzContainerInstanceCapability | Get-AzContainerInstanceCapability 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-AzContainerInstanceCapability | Get-AzContainerInstanceCapability 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-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint | Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint 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-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint | Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint 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-AzContainerInstanceLog | Get-AzContainerInstanceLog 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-AzContainerInstanceLog | Get-AzContainerInstanceLog 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-AzContainerInstanceUsage | Get-AzContainerInstanceUsage 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-AzContainerInstanceUsage | Get-AzContainerInstanceUsage 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-AzContainerGroupImageRegistryCredentialObject | New-AzContainerGroupImageRegistryCredentialObject 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-AzContainerGroupImageRegistryCredentialObject | New-AzContainerGroupImageRegistryCredentialObject 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-AzContainerGroupPortObject | New-AzContainerGroupPortObject 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-AzContainerGroupPortObject | New-AzContainerGroupPortObject 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-AzContainerGroupVolumeObject | New-AzContainerGroupVolumeObject 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-AzContainerGroupVolumeObject | New-AzContainerGroupVolumeObject 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-AzContainerInstanceEnvironmentVariableObject | New-AzContainerInstanceEnvironmentVariableObject 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-AzContainerInstanceEnvironmentVariableObject | New-AzContainerInstanceEnvironmentVariableObject 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-AzContainerInstanceHttpHeaderObject | New-AzContainerInstanceHttpHeaderObject 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-AzContainerInstanceHttpHeaderObject | New-AzContainerInstanceHttpHeaderObject 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-AzContainerInstanceInitDefinitionObject | New-AzContainerInstanceInitDefinitionObject 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-AzContainerInstanceInitDefinitionObject | New-AzContainerInstanceInitDefinitionObject 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-AzContainerInstanceObject | New-AzContainerInstanceObject 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-AzContainerInstanceObject | New-AzContainerInstanceObject 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-AzContainerInstancePortObject | New-AzContainerInstancePortObject 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-AzContainerInstancePortObject | New-AzContainerInstancePortObject 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-AzContainerInstanceVolumeMountObject | New-AzContainerInstanceVolumeMountObject 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-AzContainerInstanceVolumeMountObject | New-AzContainerInstanceVolumeMountObject 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-AzContainerGroup | Get-AzContainerGroup 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-AzContainerGroup | Get-AzContainerGroup 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-AzContainerInstanceCachedImage | Get-AzContainerInstanceCachedImage 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-AzContainerInstanceCachedImage | Get-AzContainerInstanceCachedImage 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-AzContainerInstanceCapability | Get-AzContainerInstanceCapability 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-AzContainerInstanceCapability | Get-AzContainerInstanceCapability 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-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint | Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint 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-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint | Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint 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-AzContainerInstanceLog | Get-AzContainerInstanceLog 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-AzContainerInstanceLog | Get-AzContainerInstanceLog 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-AzContainerInstanceUsage | Get-AzContainerInstanceUsage 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-AzContainerInstanceUsage | Get-AzContainerInstanceUsage 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-AzContainerGroupImageRegistryCredentialObject | New-AzContainerGroupImageRegistryCredentialObject 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-AzContainerGroupImageRegistryCredentialObject | New-AzContainerGroupImageRegistryCredentialObject 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-AzContainerGroupPortObject | New-AzContainerGroupPortObject 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-AzContainerGroupPortObject | New-AzContainerGroupPortObject 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-AzContainerGroupVolumeObject | New-AzContainerGroupVolumeObject 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-AzContainerGroupVolumeObject | New-AzContainerGroupVolumeObject 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-AzContainerInstanceEnvironmentVariableObject | New-AzContainerInstanceEnvironmentVariableObject 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-AzContainerInstanceEnvironmentVariableObject | New-AzContainerInstanceEnvironmentVariableObject 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-AzContainerInstanceHttpHeaderObject | New-AzContainerInstanceHttpHeaderObject 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-AzContainerInstanceHttpHeaderObject | New-AzContainerInstanceHttpHeaderObject 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-AzContainerInstanceInitDefinitionObject | New-AzContainerInstanceInitDefinitionObject 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-AzContainerInstanceInitDefinitionObject | New-AzContainerInstanceInitDefinitionObject 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-AzContainerInstanceObject | New-AzContainerInstanceObject 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-AzContainerInstanceObject | New-AzContainerInstanceObject 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-AzContainerInstancePortObject | New-AzContainerInstancePortObject 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-AzContainerInstancePortObject | New-AzContainerInstancePortObject 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-AzContainerInstanceVolumeMountObject | New-AzContainerInstanceVolumeMountObject 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-AzContainerInstanceVolumeMountObject | New-AzContainerInstanceVolumeMountObject 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
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
Thank you for your contribution andreygoran! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree |
Hi @andreygoran , If you are from Microsoft, please join your github account to Azure org.
|
I'm not from Microsoft. |
Thanks for your contribution! As Az.ContainerInstance is a generated module, please target your PR to generation branch. I'm checking these points and will go back to you soon. |
@BethanyZhou I added another PR #22515 |
Close as tracked by #22515 |
Description
This PR fixes the problem with Invoke-AzContainerInstanceCommand not returning any result when it's run under certain conditions, and closes #22453
The problem occurres when powershell is launched with redirection of input stream (and apparently this is how it's being run in Azure ARM Powershell Deployment Scripts and in Azure Powershell Functions).
Test.ps1
code used to reproduce the problem:Results before the fix:
Results after the fix:
Related Issues
Fixed: #22453
Probably related: #19247
Probably related: #15754 (comment)
Root Cause Analysis
The root cause of the bug was using a
return Task.Factory.StartNew(async () => {...})
construction to handle working with websockets doing actual communication with container instance. This code pattern is dangerous and should not be used, see for details https://blog.stephencleary.com/2013/08/startnew-is-dangerous.htmlAnother problem was using
Console.KeyAvailable
which throws an exception when input redirection is used. This was fixed by addingConsole.IsInputRedirected
validation.Checklist
CONTRIBUTING.md
and reviewed the following information:generation
branch.ChangeLog.md
file(s) appropriatelyChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header in the past tense. Add changelog in description section if PR goes intogeneration
branch.ChangeLog.md
if no new release is required, such as fixing test case only.