0

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://learn.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

  • Can you explain what you're trying to accomplish? Using a legacy Cloud Service is probably not the best solution. – David Browne - Microsoft Jul 02 '19 at 22:14
  • Follow the https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-nodejs-develop-deploy-express-app tutorial. Deploy a tcp server to azure in MACOS/ Linux based machines. – Pepe Calixto Jul 02 '19 at 22:30
  • How about: https://learn.microsoft.com/en-us/azure/app-service/containers/quickstart-nodejs or https://learn.microsoft.com/en-us/azure/container-instances/ – David Browne - Microsoft Jul 02 '19 at 23:26

1 Answers1

0

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

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • 1
    Tried your suggestions on a macos computer and almost got the same results: Get-InstalledModule -Name azurerm.profile -AllVersions Versions: 5.8.2 and 5.8.3 Get-InstalledModule -Name azure Versions: 5.3.0 New-AzureServiceProject testing New-AzureServiceProject : Object reference not set to an instance of an object. + CategoryInfo : NotSpecified: (:) [New-AzureServiceProject], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureServiceProjectCommand Need extra install? – Pepe Calixto Jul 03 '19 at 08:00
  • You may need to install the Azure SDK refer to your providing link. Since Azure subsequently announces the deactivation of the ASM management endpoints and cloud service still rely on ASM API refer to [this](https://social.msdn.microsoft.com/Forums/azure/en-US/6e7f0d2c-7132-4422-aab2-a0c5df2fd17f/what-to-do-with-azure-service-management-cmdlets-for-cloud-services-that-are-being-retired-without?forum=azureautomation). I suggest deploying your web app in azure app service then you can use the Azure PowerShell with new `AZ` module on the most of system windows, Linux, macos. – Nancy Jul 03 '19 at 09:03
  • 1
    Thank you Nancy. I really need a TCP server therefore I can't use a webapp. It's being very dissapointing azure in that sense (Cloud service). Messy and ambiguous information, only windows focused and worst of all there is no support. I will try to migrate to VMs which surprisingly are cheaper than Cloud services. I appreciate your time and feedback. – Pepe Calixto Jul 03 '19 at 17:22