azure-sdk-for-python
azure-sdk-for-python copied to clipboard
Create an azure VM via python with init script
Related command
No response
Resource Provider
virtual machine
Description of Feature or Work Requested
I am trying to create a virtual machine on azure via python and having it execute a script on launching time (init script). For this purpose, I am using the custom_data as follows:
the custom_data is created this way:
For the variables inside the init_script: WORKER_SCRIPT_PATH : is the string path to my shell script (an sh file) and the other variables are simple strings.
Now after I execute the script, everything seems to work fine and the VM is created but when I check on azure, I don't find he script!
AM i missing something?
Minimum API Version Required
N/A
Swagger PR link / SDK link
N/A
Request Example
No response
Target Date
22/09/2022
Additional context
No response
@zhoxing-ms for awareness
@Marwen-TAALLAH Since this is a Python SDK related issue, so I transfer this issue into the azure-sdk-for-python repo
Thank you for your feedback. This has been routed to the support team for assistance.
I will make the investigation soon.
Hi @Marwen-TAALLAH
After my investigation, it will not be displayed on the portal after the script is created. You need to query the running status of the script through the following code.
result = list(compute_client.virtual_machine_run_commands.list_by_virtual_machine(
resource_group_name=GROUP_NAME,
vm_name=VIRTUAL_MACHINE_NAME
))
for item in result:
print(item)
Hope it can help you
@Marwen-TAALLAH Could you please let us know if you had a chance to look at the above comment ?
Hi @Marwen-TAALLAH. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve
” to remove the “issue-addressed” label and continue the conversation.
Hi @Marwen-TAALLAH, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.