· 3 min read

Automation with the Secure App Model for CSP's

Microsoft 365 encompasses a wide range of features across many products. Each has one or more individual management portals and PowerShell modules. The fun starts when you want to write a script to execute without human.

Microsoft 365 encompasses a wide range of features across many products. Each has one or more individual management portals and PowerShell modules. The fun starts when you want to write a script to execute without human.

Microsoft 365 encompasses a wide range of features across many products. Each has one or more individual management portals and PowerShell modules. The fun starts when you want to write a script to execute without human interaction.

To achieve anything beyond simplistic automation, you’ll quickly realize this isn’t easy. There’s limited guidance, and Microsoft documentation often suggests certain tasks are unsupported. Yet with effort and ingenuity, much can be accomplished.

Our goal is to simplify and automate common administrative tasks for delivering IT services. Atria securely executes prescriptive processes without direct user interaction. Atria users can now safely perform administrative tasks without needing admin permissions or PowerShell expertise—enabling more self-service and reducing low-value work for highly skilled teams.

With the growth of Microsoft 365, we’ve enabled Microsoft CSP Partners to:

  • Create new tenants
  • Manage users in Azure AD
  • Create subscriptions
  • Assign licenses
  • Manage core Exchange Online features

The Secure App Model

The Secure App Model was introduced to enable CSP partners to administer on behalf of their customers securely.

It relies on Azure AD for access control. A registered Azure AD application, configured with appropriate permissions, operates on behalf of an admin user via a refresh token mechanism. This setup uses:

  • Application ID
  • Application Secret
  • Refresh Token (regularly refreshed)

These secure the connection.


Why is it hard?

While Microsoft guides may help you get started, you’ll encounter obstacles when trying to:

  • Modify PowerShell scripts to use the secure app model
  • Grant correct resource consents to your app
  • Authenticate and execute scripts reliably across various modules

Often, a required PowerShell module won’t support the secure app model or is poorly documented.


What have we done to help?

As a CSP provider, you may need to make configuration changes across APIs. Atria now includes:

  • Out-of-the-box support for baseline consents
  • Seamless authentication management

This lets you extend standard Atria processes or create your own. Atria ensures your PowerShell connection is pre-configured with the correct security context per tenant/user.


🔑 Key Benefits

  • Execute custom PowerShell scripts during tenant/user provisioning
  • Automatic secure connection handling via Atria

Partner Automation


Provided Actions

Two Atria actions support this:

  • MSOL Run Customer Script – for tenant-wide tasks
  • MSOL Run User Script – includes user-level context

✅ Supported API Connections

ConnectionProviderUse For
AzureADAzure AD PowerShell 2.0Azure AD management
ExchangeExchange Online PowerShellExchange config (v1 PowerShell)
GraphMicrosoft GraphGraph token access for HTTP requests
MSOnlineMS Online v1Legacy AzureAD / Office 365 management
PartnerCenterPartnerCenter PowerShellManage subscriptions, billing, customer data
SecurityCenterO365 Security & ComplianceSecurity & compliance configuration

💡 Available Variables

VariableAvailable WhenDescription
$CustomerIDAlwaysAtria Customer ID
$TenantIdWhen tenant exists in Azure ADAzureAD Tenant GUID
$UserAzureIDWhen user exists in Azure ADAzure AD User GUID
$SessionWhen Exchange is specifiedPowerShell session for Exchange
$GraphTokenWhen Graph is specifiedAccess token for Microsoft Graph
$SecurityCenterSessionWhen SecurityCenter is specifiedPowerShell session to Security & Compliance

For existing Atria customers, more detailed documentation is available. If you’re not yet a customer but want to learn more, feel free to get in touch —we’re happy to help without a sales pitch if it’s not a fit.


📚 Additional Resources


Want to see what Atria could do for your team?

Find a time to chat
Back to Blog

Related Posts

View All Posts »
WVD with Multi-Tenant AD

WVD with Multi-Tenant AD

Windows Virtual Desktop as part of a Modern Workplace has been rising in popularity recently. With its dependency on traditional Active Directory, there is a real opportunity for Service Providers to leverage Multi-Tenan.

Selling DaaS

Selling DaaS

A Hosted Desktop solution can feel hard to sell vs an On-Premises/MSP offering.

Microsoft 365 – How To Stop Self-Service Purchases

Microsoft 365 – How To Stop Self-Service Purchases

Last year Microsoft introduced the capability for end-users within an organization to self-service purchase a sub-set of Microsoft subscription products. The list of published self-service programs is available here Usin.

Multi-Tenancy Costs and Structure

Multi-Tenancy Costs and Structure

As part of a series of blog/vlog posts, we are going to walk you through setting up Atria and how it can help with automation, consistency, and speed for delivering services to your customers. Before we can dive into the.