Giter Site home page Giter Site logo

azureautomation / automation-packs Goto Github PK

View Code? Open in Web Editor NEW
72.0 13.0 42.0 181 KB

Collections of Automation resources that can include runbooks, configurations, modules, credentials, schedules, variables, connections, certificates, jobs, compilation jobs, and nodes.

License: MIT License

PowerShell 100.00%

automation-packs's Introduction

Automation Packs

Automation Packs include an Azure Resource Manager template that deploys Automation resources to Azure. The template can include any Automation resource needed for an Automation solution. Automation resources include:

  • Runbooks
  • DSC Configurations
  • DSC Configuration Compilation Jobs
  • Runbook jobs
  • Integration Modules
  • Schedules
  • Credentials
  • Certificates
  • Variables
  • Connections

##Rules for contributing to the Automation repository

  1. Each Automation pack is contained in its own folder.

  2. The parent deployment template must be named azuredeploy.json. You can also have child templates which do not need to follow a naming convention.

  3. Include a Readme.md file that explains: 4. How the template works and what the Automation pack automates 5. What resources are deployed 6. Includes the "Deploy to Azure" link 7. Any known limitations

  4. Any Automation assets used in your runbooks or DSC configurations should be included in the deployment template.

  5. Any runbooks, modules, or DSC Configurations in your ARM template should use the following conventions:

  6.  1. A **variable** containing the **URL** for the resource content
     2. A **variable** containing the **Name** of the resource
    
  7. Any Automation assets in your template should follow the the following conventions:

  8.  1. **Parameter(s)** for the asset value(s) are in the deployment template to allow end users input their own values
     2.  A **variable** for each asset name 	
    
  9. Template parameters should:

    1. Follow camelCasing
    2. Contain allowedValues wherever it makes sense
    3. Have the description specified using the metadata property. An example is included below:
"automationAccountName": {
      "type": "string",
      "metadata": {
          "description": "The name of the Automation Account"
      }
}

##Recommendations for writing your Automation Pack

Runbooks in Automation Packs

You can store runbooks referenced in Automation Packs in two different ways:

  1. In an external location of your choice. Preferred locations are the PowerShell Gallery or Script Center
  2. In a Runbook subfolder within the Automation Pack.

Best practices for runbooks:

  1. Follow practices outlined here.
  2. Always include a header with the following when publishing to PowerShell Gallery:
	<#PSScriptInfo
    
	    .Version 1.0
	    .Author elcooper
	    .CompanyName Microsoft Corporation
	    .Copyright (c) 2015 Microsoft Corporation. All rights reserved.
	    .Tags Tag1 Tag2
	    .LicenseUri https://contoso.com/License
	    .ProjectUri https://contoso.com/
	    .IconUri https://contoso.com/MyScriptIcon
	    .ExternalModuleDependencies bar
	    .RequiredScripts foo 
	    
	    .ReleaseNotes 
	         contoso script now supports following features
	         Feature 1
	         Feature 2
	         Feature 3
	         
	#>

PowerShell Modules in Automation Packs

You can store modules used in your runbook in two different ways:

  1. Create a Module subfolder and place all your modules in the folder.
  2. Place your modules on the PowerShell GitHub repository and publish your module to PowerShell Gallery.

To deploy a module, you must also have a zipped module folder formatted for Azure Automation. This is used in the Azure Resource Manager deployment template. For more on creating modules for Azure Automation see Authoring Integration Modules.

Follow the PowerShell best practices for publishing a module to the PowerShell gallery outlined in this blog.

Other notes on authoring Automation Packs

If you have a pack that contains many Automation resources, you can write one parent template that refers to the base templates: 000-base-templates. This allows you to reuse the core Automation resource templates without having to write your own.

automation-packs's People

Contributors

bdanse avatar dtzar avatar eamonoreilly avatar elcooper avatar epc2101 avatar jefffanjoy avatar jodoglevy avatar mbsnl avatar memoryz avatar pcgeek86 avatar ravichin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automation-packs's Issues

How do I use compilation resource and pass secure information to it?

I can not find a good reference how to securely pass information to DSC compilation job via ARM template in order to avoid this information being logged inside Azure in multiple places. I onboarded VM to AutomationAccount DSC already, have configuration in place as well compilation job via ARM template but I don't see ability to specify protectedsettings or similar which is available for DSC resource but not compilation

Bad Request for deploying start job resource

Has anyone got this error while deploying the template 101-get-vm-tutorial.
All resources are deployed except the one with job. It fails with following error message
{
"error": {
"code": "BadRequest",
"message": "\r\n<html xmlns="http://www.w3.org/1999/xhtml\">\r\n\r\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>\r\n<title>404 - File or directory not found.</title>\r\n<style type="text/css">\r\n\r\n</style>\r\n\r\n\r\n<div id="header">

Server Error

\r\n<div id="content">\r\n <div class="content-container">\r\n

404 - File or directory not found.

\r\n

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

\r\n \r\n\r\n\r\n\r\n"
}
}

I am trying to deploy an automation account with a runbook deployed and start the job automatically

Applying the configurationdata on a DSC compliationjob via ARM

Hi

Is there currently any way to apply a configurationdata configuration to a compilationjob similar to what is available via powershell sdk? This is what I am referring to below:

Start-AzureRmAutomationDscCompilationJob -ResourceGroupName "MyResourceGroup" -AutomationAccountName "MyAutomationAccount" -ConfigurationName "CredentialSample" -ConfigurationData $ConfigData

Thanks,
Matt

Cannot apply ARM template several with job schedule

Hi,

I have been using the sample 102-sample-automation-setup.
It confirmed the fact that it is impossible de use ARM templates to manage job schedules.

Anytime I try to apply twice the same ARM with jobSchedules, I get the error:

"Job with specified id already exists. Job id: 17887671-2bbd-4e79-bdee-40378a485a93"

Is there any way to work around this?

DSC Compilation job suspended does not fail ARM template deployment

When handling DSC compilation jobs with ARM templates and the compilation job suspends due to whatever reason, the ARM deployment will just go on monitoring forever and needs to be stopped manually. I would expect suspended to be handled the same as failed in this case.

Encrypted variable cannot be called in ARM template

You can set encrypted variable via ARM but you cannot output the value from that variable.
Let's say that we have the following code in output section:
"primarykey": {
"value": "[reference(Concat('Microsoft.Automation/automationAccounts/', parameters('omsAutomationAccountName'), '/variables/', variables('variableNameOmsAutomationAccountPrimaryKey')), parameters('omsAutomationApiVersion')).value]",
"type": "securestring"
}

In the output the value is not there. It works for non encrypted values.
It will be good if these values can be used in ARM

Obtaining the Azure automation reg key via ARM

Hi

Is there a way to obtain the registration key for AA via ARM to pass to the VM DSC Extension instead of running powershell to deploy AA and query for reg key and pass that in as a parameter?

Thanks,
Matt

Interval property is not an integer anymore but object

Hey there, according to microsoft documentation https://docs.microsoft.com/en-us/azure/templates/microsoft.automation/automationaccounts/schedules?tabs=json
arm template "type": "Microsoft.Automation/automationAccounts/schedules", has got property interval which is an object "interval": {}, . I would like to create a schedule for my automation job but I want a recurring job, however I have got no idea what should be passed to that object, every single tutorial or example in azureautomation repo has got this property as an integer. Any idea what kind of key value pair or any specific object should be passed to this property so I can make my schedule recurring? Thanks I tried to pass different values such as "interval": {interval :1}, but there are no many different possible scenarios. Also if you know any other way how I could make my schedule recurring, unfortunately if I pass different value than "OneTime" to the property frequency I get an error saying that for recurring jobs interval should be more than 1, but without example I find it really frustrating to find out what should be there. Thanks

Json string for automation variable being converted to System.Object[]

I'm using an ARM template to pass in a json array object string for a runbook variable. After the ARM deployment the runbook variable is calling this a System.Object[] instead of a string object. This of course is not treated as a string anymore in runbook and causes my script to fail

When I pass in the string variable in the portal and declare it of a type string I am able to pull out my json string and convert it into an object just fine.

Guid requirement via Powershell for CompilationJobs in RGTs

Hi

I just wanted to log an "issue" here for this, I have heard that this was going to get removed at some point so you there wouldn't be a requirement to generate a guid from powershell to pass in for this. Is there any updates here on this?

Thanks
Matt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.