@Deepak Goyal Thanks for reaching out. Can you please confirm what do you mean by "visibility timeout"? Do you mean the message TTL, entity (queue/topic TTL) or the operation timeout while receiving/sending the message and in which language you want to do it programmatically?
Assuming that you want to set the message time to live when sending the message then you can leverage the Azure.Messaging.ServiceBus package in your dot net application.
For more details on different samples, you can refer to this document.
string connectionString = "yourservicebus connection string";
string topicName = "test";
var client = new ServiceBusClient(connectionString);
var sender = client.CreateSender(topicName);
var message = new ServiceBusMessage("Test Message");
//The below code set the TTL on message to 1 minute (expiry time utcnow + 1 minute expiry).
message.TimeToLive = TimeSpan.FromMinutes(1);
await sender.SendMessageAsync(message);
The TTL is max 14 days for service bus basic tier and for standard and premium namespace it is max integer value. You can find more details in this document.
Please "Accept Answer" if the answer is helpful so that it can help others in the community.