Azure AzCopy and PowerShell Commands with Simple Examples
|
Command |
Simple example |
Purpose |
|---|---|---|
|
|
|
Copies a file to Azure Blob Storage. |
|
|
|
Copies all files and subfolders recursively. |
|
|
|
Synchronizes source and destination changes. |
|
|
|
Lists files and folders in a directory. |
|
|
|
Lists files and folders, including subfolders. |
|
|
|
Uploads a file to a Blob Storage container. |
|
|
|
Lists blobs in a container. |
|
|
|
Lists containers in a storage account. |
|
|
|
Creates a new blob container. |
|
|
|
Deletes a blob. |
|
|
|
Retrieves storage account details in a resource group. |
|
|
|
Creates a storage account. |
|
|
|
Signs in to Azure PowerShell. |
|
|
|
Lists accessible Azure subscriptions. |
|
|
|
Selects the active subscription. |
|
|
|
Lists resource groups. |
|
|
|
Lists virtual machines in a resource group. |
|
|
|
Starts a virtual machine. |
|
|
|
Stops a virtual machine. |
|
|
|
Restarts a virtual machine. |
Important points for AZ-104
-
AzCopy is a command-line utility for transferring data to and from Azure Storage.
-
--recursiveincludes files in subdirectories. -
azcopy syncsynchronizes differences; review deletion behavior before using it. -
Set-AzStorageBlobContentuploads files using Azure PowerShell. -
$ctxrepresents an Azure Storage context containing the required storage connection and authentication information. -
<SAS>is a placeholder for a valid Shared Access Signature; replace it with an appropriately scoped SAS token. Do not include the angle brackets.Windows Networking Commands – AZ-104 Quick Revision
Command
Sample Command
Purpose
ipconfigipconfigDisplays IP configuration for network adapters.
ipconfig /allipconfig /allDisplays detailed network settings, including DNS and MAC address.
ipconfig /releaseipconfig /releaseReleases the current DHCP-assigned IPv4 address.
ipconfig /renewipconfig /renewRequests a new DHCP IP address.
ipconfig /flushdnsipconfig /flushdnsClears the local DNS resolver cache.
ipconfig /displaydnsipconfig /displaydnsDisplays cached DNS records.
pingping google.comTests connectivity and measures response time.
tracerttracert google.comShows the network hops taken to reach a destination.
pathpingpathping google.comAnalyzes packet loss and latency across network hops.
nslookupnslookup google.comQueries DNS to resolve a domain name.
netstat -annetstat -anDisplays network connections and listening ports numerically.
netstat -anonetstat -anoDisplays connections, listening ports, and associated process IDs.
netstat -rnetstat -rDisplays the IPv4 and IPv6 routing tables.
arp -aarp -aDisplays the local ARP cache mapping IP addresses to MAC addresses.
route printroute printDisplays the computer's IP routing table.
route addroute add 10.10.0.0 mask 255.255.0.0 192.168.1.1Adds a route to a network through a specified gateway.
getmacgetmac /vDisplays MAC addresses of network adapters.
hostnamehostnameDisplays the computer's hostname.
curlcurl -I https://google.comSends an HTTP request and displays response headers.
telnettelnet server.example.com 443Tests TCP connectivity if the Telnet client is installed.
Test-NetConnectionTest-NetConnection google.com -Port 443Tests remote TCP connectivity and reports diagnostic details in PowerShell.
Get-NetIPConfigurationGet-NetIPConfigurationDisplays IP configuration using PowerShell.
Get-NetAdapterGet-NetAdapterLists network adapters and their status in PowerShell.
Get-NetRouteGet-NetRouteDisplays routing information in PowerShell.
Get-NetTCPConnectionGet-NetTCPConnectionDisplays current TCP connections in PowerShell.
Resolve-DnsNameResolve-DnsName google.comResolves DNS names using PowerShell.
Get-DnsClientCacheGet-DnsClientCacheDisplays cached DNS records in PowerShell.
netshnetsh interface ip show configDisplays or configures Windows network settings.
netsh wlan show interfacesnetsh wlan show interfacesDisplays wireless connection details.
netsh advfirewall show allprofilesnetsh advfirewall show allprofilesDisplays Windows Defender Firewall profile settings.
Important AZ-104 exam distinctions
Requirement
Command
Check VM IP address
ipconfig /allTest basic connectivity
ping <IP-address>Check DNS resolution
nslookup <domain>Test a specific TCP port
Test-NetConnection <host> -Port 443Check listening ports and connection states
netstat -anIdentify the process using a connection
netstat -anoFind the process name from a PID
tasklist /FI "PID eq 1234"Trace the route to a destination
tracert <hostname>Clear DNS cache
ipconfig /flushdnsInspect network routes
route printCheck network adapter status
Get-NetAdapterInspect DNS resolution details
Resolve-DnsName <domain>Remember:
pingtests ICMP connectivity, whileTest-NetConnection -Porttests TCP connectivity to a specific port. A failed ping does not necessarily mean the destination is unreachable because ICMP may be blocked by a firewall or network security rule.