This article, will show how to check whether a cloud service is available to use with a virtual machine or not. Cloud service is basically how to access virtual machine using virtual IP address (VIP).

Cloud services can contain multiple virtual machines by creating cloud service first and then associate that public VIP to multiple virtual machine.

When we create a cloud service using management portal it tells us that whether this cloud service is available or not. But when we do this using PowerShell we will not get such a facility and we need to test it manually using some cmdlets to check whether this cloud service is available or not.

So, let's log into our Azure account from PowerShell and check the current VM that we already have in our Azure subscription.

Now, write the command to test whether cloud service “kkvm015093” is available or not.

Test-AzureName –Service “kkvm015093”

In the result it returns True which means this service is already taken or present.

But you can still create the virtual machine using this cloud service as we know that multiple VMs can use the same cloud service.

If we write any service name that is not present it will return False.

To get the more information about an existing cloud serviced we will write command –

Get-AzureService –ServiceName “kkvm015093”

If you try to get the information of cloud service which had returned False it will throw an error, saying ‘The hosted service does not exist’.

So, we today we have learnt that how to check the cloud service availability using PowerShell.