Welcome to Microsoft Q&A, i hope you are doing great!
Thank you for reaching out with your query.
The behavior you're experiencing, where the JIT (Just-In-Time) access creates a rule for port 6516 but not for port 3389. can occur due to the way the JIT policy is configured or how the portal initiates those rules. Here are some steps and clarifications to help you troubleshoot and resolve the issue:
1. Check JIT Policy and Security Group Rules:
- Confirm that your Network Security Group (NSG) attached to the VM or subnet allows inbound RDP traffic on port 3389.
The JIT feature depends on the NSG rules to create the temporary rules. If port 3389 is not allowed or blocked, the system might not create or open it.
2. Validation of JIT Request and Rules:
- When requesting JIT access:
- The portal may sometimes automatically open a temporary port (such as 6516 if configured), especially if custom port mappings are involved.
- Verify that in the Azure Security Center / Azure Monitor logs, the JIT request attempts to open port 3389.
3. Difference in Behavior Between Users:
- The user where both rules are created might have different NSG configurations, existing rules, or JIT policies.
- Double-check the JIT policies assigned to your VM in Azure Security Center to ensure port 3389 is included in the allowed ports.
4. Manual Creation of RDP Rule:
- Since you need manual rules for port 3389:
- You can add a temporary inbound security rule to allow port 3389 on the NSG.
- After RDP is complete, remove or disable this rule to maintain security.
5. About the NIC Reset and Private IP Change:
- The 'Reset-Nic' command resets the NIC, which can cause the private IP address to change.
- To assign a fixed IP:
- Set a static IP address in your subnet settings in the Azure portal.
- You can reconfigure the NIC to have a specific private IP again, avoiding changes during resets.
6. Additional Recommendations:
- Check the JIT configuration in Azure Security Center: Make sure that port 3389 is explicitly included as an allowed port for your JIT policy. Use Azure Activity Log to review JIT requests and confirm if port 3389 is being attempted to open. You may also consider updating the JIT policy temporarily to explicitly include port 3389 if it is missing.
If you continue to experience issues or need further guidance on configuring JIT policies or NSGs, feel free to ask!
If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A.
Thanks,
Harish.