Back to docs
Azure

SDK & CLI usage — per service

Azure Swagger ›All consoles ›

Point unmodified Azure tools at this simulator at http://192.168.252.7:9000 — no real credentials needed. Snippets are copy-paste ready (your live host is filled in) and mirror the conformance harness in tests/conformance/.

Virtual Machines (Microsoft.Compute)Blob Storage (Microsoft.Storage)SQL Database (Microsoft.Sql)Service Bus (Microsoft.ServiceBus)Cosmos DB (Microsoft.DocumentDB)Functions (Microsoft.Web)API Management (Microsoft.ApiManagement)Virtual Network (Microsoft.Network)Entra ID / RBAC (Microsoft.Authorization)
Connect (one-time setup)

az CLI — register the simulator as a custom cloud

bash
# Point az at the simulator's ARM endpoint, then use a throwaway login.
az cloud register -n CloudLearn \
  --endpoint-resource-manager "http://192.168.252.7:9000" \
  --endpoint-active-directory "http://192.168.252.7:9000" \
  --endpoint-active-directory-resource-id "http://192.168.252.7:9000"
az cloud set -n CloudLearn
# The simulator ignores credentials — any login (or none) works.
export SUB="00000000-0000-0000-0000-cloudlearn01"   # default subscription
export RG="cloudlearn-rg" 

curl — raw ARM REST

bash
# Every ARM call needs ?api-version=. Auth is faked.
curl -s "http://192.168.252.7:9000/subscriptions/00000000-0000-0000-0000-cloudlearn01/resourceGroups/cloudlearn-rg/providers/Microsoft.Compute/virtualMachines?api-version=2023-09-01" 

Java — fake credential + custom AzureEnvironment

java
// com.azure.resourcemanager:azure-resourcemanager + azure-identity
TokenCredential cred = req -> Mono.just(
    new AccessToken("fake", OffsetDateTime.now().plusHours(1)));
AzureEnvironment env = new AzureEnvironment(Map.of(
    "resourceManagerEndpointUrl", "http://192.168.252.7:9000/",
    "activeDirectoryEndpointUrl", "http://192.168.252.7:9000/",
    "managementEndpointUrl", "http://192.168.252.7:9000/"));
AzureProfile profile = new AzureProfile("tenant", "00000000-0000-0000-0000-cloudlearn01", env);

Go — fake credential + custom cloud config

go
import ("github.com/Azure/azure-sdk-for-go/sdk/azcore"; "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm";
        "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud")
cfg := cloud.Configuration{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
  cloud.ResourceManager: {Endpoint: "http://192.168.252.7:9000", Audience: "http://192.168.252.7:9000"}}}
opts := &arm.ClientOptions{ClientOptions: azcore.ClientOptions{Cloud: cfg}}
// cred: a fake azcore.TokenCredential returning any token (sim ignores it).
Per-service examples (CLI · Java · Go)

Virtual Machines (Microsoft.Compute)

az CLI

bash
az vm list -g $RG
az resource create -g $RG -n vm-demo --resource-type Microsoft.Compute/virtualMachines \
  --api-version 2023-09-01 --properties '{"hardwareProfile":{"vmSize":"Standard_B1s"}}'

Java

java
ComputeManager compute = ComputeManager.authenticate(cred, profile);
compute.virtualMachines().listByResourceGroup("cloudlearn-rg")
    .forEach(vm -> System.out.println(vm.name()));

Go

go
vmc, _ := armcompute.NewVirtualMachinesClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := vmc.NewListPager("cloudlearn-rg", nil)
page, _ := pager.NextPage(ctx)   // page.Value = []*VirtualMachine

Blob Storage (Microsoft.Storage)

az CLI

bash
az storage account list -g $RG
az resource create -g $RG -n stdemo --resource-type Microsoft.Storage/storageAccounts \
  --api-version 2023-01-01 --properties '{}' --location eastus

Java

java
StorageManager storage = StorageManager.authenticate(cred, profile);
storage.storageAccounts().listByResourceGroup("cloudlearn-rg")
    .forEach(a -> System.out.println(a.name()));

Go

go
sac, _ := armstorage.NewAccountsClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := sac.NewListByResourceGroupPager("cloudlearn-rg", nil)

SQL Database (Microsoft.Sql)

az CLI

bash
az sql server list -g $RG
az resource create -g $RG -n sql-demo --resource-type Microsoft.Sql/servers \
  --api-version 2023-05-01-preview --properties '{"administratorLogin":"sqladmin"}'

Java

java
SqlServerManager sql = SqlServerManager.authenticate(cred, profile);
sql.sqlServers().listByResourceGroup("cloudlearn-rg").forEach(s -> System.out.println(s.name()));

Go

go
sc, _ := armsql.NewServersClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := sc.NewListByResourceGroupPager("cloudlearn-rg", nil)

Service Bus (Microsoft.ServiceBus)

az CLI

bash
az servicebus namespace list -g $RG
az servicebus queue list -g $RG --namespace-name sb-cloudlearn

Java

java
ServiceBusManager sb = ServiceBusManager.authenticate(cred, profile);
sb.namespaces().listByResourceGroup("cloudlearn-rg").forEach(n -> System.out.println(n.name()));

Go

go
nc, _ := armservicebus.NewNamespacesClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := nc.NewListByResourceGroupPager("cloudlearn-rg", nil)

Cosmos DB (Microsoft.DocumentDB)

az CLI

bash
az cosmosdb list -g $RG
az resource create -g $RG -n cosmos-demo --resource-type Microsoft.DocumentDB/databaseAccounts \
  --api-version 2024-05-15 --properties '{"databaseAccountOfferType":"Standard"}'

Java

java
CosmosManager cosmos = CosmosManager.authenticate(cred, profile);
cosmos.databaseAccounts().listByResourceGroup("cloudlearn-rg").forEach(a -> System.out.println(a.name()));

Go

go
cc, _ := armcosmos.NewDatabaseAccountsClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := cc.NewListByResourceGroupPager("cloudlearn-rg", nil)

Functions (Microsoft.Web)

az CLI

bash
az functionapp list -g $RG
az resource create -g $RG -n fn-demo --resource-type Microsoft.Web/sites \
  --api-version 2023-12-01 --properties '{}' --location eastus

Java

java
AppServiceManager web = AppServiceManager.authenticate(cred, profile);
web.functionApps().listByResourceGroup("cloudlearn-rg").forEach(f -> System.out.println(f.name()));

Go

go
wc, _ := armappservice.NewWebAppsClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := wc.NewListByResourceGroupPager("cloudlearn-rg", nil)

API Management (Microsoft.ApiManagement)

az CLI

bash
az apim list -g $RG
az resource show -g $RG -n apim-cloudlearn --resource-type Microsoft.ApiManagement/service \
  --api-version 2023-05-01-preview

Java

java
ApiManagementManager apim = ApiManagementManager.authenticate(cred, profile);
apim.apiManagementServices().listByResourceGroup("cloudlearn-rg").forEach(s -> System.out.println(s.name()));

Go

go
ac, _ := armapimanagement.NewServiceClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := ac.NewListByResourceGroupPager("cloudlearn-rg", nil)

Virtual Network (Microsoft.Network)

az CLI

bash
az network vnet list -g $RG
az resource create -g $RG -n vnet-demo --resource-type Microsoft.Network/virtualNetworks \
  --api-version 2023-11-01 --properties '{"addressSpace":{"addressPrefixes":["10.0.0.0/16"]}}'

Java

java
NetworkManager net = NetworkManager.authenticate(cred, profile);
net.networks().listByResourceGroup("cloudlearn-rg").forEach(v -> System.out.println(v.name()));

Go

go
vnc, _ := armnetwork.NewVirtualNetworksClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := vnc.NewListPager("cloudlearn-rg", nil)

Entra ID / RBAC (Microsoft.Authorization)

az CLI

bash
az role assignment list -g $RG
az role assignment create --role Contributor --assignee [email protected] \
  --scope /subscriptions/$SUB/resourceGroups/$RG

Java

java
AuthorizationManager authz = AuthorizationManager.authenticate(cred, profile);
authz.roleAssignments().listByResourceGroup("cloudlearn-rg").forEach(r -> System.out.println(r.name()));

Go

go
rac, _ := armauthorization.NewRoleAssignmentsClient("00000000-0000-0000-0000-cloudlearn01", cred, opts)
pager := rac.NewListForResourceGroupPager("cloudlearn-rg", nil)