ArmClient-PS is a single-script Azure Resource Manager support tool designed for redistribution.
It recreates the core ARMClient workflow by using Invoke-AzRestMethod and a locally bundled Modules folder instead of requiring runtime installation from the PowerShell Gallery.
- Ship as a zip-friendly support package.
- Prefer secure, process-scoped authentication behavior.
- Validate packaged files before use.
- Support ARM GET, POST, PUT, PATCH, and DELETE operations.
- Allow newer valid locally installed modules when they are safer or more current than the bundled version.
.
├── ArmClient-PS.ps1
├── Build-BundledModules.ps1
├── Modules\
├── Manifest\
│ ├── Files.sha256.json
│ └── Versions.json
├── Logs\
└── Output\
Show context:
.\ArmClient-PS.ps1 -ShowContextRun a GET request:
.\ArmClient-PS.ps1 `
-Method GET `
-RelativePath "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>" `
-ApiVersion "2021-04-01"Run a POST request (equivalent to armclient post /subscriptions/):
.\ArmClient-PS.ps1 `
-Method POST `
-RelativePath "/subscriptions" `
-ApiVersion "2022-12-01"Run a POST request with a JSON body:
.\ArmClient-PS.ps1 `
-Method POST `
-RelativePath "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/<providerNamespace>/<resourceType>/<resourceName>/<action>" `
-ApiVersion "2021-04-01" `
-Body '{"key":"value"}'Run a POST request with a JSON body file:
.\ArmClient-PS.ps1 `
-Method POST `
-RelativePath "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/<providerNamespace>/<resourceType>/<resourceName>/<action>" `
-ApiVersion "2021-04-01" `
-BodyFile "request-body.json"Save a response to disk:
.\ArmClient-PS.ps1 `
-Method GET `
-RelativePath "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>" `
-ApiVersion "2021-04-01" `
-OutputFile "resource-group.json"Inspect resolved module versions:
.\ArmClient-PS.ps1 -ShowResolvedModuleVersionsRun the built-in package self-test:
.\ArmClient-PS.ps1 -SelfTestArmClient-PS ships built-in operation presets for Azure Communication Services (ACS) email domain verification.
Accepted verification types are Domain, SPF, DKIM, DKIM2, and DMARC.
SPF
.\ArmClient-PS.ps1 `
-Operation "AcsEmailDomainInitiateVerification" `
-OperationParameters @{
subscriptionId = "<subscription-id>"
resourceGroupName = "<resourceGroupName>"
emailServiceName = "<emailServiceName>"
domainName = "<domainName>"
verificationType = "SPF"
}DKIM
.\ArmClient-PS.ps1 `
-Operation "AcsEmailDomainInitiateVerification" `
-OperationParameters @{
subscriptionId = "<subscription-id>"
resourceGroupName = "<resourceGroupName>"
emailServiceName = "<emailServiceName>"
domainName = "<domainName>"
verificationType = "DKIM"
}DKIM2
.\ArmClient-PS.ps1 `
-Operation "AcsEmailDomainInitiateVerification" `
-OperationParameters @{
subscriptionId = "<subscription-id>"
resourceGroupName = "<resourceGroupName>"
emailServiceName = "<emailServiceName>"
domainName = "<domainName>"
verificationType = "DKIM2"
}DMARC
.\ArmClient-PS.ps1 `
-Operation "AcsEmailDomainInitiateVerification" `
-OperationParameters @{
subscriptionId = "<subscription-id>"
resourceGroupName = "<resourceGroupName>"
emailServiceName = "<emailServiceName>"
domainName = "<domainName>"
verificationType = "DMARC"
}.\ArmClient-PS.ps1 `
-Operation "AcsEmailDomainCancelVerification" `
-OperationParameters @{
subscriptionId = "<subscription-id>"
resourceGroupName = "<resourceGroupName>"
emailServiceName = "<emailServiceName>"
domainName = "<domainName>"
verificationType = "DKIM2" # replace with SPF, DKIM, DKIM2, DMARC, or Domain
}.\ArmClient-PS.ps1 `
-Method POST `
-RelativePath "/subscriptions/<subscription-id>/resourceGroups/<resourceGroupName>/providers/Microsoft.Communication/emailServices/<emailServiceName>/domains/<domainName>/initiateVerification" `
-ApiVersion "2023-03-31" `
-Body '{"verificationType":"DKIM2"}'Replace DKIM2 with SPF, DKIM, DMARC, or Domain as needed.
Rebuild bundled modules and manifests:
.\Build-BundledModules.ps1 -ToolVersion 1.0.0 -Clean -ForceOptional signing flow:
.\Build-BundledModules.ps1 `
-ToolVersion 1.0.0 `
-Clean `
-Force `
-CodeSigningThumbprint "<thumbprint>"- Runtime execution disables Az context autosave for the current process.
- Runtime hash validation is enabled by default.
- Signature validation is available through
-EnforceSignatureValidation. - Tokens and authorization headers are redacted from log output.
Logs\andOutput\are runtime folders and are not intended for source control.
Default behavior is deterministic:
- Use a bundled module when no newer valid installed version is available.
- Prefer a newer installed version when it is valid and importable.
- Use
-PreferBundledModulesto force bundled content. - Use
-PreferInstalledModulesto make the installed-module preference explicit.
Before distributing the package:
- Run
Build-BundledModules.ps1on a maintainer machine. - Confirm
Manifest\Files.sha256.jsonandManifest\Versions.jsonwere regenerated. - Run
ArmClient-PS.ps1 -SelfTestfrom the packaged folder. - Zip the entire folder structure without removing the
ModulesorManifestfolders.