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

WebApp:Publish-AzWebapp doesn't handle relative paths properly #18028

Closed
rafaelrruiz opened this issue May 3, 2022 · 1 comment
Closed

WebApp:Publish-AzWebapp doesn't handle relative paths properly #18028

rafaelrruiz opened this issue May 3, 2022 · 1 comment
Assignees
Labels
App Services aka WebSites bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention This issue is responsible by Azure service team.

Comments

@rafaelrruiz
Copy link

Description

Public-AzWebapp interprets relative paths incorrectly.

Any relative path I use is appended to c:\windows\system32. There was a previous report of this which was closed without a proper explanation.

PS > Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Publish-AzWebApp: Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.

Issue script & Debug output

PS c:\Users\XXX\src> Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Publish-AzWebApp: Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.2.0                 Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfiguration, Enter-AzWebAppContainerPSSession…}

Error output

HistoryId: 206

Message        : Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.
StackTrace     :    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
                    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
                    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
                    at System.IO.File.OpenRead(String path)
                    at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.<>c__DisplayClass13_0.<ExecuteCmdlet>b__0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action, Func`1 useShouldContinue)
                    at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action)
                    at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.IO.DirectoryNotFoundException
InvocationInfo : {Publish-AzWebApp}
Line           : Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Position       : At line:1 char:1
                 + Publish-AzWebApp -ResourceGroupName POC -Name Test -Arc …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 206
@rafaelrruiz rafaelrruiz added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels May 3, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 3, 2022
@dingmeng-xue dingmeng-xue added App Services aka WebSites Service Attention This issue is responsible by Azure service team. labels May 4, 2022
@ghost
Copy link

ghost commented May 4, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.

Issue Details

Description

Public-AzWebapp interprets relative paths incorrectly.

Any relative path I use is appended to c:\windows\system32. There was a previous report of this which was closed without a proper explanation.

PS > Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Publish-AzWebApp: Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.

Issue script & Debug output

PS c:\Users\XXX\src> Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Publish-AzWebApp: Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.2.0                 Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfiguration, Enter-AzWebAppContainerPSSession…}

Error output

HistoryId: 206

Message        : Could not find a part of the path 'C:\Windows\system32\TestApp\TestApp.zip'.
StackTrace     :    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
                    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
                    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
                    at System.IO.File.OpenRead(String path)
                    at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.<>c__DisplayClass13_0.<ExecuteCmdlet>b__0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action, Func`1 useShouldContinue)
                    at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action)
                    at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.IO.DirectoryNotFoundException
InvocationInfo : {Publish-AzWebApp}
Line           : Publish-AzWebApp -ResourceGroupName POC -Name Test -ArchivePath ".\TestApp\TestApp.zip" -Force
Position       : At line:1 char:1
                 + Publish-AzWebApp -ResourceGroupName POC -Name Test -Arc …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 206
Author: rafaelrruiz
Assignees: -
Labels:

App Services, Service Attention, bug

Milestone: -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Services aka WebSites bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants