Help us shape the future of Go! Take the 2026 Go Developer Survey

azurearm

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 64 Imported by: 0

README

Azurearm

Parity grade: B · SDK hashicorp/terraform-provider-azurerm@v4.81.0 · last audited 2026-09-12 (f973f0c90)

Coverage

Metric Value
PARITY entries audited 20 (15 ok, 2 partial, 3 gap)
Feature families 22 (22 ok)
Known gaps 69
Deferred items 3
Resource leaks clean
Known gaps
  • Storage RP account state (StorageProvider.accounts) does not survive a snapshot/restore cycle -- only InMemoryBackend's resource-group/generic-resource/provider-registration state is persisted (see ops.StorageAccountCRUD). Fix is additive: give StorageProvider its own Snapshot/Restore and wire it into Handler.Snapshot/Restore alongside the backend's.
  • ServiceBus RP state (ServiceBusProvider's namespaces/queues/topics/subscriptions maps) does not survive a snapshot/restore cycle either, the same known gap as StorageAccountCRUD above and for the same reason -- no ResourceProvider's own state is currently wired into Handler.Snapshot/Restore.
  • TestTerraform_Azure_ServiceBus (M9) could not be confirmed against a live tofu apply on this milestone's local macOS development sandbox, due to the same pre-existing host-OS-specific TLS-trust gap documented for M7/M8 (AZURE.md section 10.10) -- apply fails at ARM's own metadata-discovery call, before reaching any ServiceBus-specific code. Compensating verification: test/integration/azurearm_test.go's TestIntegration_AzureARM_ServiceBusLifecycleAndCrossServiceWiring exercises the identical ARM CRUD + cross-service-wiring path over plain HTTP and passed; wire-shape questions were answered by reading the pinned terraform-provider-azurerm/go-azure-sdk source directly. Should be re-confirmed against a green CI run (expected to work on Linux).
  • Token endpoint accepts any (or a missing) client_id/grant_type without validation and always issues a token; a malformed client_credentials request should arguably 400 with invalid_request/unsupported_grant_type per RFC 6749, matching AAD's own error shape more closely.
  • Direct-data-plane storage resources (azurerm_storage_container/_blob/_queue/_table) are covered as of M8 via the new services/azurestoragevhost virtual-hosted-style listener (AZURE.md section 10.8 finding (9)); azurerm_storage_share (File Share) remains out of scope -- no gopherstack file-share service exists.
  • Multi-account namespace isolation: all ARM-created storage accounts alias one shared Blob/Queue/Table container/queue/table namespace (services/azureblob/azurequeue/azuretable discard the account-name path segment entirely). Two ARM storage accounts see each other's containers. Deferred to M10 per AZURE.md section 10.4's original note; StorageAccounts.RegisterAccount/DeleteAccount (interfaces.go) is the forward-compat seam for that fix.
  • ARM error codes are a small hand-picked table (errors.go's errorDetails), not audited against ARM's full published error-code catalog the way services/sqs's errorDetails table has been over multiple audit passes.
  • management locks, Azure Policy, RBAC/Microsoft.Authorization, ARM template deployments (Microsoft.Resources/deployments), PATCH-merge semantics beyond full-replace, $filter/$expand and nextLink pagination on list operations, cross-subscription/cross-tenant, resource moves, What-If, and LRO polling are all explicitly out of MVP scope per AZURE.md section 10.1/10.3 -- not bugs, deliberate scope boundaries for this milestone.
  • Flexible servers: only the listed operations are modelled. PostgreSQL administrators (Entra), backups, migrations, virtual-network subnet usage, and MySQL updateConfigurations (batch), maintenances, logFiles, backupAndExport, advanced threat protection, Entra administrators, failover, detachVNet, resetGtid and private endpoint connections answer from the generic store or 404.
  • Flexible servers: replicas and point-in-time/geo restores are state-level (a copy of the source configuration and database list); under the docker engine they are refused with 400 InvalidParameterValue because a new container would start without the source data or the administrator password. Replication is not run.
  • Flexible servers: server parameter changes are stored, validated against a documented subset of parameters and flagged pending-restart, but are not applied to the docker engine; max_connections defaults follow the documented per-SKU tables for both engines, but the docker engine itself is not started with that value; the PostgreSQL max_connections range, every other parameter default/range/allowed value, and the MySQL storage IOPS formula (360 minimum, 3 per GiB) are not taken from a published table.
  • Flexible servers: firewall rules (including the 0.0.0.0 allow-Azure-services rule) are stored and validated but not enforced - the docker engine listens on loopback only; engines are not relaunched after a gopherstack restart or snapshot restore; the automatic restart of a stopped server (7 days for PostgreSQL, 30 days for MySQL per the Learn how-to pages), maintenance windows, HA failover, data encryption and Entra authentication are stored but not acted on.
  • Flexible servers: error codes and HTTP statuses outside stop/restart are unverified (no primary source documents them): name collision (409 Conflict), write during a pending operation, write to a stopped server, validation failures (400 InvalidParameterValue), and failed operations (InternalServerError). The busy-code spelling (SeverBusyWithOtherOperation vs ServerBusyWithOtherOperation) is documented one way and observed another.
  • Flexible servers: not modelled although documented - PostgreSQL Premium SSD v2 (storage up to 64 TiB in 1 GiB steps, terraform storage_type PremiumV2_LRS), PostgreSQL confidential-compute SKUs (terraform regex Standard_Cads_v5), PostgreSQL E6ds_v4, the PostgreSQL rule that a private DNS zone name must differ from the server name, MySQL storage IOPS pre-provisioning limits below the SKU maximum, and MySQL B1s IOPS (not published).
  • Flexible servers: no Terraform azurerm fixture (azurerm_postgresql_flexible_server, azurerm_mysql_flexible_server) yet; the SDK-driven tests are the only wire proof.
  • AKS: snapshots, machines, managedNamespaces, identityBindings, private endpoint connections, rotateServiceAccountSigningKeys and the agent pool abort are not modelled (the generic store keeps what is PUT).
  • AKS: node pools are metadata; no VMs back them and the k3s engine runs one server node regardless of pool counts.
  • AKS runCommand: with the engine the command runs in the k3s node (not in a pod) through /bin/sh with KUBECONFIG pointed at the node's own admin kubeconfig; kubectl is the k3s one, helm is not in the k3s image so helm commands exit 127; clusterToken is ignored; the context zip travels in an environment variable, so it is limited to 96 KiB of base64; logs are capped at 1 MiB and a command at 10 minutes (both unverified limits). Without the engine no node can schedule the command pod, so the command ends provisioningState failed with the reason Learn documents for that case (troubleshoot/azure/azure-kubernetes/resolve-az-aks-command-invoke-failures, Cause 1: KubernetesPerformanceError, 'Failed to run command due to cluster perf issue, container command- in aks-command namespace did not start within 30s on your cluster...', with the 32-hex command id); how the service places the code relative to the message in the result body, and whether it instead answers 404 Not Found as the same page's symptom table says, is unverified. Command results are kept per cluster (the newest 50) and a restored snapshot fails the ones that were running.
  • AKS abort: only operations the emulator runs for a while can be aborted - creating or updating a cluster with the engine on, start, and certificate rotation; the abort answers 202 after the operation has wound down, and 409 OperationNotAllowed when nothing runs (the 409 is documented, the code string is not). A cancelled create leaves the cluster in provisioningState Canceled without a node until the next PUT or start. Agent pool abort is not routed.
  • AKS rotateClusterCertificates: with the engine five fresh CAs (server, client, request-header, etcd peer and server) are generated, staged in the node and installed with k3s certificate rotate-ca --force (docs.k3s.io/cli/certificate: a new self-signed root needs --force), then the node is restarted and reissues every certificate under them, so listClusterUserCredential/AdminCredential return the new CA and the old one no longer verifies the API server (Learn azure/aks/certificate-rotation: rotating the cluster CA refreshes API server, kubelet and service account certificates; the real service also recreates nodes, up to 30 minutes of downtime). The static admin token is not rotated and pods are not restarted to trust the new root; without the engine the emulated CA and token are replaced, so kubeconfigs fetched earlier stop matching. The failure code ClusterCertificateRotationFailed is not from a primary source.
  • AKS resetAADProfile / resetServicePrincipalProfile: both exist in 2026-08-01 (resetAADProfile carries the deprecation warning in its description) and are accepted for every supported api-version. The profile is stored (serverAppSecret and the service principal secret are write-only); the refusals for an AKS-managed AAD cluster and for a cluster without a service principal (the spec says the latter is not allowed) use OperationNotAllowed, which is not from a primary source. No legacy AAD token validation happens.
  • AKS maintenanceConfigurations: validated against the 2026-08-01 schema (required durationHours 4-24, startTime, exactly one schedule type with the documented interval ranges, utcOffset and date formats, notAllowedDates/notAllowedTime ordering) and the Learn table of schedule types per name (default weekly only; aksManagedAutoUpgradeSchedule and aksManagedNodeOSUpgradeSchedule all four); the 400 code InvalidParameter, the rule that default needs a window or timeInWeek, that the aksManaged names refuse timeInWeek/notAllowedTime, and the utcOffset hour limit (14) are not from a primary source. Windows are stored and returned but never gate an upgrade; list is not paged.
  • AKS trustedAccessRoleBindings / trustedAccessRoles: bindings are stored with the 24-character name rule, at most 8 per cluster (Learn) and the rule that each role is / of the source resource's type; role names are not checked against a catalog and no ClusterRoleBinding is created in the node. The role catalog lists only the roles whose rules the API reference publishes (Microsoft.MachineLearningServices/workspaces reader); writer, mlworkload, backup-operator and the other documented roles are missing because their rules are not published. Error codes are unverified.
  • AKS engine state: the k3s data directory lives on a named volume (gopherstack-aks-), the node name is pinned and the join token is derived from the cluster, so stop/start, a snapshot restore and a restart with persistence on all resume the same cluster state; a running node left by a crashed gopherstack is adopted by resource label (the data volume of a cluster that no longer exists is removed at restore). Without persistence a restart forgets the cluster, and creating a cluster of the same name discards the leftover volume. Runtimes that cannot keep stopped containers or create volumes keep state only while the container lives.
  • AKS: addon profiles, AAD, auto-upgrade, http proxy, security and storage profiles are stored and returned but not interpreted; the VM catalog and Kubernetes patch versions are representative subsets; the kubeconfig carries a bearer token only (no client certificates).
  • Container Apps: init containers, subPath mounts, NfsAzureFile volumes, additional TCP ports, exposedPort/TCP transport routing, session affinity, CORS, ipSecurityRestrictions enforcement, custom domains, Dapr runtime, probes and managed-identity registry pulls are stored but not run or enforced.
  • Container Apps: KEDA scale rules other than the http/tcp concurrency settings (queue, custom) are stored but never scale replicas; scale-out is driven by in-flight requests through the ingress.
  • Container Apps jobs: Schedule and Event triggers are stored and validated but never fire (only start runs an execution); replicaRetryLimit and replicaTimeout are not enforced.
  • Container Apps: restored revisions have no replicas until their first request (or a restart), even with minReplicas above 0.
  • Container Apps: getAuthtoken, listCustomHostNameAnalysis, diagnostics, authConfigs, daprComponents, certificates, sourcecontrols, javaComponents and sessionPools are not modelled (the generic store keeps what is PUT); the operation status URL is locations/{loc}/operations/{id} rather than the service's containerappOperationStatuses path.
  • Container Instances: interactive exec and attach need a websocket terminal session; both answer 501 NotImplemented.
  • Container Instances: not supported and rejected with 400 InvalidRequestContent: Windows containers (no Windows container runtime), GPUs (the ACI GPU preview is retired as of 2025-07-14 per Learn resource-and-quota-limits), confidential/dedicated SKUs, spot priority, encryption, extensions, UDP ports, init container securityContext.
  • Container Instances (unverified, no primary source found): the single-zone rule and the 1/2/3 zone values come from the ARM schema and memory of the zones article, which Learn no longer serves at the URL tried; dnsConfig requirements (at most 3 nameservers, no subnet needed) and the 400 text for subnet and probe validation are not confirmed; a group with zones accepts any location; init container restarts under Always/OnFailure retry forever instead of the platform's documented limits; Private addresses are still 127.0.0.1 and a delegated subnet is not reserved or checked for address space; diagnostics are stored but no logs are sent to Log Analytics; readiness gating drops connections rather than leaving them hanging; HTTP probes only reach loopback-published ports.
  • Container Instances: azureFile volumes are copied from the Azure Files share when the containers start and written back when a container exits and when the group stops or is deleted, not synchronized live; the storage account key is accepted without being checked.
  • Container Instances: the group address is 127.0.0.1 and ports are published on pool-assigned host ports (reported in a PortPublished event), not on the declared port numbers; Private addresses behave the same.
  • Container Instances: restarting a failed container under Never is not done (the platform may restart it); the restart back-off starts at 10s and caps at 5 minutes. Resource requests are validated but only limits are enforced, and per-group CPU/memory maxima are not checked.
  • Container Instances: sibling endpoints (locations/{loc}/usages, cachedImages, capabilities, the operations list, outboundNetworkDependenciesEndpoints, container group profiles) are not implemented; a restored snapshot brings groups back Stopped.
  • Network: not modelled (they stay in the generic metadata-only store): application gateways, firewalls, VPN/ExpressRoute, private link services, route filters, DDoS plans, service endpoint policies, flow logs, virtual network taps and every other Microsoft.Network type.
  • Network: load balancer, NAT gateway, prefix, ASG and private endpoint error codes are unverified recollections, not from a primary source (only the codes that already appear in Learn or the SDK, such as InvalidResourceReference and PublicIPAddressInUse, are known): PublicIPAndLBSkuDoNotMatch, LoadBalancingRuleFrontendPortConflict, InboundNatRuleFrontendPortConflict, InboundNatRuleInUse, InUseLoadBalancerChildCannotBeDeleted, NatGatewayHasTooManyPublicIps, NatGatewayPublicIpSkuMismatch, InUseNatGatewayCannotBeDeleted, InvalidPublicIpPrefixLength, PublicIPPrefixExhausted, PublicIPPrefixInUse, PublicIPPrefixSizeCannotBeChanged, PublicIPPrefixAddressSpaceExhausted, ApplicationSecurityGroupVirtualNetworkMismatch, InUseApplicationSecurityGroupCannotBeDeleted, PrivateEndpointGroupIdsInvalid, PrivateEndpointAndVnetLocationMismatch; PrivateEndpointCreationNotAllowedAsSubnetIsDelegated and LinkedInvalidPropertyId are recalled with more confidence. Default values for probes (interval 15, numberOfProbes 2, probeThreshold 1) and the Basic SKU default when sku is omitted are recalled.
  • Network: load balancing is control plane only (no traffic distribution, probe execution, SNAT or health state); Basic SKU availability set / same-virtual-network membership rules, Gateway SKU tunnel interfaces and chaining, cross-region (Global tier) backend rules, frontend zones against public IP zones, NAT gateway zone and StandardV2 SKU (rejected), NAT gateway versus Basic public IP or Basic load balancer conflicts, IPv6 load balancer frontends and the privateEndpointNetworkPolicies NSG/UDR behaviour are not modelled or enforced.
  • Network: private endpoints ignore cross-subscription authorization (a target in another subscription yields Pending), support static addresses only through ipConfigurations with groupId/memberName matching the group id, write A records for every customDnsConfig FQDN into every zone of a zone group without matching the zone name, allow more than one zone group per endpoint, do not turn a connection Disconnected when its target is deleted, and omit the Event Grid, Cosmos mongoClusters, Application Gateway, Private Link service and other private-link target types.
  • Network: the deletion rule for a backend pool or NAT rule that NICs still use is lenient: the NIC references are dropped rather than refused, while rule references are refused.
  • Network: IPv6 private addresses on NICs are rejected; IPv6 public addresses come from 2001:db8::/32. Subnet addressing with ipamPoolPrefixAllocations and NAT/gateway-subnet rules are not enforced (NICs report the virtualMachine and primary back-references of an attached Compute VM but never hostedWorkloads).
  • Network: GET operations/{id} is stateless (every id reports Succeeded); there are no failed or in-progress long-running operations. Error codes other than InUse*, PublicIPAddressCannotBeDeleted and InvalidResourceReference are not verified against Microsoft Learn (AddressSpaceOverlap, VnetAddressSpacesOverlap, SecurityRule*, PrivateIPAddress*, SubnetIsFull, InUseSubnetCannotBeUpdated, DnsRecordInUse).
  • Network: PUT of a virtual network without a subnets (or securityRules, routes) key keeps the stored children; an explicit empty array removes them. ARM replaces the set on any PUT.
  • Private DNS: auto-registration of NIC addresses into linked zones, one-registration-link-per-vnet and overlapping-namespace conflicts, zone deletion rules, $top paging of record sets by recordSetNameSuffix, and Microsoft.Network/dnszones (public DNS) are not implemented.
  • Compute: not modelled (they stay in the generic metadata-only store): proximity placement groups, capacity reservations, dedicated hosts, disk encryption sets and disk accesses, restore points, SSH public key resources, usages, the operations list, gallery sharing (share action, shared and community galleries, sharingProfile groups) and gallery applications.
  • Compute: virtual machines do not run; unmanaged (vhd) disks, inline networkInterfaceConfigurations, Spot eviction, boot diagnostics, maintenance, capture, reimage, reapply, convertToManagedDisks, attachDetachDataDisks and simulateEviction answer 501 NotImplemented or are rejected. Platform images are not looked up (any publisher/offer/sku with a latest or Major.Minor.Build version is accepted and exactVersion is not reported); the vmSizes catalog is a representative subset available in every location and zone.
  • Compute: disks accept Empty, FromImage, Copy and Upload; Import, ImportSecure, Restore and CopyStart are rejected, beginGetAccess/endGetAccess answer 501 (an Upload disk stays ReadyToUpload), and Ultra/Premium v2 IOPS limits, shared disks (maxShares), bursting, encryption sets and zone-versus-VM zone matching are stored but not enforced.
  • Compute: Uniform scale set instances are state records, so their network interfaces are not created in Microsoft.Network and subnets referenced by a Uniform scale set can still be deleted. Rolling upgrades, autoscale, scale-in policy (Flexible removes the newest machines first), Uniform per-instance power actions and instance-level PUT/PATCH are not implemented.
  • Compute extensions (unverified, recalled only): publisher, type and typeHandlerVersion are required on a VM extension (message text and 400 InvalidParameter are plausible), and a handler version is checked only for the catalog types (major version must exist); extension OS compatibility with the VM is not checked and handlers never execute, so instanceView only reports ProvisioningState/succeeded. protectedSettingsFromKeyVault is dropped like protectedSettings (whether the service echoes it is unverified). The extension image catalog lists only the documented types in rp_compute_ext.go with Major.Minor handler versions, handlerSchema is omitted.
  • Compute run commands: virtual machines run no agent, so POST runCommand validates commandId (unknown or wrong OS answers 404 'The entity was not found in this Azure location', the documented text; the code ResourceNotFound is unverified), script, and power state, then answers 409 OperationNotAllowed 'VM agent status is NOT READY' (the condition is documented, the code is unverified). Managed runCommands are stored (protectedParameters and runAsPassword dropped, at most 25 per VM) and report instanceView.executionState Unknown; locations/{l}/runCommands lists the documented command ids with their documented descriptions but labels equal the id, and locations/{l}/runCommands/{commandId} answers 501.
  • Compute images and galleries: replica counts have no upper bound (no primary source found), target region names are not checked against a region list and are stored lower-cased without spaces, ZRS availability per region, encryption sets, disk-image sources (blob and storage account sources are stored unchecked), gallery sharing, soft delete and the 100 galleries / 1000 definitions / 10000 versions per subscription and region limits are not enforced. Error codes for gallery messages quoted from learn.microsoft.com/azure/virtual-machines/troubleshooting-shared-images are unverified except PropertyChangeNotAllowed, and CannotDeleteResource, Conflict (duplicate identifier) and InvalidParameter are plausible. A managed image created from a virtual machine records osState from the generalize flag; whether the service refuses a running VM is unverified. VM creation does not check image and VM hyperVGeneration and checks managed image regions not at all.
  • Compute Flexible scale sets: scale-set-created machines are named {scaleset}_{8 hex}, NICs {machine}-{nic config}, and default to deleting NICs and OS disks with the machine (Learn documents auto-removal and the deleteOption choice but not the names); instanceIds for batch actions and the scale set VM list use the machine name; publicIPAddressConfiguration is rejected 501, a changed virtualMachineProfile applies only to machines created afterwards, machines added by hand are not counted in sku.capacity, upgradePolicy, automatic repairs, priority mix, standby pools and rolling upgrades are stored but not enforced, and platformFaultDomain is validated but machines are not spread across fault domains.
  • Compute: a virtual machine cannot be added to an availability set after creation (PropertyChangeNotAllowed) and an omitted availabilitySet, osProfile or storageProfile on update keeps the stored value. Network interfaces of a virtual machine in a removed resource group are released but a virtual machine whose NIC group is removed first keeps its dangling NIC reference.
  • Identity: container group zones are still rejected; managed-identity role assignments and token endpoints (IMDS) do not exist, so a system-assigned principal has no permissions to evaluate.
  • ManagedIdentity: listAssociatedResources, the identities/default scope and isolationScope are not implemented. Identity blocks (Compute, Web, Container Instances) resolve user-assigned identities by resource group and name, ignoring the subscription; deleting an identity that a resource still references is allowed and the reference then reports empty principalId/clientId.
  • API Management: not modelled - the built-in all-access (master) subscription and the starter/unlimited products, users, groups, tags, loggers, diagnostics, certificates, caches, identity providers, authorization servers, gateways (self-hosted), portal, schemas, API revisions/releases/version sets, wikis, issues, tenant settings, backup/restore, soft-delete/restore, custom hostnames, virtual networks, multi-region, private endpoints, v2 tiers (BasicV2, StandardV2) and the Isolated sku; they fall to 404 or are rejected. $filter, $top, $skip and nextLink paging are not implemented on the child lists.
  • API Management gateway: policies outside the subset (validate-jwt, quota, ip-filter, cache, choose, set-variable, send-request, authentication-, policy expressions, product-scope policies, on-error execution, rate-limit nested api/operation, forward-request http-version/continue-timeout/buffer-/fail-on-error-status-code, cors terminate-unmatched-request) are refused at PUT or not honoured; the backend section runs set-header/set-query-parameter/set-backend-service/forward-request in order and a chain with no forward-request answers an empty 200. The cors policy page gives two defaults for terminate-unmatched-request (false in the attribute table, true in the usage notes), so unmatched simple requests proceed without CORS headers. set-header on Connection, Content-Length, Keep-Alive and Transfer-Encoding is accepted but those headers are never forwarded (Learn: they cannot be changed).
  • API Management gateway: WebSocket and GraphQL APIs are served as plain HTTP passthrough (ws/wss serviceUrl answers 500); HTTP (non-TLS) calls are impossible because the ARM listener is HTTPS, so an API whose protocols exclude https answers 404; the gateway has no client-certificate, IP or JWT checks; failed upstream calls answer 502 where the real gateway answers 500 (unverified); the unknown-host 404 body Resource not found and the 503 body of a service that is still activating are gopherstack wording, not documented.
  • API Management (still unverified, no primary source found in azure-rest-api-specs 2022-08-01 examples, Learn, terraform-provider-azurerm or Azure/apiops): the error code strings of the 404 for missing children (ResourceNotFound here; the real service may use EntityNotFound), of the 409 for a taken service name, of the 409 for child writes during provisioning (apiops confirms 409 with code Conflict only for an in-progress API operation), of the 409 for a product delete with subscriptions and for exceeding a tier limit, and of the 400 for duplicate api path/operation/named-value; the maximum length of an operation method (20 here, spec gives none); template parameters being required to appear in the urlTemplate; the Activating/Updating durations (1s Consumption, 5s others here; real classic tiers take tens of minutes); the intermediate provisioningState seen by a GET between Created and Succeeded; publicIPAddresses (documented for Basic, Standard, Premium; real addresses cannot be invented, so it is omitted).
  • API Management: no SDK-to-Terraform fixture yet (azurerm_api_management*); armapimanagement-driven tests are the only wire proof, and only the 2022-08-01 shapes were checked.
  • Authorization: RBAC is not evaluated - role assignments and role definitions are stored, never consulted by ARM or any data plane (a Reader cannot be denied a write); there is no deny-assignment, PIM/eligibility/schedule, classic administrator, permissions-for-resource or provider-operations API, no management-group scope for locks, and management group scopes are accepted but never checked to exist.
  • Authorization: principals are not validated against a directory (the emulator has no AAD user/group/service-principal store): any GUID principalId is accepted; only a non-GUID answers PrincipalNotFound (code and text from Learn). Managed identities of this emulator are recognised only to default principalType.
  • Authorization (unverified, recalled only - no primary source found): the error codes InvalidRoleAssignmentId (non-GUID name), RoleAssignmentNotFound (GET of a missing assignment), RoleDefinitionDoesNotExist for GET (the text is documented, the 404 status is not), RoleAssignmentScopeNotAssignableToRoleDefinition, RoleDefinitionWithSameNameExists, RoleAssignmentExists and its text, LockNotFound, InvalidLockName, PolicyDefinitionNotFound, PolicySetDefinitionNotFound, PolicyAssignmentNotFound, InvalidPolicyRule, InvalidFilter and InvalidScope; the ScopeLocked text for a POST ('action') and the listing of several locked scopes; DELETE of a missing role assignment/lock/policy answering 204; assignedTo() semantics (modelled as at-or-above); the unfiltered list defaults (at and below).
  • Authorization: ScopeLocked enforcement covers the ARM listener only (not data planes, as documented); it does not model the documented exceptions where services act on locked resources, resource moves, or Microsoft.Authorization extension resources other than the lock itself inheriting a lock (role assignments and policy assignments do inherit it).
  • Authorization: role assignment conditions (ABAC) and conditionVersion are stored, not validated or evaluated; delegatedManagedIdentityResourceId is stored; assignment count limits are not enforced; the last-owner deletion guard does not exist; role definition assignableScopes are not checked to exist; list calls are not paged (no nextLink/$skipToken).
  • Policy: nothing is evaluated - no Deny/Audit/Modify/DeployIfNotExists effect runs, compliance and remediation, exemptions, policy versions, tokens and the allowed-locations deny are not implemented; policy parameters are not checked against the definition (missing required parameter, wrong type); deleting a definition referenced by an assignment or set is allowed; policyDefinitions is limited to a 13-definition and 1-initiative built-in catalog; the Policy Insights, remediation and Guest Configuration providers do not exist.
  • Authorization: azurerm_role_definition, subscription/management-group scoped policy assignments and policy set definitions have no Terraform fixture (test/terraform/azure/authorization_test.go covers azurerm_role_assignment by name and by id, azurerm_management_lock, azurerm_policy_definition, azurerm_resource_group_policy_assignment; applied, planned clean and destroyed against the docker harness on 2026-10-31, azurerm ~> 4.0).
Deferred
  • M7 initial implementation. No prior audit passes to report.
  • M9 added the Microsoft.ServiceBus RP (ServiceBusNamespaceCRUD/ServiceBusQueueTopicSubscriptionCRUD/ServiceBusAuthorizationRuleListKeys). QC pass over the pre-existing implementation found and fixed two real bugs before any Terraform run (List not filtering by resource group for queues/topics/subscriptions; DeleteResourcesInGroup's cascade delete never matching due to a double-pipe key-prefix bug) -- see AZURE.md section 10.10's M9 entry for full detail.
  • M9's first real-CI run (PR #2466, terraform-tests (6) job on Linux, past the macOS TLS-trust gap) surfaced a third real bug: classifyServiceBusPath had no case for namespaces/{ns}/networkRuleSets/default, which terraform-provider-azurerm's namespace Read calls unconditionally on every namespace regardless of SKU or config -- see ops.ServiceBusNamespaceNetworkRuleSet above and AZURE.md section 10.10's M9 entry for full detail. Checked queue/topic/subscription/authorizationRule Read functions in the same pinned source for the same class of unconditional sub-resource probe; none exists (each Read function only calls its own client.Get).

More

Documentation

Index

Constants

View Source
const (
	FunctionHostKeyTypeFunction = "functionKeys"
	FunctionHostKeyTypeSystem   = "systemKeys"
)

Host key collections ARM addresses as host/default/{keyType}.

View Source
const (
	ACIEngineAuto = "auto"
	ACIEngineNone = "none"
)

ACIEngineAuto runs container groups in the container runtime; ACIEngineNone fails them to provision.

View Source
const (
	AKSEngineStub   = "stub"
	AKSEngineDocker = "docker"
)

AKSEngineStub keeps managed clusters as ARM state; AKSEngineDocker runs each as a k3s container.

View Source
const (
	DBEngineStub   = "stub"
	DBEngineDocker = "docker"
)

DBEngineStub keeps flexible servers as ARM state; DBEngineDocker runs each as a real postgres or mysql container.

View Source
const (
	DefaultEventHubPort     = 10005
	DefaultEventHubAMQPPort = 5673
)

DefaultEventHubPort and DefaultEventHubAMQPPort are the Event Hubs REST and AMQP ports ARM advertises; they must equal services/azureeventhubs's defaults.

View Source
const DefaultAppConfigPort = 10008

DefaultAppConfigPort is the App Configuration data plane's HTTPS port ARM advertises; it must equal services/azureappconfig.DefaultPort.

View Source
const DefaultClientID = "00000000-0000-0000-0000-000000000000"

DefaultClientID is the fixed dev client (application) ID.

View Source
const DefaultClientSecret = "gopherstack"

DefaultClientSecret is the fixed dev client secret accepted by the token endpoint when validation is off (the default).

View Source
const DefaultContainerRegistryPort = 10011

DefaultContainerRegistryPort is the Container Registry data plane's port ARM advertises in loginServer; it must equal services/azurecontainerregistry.DefaultPort.

View Source
const DefaultCosmosDBPort = 8081

DefaultCosmosDBPort is the Cosmos DB data plane's default port, used for documentEndpoint when no data-plane adapter is wired; it must equal services/cosmosdb.DefaultPort.

View Source
const DefaultEnvironmentName = "gopherstack"

DefaultEnvironmentName is the environment name advertised by the metadata document; must equal the Terraform provider's own `environment` setting.

View Source
const DefaultEventGridPort = 10007

DefaultEventGridPort is the Event Grid data plane's HTTPS port ARM advertises; it must equal services/azureeventgrid.DefaultPort.

View Source
const DefaultGraphPort = 10014

DefaultGraphPort is the Microsoft Graph listener's HTTPS port ARM advertises as the environment's Graph endpoint; it must equal services/azuregraph.DefaultPort.

View Source
const DefaultKeyVaultPort = 10004

DefaultKeyVaultPort is the default port ARM's Microsoft.KeyVault RP advertises in vaultUri; it must equal services/azurekeyvault.DefaultPort.

View Source
const DefaultLocation = "local"

DefaultLocation is the default Azure "location" value used when a request doesn't specify one.

View Source
const DefaultPort = 10006

DefaultPort is the fixed TCP port for the dedicated ARM listener. It sits inside --port-range-start/--port-range-end's default range (10000-10100) and leaves Key Vault (10004, M11) and App Configuration (10005, M12) untouched -- see AZURE.md section 10.7.

View Source
const DefaultServiceBusPort = 10003

DefaultServiceBusPort is the default port ARM's Microsoft.ServiceBus RP advertises as serviceBusEndpoint (AZURE.md section 10.10's M9 entry). Mirrors DefaultStorageVHostPort's rationale for duplicating rather than importing services/azureservicebus.DefaultPort: this package has no other reason to depend on that package (rp_servicebus.go delegates through the narrow ServiceBusEntities interface, not a direct import), and importing it just for one int constant would be a needless coupling.

View Source
const DefaultStorageVHostPort = 10010

DefaultStorageVHostPort is the default port ARM's Microsoft.Storage RP advertises in primaryEndpoints (AZURE.md section 10.4/10.8). This intentionally duplicates services/azurestoragevhost.DefaultPort as a literal constant rather than importing that package: services/azurearm has no other reason to depend on it (no delegation happens here, see rp_storage.go), and importing a package just for one int constant would be a needless coupling for a documented, stable port number. Unlike the three separate per-service ports this replaced, there is only one port now: terraform-provider-azurerm's data-plane SDK requires Blob/Queue/Table to share a single domain suffix, which (since Go's url.URL.Host always includes the port) forces them onto a single shared port too -- see services/azurestoragevhost's package doc comment for the full derivation.

View Source
const DefaultSubscriptionID = "00000000-0000-0000-0000-000000000000"

DefaultSubscriptionID is the fixed dev subscription ID.

View Source
const DefaultTenantID = "00000000-0000-0000-0000-000000000000"

DefaultTenantID is the fixed dev AAD tenant ID. It, DefaultSubscriptionID, and DefaultClientID are all-zeros GUIDs, matching LocalStack's own Azure emulator convention: valid GUIDs (azurerm parses subscription_id/tenant_id as GUIDs) that are obviously not real Azure identifiers. See AZURE.md section 10.5.

Variables

View Source
var (
	ErrACIGroupNotFound     = errors.New("azurearm: container group not found")
	ErrACIContainerNotFound = errors.New("azurearm: container not found in the group")

	ErrACINotRunning = errors.New("azurearm: container has no logs: never started, or the group is stopped")
)

Sentinel errors returned by the engine.

View Source
var (
	ErrInvalidResourceID      = errors.New("azurearm: invalid resource ID")
	ErrResourceGroupNotFound  = errors.New("azurearm: resource group not found")
	ErrResourceNotFound       = errors.New("azurearm: resource not found")
	ErrSubscriptionNotFound   = errors.New("azurearm: subscription not found")
	ErrProviderNotFound       = errors.New("azurearm: resource provider not found")
	ErrInvalidRequestBody     = errors.New("azurearm: invalid request body")
	ErrStorageAccountNotFound = errors.New("azurearm: storage account not found")

	ErrServiceBusNamespaceNotFound    = errors.New("azurearm: service bus namespace not found")
	ErrServiceBusQueueNotFound        = errors.New("azurearm: service bus queue not found")
	ErrServiceBusTopicNotFound        = errors.New("azurearm: service bus topic not found")
	ErrServiceBusSubscriptionNotFound = errors.New("azurearm: service bus subscription not found")

	ErrKeyVaultNotFound = errors.New("azurearm: key vault not found")

	ErrEventHubNamespaceNotFound     = errors.New("azurearm: event hubs namespace not found")
	ErrEventHubNotFound              = errors.New("azurearm: event hub not found")
	ErrEventHubConsumerGroupNotFound = errors.New("azurearm: event hubs consumer group not found")
	ErrEventHubRuleNotFound          = errors.New("azurearm: event hubs authorization rule not found")

	ErrEventGridTopicNotFound          = errors.New("azurearm: event grid topic not found")
	ErrEventGridSubscriptionNotFound   = errors.New("azurearm: event subscription not found")
	ErrEventGridNamespaceNotFound      = errors.New("azurearm: event grid namespace not found")
	ErrEventGridNamespaceTopicNotFound = errors.New("azurearm: event grid namespace topic not found")
	ErrEventGridDomainNotFound         = errors.New("azurearm: event grid domain not found")
	ErrEventGridDomainTopicNotFound    = errors.New("azurearm: event grid domain topic not found")
	ErrEventGridUnavailable            = errors.New("azurearm: event grid data plane is not available")

	ErrAppConfigStoreNotFound    = errors.New("azurearm: app configuration store not found")
	ErrAppConfigKeyValueNotFound = errors.New("azurearm: app configuration key-value not found")
	ErrAppConfigReplicaNotFound  = errors.New("azurearm: app configuration replica not found")
	ErrAppConfigDeletedNotFound  = errors.New("azurearm: deleted app configuration store not found")
	ErrAppConfigKeyLocked        = errors.New("azurearm: app configuration key-value is read-only")
	ErrAppConfigNameTaken        = errors.New("azurearm: app configuration store name is already in use")
	ErrAppConfigSoftDeleted      = errors.New("azurearm: app configuration store name is soft-deleted")
	ErrAppConfigPurgeProtected   = errors.New("azurearm: app configuration store has purge protection enabled")
	ErrAppConfigUnavailable      = errors.New("azurearm: app configuration data plane is not available")

	ErrWebSiteNotFound         = errors.New("azurearm: web site not found")
	ErrWebPlanNotFound         = errors.New("azurearm: app service plan not found")
	ErrWebFunctionNotFound     = errors.New("azurearm: function not found")
	ErrWebKeyNotFound          = errors.New("azurearm: function key not found")
	ErrWebConfigNotFound       = errors.New("azurearm: site configuration not found")
	ErrWebNameTaken            = errors.New("azurearm: site name is already in use")
	ErrWebPlanInUse            = errors.New("azurearm: app service plan still has sites")
	ErrWebUnsupportedKind      = errors.New("azurearm: only Linux web apps and function apps are supported")
	ErrWebInvalidSiteConfig    = errors.New("azurearm: invalid site configuration")
	ErrWebPlanNotLinux         = errors.New("azurearm: Linux app needs a Linux (reserved) plan")
	ErrWebNotFunctionApp       = errors.New("azurearm: operation is only valid for function apps")
	ErrWebInvalidKeyType       = errors.New("azurearm: key type must be functionKeys or systemKeys")
	ErrWebSwapPending          = errors.New("azurearm: slot is prepared for a swap")
	ErrWebSlotLimit            = errors.New("azurearm: deployment slot limit reached for the plan tier")
	ErrWebSlotName             = errors.New("azurearm: invalid deployment slot name")
	ErrWebSwapFailed           = errors.New("azurearm: slot swap failed")
	ErrWebFunctionsUnavailable = errors.New("azurearm: azure functions data plane is not available")

	ErrACRRegistryNotFound    = errors.New("azurearm: container registry not found")
	ErrACRReplicationNotFound = errors.New("azurearm: container registry replication not found")
	ErrACRWebhookNotFound     = errors.New("azurearm: container registry webhook not found")
	ErrACRNameTaken           = errors.New("azurearm: container registry name is already in use")
	ErrACRAdminDisabled       = errors.New("azurearm: container registry admin user is not enabled")
	ErrACRInvalidSKU          = errors.New("azurearm: container registry sku name must be Basic, Standard or Premium")
	ErrACRPremiumRequired     = errors.New("azurearm: georeplication requires a Premium registry")
	ErrACRInvalidCredential   = errors.New("azurearm: credential name must be password or password2")
	ErrACRUnavailable         = errors.New("azurearm: container registry data plane is not available")

	ErrCosmosAccountNotFound    = errors.New("azurearm: cosmos db account not found")
	ErrCosmosDatabaseNotFound   = errors.New("azurearm: cosmos db database not found")
	ErrCosmosContainerNotFound  = errors.New("azurearm: cosmos db container not found")
	ErrCosmosThroughputNotFound = errors.New("azurearm: cosmos db throughput settings not found")
	ErrCosmosConflict           = errors.New("azurearm: cosmos db resource conflict")
	ErrCosmosBadRequest         = errors.New("azurearm: cosmos db invalid request")
	ErrCosmosUnavailable        = errors.New("azurearm: cosmos db data plane unavailable")

	ErrDeletedVaultNotFound = errors.New("azurearm: deleted key vault not found")
	ErrVaultPurgeProtected  = errors.New("azurearm: key vault has purge protection enabled")

	// ErrSnapshotResourceGroupNull/ErrSnapshotResourceNull are returned by
	// Restore when a persisted snapshot's map holds a JSON null entry, which
	// decodes to a nil pointer that would panic on first dereference if
	// stored as-is (same class of bug services/cosmosdb's persistence.go
	// guards against).
	ErrSnapshotResourceGroupNull = errors.New("azurearm: restore snapshot: resource group is null")
	ErrSnapshotResourceNull      = errors.New("azurearm: restore snapshot: resource is null")
)

Sentinel errors for Azure Resource Manager (ARM) emulation. Mapped to ARM error codes/HTTP statuses in the errorDetails table (handler.go), modeled on services/sqs's errorDetails pattern.

View Source
var (
	ErrRedisNotFound         = errors.New("azurearm: redis cache not found")
	ErrRedisFirewallNotFound = errors.New("azurearm: redis firewall rule not found")
	ErrRedisPatchNotFound    = errors.New("azurearm: redis patch schedule not found")
	ErrRedisLinkedNotFound   = errors.New("azurearm: redis linked server not found")
	ErrRedisNameTaken        = errors.New("azurearm: redis cache name is already in use")
	ErrRedisInvalid          = errors.New("azurearm: invalid redis request")
	ErrRedisUnavailable      = errors.New("azurearm: redis data plane is not available")
)

Sentinel errors of the Microsoft.Cache provider.

View Source
var (
	ErrSQLServerNotFound   = errors.New("azurearm: sql server not found")
	ErrSQLChildNotFound    = errors.New("azurearm: sql resource not found")
	ErrSQLNameTaken        = errors.New("azurearm: sql server name is already in use")
	ErrSQLInvalid          = errors.New("azurearm: invalid sql request")
	ErrSQLPasswordNotValid = errors.New("azurearm: sql password does not meet the policy")
	ErrSQLEngine           = errors.New("azurearm: sql engine failure")
	ErrSQLConflict         = errors.New("azurearm: sql resource is in use")
)

Sentinel errors of the Microsoft.Sql provider.

View Source
var ErrAPIMDestinationNotPermitted = errors.New(
	"azurearm: apim backend is outside loopback and external backends are not allowed",
)

ErrAPIMDestinationNotPermitted is returned by the gateway's dialer for a backend outside loopback.

View Source
var ErrGraphPortMismatch = errors.New("azurearm: --azure-arm-graph-port must match --azure-graph-port")

ErrGraphPortMismatch is returned when Settings.GraphPort (what ARM advertises as the Graph endpoint) disagrees with the Microsoft Graph listener's own port.

View Source
var ErrKeyVaultPortMismatch = errors.New(
	"azurearm: --azure-arm-keyvault-port must match --azure-keyvault-port",
)

ErrKeyVaultPortMismatch is returned when Settings.KeyVaultPort (what ARM advertises in vaultUri) disagrees with the Key Vault listener's own port.

View Source
var ErrMonitorUnavailable = &MonitorError{
	Code: redisCodeUnavailable, Message: "The Azure Monitor Logs data plane is not available.",
	Status: http.StatusServiceUnavailable,
}

ErrMonitorUnavailable is returned when no Azure Monitor Logs data plane is wired.

View Source
var ErrNilAppContext = errors.New("azurearm: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrServiceBusPortMismatch = errors.New(
	"azurearm: --azure-arm-servicebus-port must match --azure-servicebus-port",
)

ErrServiceBusPortMismatch is returned when Settings.ServiceBusPort (what ARM advertises as serviceBusEndpoint) disagrees with the actual services/azureservicebus listener's own configured port -- the same fail-fast rationale as ErrStorageVHostPortMismatch.

View Source
var ErrStorageVHostPortMismatch = errors.New(
	"azurearm: --azure-arm-storage-vhost-port must match --azure-storage-vhost-port",
)

ErrStorageVHostPortMismatch is returned when Settings.StorageVHostPort (what ARM advertises in primaryEndpoints) disagrees with the actual services/azurestoragevhost listener's own configured port. Failing fast here, rather than letting the two silently diverge, avoids repeating the exact "advertised a port nothing answers on" bug class already found and fixed twice in this milestone (AZURE.md section 10.10, M8 bugs (1)/(5)).

Functions

func ExtensionImage

func ExtensionImage(sub, loc, publisher, typ, version string) (map[string]any, bool)

ExtensionImage returns one extension image; ok is false when the type or version is not offered.

func ExtensionImageTypes

func ExtensionImageTypes(sub, loc, publisher string) []any

ExtensionImageTypes lists the extension types a publisher offers in a location.

func ExtensionImageVersions

func ExtensionImageVersions(sub, loc, publisher, typ string) ([]any, bool)

ExtensionImageVersions lists the versions of one extension type; ok is false for an unknown type.

func ProviderBody

func ProviderBody(subscriptionID, namespace, registrationState string, types []ResourceTypeDef) map[string]any

ProviderBody returns the wire response body for GET /subscriptions/{sub}/providers/{ns} and each entry of the GET /subscriptions/{sub}/providers list.

func RequestHostFromContext

func RequestHostFromContext(ctx context.Context) string

RequestHostFromContext returns the host stashed by WithRequestHost, or "" if none was set (e.g. a unit test calling a ResourceProvider directly).

func ResourceSKUs

func ResourceSKUs(location string) map[string]any

ResourceSKUs returns the skus listing for location.

func RunCommandDocs

func RunCommandDocs() map[string]any

RunCommandDocs returns the location-scoped list of action run commands.

func SubscriptionBody

func SubscriptionBody(subscriptionID, tenantID, displayName string) map[string]any

SubscriptionBody returns the wire response body for GET /subscriptions/{sub} and as the single entry of GET /subscriptions' "value" array. tenantID is a separate value from subscriptionID -- both default to the same fixed all-zeros GUID (AZURE.md section 10.5), but Settings allows overriding either independently, so this must not assume they're equal.

func TenantBody

func TenantBody(tenantID string) map[string]any

TenantBody returns the wire response body for one entry of GET /tenants' "value" array.

func VMSizes

func VMSizes() map[string]any

VMSizes returns the sizes the location offers, as the vmSizes list endpoints do.

func WithRequestHost

func WithRequestHost(ctx context.Context, host string) context.Context

WithRequestHost returns a copy of ctx carrying host (the ARM request's own Host header, hostname only, no port).

Types

type ACAClock

type ACAClock = gcpscale.Clock

ACAClock is the clock that drives scale-to-zero.

type ACIContainerView

type ACIContainerView struct {
	Prev     *ACIState
	Cur      ACIState
	Name     string
	Events   []ACIEvent
	Restarts int
}

ACIContainerView is a container's instanceView.

type ACICredential

type ACICredential struct {
	Server   string
	Username string
	Password string
}

ACICredential is an imageRegistryCredentials entry.

type ACIEngine

type ACIEngine struct {
	// contains filtered or unexported fields
}

ACIEngine runs container groups in the container runtime.

func NewACIEngine

func NewACIEngine(runtime func() (ACIRuntime, error), disabledReason string) *ACIEngine

NewACIEngine creates an engine; runtime nil makes every group fail with disabledReason (or a default reason).

func (*ACIEngine) Active

func (e *ACIEngine) Active(key string) bool

Active reports whether the group has a live (not stopped, not failed) run.

func (*ACIEngine) Close

func (e *ACIEngine) Close()

Close stops every group and the engine.

func (*ACIEngine) Deploy

func (e *ACIEngine) Deploy(cfg aciConfig)

Deploy (re)creates the group's containers and returns once each has started or failed. Failures are recorded on the group's view, not returned.

func (*ACIEngine) Logs

func (e *ACIEngine) Logs(ctx context.Context, key, name string, tail int) (string, error)

Logs returns the container's logs, limited to the last tail lines when tail is positive.

func (*ACIEngine) Remove

func (e *ACIEngine) Remove(key string)

Remove stops the group and forgets it.

func (*ACIEngine) RemoveAll

func (e *ACIEngine) RemoveAll()

RemoveAll stops and forgets every group.

func (*ACIEngine) RemovePrefixed

func (e *ACIEngine) RemovePrefixed(prefix string)

RemovePrefixed stops and forgets every group whose key starts with prefix.

func (*ACIEngine) RemoveUnprefixed

func (e *ACIEngine) RemoveUnprefixed(prefix string)

RemoveUnprefixed stops and forgets every group whose key does not start with prefix.

func (*ACIEngine) SetFileShares

func (e *ACIEngine) SetFileShares(s ACIFileShares)

SetFileShares wires the Azure Files seam used by azureFile volumes.

func (*ACIEngine) SetOnClose

func (e *ACIEngine) SetOnClose(fn func())

SetOnClose registers a hook run by Close after every group is stopped.

func (*ACIEngine) SetPortPool

func (e *ACIEngine) SetPortPool(p ACIPortPool)

SetPortPool wires the host port source for published ports.

func (*ACIEngine) SetProbeHooks

func (e *ACIEngine) SetProbeHooks(
	pause func(ctx context.Context, d time.Duration) bool,
	httpProbe func(ctx context.Context, p ACIHTTPProbe) (int, error),
)

SetProbeHooks overrides how probes wait between attempts and issue HTTP requests; for tests. Nil keeps the default.

func (*ACIEngine) SetRuntime

func (e *ACIEngine) SetRuntime(fn func() (ACIRuntime, error))

SetRuntime replaces the container runtime source; nil disables the engine.

func (*ACIEngine) SetTiming

func (e *ACIEngine) SetTiming(backoff func(int) time.Duration, startup time.Duration)

SetTiming overrides the restart backoff and the startup bound; for tests and tuning.

func (*ACIEngine) Stop

func (e *ACIEngine) Stop(key string)

Stop tears the group's containers down but keeps its record; later reads report Stopped.

func (*ACIEngine) View

func (e *ACIEngine) View(key string) (ACIView, bool)

View returns the live state of the group.

type ACIEvent

type ACIEvent struct {
	First   time.Time
	Last    time.Time
	Name    string
	Type    string
	Message string
	Count   int
}

ACIEvent is one entry of an instanceView events list.

type ACIExecRuntime

type ACIExecRuntime interface {
	Exec(ctx context.Context, id string, cmd []string) (int, error)
}

ACIExecRuntime is implemented by runtimes that can run a command inside a container; exec probes need it.

type ACIFileShares

type ACIFileShares interface {
	ExportShare(account, share string) (ACIShareTree, error)
	ApplyShare(account, share string, tree ACIShareTree) error
}

ACIFileShares is the seam azureFile volumes use to reach the Azure Files service. ExportShare must fail when the share does not exist.

type ACIHTTPProbe

type ACIHTTPProbe struct {
	Headers http.Header
	URL     string
	Timeout time.Duration
}

ACIHTTPProbe is one HTTP probe request the engine asks its prober to make.

type ACIPortPool

type ACIPortPool = gcpserve.PortPool

ACIPortPool hands out host ports for published container ports.

type ACIRuntime

type ACIRuntime interface {
	// Pull fetches ref when it is absent or when cred is set; it reports whether a pull happened.
	Pull(ctx context.Context, ref string, cred *ACICredential) (bool, error)
	Start(ctx context.Context, spec container.Spec) (string, error)
	// Wait blocks until the container exits and returns its exit code.
	Wait(ctx context.Context, id string) (int, error)
	Logs(ctx context.Context, id, tail string) (string, error)
	Remove(ctx context.Context, id string) error
}

ACIRuntime is the slice of the container runtime that container groups need.

func NewDockerACIRuntime

func NewDockerACIRuntime(r gcpserve.Runner) ACIRuntime

NewDockerACIRuntime wraps a pkgs/container runner.

type ACIShareTree

type ACIShareTree struct {
	Files map[string][]byte
	Dirs  []string
}

ACIShareTree is the content of an Azure Files share: slash paths to file bytes, and directory paths.

type ACIState

type ACIState struct {
	StartTime  *time.Time
	FinishTime *time.Time
	ExitCode   *int
	State      string
	Detail     string
}

ACIState is a container's currentState or previousState.

type ACIView

type ACIView struct {
	HostPorts  map[int]int
	State      string
	Failure    string
	Events     []ACIEvent
	Containers []ACIContainerView
	Inits      []ACIContainerView
}

ACIView is the live state of one container group.

type AKSEngineConfig

type AKSEngineConfig struct {
	Runtime      k3sengine.Runtime
	Ports        *portalloc.Allocator
	Logger       *slog.Logger
	Probe        func(ctx context.Context, addr, token string) ([]byte, error)
	Host         string
	Token        string
	Image        string
	StartTimeout time.Duration
}

AKSEngineConfig configures docker-backed clusters: each running cluster is a single-node k3s container.

type APIMProvider

type APIMProvider struct {
	// contains filtered or unexported fields
}

APIMProvider implements ResourceProvider for Microsoft.ApiManagement/service and serves the gateway data plane.

func NewAPIMProvider

func NewAPIMProvider() *APIMProvider

NewAPIMProvider creates an APIMProvider.

func (*APIMProvider) CheckName

func (p *APIMProvider) CheckName(sub, name string) map[string]any

CheckName answers checkNameAvailability for a service name.

func (*APIMProvider) Delete

func (p *APIMProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*APIMProvider) DeleteResourcesInGroup

func (p *APIMProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*APIMProvider) Do

func (p *APIMProvider) Do(req apimReq) (apimResp, error)

Do serves one control-plane request.

func (*APIMProvider) Get

func (p *APIMProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*APIMProvider) List

func (p *APIMProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*APIMProvider) ListKeys

func (p *APIMProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider; services have no listKeys action (subscriptions use listSecrets).

func (*APIMProvider) Namespace

func (p *APIMProvider) Namespace() string

Namespace implements ResourceProvider.

func (*APIMProvider) Put

func (p *APIMProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*APIMProvider) Reset

func (p *APIMProvider) Reset()

Reset implements ResourceProvider.

func (*APIMProvider) ResourceTypes

func (p *APIMProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*APIMProvider) ServeGateway

func (p *APIMProvider) ServeGateway(w http.ResponseWriter, r *http.Request) bool

ServeGateway answers a request addressed to a service's gateway (Host <name>.azure-api.net, or the path prefix /_apim/<name>/); it reports false for any other request.

func (*APIMProvider) SetActivation

func (p *APIMProvider) SetActivation(consumption, classic time.Duration)

SetActivation sets how long Consumption and the other tiers stay in Activating or Updating.

func (*APIMProvider) SetAllowExternal

func (p *APIMProvider) SetAllowExternal(allow bool)

SetAllowExternal lets gateway backends reach hosts outside loopback.

func (*APIMProvider) SetClock

func (p *APIMProvider) SetClock(now func() time.Time)

SetClock replaces the provider's clock; provisioning and rate limits follow it.

type AppConfig

type AppConfig interface {
	PutStore(name string) (time.Time, error)
	StoreCreated(name string) (time.Time, bool)
	DeleteStore(name string) error
	StoreKeys(name string) ([]AppConfigKey, error)
	RegenerateStoreKey(name, keyID string) (AppConfigKey, error)

	PutKeyValue(store string, kv AppConfigKV) (AppConfigKV, error)
	GetKeyValue(store, key, label string) (AppConfigKV, bool)
	DeleteKeyValue(store, key, label string) error
	ListKeyValues(store string) ([]AppConfigKV, error)
}

AppConfig is the seam the Microsoft.AppConfiguration resource provider uses to keep the App Configuration data plane in step with ARM, so stores, access keys and key-values are shared between both planes.

type AppConfigEndpointConfig

type AppConfigEndpointConfig struct {
	Override string
	Port     int
}

AppConfigEndpointConfig configures the endpoints the provider advertises.

type AppConfigKV

type AppConfigKV struct {
	LastModified time.Time
	Value        *string
	ContentType  *string
	Tags         map[string]string
	Key          string
	Label        string
	ETag         string
	Locked       bool
}

AppConfigKV is a key-value as the ARM keyValues resources see it.

type AppConfigKey

type AppConfigKey struct {
	LastModified time.Time
	ID           string
	Name         string
	Value        string
	ReadOnly     bool
}

AppConfigKey is one of a configuration store's access keys.

type AppConfigProvider

type AppConfigProvider struct {
	// contains filtered or unexported fields
}

AppConfigProvider implements ResourceProvider for Microsoft.AppConfiguration. ARM keeps location, tags, SKU and unmodelled properties; stores, access keys and key-values live in the data plane.

func NewAppConfigProvider

func NewAppConfigProvider(cfg AppConfigEndpointConfig, dataPlane AppConfig) *AppConfigProvider

NewAppConfigProvider creates an AppConfigProvider; dataPlane may be nil.

func (*AppConfigProvider) CheckName

func (p *AppConfigProvider) CheckName(_ context.Context, name string) map[string]any

CheckName reports whether a store name is available.

func (*AppConfigProvider) Delete

Delete implements ResourceProvider.

func (*AppConfigProvider) DeleteResourcesInGroup

func (p *AppConfigProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*AppConfigProvider) DeletedStore

func (p *AppConfigProvider) DeletedStore(_ context.Context, location, name string) (map[string]any, error)

DeletedStore returns a soft-deleted store.

func (*AppConfigProvider) Get

Get implements ResourceProvider.

func (*AppConfigProvider) KeyValue

func (p *AppConfigProvider) KeyValue(_ context.Context, storeID ResourceID, key, label string) (map[string]any, error)

KeyValue serves POST .../listKeyValue: the key-value for the requested key and label.

func (*AppConfigProvider) List

func (p *AppConfigProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; only stores are listable here.

func (*AppConfigProvider) ListDeletedStores

func (p *AppConfigProvider) ListDeletedStores(_ context.Context, subscription string) []map[string]any

ListDeletedStores lists the soft-deleted stores of a subscription.

func (*AppConfigProvider) ListKeyValues

func (p *AppConfigProvider) ListKeyValues(_ context.Context, storeID ResourceID) ([]map[string]any, error)

ListKeyValues lists the key-values of the store addressed by storeID.

func (*AppConfigProvider) ListKeys

func (p *AppConfigProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider for .../configurationStores/{name}/listKeys.

func (*AppConfigProvider) ListReplicas

func (p *AppConfigProvider) ListReplicas(_ context.Context, storeID ResourceID) ([]map[string]any, error)

ListReplicas lists the replicas of the store addressed by storeID.

func (*AppConfigProvider) Namespace

func (p *AppConfigProvider) Namespace() string

Namespace implements ResourceProvider.

func (*AppConfigProvider) PurgeDeletedStore

func (p *AppConfigProvider) PurgeDeletedStore(_ context.Context, location, name string) error

PurgeDeletedStore permanently removes a soft-deleted store.

func (*AppConfigProvider) Put

func (p *AppConfigProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*AppConfigProvider) RegenerateKey

func (p *AppConfigProvider) RegenerateKey(_ context.Context, id ResourceID, keyID string) (map[string]any, error)

RegenerateKey replaces the access key with the given id and returns it.

func (*AppConfigProvider) Reset

func (p *AppConfigProvider) Reset()

Reset implements ResourceProvider.

func (*AppConfigProvider) ResourceTypes

func (p *AppConfigProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type AuthorizationProvider

type AuthorizationProvider struct {
	// contains filtered or unexported fields
}

AuthorizationProvider implements ResourceProvider for Microsoft.Authorization: role definitions and assignments, management locks and policy definitions, set definitions and assignments. Requests are served from the scope-aware routes in rp_authorization_routes.go; the generic ResourceProvider methods exist for the provider registry only.

func NewAuthorizationProvider

func NewAuthorizationProvider(tenantID string, msi *ManagedIdentityProvider) *AuthorizationProvider

NewAuthorizationProvider creates a provider with the built-in role and policy catalogs loaded. msi, when set, lets role assignments recognise managed identity principals.

func (*AuthorizationProvider) Delete

Delete implements ResourceProvider.

func (*AuthorizationProvider) DeleteResourcesInGroup

func (p *AuthorizationProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider: locks, role assignments and policy assignments scoped to the group or to its resources go with it.

func (*AuthorizationProvider) Do

func (p *AuthorizationProvider) Do(req authReq) (authResp, error)

Do serves one request.

func (*AuthorizationProvider) Get

Get implements ResourceProvider.

func (*AuthorizationProvider) List

List implements ResourceProvider.

func (*AuthorizationProvider) ListKeys

ListKeys implements ResourceProvider.

func (*AuthorizationProvider) Namespace

func (p *AuthorizationProvider) Namespace() string

Namespace implements ResourceProvider.

func (*AuthorizationProvider) Put

Put implements ResourceProvider; Microsoft.Authorization is served by the scope routes.

func (*AuthorizationProvider) RemoveUnder

func (p *AuthorizationProvider) RemoveUnder(path string)

RemoveUnder drops locks, role assignments and policy assignments scoped to path or beneath it, after the resource at path was deleted.

func (*AuthorizationProvider) Reset

func (p *AuthorizationProvider) Reset()

Reset implements ResourceProvider.

func (*AuthorizationProvider) ResourceTypes

func (p *AuthorizationProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*AuthorizationProvider) SetPrincipalDirectory

func (p *AuthorizationProvider) SetPrincipalDirectory(dir PrincipalDirectory, validate bool)

SetPrincipalDirectory sets the directory used to type and, when validate is set, verify principals.

type ClientAuthError

type ClientAuthError struct {
	Name        string
	Description string
	Status      int
	Code        int
}

ClientAuthError is a token endpoint rejection rendered in Entra's error shape.

func (*ClientAuthError) Error

func (e *ClientAuthError) Error() string

type ClientAuthenticator

type ClientAuthenticator interface {
	AuthenticateClient(clientID, secret string) (objectID string, known bool, err error)
}

ClientAuthenticator checks client-credentials requests against a directory of registered applications. known is false for a client the directory does not know, which keeps the permissive dev-client behaviour.

type ComputeProvider

type ComputeProvider struct {
	// contains filtered or unexported fields
}

ComputeProvider implements ResourceProvider for Microsoft.Compute. It is state only: no virtual machine runs. Lock order is compute then network; the network provider never calls back into compute.

func NewComputeProvider

func NewComputeProvider(backend *InMemoryBackend, net *NetworkProvider, ids *identityService) *ComputeProvider

NewComputeProvider creates a provider that references NICs through net and identities through ids.

func (*ComputeProvider) Delete

func (p *ComputeProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*ComputeProvider) DeleteResourcesInGroup

func (p *ComputeProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider; network interfaces of removed machines are detached.

func (*ComputeProvider) Get

func (p *ComputeProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*ComputeProvider) GetExpanded

func (p *ComputeProvider) GetExpanded(id ResourceID) (map[string]any, error)

GetExpanded returns the resource with its instance view, as GET with $expand=instanceView does.

func (*ComputeProvider) GetKidExpanded

func (p *ComputeProvider) GetKidExpanded(id ResourceID, expand string) (map[string]any, error)

GetKidExpanded serves GET on a child resource with a $expand option.

func (*ComputeProvider) InstanceView

func (p *ComputeProvider) InstanceView(id ResourceID) (map[string]any, error)

InstanceView returns the virtualMachines/{name}/instanceView document.

func (*ComputeProvider) List

func (p *ComputeProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*ComputeProvider) ListKeys

func (p *ComputeProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider.

func (*ComputeProvider) Namespace

func (p *ComputeProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ComputeProvider) PatchResource

func (p *ComputeProvider) PatchResource(id ResourceID, body map[string]any) (map[string]any, error)

PatchResource applies an Update (PATCH): tags, identity and properties replace what the body names.

func (*ComputeProvider) PatchTags

func (p *ComputeProvider) PatchTags(id ResourceID, tags map[string]string) (map[string]any, error)

PatchTags replaces the tags of a resource.

func (*ComputeProvider) Put

func (p *ComputeProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*ComputeProvider) Reset

func (p *ComputeProvider) Reset()

Reset implements ResourceProvider.

func (*ComputeProvider) ResourceTypes

func (p *ComputeProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*ComputeProvider) RunCommand

func (p *ComputeProvider) RunCommand(id ResourceID, body map[string]any) error

RunCommand validates an action run command. No VM agent runs in the emulator, so a valid command on a running machine is refused instead of being given a fabricated result.

func (*ComputeProvider) VMAction

func (p *ComputeProvider) VMAction(id ResourceID, action string) error

VMAction runs start, powerOff, restart, deallocate, redeploy or generalize against a stored virtual machine.

func (*ComputeProvider) VMSSAction

func (p *ComputeProvider) VMSSAction(id ResourceID, action string, ids []string) error

VMSSAction runs manualupgrade, start, powerOff, restart, deallocate or delete against a scale set's instances; an empty ids list means every instance.

type ConfigProvider

type ConfigProvider interface {
	GetAzureARMSettings() Settings
}

ConfigProvider is a private interface to extract ARM configuration from the abstract AppContext Config, mirroring services/cosmosdb.ConfigProvider.

type ContainerAppsProvider

type ContainerAppsProvider struct {
	// contains filtered or unexported fields
}

ContainerAppsProvider implements ResourceProvider for Microsoft.App. ARM keeps the configuration; revisions run as replicas in the container engine shared with Container Instances.

func NewContainerAppsProvider

func NewContainerAppsProvider(
	engine *ACIEngine, backend *InMemoryBackend, network *NetworkProvider, ids *identityService,
) *ContainerAppsProvider

NewContainerAppsProvider creates a provider that runs replicas in engine. backend serves the Microsoft.App types this provider does not model; network and ids may be nil.

func (*ContainerAppsProvider) Close

func (p *ContainerAppsProvider) Close()

Close stops every replica.

func (*ContainerAppsProvider) Delete

Delete implements ResourceProvider.

func (*ContainerAppsProvider) DeleteResourcesInGroup

func (p *ContainerAppsProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*ContainerAppsProvider) Get

Get implements ResourceProvider.

func (*ContainerAppsProvider) List

List implements ResourceProvider.

func (*ContainerAppsProvider) ListKeys

ListKeys implements ResourceProvider.

func (*ContainerAppsProvider) Namespace

func (p *ContainerAppsProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ContainerAppsProvider) PatchResource

func (p *ContainerAppsProvider) PatchResource(id ResourceID, body map[string]any) (map[string]any, error)

PatchResource implements resourcePatcher for managed environments, container apps and jobs.

func (*ContainerAppsProvider) Put

func (p *ContainerAppsProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*ContainerAppsProvider) Reset

func (p *ContainerAppsProvider) Reset()

Reset implements ResourceProvider.

func (*ContainerAppsProvider) ResourceTypes

func (p *ContainerAppsProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*ContainerAppsProvider) ServeIngress

func (p *ContainerAppsProvider) ServeIngress(w http.ResponseWriter, r *http.Request) bool

ServeIngress proxies a request addressed to a container app host name; it reports false for any other host.

func (*ContainerAppsProvider) SetClock

func (p *ContainerAppsProvider) SetClock(c ACAClock)

SetClock replaces the clock that drives scale-to-zero; for tests.

func (*ContainerAppsProvider) SetKeyVaultSecrets

func (p *ContainerAppsProvider) SetKeyVaultSecrets(v KeyVaultSecrets)

SetKeyVaultSecrets wires the Key Vault used to resolve keyVaultUrl secrets.

func (*ContainerAppsProvider) SetTrafficPicker

func (p *ContainerAppsProvider) SetTrafficPicker(fn func(n int) int)

SetTrafficPicker replaces the source of the 0..n-1 draw that splits traffic between revisions; for tests.

type ContainerInstanceProvider

type ContainerInstanceProvider struct {
	// contains filtered or unexported fields
}

ContainerInstanceProvider implements ResourceProvider for Microsoft.ContainerInstance container groups. ARM keeps the configuration; the ACIEngine runs the containers.

func NewContainerInstanceProvider

func NewContainerInstanceProvider(engine *ACIEngine) *ContainerInstanceProvider

NewContainerInstanceProvider creates a provider over engine.

func (*ContainerInstanceProvider) Action

Action runs start, stop or restart on a group.

func (*ContainerInstanceProvider) Close

func (p *ContainerInstanceProvider) Close()

Close stops every running group.

func (*ContainerInstanceProvider) Delete

Delete implements ResourceProvider.

func (*ContainerInstanceProvider) DeleteResourcesInGroup

func (p *ContainerInstanceProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*ContainerInstanceProvider) Engine

func (p *ContainerInstanceProvider) Engine() *ACIEngine

Engine returns the execution engine.

func (*ContainerInstanceProvider) Get

Get implements ResourceProvider.

func (*ContainerInstanceProvider) List

List implements ResourceProvider.

func (*ContainerInstanceProvider) ListKeys

ListKeys implements ResourceProvider.

func (*ContainerInstanceProvider) Logs

func (p *ContainerInstanceProvider) Logs(
	ctx context.Context,
	id ResourceID,
	container string,
	tail int,
) (string, error)

Logs returns a container's logs.

func (*ContainerInstanceProvider) Namespace

func (p *ContainerInstanceProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ContainerInstanceProvider) Patch

func (p *ContainerInstanceProvider) Patch(
	_ context.Context,
	id ResourceID,
	body map[string]any,
) (map[string]any, error)

Patch replaces the group's tags.

func (*ContainerInstanceProvider) Put

func (p *ContainerInstanceProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider. It answers once the containers have started or failed to.

func (*ContainerInstanceProvider) Reset

func (p *ContainerInstanceProvider) Reset()

Reset implements ResourceProvider.

func (*ContainerInstanceProvider) ResourceTypes

func (p *ContainerInstanceProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type ContainerRegistries

type ContainerRegistries interface {
	PutRegistry(name string, adminEnabled bool) (ContainerRegistryInfo, error)
	RegistryInfo(name string) (ContainerRegistryInfo, bool)
	DeleteRegistry(name string) error
	Credentials(name string) (ContainerRegistryCredentials, error)
	RegenerateCredential(name, which string) (ContainerRegistryCredentials, error)
	SetWebhook(registry string, w ContainerRegistryWebhook) error
	DeleteWebhook(registry, name string) error
	PingWebhook(registry, name string) (string, error)
	WebhookEvents(registry, name string) ([]map[string]any, error)
}

ContainerRegistries is the seam the Microsoft.ContainerRegistry resource provider uses to keep the registry data plane in step with ARM. Primitive types only, so this package never imports the data-plane service.

type ContainerRegistryCredentials

type ContainerRegistryCredentials struct {
	Username  string
	Password  string
	Password2 string
}

ContainerRegistryCredentials are a registry's admin-user credentials.

type ContainerRegistryEndpointConfig

type ContainerRegistryEndpointConfig struct {
	Override string
	Port     int
}

ContainerRegistryEndpointConfig configures the login server the provider advertises.

type ContainerRegistryInfo

type ContainerRegistryInfo struct {
	CreatedAt    time.Time
	AdminEnabled bool
}

ContainerRegistryInfo is the data plane's view of a registry.

type ContainerRegistryProvider

type ContainerRegistryProvider struct {
	// contains filtered or unexported fields
}

ContainerRegistryProvider implements ResourceProvider for Microsoft.ContainerRegistry. ARM keeps location, tags, SKU, child resources and unmodelled properties; the registry, its admin flag and credentials live in the data plane.

func NewContainerRegistryProvider

func NewContainerRegistryProvider(
	cfg ContainerRegistryEndpointConfig, dataPlane ContainerRegistries,
) *ContainerRegistryProvider

NewContainerRegistryProvider creates a ContainerRegistryProvider; dataPlane may be nil.

func (*ContainerRegistryProvider) CallbackConfig

func (p *ContainerRegistryProvider) CallbackConfig(_ context.Context, id ResourceID) (map[string]any, error)

CallbackConfig answers POST .../webhooks/{name}/getCallbackConfig.

func (*ContainerRegistryProvider) CheckName

func (p *ContainerRegistryProvider) CheckName(name string) map[string]any

CheckName answers POST .../checkNameAvailability.

func (*ContainerRegistryProvider) Delete

Delete implements ResourceProvider.

func (*ContainerRegistryProvider) DeleteResourcesInGroup

func (p *ContainerRegistryProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*ContainerRegistryProvider) Get

Get implements ResourceProvider.

func (*ContainerRegistryProvider) List

List implements ResourceProvider; registries are listable at subscription and group scope.

func (*ContainerRegistryProvider) ListChildren

func (p *ContainerRegistryProvider) ListChildren(id ResourceID, kind acrKind) ([]map[string]any, error)

ListChildren lists a registry's replications or webhooks.

func (*ContainerRegistryProvider) ListCredentials

func (p *ContainerRegistryProvider) ListCredentials(_ context.Context, id ResourceID) (map[string]any, error)

ListCredentials answers POST .../listCredentials.

func (*ContainerRegistryProvider) ListKeys

ListKeys is not applicable to registries; credentials come from ListCredentials.

func (*ContainerRegistryProvider) Namespace

func (p *ContainerRegistryProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ContainerRegistryProvider) Patch

func (p *ContainerRegistryProvider) Patch(
	_ context.Context,
	id ResourceID,
	body map[string]any,
) (map[string]any, error)

Patch updates tags, SKU, identity and properties of a registry in place (ARM PATCH).

func (*ContainerRegistryProvider) PingWebhook

func (p *ContainerRegistryProvider) PingWebhook(_ context.Context, id ResourceID) (map[string]any, error)

PingWebhook answers POST .../webhooks/{name}/ping with the id of the ping event it delivers.

func (*ContainerRegistryProvider) Put

func (p *ContainerRegistryProvider) Put(
	ctx context.Context, id ResourceID, body map[string]any,
) (map[string]any, error)

Put implements ResourceProvider.

func (*ContainerRegistryProvider) RegenerateCredential

func (p *ContainerRegistryProvider) RegenerateCredential(
	_ context.Context, id ResourceID, which string,
) (map[string]any, error)

RegenerateCredential answers POST .../regenerateCredential.

func (*ContainerRegistryProvider) Reset

func (p *ContainerRegistryProvider) Reset()

Reset implements ResourceProvider.

func (*ContainerRegistryProvider) ResourceTypes

func (p *ContainerRegistryProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*ContainerRegistryProvider) WebhookEvents

func (p *ContainerRegistryProvider) WebhookEvents(_ context.Context, id ResourceID) (map[string]any, error)

WebhookEvents answers POST .../webhooks/{name}/listEvents.

type ContainerRegistryWebhook

type ContainerRegistryWebhook struct {
	Headers    map[string]string
	Name       string
	ServiceURI string
	Scope      string
	Status     string
	Actions    []string
}

ContainerRegistryWebhook is a registry webhook the data plane fires on image and chart pushes and deletes.

type ContainerServiceProvider

type ContainerServiceProvider struct {
	// contains filtered or unexported fields
}

ContainerServiceProvider implements ResourceProvider for Microsoft.ContainerService (AKS). ARM keeps the configuration; with the opt-in engine each running cluster is a single-node k3s container.

func NewContainerServiceProvider

func NewContainerServiceProvider(
	backend *InMemoryBackend, network *NetworkProvider, ids *identityService,
) *ContainerServiceProvider

NewContainerServiceProvider creates the provider; network and ids may be nil.

func (*ContainerServiceProvider) Close

func (p *ContainerServiceProvider) Close()

Close stops every cluster container.

func (*ContainerServiceProvider) Delete

Delete implements ResourceProvider.

func (*ContainerServiceProvider) DeleteResourcesInGroup

func (p *ContainerServiceProvider) DeleteResourcesInGroup(ctx context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider; clusters of the group go with their node resource groups, and a deleted node resource group takes its cluster.

func (*ContainerServiceProvider) EnableEngine

func (p *ContainerServiceProvider) EnableEngine(cfg AKSEngineConfig) error

EnableEngine switches the provider to docker mode with an engine built from cfg.

func (*ContainerServiceProvider) Get

Get implements ResourceProvider.

func (*ContainerServiceProvider) List

List implements ResourceProvider.

func (*ContainerServiceProvider) ListKeys

ListKeys implements ResourceProvider.

func (*ContainerServiceProvider) Namespace

func (p *ContainerServiceProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ContainerServiceProvider) PatchResource

func (p *ContainerServiceProvider) PatchResource(id ResourceID, body map[string]any) (map[string]any, error)

PatchResource implements resourcePatcher: the Update Tags operation.

func (*ContainerServiceProvider) Put

func (p *ContainerServiceProvider) Put(
	ctx context.Context,
	id ResourceID,
	body map[string]any,
) (map[string]any, error)

Put implements ResourceProvider.

func (*ContainerServiceProvider) Reset

func (p *ContainerServiceProvider) Reset()

Reset implements ResourceProvider.

func (*ContainerServiceProvider) ResourceTypes

func (p *ContainerServiceProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*ContainerServiceProvider) SetClock

func (p *ContainerServiceProvider) SetClock(now func() time.Time)

SetClock replaces the provider's time source; call it before the provider serves requests.

func (*ContainerServiceProvider) SetEngineFactory

func (p *ContainerServiceProvider) SetEngineFactory(fn func() (*k3sengine.Engine, error), image string)

SetEngineFactory enables docker mode with an engine built on first use, so the runtime is only dialed when a cluster is created.

func (*ContainerServiceProvider) SetResourceGroupCascade

func (p *ContainerServiceProvider) SetResourceGroupCascade(fn func(ctx context.Context, resourceGroup string))

SetResourceGroupCascade sets the callback that deletes the resources of a resource group in every provider; it removes the contents of a cluster's node resource group.

type CosmosAccountPolicies

type CosmosAccountPolicies struct {
	Consistency        string
	Backup             string
	MaxStalenessPrefix int64
	MaxIntervalSeconds int
	AutomaticFailover  bool
}

CosmosAccountPolicies are the account settings the data plane honours: the default consistency level (with its bounded-staleness limits), service-managed failover, and the backup mode ("Periodic", "Continuous7Days" or "Continuous30Days"). A data plane that models them implements CosmosPolicyResources.

type CosmosContainer

type CosmosContainer struct {
	Modified                 time.Time
	DefaultTTL               *int
	ID                       string
	RID                      string
	PartitionKeyPaths        []string
	IndexingPolicy           []byte
	UniqueKeyPolicy          []byte
	ConflictResolutionPolicy []byte
}

CosmosContainer is a Cosmos DB container as the data plane reports it; the policy fields are raw JSON.

type CosmosDatabase

type CosmosDatabase struct {
	Modified time.Time
	ID       string
	RID      string
}

CosmosDatabase is a Cosmos DB database as the data plane reports it.

type CosmosEndpointConfig

type CosmosEndpointConfig struct {
	Override string
}

CosmosEndpointConfig configures how the DocumentDB provider advertises documentEndpoint.

type CosmosPolicyResources

type CosmosPolicyResources interface {
	SetAccountPolicies(CosmosAccountPolicies)
}

CosmosPolicyResources is the optional seam for CosmosAccountPolicies.

type CosmosProvider

type CosmosProvider struct {
	// contains filtered or unexported fields
}

CosmosProvider implements ResourceProvider for Microsoft.DocumentDB. Databases and containers live in the Cosmos DB data plane behind the CosmosResources seam; this provider keeps account metadata, ownership and the legacy throughput entries of snapshots written before offers moved to the data plane.

func NewCosmosProvider

func NewCosmosProvider(cfg CosmosEndpointConfig, dataPlane CosmosResources) *CosmosProvider

NewCosmosProvider creates a CosmosProvider; dataPlane may be nil.

func (*CosmosProvider) ConnectionStrings

func (p *CosmosProvider) ConnectionStrings(ctx context.Context, id ResourceID) (map[string]any, error)

ConnectionStrings serves the listConnectionStrings action.

func (*CosmosProvider) Delete

func (p *CosmosProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*CosmosProvider) DeleteResourcesInGroup

func (p *CosmosProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*CosmosProvider) FailoverPriorityChange

func (p *CosmosProvider) FailoverPriorityChange(_ context.Context, id ResourceID, body map[string]any) error

FailoverPriorityChange applies a manual failover: the body must give every location exactly one unique priority, and the location with priority 0 becomes the write region.

func (*CosmosProvider) Get

func (p *CosmosProvider) Get(ctx context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*CosmosProvider) List

func (p *CosmosProvider) List(ctx context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; id's Names holds the parent chain for child lists.

func (*CosmosProvider) ListKeys

func (p *CosmosProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider.

func (*CosmosProvider) Namespace

func (p *CosmosProvider) Namespace() string

Namespace implements ResourceProvider.

func (*CosmosProvider) Patch

func (p *CosmosProvider) Patch(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Patch merges tags, identity and properties into an existing account.

func (*CosmosProvider) Put

func (p *CosmosProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*CosmosProvider) ReadonlyKeys

func (p *CosmosProvider) ReadonlyKeys(_ context.Context, id ResourceID) (map[string]any, error)

ReadonlyKeys serves the readonlykeys action.

func (*CosmosProvider) RegenerateKey

func (p *CosmosProvider) RegenerateKey(_ context.Context, id ResourceID, kind string) error

RegenerateKey replaces one of the account's keys with a fresh random one the data plane authorizes.

func (*CosmosProvider) Reset

func (p *CosmosProvider) Reset()

Reset implements ResourceProvider.

func (*CosmosProvider) ResourceTypes

func (p *CosmosProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type CosmosRegion

type CosmosRegion struct {
	Name     string
	Priority int
}

CosmosRegion is one account location and its failover priority.

type CosmosResources

type CosmosResources interface {
	// Endpoint reports the data-plane listener's port and whether it serves TLS.
	Endpoint() (port int, tls bool)
	// MasterKey is the data plane's configured master key.
	MasterKey() string
	// AcceptKey and RevokeKey manage extra keys the data plane authorizes.
	AcceptKey(key string)
	RevokeKey(key string)

	CreateDatabase(id string) (CosmosDatabase, error)
	GetDatabase(id string) (CosmosDatabase, error)
	ListDatabases() []CosmosDatabase
	DeleteDatabase(id string) error

	// PutContainer creates the container, or replaces its mutable settings when it already exists.
	PutContainer(db string, c CosmosContainer) (CosmosContainer, error)
	GetContainer(db, id string) (CosmosContainer, error)
	ListContainers(db string) ([]CosmosContainer, error)
	DeleteContainer(db, id string) error

	// GetThroughput reads the offer of a database (container == "") or container; ErrCosmosThroughputNotFound
	// when none is provisioned.
	GetThroughput(db, container string) (CosmosThroughput, error)
	// PutThroughput creates or replaces that offer.
	PutThroughput(db, container string, t CosmosThroughput) error

	// SetRegions publishes the account's regional topology (the lowest priority is the write region).
	SetRegions(regions []CosmosRegion, multiWrite bool)
}

CosmosResources is the seam the Microsoft.DocumentDB resource provider uses to reach the Cosmos DB data plane. Errors are the package's ErrCosmos* sentinels.

type CosmosThroughput

type CosmosThroughput = cosmosThroughput

CosmosThroughput is a provisioned-throughput setting: manual RU/s or an autoscale maximum.

type DockerFlexConfig

type DockerFlexConfig struct {
	// Runtime dials the container runtime on first use.
	Runtime      func() (container.Runtime, error)
	Ports        *portalloc.Allocator
	Logger       *slog.Logger
	Image        string
	StartTimeout time.Duration
}

DockerFlexConfig configures the docker engine: one postgres or mysql container per server.

type EnvironmentAuth

type EnvironmentAuth struct {
	LoginEndpoint    string   `json:"loginEndpoint"`
	IdentityProvider string   `json:"identityProvider"`
	Tenant           string   `json:"tenant"`
	Audiences        []string `json:"audiences"`
}

EnvironmentAuth is EnvironmentDescriptor's "authentication" field.

Tenant must be the literal string "common", and IdentityProvider must be "AAD" -- not gopherstack's fixed tenant GUID. hashicorp/go-azure-sdk's Environment.IsAzureStack() (sdk/environments/azure_stack.go) treats any other combination as an Azure Stack environment, which terraform-provider-azurerm explicitly refuses to run against (internal/clients/builder.go: "does not support Azure Stack"). Real Azure's own AzurePublic() environment (sdk/environments/azure_public.go) hardcodes exactly these two values even though it obviously isn't single-tenant -- this is a control field for auth flow selection, not a place to plug in a real tenant ID.

type EnvironmentDescriptor

type EnvironmentDescriptor struct {
	Suffixes                 EnvironmentSuffixes `json:"suffixes"`
	Gallery                  string              `json:"gallery"`
	Media                    string              `json:"media,omitempty"`
	Graph                    string              `json:"graph"`
	GraphAudience            string              `json:"graphAudience"`
	Name                     string              `json:"name"`
	ResourceManager          string              `json:"resourceManager"`
	ResourceManagerEndpoint  string              `json:"resourceManagerEndpoint"`
	ActiveDirectoryDataLake  string              `json:"activeDirectoryDataLake,omitempty"`
	SQLManagement            string              `json:"sqlManagement,omitempty"`
	Batch                    string              `json:"batch,omitempty"`
	Portal                   string              `json:"portal"`
	MicrosoftGraphResourceID string              `json:"microsoftGraphResourceId"`
	Authentication           EnvironmentAuth     `json:"authentication"`
}

EnvironmentDescriptor is the GET /metadata/endpoints response body: a SINGLE JSON object, not an array (see BuildMetadataEndpoints's doc comment for why this is non-obvious and easy to get backwards). Field set and semantics verified against hashicorp/go-azure-sdk's environments.FromEndpoint, which hard-fails on a document missing Name, ResourceManagerEndpoint, or MicrosoftGraphResourceID (AZURE.md section 10.8) -- every one of those three, plus every other field FromEndpoint reads, is populated below.

MicrosoftGraphResourceID is a TOP-LEVEL field ("microsoftGraphResourceId"), not nested under a "resourceIdentifiers" object -- verified against go-azure-sdk's sdk/internal/metadata/client.go's unexported metaDataResponse wire struct, which has no ResourceIdentifiers field at all. Nesting it silently zero-values the field on unmarshal (FromEndpoint then fails with "no `microsoftGraphResourceId` was returned").

func BuildMetadataEndpoints

func BuildMetadataEndpoints(baseURL string, settings Settings) EnvironmentDescriptor

BuildMetadataEndpoints builds the GET /metadata/endpoints response body for settings.Environment, with every URL pointing back at baseURL (the ARM listener's own scheme://host:port, e.g. "https://host:10006").

Returns a SINGLE EnvironmentDescriptor, not a slice -- deliberately, and non-obviously so. Real Azure's public /metadata/endpoints does return a JSON array (the multi-cloud discovery list: public/US Gov/China/etc), and that public shape is what most docs and examples show. But terraform-provider-azurerm's metadata_host custom-environment path never hits that public endpoint or its array-shaped client: it goes through hashicorp/go-azure-sdk's environments.FromEndpoint -> sdk/internal/metadata/client.go's GetMetaData, which does `json.Unmarshal(respBody, &metadata)` into a single `*metaDataResponse` struct. An array response there fails with "json: cannot unmarshal array into Go value of type metadata.metaDataResponse" -- a real bug M7 shipped with, undetected because no `terraform apply` had ever reached this endpoint until M8's CI-discovery-glob fix let the Terraform suite actually run (AZURE.md section 10.8 records this). Do not "fix" this back to an array without re-reading that section first.

type EnvironmentSuffixes

type EnvironmentSuffixes struct {
	Storage            string `json:"storage"`
	KeyVaultDNS        string `json:"keyVaultDns"`
	SQLServerHostname  string `json:"sqlServerHostname"`
	ACRLoginServer     string `json:"acrLoginServer"`
	AzureDatalakeStore string `json:"azureDataLakeStoreFileSystem,omitempty"`
}

EnvironmentSuffixes is EnvironmentDescriptor's "suffixes" field.

type EventGrid

type EventGrid interface {
	PutTopic(name, resourceID, inputSchema string) (EventGridTopic, error)
	TopicInfo(name string) (EventGridTopic, bool)
	DeleteTopic(name string) error
	TopicKeys(name string) (key1, key2 string, err error)
	RegenerateTopicKey(name, keyName string) (key1, key2 string, err error)

	PutSubscription(ctx context.Context, topic, name string, props map[string]any) (map[string]any, error)
	GetSubscription(topic, name string) (map[string]any, bool)
	DeleteSubscription(topic, name string) error
	SubscriptionFullURL(topic, name string) (string, error)

	PutNamespace(name string) error
	DeleteNamespace(name string) error
	NamespaceKeys(name string) (key1, key2 string, err error)
	RegenerateNamespaceKey(name, keyName string) (key1, key2 string, err error)
	PutNamespaceTopic(ns, name string) (time.Time, error)
	NamespaceTopicCreated(ns, name string) (time.Time, bool)
	DeleteNamespaceTopic(ns, name string) error

	PutPullSubscription(ns, topic, name string, props map[string]any) (map[string]any, error)
	GetPullSubscription(ns, topic, name string) (map[string]any, bool)
	DeletePullSubscription(ns, topic, name string) error

	PutDomain(name, resourceID, inputSchema string, autoCreate, autoDelete *bool) (EventGridDomain, error)
	DomainInfo(name string) (EventGridDomain, bool)
	DeleteDomain(name string) error
	DomainKeys(name string) (key1, key2 string, err error)
	RegenerateDomainKey(name, keyName string) (key1, key2 string, err error)
	PutDomainTopic(domain, name string) (time.Time, error)
	DomainTopic(domain, name string) (EventGridDomainTopic, bool)
	DomainTopics(domain string) ([]EventGridDomainTopic, error)
	DeleteDomainTopic(domain, name string) error

	// The scoped calls address a custom topic (domain empty), a domain (topic empty) or a domain topic.
	PutScopedSubscription(ctx context.Context, domain, topic, name string, props map[string]any) (map[string]any, error)
	GetScopedSubscription(domain, topic, name string) (map[string]any, bool)
	DeleteScopedSubscription(domain, topic, name string) error
	ScopedSubscriptionFullURL(domain, topic, name string) (string, error)
	DeliveryAttributes(domain, topic, name string) ([]map[string]any, error)
	// PatchScopedSubscription merges an EventSubscriptionUpdateParameters body into an existing subscription.
	PatchScopedSubscription(
		ctx context.Context,
		domain, topic, name string,
		patch map[string]any,
	) (map[string]any, error)

	// The resource calls address event subscriptions of an ARM scope: a subscription, resource group or resource.
	PutResourceSubscription(ctx context.Context, scopeID, name string, props map[string]any) (map[string]any, error)
	GetResourceSubscription(scopeID, name string) (map[string]any, bool)
	DeleteResourceSubscription(scopeID, name string) error
	ResourceSubscriptionFullURL(scopeID, name string) (string, error)
	ResourceDeliveryAttributes(scopeID, name string) ([]map[string]any, error)
	PatchResourceSubscription(ctx context.Context, scopeID, name string, patch map[string]any) (map[string]any, error)
}

EventGrid is the seam the Microsoft.EventGrid resource provider uses to keep the Event Grid data plane in step with ARM. Subscription and namespace-topic subscription properties cross as ARM property maps, so this package never imports services/azureeventgrid.

type EventGridDomain

type EventGridDomain struct {
	CreatedAt   time.Time
	InputSchema string
	AutoCreate  bool
	AutoDelete  bool
}

EventGridDomain is the data plane's view of a domain.

type EventGridDomainTopic

type EventGridDomainTopic struct {
	CreatedAt time.Time
	Name      string
}

EventGridDomainTopic is the data plane's view of a domain topic.

type EventGridEndpointConfig

type EventGridEndpointConfig struct {
	Override string
	Port     int
}

EventGridEndpointConfig configures the endpoints the provider advertises.

type EventGridProvider

type EventGridProvider struct {
	// contains filtered or unexported fields
}

EventGridProvider implements ResourceProvider for Microsoft.EventGrid. ARM keeps only ARM-side metadata; topics, keys, subscriptions and queued events live in the data plane.

func NewEventGridProvider

func NewEventGridProvider(cfg EventGridEndpointConfig, dataPlane EventGrid) *EventGridProvider

NewEventGridProvider creates an EventGridProvider; dataPlane may be nil.

func (*EventGridProvider) Delete

Delete implements ResourceProvider.

func (*EventGridProvider) DeleteResourcesInGroup

func (p *EventGridProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*EventGridProvider) DeleteScopeSubscription

func (p *EventGridProvider) DeleteScopeSubscription(scope EventSubscriptionScope, name string) error

DeleteScopeSubscription removes an event subscription of an ARM scope.

func (*EventGridProvider) DeliveryAttributes

func (p *EventGridProvider) DeliveryAttributes(_ context.Context, id ResourceID) (map[string]any, error)

DeliveryAttributes returns a subscription's delivery attribute mappings with secret values (POST .../getDeliveryAttributes).

func (*EventGridProvider) FullURL

func (p *EventGridProvider) FullURL(_ context.Context, id ResourceID) (map[string]any, error)

FullURL returns a WebHook subscription's complete endpoint URL (POST .../getFullUrl).

func (*EventGridProvider) Get

Get implements ResourceProvider.

func (*EventGridProvider) List

func (p *EventGridProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; only topics and namespaces are listable.

func (*EventGridProvider) ListDomainTopics

func (p *EventGridProvider) ListDomainTopics(_ context.Context, id ResourceID) ([]map[string]any, error)

ListDomainTopics lists the topics of the domain identified by id.

func (*EventGridProvider) ListEventSubscriptions

func (p *EventGridProvider) ListEventSubscriptions(q EventSubscriptionQuery) ([]map[string]any, string, error)

ListEventSubscriptions lists event subscriptions per q and returns the page and the next token.

func (*EventGridProvider) ListKeys

func (p *EventGridProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider for topics and namespaces.

func (*EventGridProvider) Namespace

func (p *EventGridProvider) Namespace() string

Namespace implements ResourceProvider.

func (*EventGridProvider) PatchScopeSubscription

func (p *EventGridProvider) PatchScopeSubscription(
	ctx context.Context, scope EventSubscriptionScope, name string, body map[string]any,
) (map[string]any, error)

PatchScopeSubscription applies an EventSubscriptionUpdateParameters body to an existing event subscription of an ARM scope.

func (*EventGridProvider) PatchSubscription

func (p *EventGridProvider) PatchSubscription(
	ctx context.Context, id ResourceID, body map[string]any,
) (map[string]any, error)

PatchSubscription applies an EventSubscriptionUpdateParameters body to an existing topic, domain or domain topic event subscription and returns the updated resource.

func (*EventGridProvider) Put

func (p *EventGridProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*EventGridProvider) PutScopeSubscription

func (p *EventGridProvider) PutScopeSubscription(
	ctx context.Context, scope EventSubscriptionScope, name string, body map[string]any,
) (map[string]any, error)

PutScopeSubscription creates or updates an event subscription on an ARM scope.

func (*EventGridProvider) RegenerateKey

func (p *EventGridProvider) RegenerateKey(_ context.Context, id ResourceID, keyName string) (map[string]any, error)

RegenerateKey replaces key1 or key2 and returns both keys.

func (*EventGridProvider) Reset

func (p *EventGridProvider) Reset()

Reset implements ResourceProvider.

func (*EventGridProvider) ResourceTypes

func (p *EventGridProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*EventGridProvider) ScopeDeliveryAttributes

func (p *EventGridProvider) ScopeDeliveryAttributes(
	scope EventSubscriptionScope, name string,
) (map[string]any, error)

ScopeDeliveryAttributes returns a subscription's delivery attribute mappings with secret values.

func (*EventGridProvider) ScopeSubscription

func (p *EventGridProvider) ScopeSubscription(scope EventSubscriptionScope, name string) (map[string]any, error)

ScopeSubscription returns an event subscription of an ARM scope.

func (*EventGridProvider) ScopeSubscriptionFullURL

func (p *EventGridProvider) ScopeSubscriptionFullURL(
	scope EventSubscriptionScope, name string,
) (map[string]any, error)

ScopeSubscriptionFullURL returns a WebHook subscription's complete endpoint URL.

type EventGridTopic

type EventGridTopic struct {
	CreatedAt   time.Time
	InputSchema string
}

EventGridTopic is the data plane's view of a custom topic.

type EventHubEndpointConfig

type EventHubEndpointConfig struct {
	Override string
	Port     int
	AMQPPort int
}

EventHubEndpointConfig configures the endpoints the provider advertises.

type EventHubInfo

type EventHubInfo struct {
	CreatedAt    time.Time
	PartitionIDs []string
	Retention    time.Duration
}

EventHubInfo is the data plane's view of an event hub.

type EventHubProvider

type EventHubProvider struct {
	// contains filtered or unexported fields
}

EventHubProvider implements ResourceProvider for Microsoft.EventHub. ARM keeps only ARM-side metadata; hubs, consumer groups, rules and their keys live in the data plane.

func NewEventHubProvider

func NewEventHubProvider(cfg EventHubEndpointConfig, dataPlane EventHubs) *EventHubProvider

NewEventHubProvider creates an EventHubProvider; dataPlane may be nil.

func (*EventHubProvider) Delete

func (p *EventHubProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*EventHubProvider) DeleteResourcesInGroup

func (p *EventHubProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*EventHubProvider) Get

func (p *EventHubProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*EventHubProvider) List

func (p *EventHubProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*EventHubProvider) ListKeys

func (p *EventHubProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider for .../authorizationRules/{rule}/listKeys.

func (*EventHubProvider) Namespace

func (p *EventHubProvider) Namespace() string

Namespace implements ResourceProvider.

func (*EventHubProvider) Put

func (p *EventHubProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*EventHubProvider) Reset

func (p *EventHubProvider) Reset()

Reset implements ResourceProvider.

func (*EventHubProvider) ResourceTypes

func (p *EventHubProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type EventHubRule

type EventHubRule struct {
	PrimaryKey   string
	SecondaryKey string
	Rights       []string
}

EventHubRule is the data plane's view of an authorization rule.

type EventHubs

type EventHubs interface {
	EnsureNamespace(name string) error
	DeleteNamespace(name string) error
	CreateHub(ns, name string, partitionCount int, retention time.Duration) (EventHubInfo, error)
	HubInfo(ns, name string) (EventHubInfo, bool)
	DeleteHub(ns, name string) error
	CreateConsumerGroup(ns, hub, name string) error
	DeleteConsumerGroup(ns, hub, name string) error
	PutRule(ns, hub, name string, rights []string) (EventHubRule, error)
	GetRule(ns, hub, name string) (EventHubRule, bool)
	DeleteRule(ns, hub, name string) error
}

EventHubs is the seam the Microsoft.EventHub resource provider uses to keep the Event Hubs data plane in step with ARM. Primitive types only, so this package never imports services/azureeventhubs. hub is empty for namespace-scoped rules.

type EventSubscriptionQuery

type EventSubscriptionQuery struct {
	// OwnerID, when set, restricts the list to subscriptions owned by that resource.
	OwnerID        string
	SubscriptionID string
	ResourceGroup  string
	Location       string
	TopicType      string
	Filter         string
	SkipToken      string
	// Regional selects subscriptions of Event Grid topics and domains (by location);
	// otherwise subscriptions of subscriptions, resource groups and other resources.
	Regional bool
	Top      int
}

EventSubscriptionQuery selects the event subscriptions a list operation returns.

type EventSubscriptionScope

type EventSubscriptionScope struct {
	ID             string
	SubscriptionID string
	ResourceGroup  string
}

EventSubscriptionScope identifies the owner of an event subscription that is not an Event Grid resource: a subscription, a resource group or a resource.

type FileServices

type FileServices interface {
	SetShareRetention(account string, enabled bool, days int32)
	ShareRetention(account string) (bool, int32)
}

FileServices is the seam through which the file service's share soft-delete policy reaches the Azure Files data plane.

type FlexDBProvider

type FlexDBProvider struct {
	// contains filtered or unexported fields
}

FlexDBProvider implements ResourceProvider for Microsoft.DBforPostgreSQL and Microsoft.DBforMySQL flexible servers (one instance per namespace). ARM keeps the server metadata and child resources; with an engine wired, real database servers run behind the FlexEngine seam.

func NewMySQLFlexProvider

func NewMySQLFlexProvider() *FlexDBProvider

NewMySQLFlexProvider creates the Microsoft.DBforMySQL provider.

func NewPostgresFlexProvider

func NewPostgresFlexProvider() *FlexDBProvider

NewPostgresFlexProvider creates the Microsoft.DBforPostgreSQL provider.

func (*FlexDBProvider) Action

func (p *FlexDBProvider) Action(id ResourceID, action string) (string, error)

Action runs start, stop or restart and returns the operation it started.

func (*FlexDBProvider) Capabilities

func (p *FlexDBProvider) Capabilities() []map[string]any

Capabilities returns the location capability list in the flavor's v1 shape.

func (*FlexDBProvider) CapabilitySet

func (p *FlexDBProvider) CapabilitySet(sub string) map[string]any

CapabilitySet returns the MySQL v2 capability set named aksDefaultName.

func (*FlexDBProvider) CheckName

func (p *FlexDBProvider) CheckName(_ context.Context, name, typ string) map[string]any

CheckName answers checkNameAvailability for a server name. Names are unique across the subscription.

func (*FlexDBProvider) Close

func (p *FlexDBProvider) Close()

Close stops background work and the engine's servers.

func (*FlexDBProvider) Delete

func (p *FlexDBProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*FlexDBProvider) DeleteResourcesInGroup

func (p *FlexDBProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*FlexDBProvider) Get

func (p *FlexDBProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*FlexDBProvider) List

func (p *FlexDBProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; only servers are listable here, children use ListChildren.

func (*FlexDBProvider) ListChildren

func (p *FlexDBProvider) ListChildren(id ResourceID, collection string) ([]map[string]any, error)

ListChildren returns the firewall rules, databases, configurations or replicas of a server.

func (*FlexDBProvider) ListKeys

func (p *FlexDBProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider; flexible servers have no keys.

func (*FlexDBProvider) Namespace

func (p *FlexDBProvider) Namespace() string

Namespace implements ResourceProvider.

func (*FlexDBProvider) OperationStatus

func (p *FlexDBProvider) OperationStatus(opID string) (flexOp, bool, bool)

OperationStatus reports whether opID is known, finished, and its failure message.

func (*FlexDBProvider) Put

func (p *FlexDBProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*FlexDBProvider) Remove

func (p *FlexDBProvider) Remove(id ResourceID) (string, error)

Remove deletes a resource and returns the async operation it started.

func (*FlexDBProvider) Reset

func (p *FlexDBProvider) Reset()

Reset implements ResourceProvider.

func (*FlexDBProvider) ResourceTypes

func (p *FlexDBProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*FlexDBProvider) SetClock

func (p *FlexDBProvider) SetClock(now func() time.Time)

SetClock replaces the provider's clock.

func (*FlexDBProvider) SetEngine

func (p *FlexDBProvider) SetEngine(e FlexEngine)

SetEngine wires the database engine; nil keeps servers ARM-only.

func (*FlexDBProvider) SetNetwork

func (p *FlexDBProvider) SetNetwork(n *NetworkProvider)

SetNetwork lets the provider validate delegated subnets against Microsoft.Network.

func (*FlexDBProvider) Write

func (p *FlexDBProvider) Write(id ResourceID, method string, body map[string]any) (flexResult, error)

Write applies a PUT or PATCH and returns the body and the async operation it started.

type FlexEndpoint

type FlexEndpoint struct {
	Host string
	Port int
}

FlexEndpoint is where a server's engine listens.

type FlexEngine

type FlexEngine interface {
	Ensure(ctx context.Context, id string, spec FlexSpec) (FlexEndpoint, error)
	Endpoint(id string) (FlexEndpoint, bool)
	SetPassword(ctx context.Context, id, login, password string) error
	Stop(ctx context.Context, id string) error
	Start(ctx context.Context, id string) error
	Restart(ctx context.Context, id string) error
	CreateDatabase(ctx context.Context, id, name, charset, collation string) error
	DropDatabase(ctx context.Context, id, name string) error
	Delete(ctx context.Context, id string) error
}

FlexEngine is the seam the flexible server providers use to run real database servers. id is the lower-cased ARM resource ID of the server. Primitive types only.

func NewDockerFlexEngine

func NewDockerFlexEngine(kind string, cfg DockerFlexConfig) FlexEngine

NewDockerFlexEngine returns a FlexEngine for kind flexKindPostgres or flexKindMySQL.

type FlexSpec

type FlexSpec struct {
	Version       string
	AdminLogin    string
	AdminPassword string
}

FlexSpec is what the database engine needs to bring up one flexible server. AdminPassword is empty when the request did not carry one.

type FunctionAppConfig

type FunctionAppConfig struct {
	Kind            string
	LinuxFx         string
	AppCommandLine  string
	HealthCheckPath string
}

FunctionAppConfig is what ARM tells the data plane about a function app's stack.

type FunctionAppFunction

type FunctionAppFunction struct {
	Config     map[string]any
	Name       string
	Language   string
	InvokeURL  string
	IsDisabled bool
}

FunctionAppFunction is one function of an app.

type FunctionAppInfo

type FunctionAppInfo struct {
	Created    time.Time
	LastDeploy time.Time
	HostName   string
	SCMHost    string
	Image      string
	Worker     string
	Failure    string
	Stopped    bool
	Deployed   bool
}

FunctionAppInfo is the data plane's view of a function app.

type FunctionApps

type FunctionApps interface {
	PutApp(name string, cfg FunctionAppConfig) (FunctionAppInfo, error)
	DeleteApp(name string) error
	AppInfo(name string) (FunctionAppInfo, bool)
	Settings(name string) (map[string]string, error)
	SetSettings(name string, settings map[string]string) error
	SetStopped(name string, stopped bool) error
	Restart(name string) error
	Functions(ctx context.Context, name string) ([]FunctionAppFunction, error)
	HostKeys(name string) (FunctionHostKeys, error)
	SetHostKey(name, keyType, keyName, value string) (string, error)
	DeleteHostKey(name, keyType, keyName string) error
	FunctionKeys(name, fn string) (map[string]string, error)
	SetFunctionKey(name, fn, keyName, value string) (string, error)
	DeleteFunctionKey(name, fn, keyName string) error
	PublishingCredentials(name string) (user, password, scmURI string, err error)
	SwapContent(first, second string) error
	WarmUp(ctx context.Context, name string) error
}

FunctionApps is the seam the Microsoft.Web resource provider uses to keep function apps and Linux web apps in step with the Azure Functions data plane. Primitive types only, so this package never imports the data-plane service. Slots are addressed as "<app>/<slot>". Implementations return ErrWebSiteNotFound, ErrWebFunctionNotFound, ErrWebKeyNotFound or ErrWebInvalidKeyType.

type FunctionHostKeys

type FunctionHostKeys struct {
	FunctionKeys map[string]string
	SystemKeys   map[string]string
	MasterKey    string
}

FunctionHostKeys are an app's host-level keys.

type GraphPortProvider

type GraphPortProvider interface {
	GetAzureGraphPort() int
}

GraphPortProvider is a private interface AppContext.Config may implement to expose the Graph listener's port.

type Handler

type Handler struct {
	Backend  *InMemoryBackend
	Registry *Registry
	Issuer   *aadauth.Issuer

	Settings Settings
	Port     int
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for the ARM emulation's dedicated listener.

func NewHandler

func NewHandler(backend *InMemoryBackend, registry *Registry, issuer *aadauth.Issuer, settings Settings) *Handler

NewHandler creates a new ARM Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the ARM operation name from the request, for metrics labeling.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts a resource identifier from the request path, for metrics labeling.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported ARM operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for ARM operations.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for the AzureARM handler. Irrelevant in practice since RouteMatcher never matches; 0 is the safe default.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory ARM state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher exists only to satisfy service.Registerable's interface contract: AzureARM deliberately never matches on the shared AWS single-port Router, exactly like services/azureblob/azurequeue/azuretable/ cosmosdb -- it runs on its own dedicated HTTPS listener started by StartWorker. Only RouteMatcher itself is inert.

func (*Handler) SetClientAuthenticator

func (h *Handler) SetClientAuthenticator(a ClientAuthenticator)

SetClientAuthenticator makes the token endpoint verify secrets of applications the directory knows. Call before the listener starts.

func (*Handler) SetPrincipalDirectory

func (h *Handler) SetPrincipalDirectory(dir PrincipalDirectory)

SetPrincipalDirectory lets role assignments resolve principals against dir; with Settings.ValidatePrincipals set, unknown principals are rejected with PrincipalNotFound.

func (*Handler) SetResourceObserver

func (h *Handler) SetResourceObserver(o ResourceObserver)

SetResourceObserver registers the observer; call it before the handler serves requests.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the dedicated ARM listener, mirroring services/azureblob.Handler.Shutdown's graceful-then-forced-close shape.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable: backend state plus the Microsoft.KeyVault provider's ARM-side vaults and deleted vaults.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds AzureARM's dedicated fixed port and serves HTTPS -- either with a stable caller-supplied certificate or a freshly generated self-signed one (see loadOrGenerateCert) -- synchronously, failing fast if the port is unavailable rather than falling back into the shared PortAlloc pool -- exactly like services/azureblob/azurequeue/azuretable/cosmosdb's StartWorker (see AZURE.md section 10.7). Unlike those, ARM serves HTTPS unconditionally: azurerm's metadata_host handling hardcodes "https://" (AZURE.md section 10.8), so a plain-HTTP listener here would make provider initialization fail outright, not merely warn.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend owns the ARM resource graph: one subscription's resource groups, its generic resource-provider-registration state, and the flat map of every resource not owned by a dedicated ResourceProvider's own internal state (e.g. rp_storage.go keeps its own storage-account map -- see registry.go for how the two interact). This is ARM-side metadata ONLY, never a second copy of any data-plane service's state (AZURE.md section 10.9).

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty InMemoryBackend.

func (*InMemoryBackend) DeleteResourceGroup

func (b *InMemoryBackend) DeleteResourceGroup(name string) error

DeleteResourceGroup deletes the resource group named name, along with every generic resource whose ResourceGroup matches (case-insensitively). Resources owned by a dedicated ResourceProvider's own internal state (e.g. storage accounts) are NOT cascaded here -- see registry.go's DeleteResourcesInGroup, which handler.go calls across every registered provider before calling this.

func (*InMemoryBackend) GetResourceGroup

func (b *InMemoryBackend) GetResourceGroup(name string) (ResourceGroup, error)

GetResourceGroup returns the resource group named name.

func (*InMemoryBackend) IsProviderRegistered

func (b *InMemoryBackend) IsProviderRegistered(subscriptionID, namespace string) bool

IsProviderRegistered reports whether namespace has been registered for subscriptionID.

func (*InMemoryBackend) ListResourceGroups

func (b *InMemoryBackend) ListResourceGroups() []ResourceGroup

ListResourceGroups returns every resource group, sorted by name.

func (*InMemoryBackend) ProviderRegistrationState

func (b *InMemoryBackend) ProviderRegistrationState(subscriptionID, namespace string) string

ProviderRegistrationState returns "Registered" or "NotRegistered" for namespace under subscriptionID, the value ARM's /providers/{ns} response carries in its "registrationState" field.

func (*InMemoryBackend) PutResourceGroup

func (b *InMemoryBackend) PutResourceGroup(name, location string, tags map[string]string) (ResourceGroup, bool)

PutResourceGroup creates or updates the resource group named name. Always synchronous (AZURE.md section 10.3): the caller determines 200 vs 201 from the returned created bool.

func (*InMemoryBackend) RegisterProvider

func (b *InMemoryBackend) RegisterProvider(subscriptionID, namespace string)

RegisterProvider marks namespace as registered for subscriptionID.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory ARM state. Used by the POST /_gopherstack/reset endpoint. Never touches any data-plane service's own state (AZURE.md section 10.9).

func (*InMemoryBackend) ResourceGroupExists

func (b *InMemoryBackend) ResourceGroupExists(name string) bool

ResourceGroupExists reports whether a resource group named name exists.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable. Restore must be idempotent against the data plane (AZURE.md section 10.9): this method only ever restores ARM's own metadata, never re-creates or otherwise touches any data-plane service's state.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

type KeyVaultEndpointConfig

type KeyVaultEndpointConfig struct {
	Override string
	Port     int
}

KeyVaultEndpointConfig configures how the KeyVault resource provider advertises properties.vaultUri.

type KeyVaultPortProvider

type KeyVaultPortProvider interface {
	GetAzureKeyVaultPort() int
}

KeyVaultPortProvider is a private interface AppContext.Config may implement to expose the Key Vault listener's configured port.

type KeyVaultProvider

type KeyVaultProvider struct {
	// contains filtered or unexported fields
}

KeyVaultProvider implements ResourceProvider for Microsoft.KeyVault/vaults. Vault lifecycle is delegated to the data plane through the KeyVaults seam.

func NewKeyVaultProvider

func NewKeyVaultProvider(cfg KeyVaultEndpointConfig, dataPlane KeyVaults) *KeyVaultProvider

NewKeyVaultProvider creates a KeyVaultProvider; dataPlane may be nil.

func (*KeyVaultProvider) CheckNameAvailability

func (p *KeyVaultProvider) CheckNameAvailability(name string) map[string]any

CheckNameAvailability implements the checkNameAvailability action.

func (*KeyVaultProvider) Delete

func (p *KeyVaultProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*KeyVaultProvider) DeleteResourcesInGroup

func (p *KeyVaultProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*KeyVaultProvider) Get

func (p *KeyVaultProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*KeyVaultProvider) GetDeleted

func (p *KeyVaultProvider) GetDeleted(sub, location, name string) (map[string]any, error)

GetDeleted returns the wire body of a soft-deleted vault.

func (*KeyVaultProvider) List

func (p *KeyVaultProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*KeyVaultProvider) ListKeys

func (p *KeyVaultProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider; vaults have no listKeys action.

func (*KeyVaultProvider) Namespace

func (p *KeyVaultProvider) Namespace() string

Namespace implements ResourceProvider.

func (*KeyVaultProvider) PurgeDeleted

func (p *KeyVaultProvider) PurgeDeleted(sub, location, name string) error

PurgeDeleted permanently removes a soft-deleted vault, unless purge protection is enabled.

func (*KeyVaultProvider) Put

func (p *KeyVaultProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*KeyVaultProvider) Reset

func (p *KeyVaultProvider) Reset()

Reset implements ResourceProvider.

func (*KeyVaultProvider) ResourceTypes

func (p *KeyVaultProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type KeyVaultSecrets

type KeyVaultSecrets interface {
	SecretValue(vault, name, version string) (string, error)
}

KeyVaultSecrets reads secret values for container app secrets that reference Key Vault.

type KeyVaults

type KeyVaults interface {
	CreateVault(name string, retentionDays int, purgeProtection bool)
	DeleteVault(name string)
	// SoftDeleteVault retires the vault, keeping its contents for RecoverVault.
	SoftDeleteVault(name string)
	// RecoverVault restores a soft-deleted vault with its contents.
	RecoverVault(name string)
	// PurgeVault permanently discards a soft-deleted vault's contents.
	PurgeVault(name string)
}

KeyVaults is the seam the Microsoft.KeyVault resource provider uses to register and remove vaults in the Key Vault data plane. Primitive types only, so this package never imports services/azurekeyvault.

type ManagedIdentityProvider

type ManagedIdentityProvider struct {
	// contains filtered or unexported fields
}

ManagedIdentityProvider implements ResourceProvider for Microsoft.ManagedIdentity user-assigned identities.

func NewManagedIdentityProvider

func NewManagedIdentityProvider(tenantID string) *ManagedIdentityProvider

NewManagedIdentityProvider creates a provider whose identities belong to tenantID.

func (*ManagedIdentityProvider) Delete

Delete implements ResourceProvider.

func (*ManagedIdentityProvider) DeleteResourcesInGroup

func (p *ManagedIdentityProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*ManagedIdentityProvider) Get

Get implements ResourceProvider.

func (*ManagedIdentityProvider) List

List implements ResourceProvider.

func (*ManagedIdentityProvider) ListKeys

ListKeys implements ResourceProvider.

func (*ManagedIdentityProvider) Namespace

func (p *ManagedIdentityProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ManagedIdentityProvider) PatchTags

func (p *ManagedIdentityProvider) PatchTags(id ResourceID, tags map[string]string) (map[string]any, error)

PatchTags implements the identity Update operation.

func (*ManagedIdentityProvider) Put

func (p *ManagedIdentityProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*ManagedIdentityProvider) Reset

func (p *ManagedIdentityProvider) Reset()

Reset implements ResourceProvider.

func (*ManagedIdentityProvider) ResourceTypes

func (p *ManagedIdentityProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type MonitorError

type MonitorError struct {
	Code    string
	Message string
	Status  int
}

MonitorError is a data-plane failure carried to the ARM error envelope unchanged.

func (*MonitorError) Error

func (e *MonitorError) Error() string

type MonitorLogs

type MonitorLogs interface {
	Put(req MonitorRequest, body map[string]any) (map[string]any, error)
	Get(req MonitorRequest) (map[string]any, error)
	Patch(req MonitorRequest, body map[string]any) (map[string]any, error)
	Delete(req MonitorRequest) error
	List(req MonitorRequest) ([]map[string]any, error)
	Action(req MonitorRequest, action string, body map[string]any) (map[string]any, error)
	DeleteInGroup(rg string)
	Reset()
}

MonitorLogs is the seam the Microsoft.OperationalInsights and Microsoft.Insights providers use to keep workspaces, tables, data collection endpoints and rules in the Azure Monitor Logs data plane. Errors wrap ErrResourceNotFound or are *MonitorError values.

type MonitorProvider

type MonitorProvider struct {
	// contains filtered or unexported fields
}

MonitorProvider implements ResourceProvider for Microsoft.OperationalInsights (workspaces, tables) and Microsoft.Insights (data collection endpoints and rules). Every other type under those namespaces keeps the generic metadata-only store.

func NewMonitorProvider

func NewMonitorProvider(namespace string, backend *InMemoryBackend, dataPlane MonitorLogs) *MonitorProvider

NewMonitorProvider creates the provider for one namespace; dataPlane may be nil.

func (*MonitorProvider) Action

func (p *MonitorProvider) Action(
	ctx context.Context, id ResourceID, action string, body map[string]any,
) (map[string]any, error)

Action runs a POST action on a workspace.

func (*MonitorProvider) Delete

func (p *MonitorProvider) Delete(ctx context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*MonitorProvider) DeleteResourcesInGroup

func (p *MonitorProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*MonitorProvider) Get

func (p *MonitorProvider) Get(ctx context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*MonitorProvider) List

func (p *MonitorProvider) List(ctx context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*MonitorProvider) ListKeys

func (p *MonitorProvider) ListKeys(ctx context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider; only workspaces have keys.

func (*MonitorProvider) Namespace

func (p *MonitorProvider) Namespace() string

Namespace implements ResourceProvider.

func (*MonitorProvider) Patch

func (p *MonitorProvider) Patch(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Patch updates tags and mutable properties.

func (*MonitorProvider) Put

func (p *MonitorProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*MonitorProvider) Reset

func (p *MonitorProvider) Reset()

Reset implements ResourceProvider.

func (*MonitorProvider) ResourceTypes

func (p *MonitorProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type MonitorRequest

type MonitorRequest struct {
	Host      string
	Sub       string
	RG        string
	Namespace string
	Types     []string
	Names     []string
}

MonitorRequest addresses a Microsoft.OperationalInsights or Microsoft.Insights resource.

type NetworkProvider

type NetworkProvider struct {
	// contains filtered or unexported fields
}

NetworkProvider implements ResourceProvider for Microsoft.Network.

func NewNetworkProvider

func NewNetworkProvider(backend *InMemoryBackend) *NetworkProvider

NewNetworkProvider creates a provider; types it does not model fall through to backend's generic store.

func (*NetworkProvider) CheckIPAddressAvailability

func (p *NetworkProvider) CheckIPAddressAvailability(id ResourceID, ip string) (map[string]any, error)

CheckIPAddressAvailability implements the virtual network action of the same name.

func (*NetworkProvider) Delete

func (p *NetworkProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*NetworkProvider) DeleteResourcesInGroup

func (p *NetworkProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider; references from other groups to the removed resources are dropped so no association dangles.

func (*NetworkProvider) Get

func (p *NetworkProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*NetworkProvider) List

func (p *NetworkProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*NetworkProvider) ListKeys

func (p *NetworkProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider.

func (*NetworkProvider) Namespace

func (p *NetworkProvider) Namespace() string

Namespace implements ResourceProvider.

func (*NetworkProvider) PatchTags

func (p *NetworkProvider) PatchTags(id ResourceID, tags map[string]string) (map[string]any, error)

PatchTags replaces the tags of a top-level resource, as the UpdateTags operations do.

func (*NetworkProvider) Put

func (p *NetworkProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*NetworkProvider) Reset

func (p *NetworkProvider) Reset()

Reset implements ResourceProvider.

func (*NetworkProvider) ResourceTypes

func (p *NetworkProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*NetworkProvider) SetLookup

func (p *NetworkProvider) SetLookup(f func(context.Context, ResourceID) (map[string]any, error))

SetLookup gives the provider a way to resolve private-link targets in other namespaces.

type PrincipalDirectory

type PrincipalDirectory interface {
	PrincipalType(id string) (string, bool)
}

PrincipalDirectory resolves role assignment principals; PrincipalType returns User, Group or ServicePrincipal.

type Provider

type Provider struct{}

Provider implements service.Provider for the ARM emulation.

Like services/azureblob/azurequeue/azuretable/cosmosdb/azureservicebus, AzureARM does not register a RouteMatcher into the shared AWS single-port Router -- see handler.go's RouteMatcher doc comment. It is registered in cli.go's getMostRecentServiceProviders like every other provider; only its RouteMatcher (which always returns false) is inert.

func (*Provider) Init

Init initializes the ARM backend, registry (with the Storage RP registered), AAD token issuer, and handler. The configured port (Settings.Port, default DefaultPort) is only recorded here; the actual TCP bind happens synchronously in Handler.StartWorker, so a port-in-use failure is returned to the caller directly instead of being discovered later from a background goroutine.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type Redis

type Redis interface {
	Ensure(id string, spec RedisSpec) (RedisEndpoint, error)
	Endpoint(id string) (RedisEndpoint, bool)
	Delete(id string) error
	Keys(id string) (RedisKeys, error)
	RegenerateKey(id, keyType string) (RedisKeys, error)
	Reboot(id, rebootType string) error
	Import(id, format string, files []string) error
	Export(id, format, prefix, container string) error
}

Redis is the seam the Microsoft.Cache resource provider uses to run real Redis servers for its caches. id is the lower-cased ARM resource ID. Primitive types only, so this package never imports services/azureredis.

type RedisEndpoint

type RedisEndpoint struct {
	Host    string
	Port    int
	SSLPort int
}

RedisEndpoint is where a cache's servers listen; Port is 0 while the plaintext port is disabled.

type RedisKeys

type RedisKeys struct {
	Primary   string
	Secondary string
}

RedisKeys are a cache's access keys.

type RedisProvider

type RedisProvider struct {
	// contains filtered or unexported fields
}

RedisProvider implements ResourceProvider for Microsoft.Cache/redis. ARM keeps the resource metadata, firewall rules, patch schedule and linked servers; the Redis servers, access keys and data live behind the Redis seam.

func NewRedisProvider

func NewRedisProvider(dataPlane Redis) *RedisProvider

NewRedisProvider creates a RedisProvider; dataPlane may be nil.

func (*RedisProvider) CreateOperation

func (p *RedisProvider) CreateOperation(readyAt time.Time) string

CreateOperation registers an async operation that completes at readyAt and returns its ID.

func (*RedisProvider) Delete

func (p *RedisProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*RedisProvider) DeleteResourcesInGroup

func (p *RedisProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*RedisProvider) ExportData

func (p *RedisProvider) ExportData(id ResourceID, body map[string]any) error

ExportData writes the cache's data to a blob container as an RDB file.

func (*RedisProvider) ForceReboot

func (p *RedisProvider) ForceReboot(id ResourceID, body map[string]any) (map[string]any, error)

ForceReboot reboots the selected nodes; see azureredis.Reboot for what survives.

func (*RedisProvider) Get

func (p *RedisProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*RedisProvider) ImportData

func (p *RedisProvider) ImportData(id ResourceID, body map[string]any) error

ImportData loads an RDB blob into the cache.

func (*RedisProvider) List

func (p *RedisProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; only caches are listable here.

func (*RedisProvider) ListChildren

func (p *RedisProvider) ListChildren(parent ResourceID, childType string) ([]map[string]any, error)

ListChildren lists a cache's firewall rules, patch schedules or linked servers.

func (*RedisProvider) ListKeys

func (p *RedisProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider.

func (*RedisProvider) Namespace

func (p *RedisProvider) Namespace() string

Namespace implements ResourceProvider.

func (*RedisProvider) OperationDone

func (p *RedisProvider) OperationDone(id string) bool

OperationDone reports whether an operation has completed; unknown (aged-out) operations are complete.

func (*RedisProvider) Patch

func (p *RedisProvider) Patch(id ResourceID, body map[string]any) (map[string]any, error)

Patch merges an Update request into an existing cache.

func (*RedisProvider) Put

func (p *RedisProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*RedisProvider) ReadyAt

func (p *RedisProvider) ReadyAt(id ResourceID) time.Time

ReadyAt is when the cache's current provisioning completes.

func (*RedisProvider) RegenerateKey

func (p *RedisProvider) RegenerateKey(id ResourceID, keyType string) (map[string]any, error)

RegenerateKey replaces the Primary or Secondary access key.

func (*RedisProvider) Reset

func (p *RedisProvider) Reset()

Reset implements ResourceProvider.

func (*RedisProvider) ResourceTypes

func (p *RedisProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type RedisSpec

type RedisSpec struct {
	SKU              string
	MinTLS           string
	EnableNonSSLPort bool
	Persistence      bool
	AuthNotRequired  bool
}

RedisSpec is the part of a cache's configuration the Redis servers act on.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry dispatches generic-resource operations to the ResourceProvider registered for a namespace, falling back to InMemoryBackend's own generic (metadata-only) resource storage for any namespace with no dedicated provider -- so PUT/GET/DELETE of an arbitrary Microsoft.SomeFutureThing/whatever resource still round-trips instead of 404ing, per AZURE.md section 10.1's generic-resource-plane requirement.

func NewRegistry

func NewRegistry(backend *InMemoryBackend) *Registry

NewRegistry creates a Registry backed by backend, with no providers registered yet (use Register).

func (*Registry) CloseAll

func (r *Registry) CloseAll()

CloseAll stops the workloads of every provider that runs any.

func (*Registry) Delete

func (r *Registry) Delete(ctx context.Context, id ResourceID) error

Delete removes the resource identified by id.

func (*Registry) DeleteResourcesInGroup

func (r *Registry) DeleteResourcesInGroup(ctx context.Context, resourceGroup string)

DeleteResourcesInGroup cascades a resource-group delete into every registered dedicated provider, so a provider's own resources in that group (e.g. StorageProvider's accounts) don't survive as orphans reachable by their own resource ID after the owning group is gone.

func (*Registry) Get

func (r *Registry) Get(ctx context.Context, id ResourceID) (map[string]any, error)

Get returns the resource identified by id.

func (*Registry) List

func (r *Registry) List(ctx context.Context, id ResourceID) ([]map[string]any, error)

List returns every resource of id's LeafType, scoped per id.ResourceGroup.

func (*Registry) ListKeys

func (r *Registry) ListKeys(ctx context.Context, id ResourceID) (map[string]any, error)

ListKeys returns the listKeys response body for id.

func (*Registry) ProviderNamed

func (r *Registry) ProviderNamed(ns string) (ResourceProvider, bool)

ProviderNamed returns the dedicated ResourceProvider registered for ns (matched case-insensitively, AZURE.md section 10.1), and whether one was found. Used by the /providers/{ns} and /providers/{ns}/register handlers, which take ns directly from the URL path rather than a parsed ResourceID.

func (*Registry) Providers

func (r *Registry) Providers() []string

Providers returns the namespaces of every registered dedicated ResourceProvider, sorted, for the provider-list endpoint.

func (*Registry) Put

func (r *Registry) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, bool, error)

Put creates or updates the resource identified by id.

func (*Registry) Register

func (r *Registry) Register(p ResourceProvider)

Register adds a ResourceProvider to the registry, keyed by its lowercased Namespace() -- ARM namespaces are matched case-insensitively (AZURE.md section 10.1: "Microsoft.storage" and "microsoft.STORAGE" must both reach the same dedicated provider, not fall through to the generic pass-through).

func (*Registry) ResetAll

func (r *Registry) ResetAll()

ResetAll clears every registered dedicated provider's own state. Called by Handler.Reset alongside InMemoryBackend.Reset -- the generic pass-through resources and dedicated-provider resources (e.g. StorageProvider.accounts) are two separate stores, and the /_gopherstack/reset endpoint must clear both.

func (*Registry) SetACIFileShares

func (r *Registry) SetACIFileShares(s ACIFileShares)

SetACIFileShares gives the registered Microsoft.ContainerInstance provider (if any) the Azure Files seam that azureFile volumes use.

func (*Registry) SetAppConfig

func (r *Registry) SetAppConfig(a AppConfig)

SetAppConfig gives the registered Microsoft.AppConfiguration provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetContainerRegistries

func (r *Registry) SetContainerRegistries(c ContainerRegistries)

SetContainerRegistries gives the registered Microsoft.ContainerRegistry provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetCosmosResources

func (r *Registry) SetCosmosResources(c CosmosResources)

SetCosmosResources gives the registered Microsoft.DocumentDB provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetEventGrid

func (r *Registry) SetEventGrid(e EventGrid)

SetEventGrid gives the registered Microsoft.EventGrid provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetEventHubs

func (r *Registry) SetEventHubs(e EventHubs)

SetEventHubs gives the registered Microsoft.EventHub provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetFileServices

func (r *Registry) SetFileServices(fs FileServices)

SetFileServices gives the Microsoft.Storage provider (if any) a data-plane adapter for file service properties.

func (*Registry) SetFunctionApps

func (r *Registry) SetFunctionApps(f FunctionApps)

SetFunctionApps gives the registered Microsoft.Web provider (if any) a real Azure Functions data-plane adapter, replacing its no-op default.

func (*Registry) SetKeyVaultSecrets

func (r *Registry) SetKeyVaultSecrets(v KeyVaultSecrets)

SetKeyVaultSecrets gives the registered Microsoft.App provider (if any) the Key Vault reader that resolves keyVaultUrl secrets.

func (*Registry) SetKeyVaults

func (r *Registry) SetKeyVaults(k KeyVaults)

SetKeyVaults gives the registered Microsoft.KeyVault provider (if any) a real KeyVaults adapter, replacing its no-op default.

func (*Registry) SetMonitorLogs

func (r *Registry) SetMonitorLogs(m MonitorLogs)

SetMonitorLogs gives the registered Microsoft.OperationalInsights and Microsoft.Insights providers (if any) a real data-plane adapter, replacing their no-op default.

func (*Registry) SetRedis

func (r *Registry) SetRedis(rd Redis)

SetRedis gives the registered Microsoft.Cache provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetSQL

func (r *Registry) SetSQL(s SQL)

SetSQL gives the registered Microsoft.Sql provider (if any) a real data-plane adapter, replacing its no-op default.

func (*Registry) SetServiceBusEntities

func (r *Registry) SetServiceBusEntities(e ServiceBusEntities)

SetServiceBusEntities gives the registered Microsoft.ServiceBus provider (if any) a real ServiceBusEntities adapter, replacing its no-op default -- called post-construction by cli.go's wireAzureARMResourceProviders once services/azureservicebus's own Handler exists, mirroring M8's wireAzureStorageVHost pattern (this can't be wired at azurearm.Provider.Init time the way StorageAccountsProvider is, since it needs a live reference to a sibling service's already-constructed runtime handler). A no-op if Microsoft.ServiceBus isn't registered or isn't a *ServiceBusProvider.

type Resource

type Resource struct {
	Tags       map[string]string
	Properties map[string]any
	SKU        map[string]any
	Location   string
	Kind       string
	ID         ResourceID
}

Resource is the generic stored representation of an ARM resource (any namespace/type not owned by a specific ResourceProvider -- see registry.go's fallback behavior). ResourceProvider implementations (e.g. rp_storage.go) may keep their own richer internal representation and build the wire body directly instead of using this type; Resource exists for the generic pass-through path every namespace gets even without a dedicated RP.

func (Resource) Body

func (r Resource) Body() map[string]any

Body returns the ARM wire response body for r.

type ResourceChange

type ResourceChange struct {
	Time            time.Time
	Claims          map[string]any
	SubscriptionID  string
	ResourceGroup   string
	ResourceURI     string
	Provider        string
	OperationName   string
	CorrelationID   string
	TenantID        string
	HTTPMethod      string
	HTTPURL         string
	ClientRequestID string
	ClientIP        string
	Kind            ResourceChangeKind
}

ResourceChange describes a successful ARM write, delete or action.

type ResourceChangeKind

type ResourceChangeKind int

ResourceChangeKind is the kind of a successful ARM operation.

const (
	ResourceWritten ResourceChangeKind = iota
	ResourceDeleted
	ResourceActionRun
)

Kinds of ResourceChange.

type ResourceGroup

type ResourceGroup struct {
	Tags     map[string]string `json:"tags,omitempty"`
	Name     string            `json:"name"`
	Location string            `json:"location"`
}

ResourceGroup is the stored representation of an ARM resource group.

func (ResourceGroup) Body

func (g ResourceGroup) Body(subscriptionID string) map[string]any

Body returns the ARM wire response body for g, scoped to subscriptionID.

type ResourceID

type ResourceID struct {
	SubscriptionID string
	ResourceGroup  string
	Namespace      string
	Types          []string
	Names          []string
}

ResourceID is a parsed ARM resource identifier of the generic shape /subscriptions/{sub}/resourceGroups/{rg}/providers/{namespace}/{type1}/{name1}[/{type2}/{name2}...].

Types/Names are parallel slices so nested child resources (e.g. Microsoft.ServiceBus/namespaces/{ns}/queues/{q}, two type/name pairs) are represented without a separate "parent" concept -- exactly the single generic path walker AZURE.md section 10.1 requires instead of per-type route registration.

func ParseGenericResourceListPath

func ParseGenericResourceListPath(path string) (ResourceID, bool, error)

ParseGenericResourceListPath parses a resource-type LIST path, either scoped to a resource group:

/subscriptions/{sub}/resourceGroups/{rg}/providers/{ns}/{type}

or across the whole subscription:

/subscriptions/{sub}/providers/{ns}/{type}

Returns the parsed (partial) ResourceID -- Names is empty -- and whether a resource group scope was present.

func ParseGenericResourcePath

func ParseGenericResourcePath(path string) (ResourceID, error)

ParseGenericResourcePath parses a full generic-resource ARM path:

/subscriptions/{sub}/resourceGroups/{rg}/providers/{ns}/{type}/{name}[/{type}/{name}...]

The "resourcegroups"/"resourceGroups" segment is matched case-insensitively per AZURE.md section 10.1 -- real ARM accepts both and azurerm emits both depending on code path.

func (ResourceID) ARMID

func (id ResourceID) ARMID() string

ARMID renders the canonical ARM resource ID string for id, always using the canonical "resourceGroups" casing regardless of what was parsed.

func (ResourceID) LeafName

func (id ResourceID) LeafName() string

LeafName returns the last (innermost) resource name segment -- the name of the resource this ID actually identifies.

func (ResourceID) LeafType

func (id ResourceID) LeafType() string

LeafType returns the last (innermost) resource type segment.

func (ResourceID) ResourceType

func (id ResourceID) ResourceType() string

ResourceType returns the ARM resource type string, e.g. "Microsoft.Storage/storageAccounts" or "Microsoft.ServiceBus/namespaces/queues".

type ResourceObserver

type ResourceObserver interface {
	ResourceChanged(ResourceChange)
}

ResourceObserver is told about every successful ARM write, delete and action.

type ResourceProvider

type ResourceProvider interface {
	// Namespace returns the ARM provider namespace this implementation
	// serves, e.g. "Microsoft.Storage".
	Namespace() string
	// ResourceTypes returns the resource types this provider serves, for
	// the /providers/{ns} registration-status response.
	ResourceTypes() []ResourceTypeDef
	// Put creates or updates the resource identified by id from body,
	// returning the full wire response body.
	Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)
	// Get returns the full wire response body for id.
	Get(ctx context.Context, id ResourceID) (map[string]any, error)
	// Delete removes the resource identified by id.
	Delete(ctx context.Context, id ResourceID) error
	// List returns every resource of id's LeafType, scoped to id's
	// ResourceGroup if set, else the whole subscription.
	List(ctx context.Context, id ResourceID) ([]map[string]any, error)
	// ListKeys returns the POST .../listKeys response body for id.
	ListKeys(ctx context.Context, id ResourceID) (map[string]any, error)
	// Reset clears all of this provider's own state, called by
	// Handler.Reset via Registry.ResetAll (the /_gopherstack/reset
	// endpoint) -- without this, a dedicated provider's resources survive
	// a reset that's supposed to wipe every service's state.
	Reset()
	// DeleteResourcesInGroup deletes every resource this provider owns in
	// resourceGroup, called by Registry.DeleteResourcesInGroup when a
	// resource group is deleted -- without this, a dedicated provider's
	// resources in that group are orphaned (InMemoryBackend's own generic
	// resources are cascaded directly by DeleteResourceGroup, but a
	// dedicated provider's internal state is opaque to InMemoryBackend).
	DeleteResourcesInGroup(ctx context.Context, resourceGroup string)
}

ResourceProvider is the small interface a resource-provider namespace (Microsoft.Storage today; Microsoft.ServiceBus/Microsoft.DocumentDB in M8/M9, Microsoft.KeyVault/Microsoft.AppConfiguration in M11/M12) plugs into the registry with. Deliberately narrow (AZURE.md section 10.6) so each future milestone adds one file and one registry entry.

Put/Get/Delete/ListKeys all return the full ARM wire response body (or nil for Delete's 204 case) -- the ResourceProvider owns its own response shape entirely, including the common id/name/type/location/tags/ properties.provisioningState envelope (Resource.Body / a hand-built equivalent), rather than the registry re-wrapping it.

type ResourceTypeDef

type ResourceTypeDef struct {
	Type        string
	APIVersions []string
	HasChildren bool
}

ResourceTypeDef describes one resource type a ResourceProvider serves -- its type name, supported API versions, and whether it has child resource types nested beneath it (informational only in this MVP; see registry.go).

type SQL

type SQL interface {
	EnsureServer(id string, spec SQLSpec) (SQLEndpoint, error)
	Endpoint(id string) (SQLEndpoint, bool)
	DeleteServer(id string) error
	EnsureDatabase(serverID, name, collation string) error
	DropDatabase(serverID, name string) error
}

SQL is the seam the Microsoft.Sql resource provider uses to run real SQL Server engines for its logical servers. id is the lower-cased ARM resource ID of the server. Primitive types only, so this package never imports services/azuresql.

type SQLEndpoint

type SQLEndpoint struct {
	Host string
	Port int
}

SQLEndpoint is where a server's TDS port listens; Port is 0 while the server is state-only.

type SQLProvider

type SQLProvider struct {
	// contains filtered or unexported fields
}

SQLProvider implements ResourceProvider for Microsoft.Sql. ARM keeps the resource metadata and child resources; the SQL Server engines and their databases live behind the SQL seam.

func NewSQLProvider

func NewSQLProvider(dataPlane SQL) *SQLProvider

NewSQLProvider creates a SQLProvider; dataPlane may be nil.

func (*SQLProvider) CreateOperation

func (p *SQLProvider) CreateOperation() string

CreateOperation registers an async operation and returns its ID.

func (*SQLProvider) Delete

func (p *SQLProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*SQLProvider) DeleteResourcesInGroup

func (p *SQLProvider) DeleteResourcesInGroup(ctx context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*SQLProvider) Get

func (p *SQLProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*SQLProvider) List

func (p *SQLProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider; only servers are listable here, children use ListChildren.

func (*SQLProvider) ListChildren

func (p *SQLProvider) ListChildren(parent ResourceID, childType string) ([]map[string]any, error)

ListChildren lists the children of type childType under a server or database.

func (*SQLProvider) ListKeys

func (p *SQLProvider) ListKeys(context.Context, ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider; SQL servers have no keys.

func (*SQLProvider) Namespace

func (p *SQLProvider) Namespace() string

Namespace implements ResourceProvider.

func (*SQLProvider) OperationKnown

func (p *SQLProvider) OperationKnown(id string) bool

OperationKnown reports whether id was issued by CreateOperation and has not aged out.

func (*SQLProvider) Patch

func (p *SQLProvider) Patch(id ResourceID, body map[string]any) (map[string]any, error)

Patch merges an Update request into an existing server.

func (*SQLProvider) PatchDatabase

func (p *SQLProvider) PatchDatabase(id ResourceID, body map[string]any) (map[string]any, error)

PatchDatabase merges an Update request into an existing database.

func (*SQLProvider) Put

func (p *SQLProvider) Put(_ context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*SQLProvider) Reset

func (p *SQLProvider) Reset()

Reset implements ResourceProvider.

func (*SQLProvider) ResourceTypes

func (p *SQLProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type SQLSpec

type SQLSpec struct {
	AdminLogin    string
	AdminPassword string
}

SQLSpec is the part of a logical server's configuration the SQL Server engine acts on. An empty AdminPassword keeps the current one.

type ServiceBusEndpointConfig

type ServiceBusEndpointConfig struct {
	Override string
	Port     int
}

ServiceBusEndpointConfig configures how the ServiceBus resource provider advertises the namespace's serviceBusEndpoint. Unlike Storage's StorageEndpointConfig, this needs no vhost/shared-port scheme: services/azureservicebus has no namespace-in-URL routing at all (a flat host:port reaches it directly), so a single scalar override suffices.

type ServiceBusEntities

type ServiceBusEntities interface {
	CreateQueue(name string, lockDuration, defaultMessageTTL time.Duration, maxDeliveryCount int) error
	DeleteQueue(name string) error
	QueueExists(name string) bool

	CreateTopic(name string, defaultMessageTTL time.Duration) error
	DeleteTopic(name string) error
	TopicExists(name string) bool

	CreateSubscription(topic, name string, lockDuration time.Duration, maxDeliveryCount int) error
	DeleteSubscription(topic, name string) error
	SubscriptionExists(topic, name string) bool
}

ServiceBusEntities is the narrow, consumer-defined seam the Microsoft.ServiceBus resource provider (rp_servicebus.go) delegates queue/topic/subscription lifecycle through, mirroring StorageAccounts's shape above. Uses only primitive types (time.Duration, int, string) rather than services/azureservicebus's own EntityConfig, so this package never imports a data-plane service package (AZURE.md section 10.6) -- the real adapter translating these calls into azureservicebus.EntityConfig lives in cli_adapters.go, which already imports across services.

Unlike StorageAccounts, ServiceBusEntities calls are load-bearing for M9's test plan: services/azureservicebus (M5) is one-process-one-namespace with no ARM-shaped state of its own, so a Terraform-created queue/topic/ subscription must actually exist in the real M5 backend for the REST send->peek-lock->complete liveness round-trip to succeed -- this is not an optional best-effort hook the way Storage's RegisterAccount is.

type ServiceBusPortProvider

type ServiceBusPortProvider interface {
	GetAzureServiceBusPort() int
}

ServiceBusPortProvider is a private interface AppContext.Config may implement to expose the actual services/azureservicebus listener's configured port, so Init can cross-check it against Settings.ServiceBusPort. cli.go implements this via CLI.GetAzureServiceBusPort.

type ServiceBusProvider

type ServiceBusProvider struct {
	// contains filtered or unexported fields
}

ServiceBusProvider implements ResourceProvider for Microsoft.ServiceBus. Unlike StorageProvider, its queue/topic/subscription Put calls ARE load-bearing against dataPlane (services/azureservicebus, M5) -- M5 has no ARM-shaped state of its own, so a Terraform-created entity must genuinely exist in the real backend for AZURE.md's M9 test plan (a REST send->peek-lock->complete round-trip) to succeed. Namespace Put is metadata-only: M5 is one-process-one-namespace, so there's nothing to delegate for "creating" one.

func NewServiceBusProvider

func NewServiceBusProvider(cfg ServiceBusEndpointConfig, dataPlane ServiceBusEntities) *ServiceBusProvider

NewServiceBusProvider creates a ServiceBusProvider. dataPlane may be nil, in which case a no-op default is used (see interfaces.go) until cli.go's wireAzureARMResourceProviders wires a real one post-construction.

func (*ServiceBusProvider) Delete

func (p *ServiceBusProvider) Delete(ctx context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*ServiceBusProvider) DeleteResourcesInGroup

func (p *ServiceBusProvider) DeleteResourcesInGroup(ctx context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider (Registry's cascade delete when a resource group is deleted).

func (*ServiceBusProvider) Get

Get implements ResourceProvider.

func (*ServiceBusProvider) List

func (p *ServiceBusProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider, scoped to id.ResourceGroup if set, else every resource of id's LeafType in the subscription.

func (*ServiceBusProvider) ListKeys

func (p *ServiceBusProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider for namespaces/{ns}/authorizationRules/{rule}/listKeys. Response shape -- {"primaryConnectionString","secondaryConnectionString","primaryKey", "secondaryKey","keyName"} -- matches real ARM's Service Bus AuthorizationRules ListKeys AccessKeys model. This emulator has exactly one fixed dev SAS identity (services/azureservicebus/sas.go's DefaultKeyName/DefaultKeyValue, mirrored here as sbDefaultKeyName/ sbDefaultKeyValue), so both primary/secondary key are the same value -- matching StorageProvider.ListKeys's identical key1/key2 convention.

func (*ServiceBusProvider) Namespace

func (p *ServiceBusProvider) Namespace() string

Namespace implements ResourceProvider.

func (*ServiceBusProvider) Put

func (p *ServiceBusProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*ServiceBusProvider) Reset

func (p *ServiceBusProvider) Reset()

Reset implements ResourceProvider (Registry.ResetAll, the /_gopherstack/reset endpoint).

func (*ServiceBusProvider) ResourceTypes

func (p *ServiceBusProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type Settings

type Settings struct {
	ACIEngine string `` //nolint:lll // config struct tags are intentionally verbose
	/* 403-byte string literal not displayed */
	AKSEngine string `` //nolint:lll // config struct tags are intentionally verbose
	/* 405-byte string literal not displayed */
	ClientID string `` //nolint:lll // config struct tags are intentionally verbose
	/* 198-byte string literal not displayed */
	ClientSecret string `` //nolint:lll // config struct tags are intentionally verbose
	/* 249-byte string literal not displayed */
	Environment string `` //nolint:lll // config struct tags are intentionally verbose
	/* 270-byte string literal not displayed */
	Location string `` //nolint:lll // config struct tags are intentionally verbose
	/* 229-byte string literal not displayed */
	AdvertiseStorageVHost string `` //nolint:lll // config struct tags are intentionally verbose
	/* 357-byte string literal not displayed */
	TLSCertFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 311-byte string literal not displayed */
	TLSKeyFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 253-byte string literal not displayed */
	AdvertiseServiceBus string `` //nolint:lll // config struct tags are intentionally verbose
	/* 290-byte string literal not displayed */
	AdvertiseKeyVault string `` //nolint:lll // config struct tags are intentionally verbose
	/* 306-byte string literal not displayed */
	AdvertiseCosmosDB string `` //nolint:lll // config struct tags are intentionally verbose
	/* 290-byte string literal not displayed */
	AdvertiseEventHub string `` //nolint:lll // config struct tags are intentionally verbose
	/* 325-byte string literal not displayed */
	AdvertiseEventGrid string `` //nolint:lll // config struct tags are intentionally verbose
	/* 321-byte string literal not displayed */
	AdvertiseAppConfig string `` //nolint:lll // config struct tags are intentionally verbose
	/* 328-byte string literal not displayed */
	AdvertiseACR string `` //nolint:lll // config struct tags are intentionally verbose
	/* 334-byte string literal not displayed */
	SubscriptionID string `` //nolint:lll // config struct tags are intentionally verbose
	/* 192-byte string literal not displayed */
	DBEngine string `` //nolint:lll // config struct tags are intentionally verbose
	/* 405-byte string literal not displayed */
	TenantID string `` //nolint:lll // config struct tags are intentionally verbose
	/* 227-byte string literal not displayed */
	AdvertiseGraph string `` //nolint:lll // config struct tags are intentionally verbose
	/* 311-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 260-byte string literal not displayed */
	ServiceBusPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 323-byte string literal not displayed */
	KeyVaultPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 307-byte string literal not displayed */
	EventHubPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 273-byte string literal not displayed */
	EventHubAMQPPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 324-byte string literal not displayed */
	ACRPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 309-byte string literal not displayed */
	StorageVHostPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 336-byte string literal not displayed */
	GraphPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 332-byte string literal not displayed */
	EventGridPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 323-byte string literal not displayed */
	AppConfigPort int `` //nolint:lll // config struct tags are intentionally verbose
	/* 323-byte string literal not displayed */
	APIMAllowExternal bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 301-byte string literal not displayed */
	ValidatePrincipals bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 386-byte string literal not displayed */
	ValidateTokens bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 258-byte string literal not displayed */
}

Settings holds service-level configuration for the ARM emulation backend. Fields are picked up by the Kong CLI parser when embedded in the root CLI command (see cli.go's CLI.AzureARM field), mirroring services/cosmosdb's Settings pattern. Field order below is grouped by type (all strings, then all ints, then the bool) rather than by topic, to satisfy govet's fieldalignment check -- interleaving AdvertiseServiceBus (a string) between the int fields, as a topic-grouped order would, widens the struct's leading run of pointer-containing fields from 152 to 168 bytes. Safe to reorder: every construction of Settings (DefaultSettings, and Kong's tag-driven parsing) uses field names, never positional literals.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the default Settings. Used when no ConfigProvider is available at init time (e.g. tests constructing a Provider directly).

type StorageAccounts

type StorageAccounts interface {
	// RegisterAccount is called when the Storage RP creates a new storage
	// account. A nil-safe no-op default (noopStorageAccounts) is used when no
	// real adapter is wired, so services/azurearm works standalone in unit
	// tests and degrades gracefully if the data plane is disabled.
	RegisterAccount(name string) error
	// DeleteAccount is called when the Storage RP deletes a storage account.
	DeleteAccount(name string) error
}

StorageAccounts is the narrow, consumer-defined seam the Microsoft.Storage resource provider (rp_storage.go) delegates account lifecycle events through, mirroring the wireCrossServiceDependencies adapter pattern cli_adapters.go already uses ~60 times for AWS (see AZURE.md section 10.6). It is declared here even though M7's Storage RP does not need it to serve Blob/Queue/Table traffic today (those backends are already account-name-agnostic -- AZURE.md section 10.4) -- so that M10's per-account namespacing (RegisterAccount/DeleteAccount keying each data plane's top-level map by account name) is additive: rp_storage.go already calls these hooks, they're just no-ops until M10 wires a real adapter in cli_adapters.go.

CosmosResources (M10's equivalent) is deliberately NOT declared here yet -- AZURE.md's own scope note prefers keeping this milestone's interface surface to what it actually uses, over speculatively declaring shapes for resource providers this milestone doesn't implement. ServiceBusEntities below is M9's version of the same pattern, now that M9 actually needs it.

type StorageAccountsProvider

type StorageAccountsProvider interface {
	GetAzureARMStorageAccounts() StorageAccounts
}

StorageAccountsProvider is a private interface AppContext.Config may implement to supply a real StorageAccounts adapter (wired by cli.go's wireCrossServiceDependencies in a future milestone -- see interfaces.go). Absent (the common case for M7), NewStorageProvider falls back to the nil-safe noopStorageAccounts default.

type StorageEndpointConfig

type StorageEndpointConfig struct {
	VHostOverride string
	VHostPort     int
}

StorageEndpointConfig configures how the Storage resource provider advertises Blob/Queue/Table data-plane endpoints in properties.primaryEndpoints, per AZURE.md section 10.4's endpoint-advertisement design. VHostOverride/VHostPort replace this struct's earlier three separate per-service overrides/ports (Blob/Queue/Table): terraform-provider-azurerm's data-plane SDK requires Blob/Queue/Table to share one domain suffix for account-ID parsing, and since Go's url.URL.Host always includes the port, that forces them onto one shared port too -- see services/azurestoragevhost's package doc comment and AZURE.md section 10.8 for the full derivation. advertiseVHostEndpoint below is the only thing that reads these.

type StorageProvider

type StorageProvider struct {
	// contains filtered or unexported fields
}

StorageProvider implements ResourceProvider for Microsoft.Storage. Per AZURE.md section 10.4, it is metadata-only: Blob/Queue/Table are already account-name-agnostic, so no data-plane delegation is required for an ARM-created account to be immediately usable. StorageAccounts (accounts StorageAccounts interface) is called best-effort for forward-compat with M10's per-account namespacing.

func NewStorageProvider

func NewStorageProvider(cfg StorageEndpointConfig, dataPlane StorageAccounts) *StorageProvider

NewStorageProvider creates a StorageProvider. dataPlane may be nil, in which case a no-op default is used (see interfaces.go).

func (*StorageProvider) Delete

func (p *StorageProvider) Delete(ctx context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*StorageProvider) DeleteResourcesInGroup

func (p *StorageProvider) DeleteResourcesInGroup(ctx context.Context, resourceGroup string)

DeleteResourcesInGroup implements the cascade-delete hook Registry.DeleteResourcesInGroup calls when a resource group is deleted (CodeRabbit-flagged: DELETE .../resourceGroups/{name} previously only cleared InMemoryBackend's generic resources, leaving StorageProvider accounts in that group orphaned but still reachable).

func (*StorageProvider) Get

func (p *StorageProvider) Get(_ context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*StorageProvider) List

func (p *StorageProvider) List(_ context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider, scoped to id.ResourceGroup if set (per the ResourceProvider interface contract), else every account in the subscription.

func (*StorageProvider) ListKeys

func (p *StorageProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider. The response shape -- {"keys":[{"keyName","value","permissions"}, ...]} -- was verified against the real ARM "Storage Accounts - List Keys" REST API documentation (learn.microsoft.com/en-us/rest/api/storagerp/storage-accounts/list-keys): StorageAccountListKeysResult.keys is a StorageAccountKey[] with exactly those three fields, "permissions" taking the KeyPermission enum value "Full" (not "FULL"). Key values are pkgs/azureauth's well-known devstoreaccount1 development key, matching every other Azure service's well-known-credential convention.

func (*StorageProvider) Namespace

func (p *StorageProvider) Namespace() string

Namespace implements ResourceProvider.

func (*StorageProvider) Put

func (p *StorageProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider: creates or updates a storage account.

func (*StorageProvider) Reset

func (p *StorageProvider) Reset()

Reset implements the reset hook Registry.ResetAll calls across every registered provider (Handler.Reset -- CodeRabbit-flagged: without this, accounts created before a /_gopherstack/reset survived it, since only InMemoryBackend was being cleared).

func (*StorageProvider) ResourceTypes

func (p *StorageProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

type TokenResponse

type TokenResponse struct {
	TokenType   string `json:"token_type"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

TokenResponse is the client-credentials grant response body, for both the v1 (/{tenant}/oauth2/token) and v2 (/{tenant}/oauth2/v2.0/token) endpoints -- AZURE.md section 10.1 specifies the identical body shape for both.

func IssueToken

func IssueToken(issuer *aadauth.Issuer, baseURL, tenant, clientID, scopeOrResource string) (TokenResponse, error)

IssueToken issues a client-credentials access token for tenant, using issuer, returning the wire response body.

func IssueTokenForObject

func IssueTokenForObject(
	issuer *aadauth.Issuer, baseURL, tenant, clientID, objectID, scopeOrResource string,
) (TokenResponse, error)

IssueTokenForObject is IssueToken with an explicit oid/sub claim, the client's service principal object ID.

type VHostPortProvider

type VHostPortProvider interface {
	GetAzureStorageVHostPort() int
}

VHostPortProvider is a private interface AppContext.Config may implement to expose the actual services/azurestoragevhost listener's configured port, so Init can cross-check it against Settings.StorageVHostPort. cli.go implements this via CLI.GetAzureStorageVHostPort.

type WebProvider

type WebProvider struct {
	// contains filtered or unexported fields
}

WebProvider implements ResourceProvider for Microsoft.Web function apps and their hosting plans. ARM keeps location, tags, plan links, and site configuration; the app itself (settings, keys, package, host) lives in the Azure Functions data plane.

func NewWebProvider

func NewWebProvider(dataPlane FunctionApps) *WebProvider

NewWebProvider creates a WebProvider; dataPlane may be nil.

func (*WebProvider) ApplySlotConfig

func (p *WebProvider) ApplySlotConfig(ctx context.Context, id ResourceID, body map[string]any) error

ApplySlotConfig serves POST .../applySlotConfig: the first phase of a swap with preview.

func (*WebProvider) CheckName

func (p *WebProvider) CheckName(name string) map[string]any

CheckName answers POST /subscriptions/{sub}/providers/Microsoft.Web/checknameavailability.

func (*WebProvider) Delete

func (p *WebProvider) Delete(_ context.Context, id ResourceID) error

Delete implements ResourceProvider.

func (*WebProvider) DeleteFunctionKey

func (p *WebProvider) DeleteFunctionKey(ctx context.Context, id ResourceID, fn, keyName string) error

DeleteFunctionKey serves DELETE .../functions/{fn}/keys/{name}.

func (*WebProvider) DeleteHostKey

func (p *WebProvider) DeleteHostKey(_ context.Context, id ResourceID, keyType, keyName string) error

DeleteHostKey serves DELETE .../host/default/{keyType}/{name}.

func (*WebProvider) DeleteResourcesInGroup

func (p *WebProvider) DeleteResourcesInGroup(_ context.Context, resourceGroup string)

DeleteResourcesInGroup implements ResourceProvider.

func (*WebProvider) FunctionKeys

func (p *WebProvider) FunctionKeys(ctx context.Context, id ResourceID, fn string) (map[string]any, error)

FunctionKeys serves POST .../functions/{fn}/listkeys.

func (*WebProvider) FunctionSecrets

func (p *WebProvider) FunctionSecrets(ctx context.Context, id ResourceID, fn string) (map[string]any, error)

FunctionSecrets serves POST .../functions/{fn}/listsecrets.

func (*WebProvider) Get

func (p *WebProvider) Get(ctx context.Context, id ResourceID) (map[string]any, error)

Get implements ResourceProvider.

func (*WebProvider) GetConfig

func (p *WebProvider) GetConfig(_ context.Context, id ResourceID, name string) (map[string]any, error)

GetConfig serves GET and POST .../config/{name}[/list].

func (*WebProvider) GetFunction

func (p *WebProvider) GetFunction(ctx context.Context, id ResourceID, fn string) (map[string]any, error)

GetFunction serves GET .../functions/{fn}.

func (*WebProvider) HostKeys

func (p *WebProvider) HostKeys(_ context.Context, id ResourceID) (map[string]any, error)

HostKeys serves POST .../host/default/listkeys.

func (*WebProvider) List

func (p *WebProvider) List(ctx context.Context, id ResourceID) ([]map[string]any, error)

List implements ResourceProvider.

func (*WebProvider) ListFunctions

func (p *WebProvider) ListFunctions(ctx context.Context, id ResourceID) ([]map[string]any, error)

ListFunctions serves GET .../functions.

func (*WebProvider) ListKeys

func (p *WebProvider) ListKeys(_ context.Context, id ResourceID) (map[string]any, error)

ListKeys implements ResourceProvider: POST .../sites/{name}/host/default/listkeys is routed here by type.

func (*WebProvider) ListSlots

func (p *WebProvider) ListSlots(ctx context.Context, id ResourceID) ([]map[string]any, error)

ListSlots serves GET .../sites/{name}/slots.

func (*WebProvider) Namespace

func (p *WebProvider) Namespace() string

Namespace implements ResourceProvider.

func (*WebProvider) Patch

func (p *WebProvider) Patch(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Patch serves PATCH on a site: properties are merged over the stored ones.

func (*WebProvider) Policy

func (p *WebProvider) Policy(
	_ context.Context, id ResourceID, name string, body map[string]any, put bool,
) (map[string]any, error)

Policy serves GET and PUT .../basicPublishingCredentialsPolicies/{ftp|scm}.

func (*WebProvider) PublishXML

func (p *WebProvider) PublishXML(_ context.Context, id ResourceID) ([]byte, error)

PublishXML serves POST .../publishxml: a ZipDeploy profile that points at the app's Kudu site.

func (*WebProvider) PublishingCredentials

func (p *WebProvider) PublishingCredentials(_ context.Context, id ResourceID) (map[string]any, error)

PublishingCredentials serves POST .../config/publishingcredentials/list.

func (*WebProvider) Put

func (p *WebProvider) Put(ctx context.Context, id ResourceID, body map[string]any) (map[string]any, error)

Put implements ResourceProvider.

func (*WebProvider) PutConfig

func (p *WebProvider) PutConfig(
	_ context.Context, id ResourceID, name string, body map[string]any, merge bool,
) (map[string]any, error)

PutConfig serves PUT (replace) and PATCH (merge) .../config/{name}.

func (*WebProvider) Reset

func (p *WebProvider) Reset()

Reset implements ResourceProvider.

func (*WebProvider) ResetSlotConfig

func (p *WebProvider) ResetSlotConfig(_ context.Context, id ResourceID) error

ResetSlotConfig serves POST .../resetSlotConfig: it cancels a swap with preview.

func (*WebProvider) ResourceTypes

func (p *WebProvider) ResourceTypes() []ResourceTypeDef

ResourceTypes implements ResourceProvider.

func (*WebProvider) SetFunctionKey

func (p *WebProvider) SetFunctionKey(
	ctx context.Context, id ResourceID, fn, keyName string, body map[string]any,
) (map[string]any, error)

SetFunctionKey serves PUT .../functions/{fn}/keys/{name}.

func (*WebProvider) SetHostKey

func (p *WebProvider) SetHostKey(
	_ context.Context, id ResourceID, keyType, keyName string, body map[string]any,
) (map[string]any, error)

SetHostKey serves PUT .../host/default/{keyType}/{name}.

func (*WebProvider) SetState

func (p *WebProvider) SetState(_ context.Context, id ResourceID, action string) error

SetState serves POST .../start, .../stop and .../restart.

func (*WebProvider) SlotDifferences

func (p *WebProvider) SlotDifferences(_ context.Context, id ResourceID, body map[string]any) ([]map[string]any, error)

SlotDifferences serves POST .../slotsdiffs: the swapped settings whose values differ between the slots.

func (*WebProvider) SwapSlots

func (p *WebProvider) SwapSlots(ctx context.Context, id ResourceID, body map[string]any) error

SwapSlots serves POST .../slotsswap: a full swap, or the completion of a swap with preview.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL