Repository navigation
v1.1.0
·
38 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
go install github.com/bgs113/azpim@latestnow works: the module path isgithub.com/bgs113/azpim(wasazpim), so the Go module proxy and pkg.go.dev can find it (#34). Binaries built this way report their module version inazpim version.activate,deactivateandextendprint the identity they act as (Acting as alice@contoso.com (tenant …), orservice principal <appid>) to stderr before changing anything, so a service-principal secret left inAZURE_CLIENT_ID/AZURE_CLIENT_SECRETcan't elevate unnoticed. JSON on stdout is unchanged (#29).--cloud public|usgov|china(orAZURE_CLOUD) targets Azure US Government or Azure China instead of the public cloud. Sign-in, the ARM endpoint and the token scope all follow the chosen cloud (#25).--dry-runand--validate-onlyonactivate,deactivateandextend.--dry-runshows what would be sent and sends nothing.--validate-onlyhas Azure check the request against the role policy without creating it, and exits non-zero with Azure's reason if it fails. JSON output reports"status": "DryRun"or"Validated"(#26).activate --startschedules an activation for a later time, e.g. a maintenance window:--start 22:00(today, or tomorrow if that time has passed),--start 2026-10-01T22:00(local time), or RFC 3339.azpim requestsshows such a request asScheduleduntil it starts, and its JSON has a newstarts_atfield (#28).--management-group(-m) accepts a management group's display name as well as its ID, e.g.-m "Production". Names are looked up among the management groups where you have an eligible or active assignment, so no extra permission is needed. An ID still costs no extra API calls, and an unknown or ambiguous name gives an error that lists the candidates and their IDs (#31).
Changed
--subscriptionno longer defaults to theAZURE_SUBSCRIPTION_IDenvironment variable. When it was set (often byazdor a deployment script), commands run without scope flags quietly looked at only that subscription, anddeactivate --allleft roles in other subscriptions active. Commands without scope flags now always cover the whole tenant. To keep the old behaviour, pass-s "$AZURE_SUBSCRIPTION_ID".- JSON output of
activate,extendanddeactivate:statusnow uses the same values asazpim requests(Active,Pending, …), and a newazure_statusfield carries Azure's raw status.activate's pending value changes fromPendingApprovaltoPending. The time fields (activated_at,extended_at,deactivated_at,expires_at) are omitted until Azure confirms the change;requested_atis always set. - With no scope flags,
eligible,active,requests,activate,deactivateandextendnow list assignments with one tenant-wide query instead of querying every subscription and management group separately. This is faster in large tenants and avoids ARM throttling. Role and scope names now come from the same response, so azpim no longer makes extra lookups for them (#23). requestsnow lists requests that target you (asTarget()) instead of requests you submitted (asRequestor()), which Azure rejects at the tenant root. For self-activation the results are the same. Requests an admin made on your behalf now appear too.
Fixed
extendno longer prints✓ extendedwhen Azure only queued the request for approval: it says the request is pending and not in effect yet (#32).activateanddeactivatenow check Azure's status the same way.activatetreatedPendingAdminDecisionand some other pending statuses as success, anddeactivatenever checked the status at all. Denied, failed and timed-out requests are reported as errors.- The interactive picker in
extendsaid "Select active role to deactivate"; it now says "to extend". RoleAssignmentDoesNotExisterrors, which Azure returns when you deactivate or extend a role within about 5 minutes of activating it, now explain that and suggest waiting.PendingRoleAssignmentRequesterrors now say a request for the role is already pending, and point toazpim requests --pending.- The MEMBERSHIP column (
membership_typein JSON) now shows Azure's value as-is. Before, anything other thanGroupwas shown asDirect, so an assignment inherited from a parent scope (Inherited) looked like a direct assignment. active --include-permanentno longer hides a permanent assignment when you also have a group-based assignment for the same role and scope. Only the shadow Direct copies that Azure creates for group members are hidden now.- A subscription or management group that failed to list is no longer dropped silently. There is now a single query, so a failure is reported as an error.
Removed
- The on-disk caches
~/.cache/azpim/scopes.jsonand~/.cache/azpim/roledefs.json. azpim no longer writes to~/.cache/azpim/, and the directory can be deleted. The Docker examples no longer mount it.