Importing schedules using the Rundeck API - rundeck

Is there a Rundeck API call for loading named schedules that can then be referenced in job definitions?
It can be done from the UI, but I have not found any information about doing it via the API.

On Rundeck Community, you can enable and disable job schedules following this and this endpoint. Here and here you can see good examples of how to use these endpoints.
But if you mean about project schedules feature it's exclusive of Rundeck Enterprise, and that is covered by the dedicated support team.

Related

VS Code - Alternative for Deploy To Azure Extension?

I used to use this MS VS Code extension (Deploy to Azure) to publish various webapps to Azure. I liked it particularly well because you could publish to a specific Deployment Slot (eg. Staging). Unfortunately, it's now been deprecated and no longer works. Are there any recommended alternative extensions that can accomplish the same task (deploying to a specific Azure slot)
As Per this GitHub-VSCode-Extensions-Update,
Hi! Please note that this extension is being deprecated and will be removed from VS code marketplace on 11 April 2022.
This also means that "Configure CI/CD Workflow" and "Browse CI/CD Workflows" option will no longer be available on Azure Kubernetes Service extension.
Please move your workloads away from the extension before 11 April 2022.
As an alternative, you may choose to use Starter workflows from GitHub to quickly onboard your application to GitHub Actions. You may alternatively choose to use Create file API to create a Actions workflow file and Secrets API to create pre-requisites deployment secrets.

Azure Pipelines Tasks - How to query available versions?

We have a situation where for stability reasons, we are locking some Tasks in our azure pipelines to specific versions.
For example, we might lock S3Upload#1.10.0 (from the AWS Task Toolkit) or PublishTestResults#2.180.0 (built-in task). We don't want these specific versions changing on us without doing a manual test pass on this pipeline.
However, there's no easy way to tell that a new version should be tested. Is there a comprehensive list of the task versions available in your account, or a way to ask via an API what the available versions of a task is? Ideally I could make an API call like _apis/tasks/S3Upload/versions and see what versions of that task are available for me to use in a pipeline.
(An API, query, or feed of some kind would allow us to gather up the changed tasks and queue them for a periodic manual test pass.)
Currently you can use Azure DevOps rest API to get the list of installed extensions (could be pipeline tasks).
You can find version in the response as shown below
"extensionId": "pr-multi-cherry-pick",
"extensionName": "PR Multi-Cherry-Pick",
"publisherId": "1ESLighthouseEng",
"publisherName": "Microsoft DevLabs",
"version": "1.0.0.64",
"registrationId": "204772b3-5f43-40f4-9c1b-c15c798f1544",

How to monitor VSTS agent availability

We have multiple on-site build agents attached to our VSTS instance, and would like to implement monitor their availability. That is, not just that their services are running, but also that they can connect to VSTS, since we have had some issues with the proxy previously.
I have checked the VSTS API documentation, but I couldn't find a call that would return whether a particular agent is online. Basically what I would need to do is integrate the green/red indicator that's available in VSTS when you go to the agent pool management page. I don't want to do web scraping, and I know I could check the agent log (and that's what I have in mind as last resort), but it would be good to have a prettier solution.
Does anyone have any ideas? Is there an API I missed? Or can you talk to the agent directly and ask it whether it is currently connected to VSTS?
You can use this api to get the status of agent:
https://XXX.visualstudio.com/_apis/distributedtask/pools/[pool id]/agents
A related thread: TFS 2015 api remove agent from pool with powershell

Best practice for scripting Azure resource creation

I'm creating a test environment in Azure. I want to have an accurate script of what of the configuration so it's easy to replicate for other test, pre-prod and prod environments later on. The environment has an existing subscription, and I want the entire hierarchy of resources from Resource Groups through to Web Apps to be created by script.
I'm currently rolling my own script in PowerShell utilising AzureRm. This is working well, but I can't help feel I'm reinventing the wheel. What is the existing method for creating an entire Azure environment by script?
Yes, that way is called Azure Resource Manager Templates. Quote:
With Resource Manager, you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state. When you create a solution from the portal, the solution automatically includes a deployment template. You do not have to create your template from scratch because you can start with the template for your solution and customize it to meet your specific needs. You can retrieve a template for an existing resource group by either exporting the current state of the resource group, or viewing the template used for a particular deployment. Viewing the exported template is a helpful way to learn about the template syntax.
Reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#template-deployment
Edit: you can use powershell, azure cli, azure cli2, azure sdk to deploy those templates (or simply Azure portal, search for "Template Deployment")

Deploy Website to Azure task Additional Arguments

When creating a new release definition in VSTS using the Azure Website Deployment template you get two tasks added automatically.
One of those tasks is the "Deploy Website to Azure". In that task there is a setting called "Additional Arguments". What is this setting for? And what does the defaults do?
-connectionString #{"$(ConnectionStringName)"="Server=tcp:$(ServerName).database.windows.net,1433;Database=$(DatabaseName);User ID=$(AdministratorLogin)#$(ServerName);Password=$(AdministratorLoginPassword);Trusted_Connection=False;Encrypt=True;"}
I have checked the docs at https://www.visualstudio.com/docs/overview but I can't find a single paragraph where someone talks about this feature. Google hasn't been of any help either unfortunately. I would appreciate it if someone could explain.
The Azure Web App Deployment task uses Publish-AzureWebsiteProject command to publish the web deployment package just as starain mentioned. With this command, you can specify the "-ConnectionString" argument to configure the connection strings in the deployment. The setting in the task is used to do this.
As soon as you create a release definition with "Azure Website Deployment", you will see this setting, and you will also see the related variables created if you select "Configure variables...":
You can then update the connection strings by update the value of these variables.
Based on this article: https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/AzureWebPowerShellDeployment/Publish-AzureWebDeployment.ps1, it uses Publish-AzureWebsiteProject command. https://msdn.microsoft.com/en-us/library/dn722468.aspx
The Additional Arguments is used for extra arguments that not included, for example, the -connectionstring argument, which is to use for the deployment.
You may want to consider utilizing the Deploy Azure RM Web App task instead as it provides more capabilities and leverages the Azure Resource Manager (ARM) APIs instead of the legacy Azure Service Management infrastructure. Both use Web Deploy for actual deployment of the application. Please note that to use the ARM-based tasks, you need to configure a Azure Resource Manager Service endpoint (link is in the documentation referenced)