Re-register own MFA guest account in Microsoft Azure

Provided you still have access to the original/old MFA device or it was originally configured to allow SMS MFA login, these instructions worked for me.

Log in to https://myapplications.microsoft.com using your ‘normal’ tenancy credentials.

Select your own profile badge in the circle in the top right corner of the screen and choose ‘Switch organization’ to log into the guest tenancy you want to reconfigure. Use the MFA authentication on the original/old device.

Now, in the guest tenancy, select your badge again in the top right corner of the screen, and choose ‘My Profile / Show Account’. Next, select ‘Security Credentials / Security Data’ and click on ‘Add Method’ (The URL ends with /security-info). Follow the procedure to add the new device.

Show result in Postman

Sometimes you would like result of the website in Postman. Most of the time setting up all the API Keys to connect with the site is a great hassle. If you only need a quick and dirty methode you can use the import function of Postman (if the site supports API the result should be readable). For this purpose you can use the copy to cURL methode from the network tab of the developper tools screen and then post the result to Postman (use the import raw text option)

Dit voorbeeld is van Chrome versie 96

LAST STEP!! Check if any previous steps failed SQL server agent

Imagine that you want multiple steps in one MSSQL agent job. Every step has to be executed (no matter what) and you will want to be informed if one of the steps failed.

First you need the guid of the job you are running.

SELECT TOP(1) 
 job_id
FROM 
 msdb.dbo.sysjobhistory jh
WHERE 
 step_name = '<pick a step name from your job'

After this you can put a last step in you job with the following code:

Don’t forget to change the text <PUT YOUR JOB GUID HERE!> to the GUID you got from the last step.

SET QUOTED_IDENTIFIER ON;
DECLARE @errorMsg nvarchar(max);

SELECT
 @errorMsg= 'The following steps failed, please investigate:' + LEFT(o.list, LEN(o.list)-1)
FROM (
 SELECT
 *
 FROM 
 msdb.dbo.sysjobhistory jh
 join msdb.dbo.sysjobactivity ja ON jh.job_id=ja.job_id
 WHERE 
 run_status=0 --step failed
 AND step_id != 0
 AND jh.job_id = CONVERT(uniqueidentifier, '<PUT YOUR JOB GUID HERE!>')
 AND convert(varchar(10),jh.run_date,112) = convert(varchar(10),getdate(),112)
 order by instance_id -- this sort off ensures that we just pull information from the most recent job run
 FOR XML PATH ('')

) o (list)

IF @errorMsg is null
 print ' Everything looks good...'
ELSE
BEGIN
 RAISERROR (@errorMsg, 16, 1)
END

Don’t forget to change the job steps so that all steps are going to the last step and the last step reports a success or a failure. Of course you also have to setup notification in the SQL Server Agent.

Deploy a project from Gitlab to Azure

  • Go to Advanced Tools -> click go and add /api/sshkey?ensurePublicKey=1 to the URL. You should get  a page starting with:
"ssh-rsa
  • Copy the whole content of the page except for the quotes “
  • Add a key in Gitlab inĀ  reposity -> deploy keys
  • Enter a descriptive title (only used in Gitlab to know which key belongs to which environment)
  • Paste the key just copied into the key field;
  • Add the website through the Deployment Center as you would normally do.

Done.

If you have multiple projects to get in one webapp you could use Deploy Tokens with an auth.json in the deployed directory:

{
    "gitlab-token": {
        "gitlab.com": "<key here>"
    }
}

(don’t forget to change the virtual path of the website)