Recently working on a pipeline, I wanted to restore multiple transaction log backups on a MS SQL server. The files were located under R:\files\incremental.
You can use below powershell in order to do the restore automatically.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The above powershell will try to restore the X transaction log in the database. If the one is already restored, it will skip, else the log will be restored.
In this article I will explain how you can build your nodeJS application on Azure Devops. For the purposes of this demo I have created a hello world javascript application and stored it under a folder called node inside my repository with the name project.
We will use the folder structure later on for the build tasks.
The node folder contains two files, index.js and package.json.
The package.json file has been created automatically after initialization of a new project with
npm init
In order to build this project using npm you should define under the scripts section the commands that will be executed using a specific target.
For example in order to compile application I will execute
npm run build
but the build instructions have to be configured under the package.json file.
As shown above, the build and dev targets have a simple node command that will start the application.
The index.js file is a console output javascript command.
console.log("Hello from node js app");
In order to build this node app using devops I will use the build in Npm@1 task. First I will execute the install command in order to install dependencies. Then I will run npm run with the target build. This will execute the node index.js command and will execute the node application.
For some data processing scenarios I had to create an automation that would download some files from a storage account, perform actions on them (python, custom tools) and lastly upload the processed files again in the storage account.
A high level diagram is visible below:
In order to automate this scenario I used a custom devops agent on azure devops and assigned a managed identity on this agent (virtual machine) on the storage account in order to interact with it without using credentials.
Then I only used powershell and az cli to download and upload the files on the storage account.
The three pipeline tasks that are required to perform the upload, processing, download actions can be found below.
The json object is used to download a specific file based on the requirements for example the first entry on chronological order. This is why the sort-object-descending is used.
Most times you will need to store logs for your azure resources in order to troubleshoot when things do not work as expected. Diagnostic settings for an app service can be enabled from the pane under Monitoring.
Then you should configure the diagnostic settings that will point which logs should be forwarded.
You can choose from the available categories shown below.
Lets now discover how we can enable diagnostic settings for an app service using terraform.
Create a file for example diagnostic_settings.tf and apply. The below configuration will enable all diagnostic settings categories.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here:
Cookie Policy