azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

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

Open viveklingaiah opened this issue 2 years ago • 6 comments

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

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

NA

Module versions

Not a bug. New parameters request

Error output

No errors

viveklingaiah avatar Jul 25 '23 00:07 viveklingaiah

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT.

Issue Details

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

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

NA

Module versions

Not a bug. New parameters request

Error output

No errors
Author: vivlingaiah
Assignees: -
Labels:

Compute - VM, Compute - VMSS, Service Attention, bug

Milestone: -

ghost avatar Jul 25 '23 01:07 ghost

assigning to @nikhilpatel909

TravisCragg-MSFT avatar Jul 27 '23 19:07 TravisCragg-MSFT

@TravisCragg-MSFT , I'm from Compute VM extensions team (we are owners of Run command). This is an ask for Az.Compute module owners for adding new parameters for cmdlets Set-AzVMRunCommand and Set-AzVMSSVMRunCommand. Deployment of API changes for scriptUriManagedIdentity, outputBlobManagedIdentity, errorBlobManagedIdentity parameters will be completed by early next week. Swagger and SDK changes are already published I believe.

viveklingaiah avatar Jul 27 '23 19:07 viveklingaiah

parameters added in https://github.com/Azure/azure-powershell/pull/23316

grizzlytheodore avatar Mar 18 '24 21:03 grizzlytheodore

it's been released in the latest release: https://www.powershellgallery.com/packages/Az/11.5.0

grizzlytheodore avatar Apr 02 '24 14:04 grizzlytheodore

Hi @grizzlytheodore Theodore, I do not find the below parameters in latest Az module version 12 for Set-AzVmRunCommand and Set-AzVMSSVMRunCommand cmdlets that were added in PR https://github.com/Azure/azure-powershell/pull/23316

TreatFailureAsDeploymentFailure ScriptUriManagedIdentityClientId ScriptUriManagedIdentityObjectId OutputBlobManagedIdentityObjectId OutputBlobManagedIdentityClientId ErrorBlobManagedIdentityClientId ErrorBlobManagedIdentityObjectId

{97936777-1843-42FA-A721-AEA1B8C14E4C}

viveklingaiah avatar Oct 02 '24 22:10 viveklingaiah