Using container to run multiple different scheduled PowerShell scripts regularly?

EnterpriseArchitect 4,871 Reputation points
2023-01-23T03:29:58.7766667+00:00

People,

I need some help and guidance in deploying Docker or Container on Azure, my aim here is to be able to run Active Directory, M365, Azure and other PowerShell scripts as scheduled tasks.

Using this [https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-in-docker

My current situation is that I am running Windows Server 2022 VM OnPremise and then manually installing all the required PowerShell script modules, just to run a few PowerShell scripts that are no more than 600 KB in total size.

It is rather overkilling to deploy an 80 GB VM just to run a script regularly.

Any help and suggestion would be greatly appreciated.

Thanks,

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
405 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
650 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,893 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,157 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. ioan corcodel 1 Reputation point Microsoft Employee
    2023-01-23T16:33:44.0266667+00:00

    Hi.

    Looking at your request, it would me better to check the Azure Automation Account solution. Check more info at the next to link: https://learn.microsoft.com/en-us/azure/automation/overview

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

  3. vipullag-MSFT 25,041 Reputation points
    2023-01-24T01:15:58.7666667+00:00

    Hello @Enterprise Architect

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Adding to previous response of ioan corcodel, if you needs to interact with other Azure services via PowerShell scripts, it is recommended to go with Azure Automation Account/Runbook. It has built in support for scheduling, supports the PS runtime 5.1 and 7.1 and support for managed identity to provide a granular RBAC permissions on different Azure resources.

    Hope this helps.

    If you need further help on this, tag me in a comment.

    If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.