.NET Fiddle

CSharp · Console

/Program.cs

using System;
					
public class Program
{
    public static void Main()
    {
		var tenantId = "bea81f24-5073-4f1d-98bc-1f803bb7213c"; //replace with your tenantID
        // The GUID to be converted
        Guid guid = new Guid(tenantId);

        // Convert GUID to byte array
        byte[] byteArray = guid.ToByteArray();

        // Encode byte array to Base64 URL-safe string
        string base64Url = Convert.ToBase64String(byteArray)
                              .Replace('+', '-')
                              .Replace('/', '_')
                              .TrimEnd('=');

        Console.WriteLine(base64Url);
    }
}
;