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
REM login to azure interactively | |
az login | |
REM Create the linux azure vm with ubuntu distribution | |
az vm create \ | |
--resource-group myResourceGroups \ | |
--name ubuntu-vm-lts \ | |
--image UbuntuLTS \ | |
--admin-username azureuser \ | |
--generate-ssh-keys |
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
ssh azureuser@public-ip | |
REM Use the following command to check the SSH debug trace | |
ssh -vvv azureuser@public-ip |
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
//Create a CTS to launch a task in charge of renewing the message lock | |
var brokeredMessageRenewCancellationTokenSource = new CancellationTokenSource(); | |
try { | |
var brokeredMessage = _client.Receive(); | |
var brokeredMessageRenew = Task.Factory.StartNew(() => { | |
while (!brokeredMessageRenewCancellationTokenSource.Token.IsCancellationRequested) { | |
//Based on LockedUntilUtc property to determine if the lock expires soon | |
if (DateTime.UtcNow > brokeredMessage.LockedUntilUtc.AddSeconds(-10)) { |
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
static void Main(string[] args) { | |
try { | |
string sbconnectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"]; | |
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect; | |
var namespaceManager = NamespaceManager.CreateFromConnectionString(sbconnectionString); | |
var src_queueName = "source_queue"; | |
var dest_queueName = "destination_queue"; | |
// var dest_queueName = "destination_queue/$deadletterqueue"; | |
QueueClient src_queue = MessagingFactory.CreateFromConnectionString(sbconnectionString).CreateQueueClient(src_queueName, ReceiveMode.ReceiveAndDelete); | |
QueueClient dest_queue = MessagingFactory.CreateFromConnectionString(sbconnectionString).CreateQueueClient(dest_queueName, ReceiveMode.ReceiveAndDelete); |
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
REM Use az cli version 2.14.0 | |
REM Log in to Azure and authenticate interactively | |
az login | |
REM Create the Azure linux vm with default public key id_rsa.pub | |
REM The resource group myResourceGroups should exists else create it | |
az vm create ^ | |
--resource-group myResourceGroups ^ | |
--name ubuntu-vm-20102020 ^ | |
--image UbuntuLTS ^ |
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
ssh azureuser@public-ip | |
REM Use the following command to check the SSH debug trace | |
ssh -vvv azureuser@public-ip | |
REM Connect to the vm using the ubuntu private key located under .ssh directory | |
ssh -i .ssh\ubuntu azureuser@public-ip |
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
REM Create a key-pair in .ssh folder with id_rsa and id_rsa.pub names | |
ssh-keygen | |
REM Create a key-pair in .ssh folder with ubuntu and ubuntu.pub names | |
ssh-keygen -f .ssh\ubuntu |
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
REM Log in to Azure and authenticate interactively | |
az login | |
REM Create the Azure linux vm with Ubuntu LTS distro | |
REM The resource group myResourceGroups should exists else create it | |
az vm create ^ | |
--resource-group myResourceGroups ^ | |
--name ubuntu-vm-21102020 ^ | |
--image UbuntuLTS ^ | |
--admin-username azureuser ^ |
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
REM Log in to Azure and authenticate interactively | |
az login | |
REM Create the Azure linux vm with Ubuntu LTS distro | |
REM The resource group myResourceGroups should exists else create it | |
az vm create ^ | |
--resource-group myResourceGroups ^ | |
--name ubuntu-vm-22102020 ^ | |
--image UbuntuLTS ^ | |
--admin-username azureuser ^ |
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
#!/bin/bash | |
# Check the status of the SSH daemon service | |
systemctl status sshd |