ASD's Blueprint for Secure Cloud

Automated deployment

This page describes the use of Microsoft 365 Desired State Configuration to deploy a Blueprint configuration.

Estimated reading time: 4 minutes

Overview

Microsoft 365 DSC (M365DSC) is a configuration-as-code tool developed by Microsoft to automate the configuration of Microsoft 365 services. It is the primary tool used to automate the deployment of the configuration guidance in the Blueprint.

Deployment steps

1. Complete the prerequisite tasks

  • A Windows host and specific credentials are required to use DSC, instructions on setting these up are in the DSC setup page.

2. Determine the required permissions for the targeted M365 service

The service principal used to deploy DSC will require administrative permissions to the targeted M365 service’s APIs. The components specific to the Blueprint that require administrative permissions are listed on the targeted service’s configuration index page, along with any specific instructions for using DSC to configure the service.

  • On the Windows host used for deployment, update the service principal with the permissions required for the targeted M365 service. Substitute <list of components> with those of your targeted service:
Update-M365DSCAzureAdApplication -ApplicationName 'M365DSC' -Permissions $(Get-M365DSCCompiledPermissionList -ResourceNameList <list of components> -PermissionType Application -AccessType Update) -AdminConsent -Credential $creds

3. Copy the DSC files

  • Copy the DSC file for the targeted M365 service to your working folder:
ServiceDeployment mechanismDeployment coverage
Entra ID- Desired State ConfigurationPartial
Microsoft 365- N/ANone
Microsoft Intune- Desired State ConfigurationPartial
Microsoft Defender- Desired State ConfigurationPartial
Microsoft Purview- Desired State ConfigurationPartial
Exchange Online- Desired State ConfigurationPartial
SharePoint Online- Desired State ConfigurationPartial
Microsoft Teams- Desired State ConfigurationFull
Power Platform- N/ANone

4. Compile the MOF file

  • Execute the DSC script in an elevated PowerShell prompt to compile the MOF file. For example:
PS C:\DSC> .\entradsc.ps1

    Directory: C:\DSC\M365TenantConfig

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----               #####                 108984 localhost.mof

This will create a folder named M365TenantConfig in which the MOF file will be placed.

5. Deploy the configuration

  • Execute the following command to deploy the configuration. Substitute <MOF folder location> for the full path of the M365TenantConfig folder:
Start-DSCConfiguration -Path <MOF folder location> -Wait -Verbose -Force
  • After the configuration has finished deploying, run the following commands to stop the M365DSC process:
Stop-DSCConfiguration -Force
Remove-DSCConfigurationDocument -Stage Current

This will stop M365DSC from monitoring for configuration drift.

Troubleshooting

Version of M365DSC specified in DSC file is outdated

In the DSC file, change the version parameter in the Import-DscResource command to the version currently installed.

Errors during DSC deployment and/or missing settings

If any settings fail to deploy automatically via Microsoft365DSC then they will require manual configuration.

If significant or reoccurring errors are encountered, please feel free to contact us using the details in the footer of this page.

Configuration

Tooling

References

Do you have a suggestion on how the above page could be improved? Get in touch! ASD's Blueprint for Secure Cloud is an open source project, and we would love to get your input. Submit an issue on our GitHub, or send us an email at blueprint@asd.gov.au

Acknowledgement of Country icon

Acknowledgement of Country
We acknowledge the Traditional Owners and Custodians of Country throughout Australia and their continuing connections to land, sea and communities. We pay our respects to them, their cultures and their Elders; past, present and emerging. We also recognise Australia's First Peoples' enduring contribution to Australia's national security.

Authorised by the Australian Government, Canberra