[VM Scale Set]如何执行存储在Blob存储中的自定义脚本 [英] [VM Scale Set] How to execute a custom script stored in a blob storage

查看:64
本文介绍了[VM Scale Set]如何执行存储在Blob存储中的自定义脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试在我的环境中配置虚拟机规模集,当创建新实例时,将在其上执行自定义脚本.

我首先是如何做到的:我创建了一个Github公共存储库,存储了一个脚本bash,然后在我的JSON自定义脚本中将其命名为:

{
" fileUris" ;: [" https://raw.githubusercontent.com/path_to_my_script.sh"],
" commandToExecute":" sh my_script.sh"
时间戳":1
}

非常简单,而且有效.

但是,它是一个公共存储库,并且我有敏感数据,因此我需要将此脚本存储在私有存储中.然后,我搜索了其他解决方案,发现可以调用存储在蔚蓝斑点存储中的脚本.

我创建了一个存储帐户和一个Blob存储,并上传了我的script.sh

然后,在我的JSON自定义脚本中,我这样写了:

{
"fileUris":["https://cwfrqastorageaccount.blob.core.windows.net/vmsstorage/new_deploy.sh"",
"storageAccountName":"cwfrqastorageaccount",

" commandToExecute":"sh new_deploy.sh",
时间戳":1
}

但是在我的VM Scale Set中创建一个新实例时,它不会执行任何操作.而且我也不知道是否有日志可以调试它.

我的问题是:您是否已经使用自定义脚本设置了VMSS,并且该脚本存储在azure存储blob中,如果是,怎么办? :)

非常感谢您的帮助
问候,
MicroVal

解决方案

UP:(


Hi everyone,

I'm trying to configure a Virtual Machine Scale Set on my environment, when a new instance is created, a custom script is executed on it.

How I did that first : I created a Github public repository, I stored a script bash, and I called it in my JSON custom script which look like :  

{
  "fileUris": ["https://raw.githubusercontent.com/path_to_my_script.sh"],
  "commandToExecute": "sh my_script.sh",
  "timestamp": 1
}

Very simple, and it worked.

But, it is a public repository and I have sensitive data, so I need to stored this script in a private storage. Then I searched other solutions and I found that we can call a script stored in an azure blob storage.

I created a storage account and a blob storage, and upload my script.sh

Then, in my JSON custom script, I wrote this : 

{
  "fileUris": ["https://cwfrqastorageaccount.blob.core.windows.net/vmsstorage/new_deploy.sh"],
  "storageAccountName": "cwfrqastorageaccount",
  "storageAccountKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "commandToExecute": "sh new_deploy.sh",
  "timestamp": 1
}

But when a new instance is created in my VM Scale Set, it doesn't execute anything.. And I don't know if there is logs somewhere to debug this.

My question is : do you already set up a VMSS with Custom Script where the script is stored in an azure storage blob, and if yes, how ? :)

Thanks a lot for your help
Regards,
MicroVal

解决方案

UP :(


这篇关于[VM Scale Set]如何执行存储在Blob存储中的自定义脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆