0
votes

Description

Hi We need to deploy a TCP server with a "different known" port so we selected an azure cloud service. My team has different OS so we need to deploy with powershell code. We also enabled the "Enable-AzureRmAlias" command to avoid errors. In both operating systems we got the same error.

The term 'New-AzureServiceProject' is not recognized as the name of a cmdlet

Steps to reproduce

We tried the same steps in MACOS and a windows 7 machine and followed the azure tutorial:

https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-nodejs-develop-deploy-express-app

Everything works fine until the New-AzureServiceProject expressapp command.

Environment data

In both machines we got:

$PSVersionTable.PSVersion Major Minor Patch PreReleaseLabel BuildLabel


6 2 1

Get-InstalledModule -Name Az -AllVersions | select Name,Version Name Version


Az 2.4.0 Az 2.3.2

az --version azure-cli 2.0.67 *

Error output

New-AzureServiceProject : The term 'New-AzureServiceProject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + New-AzureServiceProject helloworld + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (New-AzureServiceProject:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

1
Can you explain what you're trying to accomplish? Using a legacy Cloud Service is probably not the best solution. - David Browne - Microsoft
Follow the docs.microsoft.com/en-us/azure/cloud-services/… tutorial. Deploy a tcp server to azure in MACOS/ Linux based machines. - Pepe Calixto

1 Answers

0
votes

New-AzureServiceProject is using the Azure module, this command is working well on my windows 10. I have PSVersion 5.1.17763.503.

To avoid this, you must make sure that you've got the Azure module 5.3.0+ install and NO other older version. Once that's installed, force installs the Az module again. You could follow this to migrate existing scripts to Az and more details from this SO question about Az / AzureRM / Legacy Azure Powershell Conflicts

enter image description here