Restart an instance of Azure Cloud Service using Azure CLI - azure

Is it possible to restart an instance of an Azure Cloud Service through the Azure CLI?
Azure CLI command reference here. I have seen options for restarting a vm, a vmss, a function app, a service fabric node and a web app.

Note: It is not possible to restart an instance of an Azure Cloud Services through Azure CLI.
As Walter said, you can use Azure CLI 1.0 to create and manage Azure Cloud Service, but you cannot restart an instance.
You may check the available options for Azure Cloud Service with Azure CLI 1.0:
Azure CLI Options for Cloud Services
You may use Azure PowerShell to restart an instance of an Cloud Services:
PS C:> ReSet-AzureRoleInstance -ServiceName "MySvc01" -Slot "Staging" -InstanceName "MyWebRole_IN_0" -Reboot

Is it possible to restart an instance of an Azure Cloud Service
through the Azure CLI?
Based on my knowledge, it is not possible.
Azure Cloud Service is a Classic mode service. However, Azure CLI 2.0 is optimized for managing and administering Azure resources from the command line, and for building automation scripts that work against the Azure Resource Manager. ASM/Classic mode is not supported in the Azure CLI 2.0. Please refer to this link.
Azure Cli 1.0 supports ASM mode and Cloud Service.

Related

What is the Azure equivalent of GCP's Cloud Run?

I'm looking for an equivalent to Cloud Run (GCP offering) in Azure
In particular:
It deploys a container
Can scale down to 0
Can serve a webapp
Does Azure have such a service?
I was looking at Azure App Service, but it seems to be missing the ability to scale down to 0.
Azure Container Apps is similar to CGP Cloud Run.
It deploys a container: yes
Can scale down to 0: yes
Can serve a webapp: yes
https://azure.microsoft.com/en-us/services/container-apps/
I think the equivalent of Cloud Run would be Azure Container Instances rather than Azure Container Apps.
I would say Azure Container Apps would be the equivalent of App Engine from Google Cloud which comes with more managed services around the served container like authentication, etc...

Can we create Azure Service Connection using any command/script/ARM Template?

I need to create Azure Service Connection, I can create the same using UI in Azure DevOps portal. But I need to know if I can create the same using some Az command or ARM Template or any Powershell script ?
Did you take a look at https://learn.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/create?view=azure-devops-rest-6.0 ?
Here, You can manage Azure services using Azure REST API.
You can create service endpoint via REST API or Azure DevOps CLI.
REST API:
POST https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?api-version=5.1-preview.2
Azure DevOps CLI:
az devops service-endpoint create

How to find backup policy details attached to a VM in Azure using Azure python SDK?

How can I fetch the VM backup policy details for VM running in Azure cloud using Azure python SDK?
Also, Is there any way we can fetch VM start/stop schedule?
In Azure portal, I can see backup policy detail inside VM operations section.

Deploy Azure Cloud Service using Azure Automation Powershell DSC

We are using Azure Automation DSC and were able to do simple things like create Automation account, create Resource group, VM creation and even able to deploy a web site on the target VM. All using powershell scripting.
How can we deploy Azure Cloud Services (web role / worker role)? what are the cmdlets? Any pointers? Please help.
What more things can be achieved using this? Moreover what limitations we can expect here.
Best Regards
Azure DSC is really focused on Azure's Infrastructure as a Service (IaaS) offering. Basically you can configure virtual servers (Windows and Linux) hosted on Azure.
To manage configurations for other services in Azure it is recommended to utilize Azure Resource Manager (ARM) which will allow you to define and configure Azure services in JSON.
Microsoft offers a lot of Quick Start ARM templates that can be accessed at the Azure Quickstart site.

How do I create Internal Load Balancer (ILB) using Azure Management SDK?

I want to configure an ILB for my Azure Cloud Service, similar to discussed in this article https://azure.microsoft.com/en-us/documentation/articles/load-balancer-internal-getstarted/
- but using the .Net SDK instead of powershell. (Also I have some conceptual confusion about the article/powershell maybe people will be able to explain. For VM scenario you have to explicitly create the ILB, but it seems like for cloud service you do not - is it already created, or automatically created? Why are New-AzureVM commandlets being used in a cloud service context?)
Documentation has been updated
https://azure.microsoft.com/en-us/documentation/articles/load-balancer-get-started-ilb-classic-cloud/
Or are you looking for a C# sample?
You should probably not be using cloud services. These are being deprecated. Just use v2 - Azure Resource Manager (portal.azure.com) and create a load balancer instead of a cloud service. Regardless, in v1 (Azure Service Management), when you create a VM, you automatically get a cloud service if you don't have one already - which is why new-azurevm is being used in cloud service context.

Resources