Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def run_script():
- credentials_dict = authenticate( client_id, key, tenant_id )
- compute_client = ComputeManagementClient( credentials_dict['credentials'], credentials_dict['subscription_id'] )
- GROUP_NAME = 'DEV-Central'
- vmname = 'run-script-vm'
- ext_type_name = 'CustomScriptForLinux'
- ext_name = 'varun-script-test'
- params_create = {
- 'location':'centralindia',
- 'publisher': 'Microsoft.OSTCExtensions',
- 'virtual_machine_extension_type': ext_type_name,
- 'type_handler_version': '1.5',
- 'auto_upgrade_minor_version': True,
- 'settings':
- {
- 'fileUris': ["https://s3.ap-south-1.amazonaws.com/mybucketprog/custom_script.sh"],
- 'commandToExecute': "sh custom_script.sh"
- }
- }
- ext_poller = compute_client.virtual_machine_extensions.create_or_update( GROUP_NAME, vmname,ext_name,params_create )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement