I understand that you want to know about Nat Gateway.
- Azure Nat Gateway is used for Internet Bound Communication not for the access the VM and can't be associate to the VM.
- It provides outbound internet connectivity for virtual machines without requiring public IP addresses on each VM
- It can be attached to subnet in the vnet.
If I create NAT gateway by taking public IP of my VM, can I able to access my VM with associated public IP address?
No.
If it is not able to access, how can I access if i configure NAT to my VM?
To access the VM, please use the Public IP for inbound access. Nat Gateway only used for the Outbound access to the internet.
Refer this link : https://learn.microsoft.com/en-us/azure/nat-gateway/faq
I hope it helps.
If above is unclear and/or you are unsure about something add a comment below.
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.