共用方式為


VirtualMachineRunCommandScriptSource interface

描述執行命令的腳本來源。 僅使用下列其中一個指令碼來源:script、scriptUri、commandId、galleryScriptReferenceId。

屬性

commandId

指定預先定義內建腳本的 commandId。 適用於 Linux 的命令 ID 列在 、 Windows 中https://aka.ms/RunCommandManagedLinux#available-commandshttps://aka.ms/RunCommandManagedWindows#available-commands

galleryScriptReferenceId

需要執行之資源庫指令碼版本的資源識別碼。 範例識別碼看起來像 /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}。

script

指定要在 VM 上執行的文稿內容。

scriptShell

選擇性。 指定要用來執行指令碼的 Shell。 這些值必須符合延伸模組預期的值。 目前僅支援 Windows VM,指令碼會在指定時使用 Powershell 7。 計算機上必須已安裝 Powershell 7,才能使用 Powershell7 參數值。

scriptUri

指定文稿下載位置。 它可以是具有讀取許可權或公用 URI 的 Azure 記憶體 Blob SAS URI。

scriptUriManagedIdentity

使用者指派的受控識別,可存取 Azure 記憶體 Blob 時可存取 scriptUri。 在系統指派的身分識別的情況下,請使用空白物件。 請確定 Azure 記憶體 Blob 存在,且受控識別已獲授與具有「記憶體 Blob 數據讀取者」角色指派之 Blob 容器的存取權。 如果是使用者指派的身分識別,請務必將其新增到 VM 的身分識別之下。 如需受控識別和執行命令的詳細資訊,請參閱 https://aka.ms/ManagedIdentityhttps://aka.ms/RunCommandManaged

屬性詳細資料

commandId

指定預先定義內建腳本的 commandId。 適用於 Linux 的命令 ID 列在 、 Windows 中https://aka.ms/RunCommandManagedLinux#available-commandshttps://aka.ms/RunCommandManagedWindows#available-commands

commandId?: string

屬性值

string

galleryScriptReferenceId

需要執行之資源庫指令碼版本的資源識別碼。 範例識別碼看起來像 /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}。

galleryScriptReferenceId?: string

屬性值

string

script

指定要在 VM 上執行的文稿內容。

script?: string

屬性值

string

scriptShell

選擇性。 指定要用來執行指令碼的 Shell。 這些值必須符合延伸模組預期的值。 目前僅支援 Windows VM,指令碼會在指定時使用 Powershell 7。 計算機上必須已安裝 Powershell 7,才能使用 Powershell7 參數值。

scriptShell?: string

屬性值

string

scriptUri

指定文稿下載位置。 它可以是具有讀取許可權或公用 URI 的 Azure 記憶體 Blob SAS URI。

scriptUri?: string

屬性值

string

scriptUriManagedIdentity

使用者指派的受控識別,可存取 Azure 記憶體 Blob 時可存取 scriptUri。 在系統指派的身分識別的情況下,請使用空白物件。 請確定 Azure 記憶體 Blob 存在,且受控識別已獲授與具有「記憶體 Blob 數據讀取者」角色指派之 Blob 容器的存取權。 如果是使用者指派的身分識別,請務必將其新增到 VM 的身分識別之下。 如需受控識別和執行命令的詳細資訊,請參閱 https://aka.ms/ManagedIdentityhttps://aka.ms/RunCommandManaged

scriptUriManagedIdentity?: RunCommandManagedIdentity

屬性值