Skip to content
InvardiaInvardia
Why InvardiaProductsFeaturesPricingCommunity
Docs
All documentation
Product documentationPIM ManagerSecurityInsight
SettingsPIM Manager settingsSecurityInsight settingsEntra Policy Suite settings
ScriptsPIM Manager scriptsSecurityInsight scriptsEntra Policy Suite scriptsInvardia scripts
Error codesPIM Manager error codesSecurityInsight error codes
API and MCPPIM Manager APIPIM Manager MCP toolsSecurityInsight APISecurityInsight MCP tools
SecurityPIM Manager security packSecurityInsight security packEntra Policy Suite security pack
Network and designPIM Manager network guidesPIM Manager command wizardNetwork egressDesign your installationCalculate your cost
SupportSetup scriptsRemote support access
Search the docs
SupportAboutContactBook a demoCustomer portalDesign your installationFree Pro trial

PIM Manager scripts

Remove-PimContainerStack

Remove the Container Apps part of a PIM Manager environment (keep the data)

Part of the PIM Manager release - not a standalone download; it runs via the product's own install command or the updater.

Purpose

Removes the Container Apps part of one PIM Manager environment (every Container Apps job and app and the Container Apps environment in the resource group, plus the Azure role assignments held by their system identities) so the environment can be deployed again with a different exposure. Data is kept: the SQL database, the registry, Key Vault, storage, the VNet, the user-assigned identities and Log Analytics. It only lists what it would remove unless -Apply is given.

When to run it

Before redeploying an environment with the other exposure (for example public to private, the 'remove and redeploy' route), or to remove the Container Apps part while keeping the data. It is part of the PIM Manager release package (it loads the engine's REST libraries next to it): run it from the package folder that Install-Invardia or the guided install downloaded (signed), or, for Community, from the public repository at the release tag. Then run Invoke-PimDeployAll.ps1 with the new exposure.

Who may run it

KindRoleScopeWhy
azureRbacOwner, or Contributor + User Access Administratorthe PIM resource group (role assignments: the subscription)Deletes the Container Apps jobs, apps and environment, and the Azure role assignments of their system identities. Signed in through the browser or the Invardia Support app session (no Azure CLI, no modules).

What it changes

WhereActionWhatPermission / roleScopeWhyUndo
Azure (the PIM resource group)removeevery Microsoft.App/jobs and Microsoft.App/containerApps resource, then the Microsoft.App/managedEnvironments resource (all listed first)the resource group givenThe internal/external setting of a Container Apps environment cannot be changed; the stack is rebuilt by the next deploy.Run Invoke-PimDeployAll.ps1 with the install's parameters (the saved deploy profile): it recreates the environment, the PIM Manager and the jobs and grants the new identities again.
Azure (the subscription)removethe Azure role assignments whose principal is one of those apps' or jobs' system identitiesassignments inside the subscriptionThey would be orphaned once the identities are deleted.The next deploy grants the new identities their Azure roles again.

What it only reads

  • the resources in the resource group (Microsoft.App/* only are acted on)
  • each job's and app's system identity
  • the Azure role assignments of those identities

Parameters

ParameterRequiredDefaultWhat it does
-SubscriptionIdyesThe PIM subscription. Every call names it explicitly; a sign-in that cannot see it is refused.
-ResourceGroupyesThe PIM resource group whose Container Apps stack is removed.
-ApplynofalseDelete. Without it (and always with -WhatIf) the script only lists the jobs, apps, environment and role assignments it would remove.

Preview with -WhatIf

Lists every Container Apps job, app and environment in the resource group with its system identity, and the role assignments of those identities, then prints 'PLAN ONLY: <n> job(s), <n> app(s), <n> environment(s), <n> role assignment(s)'. -WhatIf wins over -Apply ('-WhatIf: plan only -- -Apply is ignored'). Nothing is deleted.

Undo

Run Invoke-PimDeployAll.ps1 with the install's parameters: it recreates the Container Apps environment, the PIM Manager and the jobs on the kept SQL database, registry and VNet, and grants the new identities again.

Network

It connects to: login.microsoftonline.com (sign-in), management.azure.com (Azure Resource Manager)

How it runs

Part of the PIM Manager release - not a standalone download; it runs via the product's own install command or the updater.

Release 3.0.70

Every script, identity and permission for your security review: PIM Manager

InvardiaInvardia

See the risk. Control the access.

Products

PIM ManagerSecurityInsightEntra Policy SuiteAll featuresPricingFree 60-day Pro trialBook a demoWhy Invardia

Docs

DocumentationSearch the docsPIM Manager settingsSecurityInsight settingsPIM network guidesCommand wizardNetwork egressPIM Manager design configuratorSecurityInsight design configuratorDesign your installationCalculate your cost

Company

AboutContactCustomer portalSupportHow support worksHow updates reach youSupport in numbersSetup scriptsRemote support accessContact: info@invardia.com

Legal

Terms of saleLicence termsData processingPrivacyCookiesCompany information
© 2026 Invardia – a brand of 2LINKIT, founded and owned by Morten Knudsen · Strandvejen 21A, 6000 Kolding, Denmark · VAT DK39208032 · Contact: info@invardia.com