How to ping to Azure VM.


Basically, ICMP protocol is not permitted through the Azure.

Therefore, you cannot ping to Azure VM.


Example.



There are several ways to achieve this goal.


Let me introduce 2 main methods as below.


1. Azure VPN Connection

 You can ping to VM through VPN connection.

 Configure a Point-to-Site connection to a VNet using the Azure portal


 


 


2. psping

 "psping" is the part of "Windows Sysinternals Suite".

Windows Sysinternals Download

 



Usage

psping [server]:[port]


ex. 

psing -n 1000 test-server.cloudapp.net:443




References.

Use port pings instead of ICMP to test Azure VM connectivity

https://blogs.msdn.microsoft.com/mast/2014/06/22/use-port-pings-instead-of-icmp-to-test-azure-vm-connectivity/


Windows Sysinternals

: https://technet.microsoft.com/en-gb/bb842062


Configure a Point-to-Site connection to a VNet using the Azure portal

https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-point-to-site-resource-manager-portal


Check Public IP Address


* What Is My IP Address.com - IPv4 / v6

http://whatismyipaddress.com/ds-check


* WHAT IS MY PUBLIC IP - IPv4

http://www.whatismypublicip.com/


* IP LOCATION - IPv4

https://www.iplocation.net/find-ip-address


* ip-adress.eu - IPv4

http://www.ip-adress.eu/


* What IP Me - IPv4 / v6

http://whatip.me/


* What Is My IPv6 Address?

http://www.whatismyipv6.com/





Microsoft Azure SQL Database Min/Max Pricing & Performance(DTU)


Region: West Europe

Current: Euro(€)

Pricing by: Monthly


* Minimum Pricing (Starting at)


- Basic: 4.09


- Standard: 12.24


- Premium: 380.37


- PremiumRS: 97.96



* Maximum Pricing (Starting at)

- Basic: 4.09


- Standard: 122.45


- Premium: 13,495.71


- PremirumRS: 784.27



* Pricing can be different according to the contract.


* It's not possible to set smaller data size than current database size.



References: 

SQL Database Pricing

 : https://azure.microsoft.com/en-us/pricing/details/sql-database/


SQL Database options and performance: Understand what's available in each service tier

 : https://docs.microsoft.com/en-us/azure/sql-database/sql-database-service-tiers


Explaining Database Transaction Units (DTUs) and elastic Database Transaction Units (eDTUs)

 : https://docs.microsoft.com/en-us/azure/sql-database/sql-database-what-is-a-dtu


https://dev.mysql.com/doc/refman/5.6/en/string-literals.html


Retrieve special character in MySQL.


ex.

DROP TEMPORARY TABLE IF EXISTS CharTest;

CREATE TEMPORARY TABLE CharTest

(value varchar(100));


INSERT INTO CharTest VALUES 

('ABXX'), ('ACYY'), 

('A%BXX'), ('A%CYY'), 

('A\\BXX'), ('A\\CYY'), 

('A''BXX'), ('A''CYY'),

('A/BXX'), ('A/CYY')

;


SELECT * FROM CharTest;

+-------+

| value |

+-------+

| ABXX  |

| ACYY  |

| A%BXX |

| A%CYY |

| A\BXX |

| A\CYY |

| A'BXX |

| A'CYY |

| A/BXX |

| A/CYY |

+-------+

10 rows in set (0.00 sec)


If you want to search data start with "A%".

It will not work properly as below.

SELECT * FROM CharTest where value like 'A%';

+-------+

| value |

+-------+

| ABXX  |

| ACYY  |

| A%BXX |

| A%CYY |

| A\BXX |

| A\CYY |

| A'BXX |

| A'CYY |

| A/BXX |

| A/CYY |

+-------+

10 rows in set (0.00 sec)



The result is exactly same data as start with "A".

So you need to use some escape sequence as below.

SELECT * FROM CharTest where value like 'A$%B%' ESCAPE '$';

+-------+

| value |

+-------+

| A%BXX |

+-------+

1 row in set (0.00 sec)


SELECT * FROM CharTest where value like 'A\\B%' ESCAPE '$';

+-------+

| value |

+-------+

| A\BXX |

+-------+

1 row in set (0.00 sec)


SELECT * FROM CharTest where value like 'A''B%';

+-------+

| value |

+-------+

| A'BXX |

+-------+

1 row in set (0.00 sec)


SELECT * FROM CharTest where value like 'A/B%';

+-------+

| value |

+-------+

| A/BXX |

+-------+

1 row in set (0.00 sec)


As you can see, "/" is not a special character.


##1. Concat String with delimiter

 GROUP_CONCAT


https://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html


ex.

DROP TABLE IF EXISTS group_concat_test;

CREATE TABLE group_concat_test

(

  SEQ INT NOT NULL AUTO_INCREMENT,

  CITY VARCHAR(20),

  PRIMARY KEY `pk_group_concat_test` (SEQ)

) ENGINE = MEMORY;


INSERT INTO group_concat_test (CITY) VALUES ('Luxembourg') ,('London'), ('Seoul'), ('Paris');


SELECT GROUP_CONCAT(CITY) AS ALL_CITY_NAMES

FROM group_concat_test;


+-------------------------------+

| ALL_CITY_NAMES                |

+-------------------------------+

| Luxembourg,London,Seoul,Paris |

+-------------------------------+

1 row in set (0.00 sec)


SELECT GROUP_CONCAT(CITY SEPARATOR '#') AS ALL_CITY_NAMES

FROM group_concat_test;


+-------------------------------+

| ALL_CITY_NAMES                |

+-------------------------------+

| Luxembourg#London#Seoul#Paris |

+-------------------------------+

1 row in set (0.00 sec)


SELECT GROUP_CONCAT(CITY ORDER BY CITY SEPARATOR '$') AS ALL_CITY_NAMES

FROM group_concat_test;


+-------------------------------+

| ALL_CITY_NAMES                |

+-------------------------------+

| London$Luxembourg$Paris$Seoul |

+-------------------------------+

1 row in set (0.00 sec)


DROP TABLE IF EXISTS group_concat_test;



##2. Split String Array using specific delimiter


#Create a procedure and call.

DELIMITER $$

DROP PROCEDURE IF EXISTS usp_split_array_test$$

CREATE PROCEDURE usp_split_array_test(

  iValueArray   VARCHAR(100) # Input array value ex) 'value1, value2, value3'

  ,iDelimiter   CHAR(1)      # Delimiter

)

BEGIN

  DECLARE vValueArry VARCHAR(100);

  DECLARE vValue VARCHAR(10);

  DECLARE vDelimiter CHAR(1);

  

  SET vDelimiter := iDelimiter; #Variable for delimiter

  IF IFNULL(vDelimiter,'') = '' THEN

    SET vDelimiter := ',';

  END IF;

  

  SET vValueArry := iValueArray; #Variable for split work

  IF RIGHT(vValueArry,1) != vDelimiter THEN

    SET vValueArry := CONCAT(vValueArry,vDelimiter); # 'value1, value2, value3' --> 'value1, value2, value3,'

  END IF;

  

  DROP TEMPORARY TABLE IF EXISTS temp_split_array;

  CREATE TEMPORARY TABLE temp_split_array

  (

    SEQ INT NOT NULL AUTO_INCREMENT,

    VALUE VARCHAR(20),

    PRIMARY KEY `PK_temp_split_array` (SEQ)

  ) ENGINE = MEMORY;


  #SET @vValueArry := 'value1, value2, value3,'

  WHILE (LOCATE(vDelimiter, vValueArry) > 0)

  DO

      SET vValue := LEFT(vValueArry, LOCATE(vDelimiter,vValueArry) - 1);    

      SET vValueArry := SUBSTRING(vValueArry, LOCATE(vDelimiter,vValueArry) + 1);

      INSERT INTO temp_split_array (SEQ, VALUE)

      VALUES (null, vValue);

  END WHILE;


  SELECT * FROM temp_split_array;


  DROP TEMPORARY TABLE IF EXISTS temp_split_array;

END$$

DELIMITER ;


CALL usp_split_array_test('Luxembourg,London,Seoul,Paris', ',');


+-----+------------+

| SEQ | VALUE      |

+-----+------------+

|   1 | Luxembourg |

|   2 | London     |

|   3 | Seoul      |

|   4 | Paris      |

+-----+------------+

4 rows in set (0.00 sec)


CALL usp_split_array_test('Luxembourg;London;Seoul;Paris', ';');


+-----+------------+

| SEQ | VALUE      |

+-----+------------+

|   1 | Luxembourg |

|   2 | London     |

|   3 | Seoul      |

|   4 | Paris      |

+-----+------------+

4 rows in set (0.01 sec)






+ Recent posts