Azure / Azure/azure-powershell

Set-AzVmRunCommand and Set-AzVMSSVMRunCommand cmdlets - Add optional scriptUriManagedIdentity, outputBlobManagedIdentity, errorBlobManagedIdentity parameters

Open
#22,402 7 comments 0 reactions 2 assignees Claimed by @GabstaMSFT View on GitHub
act-observability-squad bug Compute - VM Compute - VMSS Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

- Set-AzVmRunCommand and Set-AzVMSSVMRunCommand cmdlets - Add optional scriptUriManagedIdentity, outputBlobManagedIdentity, errorBlobManagedIdentity parameters
- REST API reference: (request body)
https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-run-commands/create-or-update?tabs=HTTP#request-body
- Swagger specs:
https://github.com/Azure/azure-rest-api-specs/blob/55fc71748c6f51a049fb77aa162ca797aabfbae6/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/runCommand.json#L1254
-Please note where they appear in API request body
properties.source.scriptUriManagedIdentity
properties.outputBlobManagedIdentity
properties.errorBlobManagedIdentity

-Service already supports these 3 inputs.

### Issue script & Debug output

```PowerShell
Examples of working request bodies of Run Command:

System Managed identity (clientId and objectId do not work with system managed identity. Use empty managed identity)
{
"name": "RC050724_11",
"id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/VivRG0/providers/Microsoft.Compute/virtualMachines/vivl/runCommands/RC050724_11",
"type": "Microsoft.Compute/virtualMachines/runCommands",
"location": "centraluseuap",
"properties": {
"source": {
"scriptUri": "https://vivst.blob.core.windows.net/vivcontainer/LongOutput.sh",
"scriptUriManagedIdentity" : {
}
},
"outputBlobUri": "https://vivst.blob.core.windows.net/vivcontainer/RC050724_11_Output.txt",
"outputBlobManagedIdentity": {
},
"errorBlobUri": "https://vivst.blob.core.windows.net/vivcontainer/RC050724_11_Error.txt",
"errorBlobManagedIdentity": {
}
}
}

User-ManagedIdentity (use clientId, objectId does not work with user managed identity)

{
"name": "RC050724_15",
"id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/VivRG0/providers/Microsoft.Compute/virtualMachines/vivl/runCommands/RC050724_15",
"type": "Microsoft.Compute/virtualMachines/runCommands",
"location": "centraluseuap",
"properties": {
"source": {
"scriptUri": "https://vivst.blob.core.windows.net/vivcontainer/LongOutput.sh",
"scriptUriManagedIdentity" : {
"clientId": "d50aeb63-9c24-421a-815e-c6f1b65fefb7"
}
},
"outputBlobUri": "https://vivst.blob.core.windows.net/vivcontainer/RC050724_15_Output.txt",
"outputBlobManagedIdentity": {
"clientId": "d50aeb63-9c24-421a-815e-c6f1b65fefb7"
},
"errorBlobUri": "https://vivst.blob.core.windows.net/vivcontainer/RC050724_15_Error.txt",
"errorBlobManagedIdentity": {
"clientId": "d50aeb63-9c24-421a-815e-c6f1b65fefb7"
}
}
}
```

### Environment data

```PowerShell
NA
```

### Module versions

```PowerShell
Not a bug. New parameters request
```

### Error output

```PowerShell
No errors
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.