Finding azure Availability sets using Azure in classic mode - azure

I am trying to find the availability sets in a Azure Cloud Service using powershell. The Cloud Service was created using classic model.
I am not sure if this is the right answer:
get-AzureService -ServiceName "myService"

That is correct. Get-AzureService returns with the information about the cloud services for the current subscription.
The Syntax is:
Get-AzureService -ServiceName "nameOfService"

Related

Az Powershell commands not working for "Cloud service (classic)"

I'm simply trying to extract the below information using Az PowerShell.
Resource on portal
Already tried the below commands
Get-AzCloudService -ResourceGroupName "testCosmosDB" # it gives no result.
Get-AzCloudService -ResourceGroupName "testCosmosDB" -CloudServiceName "testnameon" # as shown below.
The reason you're getting this error is because Az PowerShell module only support Cloud Services (Extended Support) and not Cloud Services (Classic).
One option for you is to migrate your classic Cloud Services to Cloud Services (Extended Support). You can learn more about the migration here: https://learn.microsoft.com/en-us/azure/cloud-services-extended-support/overview#migration-to-azure-resource-manager.
Another option (not sure if it is even viable) is to make use of really old version of Azure PowerShell (even before AzureRM) which has support for classic resources.

powershell azure find autoscale settings for classic vm

I have a lot of classic Azure services with classic VMs some have auto scale setting and some don't. Is there a way through powershell I can find out if a classic Azure services has AutoScale set or not. looking at Get-AzureService and Get-AzureVM does not seem to have this information
For now, classic service display in ARM resource group, so we can use this command Get-AzureRmAutoscaleSetting to list autoscale enable or no on-configure.
Get-AzureRmAutoscaleSetting -ResourceGroup jasonnew
If the cloud service autoscale is enable, we will get the result, if not, nothing will output.
Also, we can use Azure portal to get the information:

How to use Azure PowerShell to identify type of service?

I can use Azure Powershell to get a list of services from my subscription e.g. using Get-AzureService.
What I can't currently easily work out is how to tell if the service is a VM (new or classic) or a cloud service (web/worker role).
What I am currently doing to identify a cloud service is using Get-AzureDeployment on the service-name and looking for a non-empty SdkVersion property but I feel this is a bit cludgy. Is there a better way?
Afaik there's no way to do this through the Get-AzureService without using (as you said) the Get-AzureDeployment.
You should be able to fetch the information using the new AzureResourcemanager cmdlets (Switch-AzureMode -Name AzureResourceManager) and using Get-AzureResource.
The ResourceId (in ARM mode) will give you a clue of what kind of provider it is.

Antimalware for Azure Cloud Service

I understand that there is way to enable Antimalware for Azure VM like below:
But I don't see such option when creating a Cloud Service.
There is a worker role running on Azure Cloud Service. The organization has a security rule of having Antimalware on the machines.
Does a Cloud Service by default contain antimalware?
I Wish Microsoft were better at documenting their stuff. It seems that AntiMalware extension is also avialable for Cloud Services, not only Virtual Machines. But this can only be understood from the PowerShell reference here. And another resource entirely for Extensions on Cloud Services.
A valid and working PowerShell Script can be found here:
Add-AzureAccount
# use Select-AzureSubscription in case your account has more than one
Select-AzureSubscription -SubscriptionName 'PUT HERE YOUR SUBSCRIPTION'
[System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument
# load the Antimalware extension configuration from external XML file
# The content of the XML needs to be:
# <AntimalwareConfig><AntimalwareEnabled>true</AntimalwareEnabled></AntimalwareConfig>
# ref.: http://msdn.microsoft.com/en-US/library/azure/dn771718
$XmlConfig.load('D:\tmp\AntiMalware.config')
Set-AzureServiceAntimalwareExtension -ServiceName "PUT HERE THE CLOUD SERVICE NAME" -AntimalwareConfiguration $XmlConfig

Windows Azure: how do I check the Virtual IP of my service?

I have a worker role that performs web scraping. I need to determine the IP from which it works when deployed on Azure. How do I do that?
If you need the public VIP address, that can be obtained from the Windows Azure management portal. It's on the dashboard for the selected Cloud Service (about half way down on the right).
You can use InstanceEndpoints property of the RoleInstance... you can get all role instances executing by using the RoleEnvironment class, and then find the role you are interested in.
RoleInstance.InstanceEndpoints Property - there is a sample showing all of this.
Using Azure PowerShell You can use like this -
Get-AzureRole -ServiceName "abc" -Slot "production" -InstanceDetails | select {$_.InstanceEndpoints[0].VIP }

Resources