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

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

Related

Azure - Run bicep from registry via ARM REST api

I'm looking into publishing bicep templates to a Bicep registry (ACR), and then deploying them via the ARM REST api. However the REST create deployment api only allows me to specify a templateSpec - I don't see any way to reference an ACR url. Is this possible, or do I need to use template specs for this?
For context, I need to create an automated service that can deploy resources when a particular event happens, e.g. add new customer -> spin up Azure resources xyz. Having my service use the REST api seems reasonable, and I'd prefer to use the bicep registry over template specs.
Currently Content in the Bicep module registry can only be deployed from another Bicep file. Template specs can be deployed directly from the API, Azure PowerShell, Azure CLI, and the Azure portal. You can even use UiFormDefinition to customize the portal deployment experience.
You can refer to this documentation for more information.

My Dashboard in Azure for App Services outage

I am working on a custom Dashboard in Azure. My Application is hosted in an APp Service. If App services is down at Microsoft end, i want to show a Red Dot in my dashboard.
KUSTO will work here?
Some API calls i need to do and some Programming to create dashboard?
Please guide me
You can create the Azure dashboard using template deployment in which Azure offers the ability to orchestrate the deployment of multiple resources.
Once the required resources for Azure Dashboard can be configured in template ARM template format, you can deploy using REST APIs, PowerShell, Azure CLI and Azure Portal template deployment.
This Microsoft Documentation helps you to create the Azure Dashboard using the Sample Templates given.
You can enable Health checks for your App Service using Azure Monitor App and that you can bring on Azure Dashboard to see your app service is up or down in the form of graph.
Source: Azure Service Health Dashboard

How to automatically create a service connection in azure devops?

I would like to automatically create a service connection in azure devops. Ideally either with terraform or azure cli. I would like to do this as part of an azure devops pipeline using 1 of the above methods. Is this possible? If so how? ... I did not see any docs talking about this but it seems like you should be able to do it instead of using the UI. Thanks in advance.
You can automatically create a service connection using the az cli and the az devops service-endpoint command. Use an Azure CLI task to use this in an Azure DevOps pipeline.
Alternatively, in Terraform, you can use azuredevops_serviceendpoint_azurerm

Azure Deployment in VSTS with ARM Storage

Is there components that Will be able to deploy a project to Azure with ARM storage?
Currently, We are using "Azure Deployment" with Azure Classic, that is working properly.
But, in that components We can'T select the ARM subscription, just only the classic one.
Do you have any information about that?
Maybe the ARM template will be the solution?
Thanks
Cloud Services can only be associated with classic storage accounts.
More information, you can refer to: How to create and deploy a cloud service.
So, you need to use Azure Deployment step/task with Azure Classic.

How to create an Azure Website programmatically using Azure PowerShell commands in C#?

I found all Azure Management Cmdlets here:
Windows Azure Management Cmdlets.
My question is how can I use these cmdlets in C# to create, remove and deploy an Azure Website?
Windows Azure managemnet cmdlets have been updated and now it includes web site creation. Check it here.
Without azure login we can not fire any command. We can Create Website in following steps.
Login to AzureAccount (Add-AzureAccount)
Setup The Azure Subscription (Get-AzureSubscription)
Select Azure Subscription (Select-AzureSubscription -Name AzureSubName)
Then We Can Deploy Azure site here
Ref to deploy site : http://blogs.msdn.com/b/cdndevs/archive/2015/04/23/azure-powershell-azure-websites-for-the-command-line-junkies-part-1.aspx
Here is a link to the samples from my book, PowerShell for Developers.
This example embeds the PowerShell engine in a C# application. You can then call the Azure PowerShell cmdlets and/or external PowerShell scripts that contain the workflow that you develop.
http://goo.gl/4kiYa

Resources