New-AzureServiceProject: "Could not find a part of the path"
Cmdlet
New-AzureServiceProject
PowerShell Version
5.0.10586.672
Module Version
3.8.0
OS Version
10.0.10586.672
Description
I was completing the following tutorial: Build a Node.js Chat Application with Socket.IO on an Azure Cloud Service
I was unable to execute the first line of Step 4 and received the error shown in the debug output below. My directory structure goes as far as C:\Program Files\WindowsPowerShell\Modules\Azure\3.8.0\Automation but there are no directories within the automation folder.
Debug Output
New-AzureServiceProject : Could not find a part of the path 'C:\Program
Files\WindowsPowerShell\Modules\Azure\3.8.0\Automation\Resources\Scaffolding\General\scaffold.xml'.
At line:1 char:1
+ New-AzureServiceProject chatapp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureServiceProject], DirectoryNotFoundException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureServicePr
ojectCommand
DEBUG: 3:27:38 PM - NewAzureServiceProjectCommand end processing.
DEBUG: 3:27:38 PM - NewAzureServiceProjectCommand end processing.
Script/Steps for Reproduction
- From the 'C:\Windows\System32\WindowsPowerShell\v1.0' directory, right click powershell_ise, click Run as administrator. Run the following steps from the PowerShell:
- Import-Module Azure
- Login-AzureRmAccount
- md AzureNodeApp
- cd AzureNodeApp
- New-AzureServiceProject chatapp
@mbenaven Hey Matt, I'm going to close this issue as it is a duplicate of an existing issue (that was closed a few months ago): https://github.com/Azure/azure-powershell/issues/2199
@mbenaven please feel free to re-open this issue if you still have any questions about this cmdlet
@cormacpayne Could you please re-open this issue? A team member of mine would like to add additional information.
P.S. I tried to re-open this myself but found that I am unable to re-open issues which have been closed by the repo collaborator.
- We did see issue #2199 and see how it is similar, but thought they are different issues since they have different path problems.
- I don’t fully understand the resolution. ○ Is the resolution to copy and paste files from one folder to another? ○ Is the resolution to run in debug mode and import the module? If so, what module do we need to import?
- I’ve also noticed that there is a link to another issue #3464, which suggests using ‘webapp.’ Does this mean we should be using a different cmdlet?
#2199 was closed as 'won't fix'
The ServiceProject cmdlets represent a very old way to deploy apps to a very old RDFE service hosting mechanism. Our best advice it so migrate to a VM, Website, or Conatiner -based hosting for your application - long term you will need to do this.
In the short term, these commands are fully supported in previous versions [like 0.9.8.1: https://aka.ms/azure-powershell], and if you need to use these cmdlets and are finding issues, that version is your best bet as a temporary workaround.