"Could not find part of the path" by creating a service

I tried to create an Azure cloud service using:

Create a cloud service

New-AzureServiceProject -ServiceName 'service-lift-and-shift' -Verbose

I am using Azure SDK 2.9 and it gives the following error:

ServiceName: service-lift-and-shift
New-AzureServiceProject: Could not find a part of the path 'C: \ Program Files (x86) \ Microsoft 
SDKs \ Azure \ PowerShell \ ResourceManager \ AzureResourceManager \ AzureRM.Profile \ Resources \ Scaffolding \ General \ scaffold.xml '.
At line: 1 char: 1
+ New-AzureServiceProject
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: CloseError: (:) [New-AzureServiceProject], DirectoryNotFoundException
    + FullyQualifiedErrorId: Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureServiceProjectCommand
+2
source share
2 answers

I solved this problem by copying the folder
C: \ Program Files (x86) \ Microsoft SDK \ Azure \ PowerShell \ ServiceManagement \ Azure \ Services \ Resources
to
C: \ Program Files (x86) \ Microsoft SDK \ Azure \ PowerShell \ ResourceManager \ AzureResourceManager \ AzureRM.Profile

+6
source

Since you want to create a Could Service , which exists only in ASM mode, you must log in with the command: Add-AzureAccount .

I first logged in with Add-AzureRmAccount , and I got the same error as you. But when I logged in with Add-AzureAccount in ASM mode, it works.

, ASM.

+1

All Articles