Go to Cloud Assembly.
Navigate to Extensibility - Library - Actions and click NEW ACTION.
Give it a name and choose your project.
Pick your scripting language of choice. Here's an Python based example. Verify you have a Default input named target with value World.
def handler(context, inputs):
greeting = "Hello, {0}!".format(inputs["target"])
print(greeting)
outputs = {
"greeting": greeting
}
return outputs
Hit Save and then Create Version
Give it a version number and click CREATE.
Click versions in upper right hand corner.
Click RELEASE.
Again click RELEASE.
Go to Service Broker to update your content sources.
Create another content source.
Pick Extensibility actions.
Give it a name and choose your source project.
Go to Policies - Definitions. Click on your already existing Definition.
Click ADD ITEMS.
Add Extensibility actions and hit save.
Your newly created action should now be available in the catalog. You can try it out by clicking REQUEST.
Enter a deployment name and click SUBMIT.
Deployment running.
When finished you can view the output from the script.