Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'CustomScriptExtension', and type handler version '2.0' could not be found in the extension repository." #10862

Closed
5 tasks
cloudmelon opened this issue Jun 27, 2018 · 13 comments

Comments

@cloudmelon
Copy link
Contributor

cloudmelon commented Jun 27, 2018

I did as mentioned in the documentation
{
"name": "config-app",
"type": "extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', concat(variables('vmName'),copyindex()))]"
],
"tags": {
"displayName": "config-app"
},
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0", ========> version
"autoUpgradeMinorVersion": true,
"settings": {
},
"protectedSettings": {
"commandToExecute": "sh hello.sh ",
"fileUris": ["https://github.com/MyProject/Archive/MyPythonScript.py"
]
}
}
}

What i did as the following :
image

But My api version is "apiVersion": "2017-03-30",

I have error as the following :
{
"error": {
"code": "ArtifactNotFound",
"message": "Extension with publisher 'Microsoft.Compute', type 'CustomScriptExtension', and type handler version '2.0' could not be found in the extension repository."
}
}

image

But I do found the custom extension for linux vm in GitHub :
https://github.com/Azure/custom-script-extension-linux
They have version 2.0. Can't understand why they don't exist in the extension repository. I tried also the api version mentionned in the doc, it doesn't working. I think it has nothing to do with api-version but about if archifact existing in the extension repostory, please update the documentation about this issue. Thanks

Here is the Url : https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux

Azure documentation issue guidance

Thanks for opening an issue in the Azure technical documentation repository.

We use GitHub issues as the primary channel for customer and community feedback about the Azure documentation.

Creating an issue

We prefer that you create documentation feedback issues using the Feedback link on the published article - the feedback control on the doc page creates an issue that contains all the article details so you can focus on the feedback part.

You can also create a feedback issue here in the repo. If you do this, please make sure your issue lists:

  • The relevant Azure service or technology.
  • A link to the published documentation article that you have feedback about.
  • Clear, specific feedback that the author can act on.

Pull requests and article contributions

If you know the change that is needed in an article, we encourage you to submit the changes directly using a pull request. If the change is large, or if you want to contribute an entire article, follow these guidelines:

  • Don't surprise us with a big pull request or a pull request with a new article! Submit an issue that describes the details of the proposed large change or new article.
  • Include the service or technology area.

We'll route the issue to the appropriate content team for review and discussion.

Tech support and product feedback

If you would like to contact Microsoft about other things, such as product feedback or tech support, please review these guidelines:

@mimckitt
Copy link
Contributor

Thanks for the feedback! We are currently investigating and will update you shortly.

@mimckitt
Copy link
Contributor

Thanks @cloudmelon. I have assigned to the author to review and update the doc as appropriate.

@danielsollondon can you take a look?

@JoolsJops
Copy link

Hi,

Has this been resolved?

@cloudmelon
Copy link
Contributor Author

cloudmelon commented Oct 26, 2018 via email

@majorvin
Copy link

majorvin commented Oct 29, 2018

@cloudmelon I had the same problem but I noticed one thing that did work for me.
Make sure that
publisher is set to Microsoft.Azure.Extensions VS Microsoft.Computes and
type is set to CustomScript VS CustomScriptExtension

@cloudmelon
Copy link
Contributor Author

cloudmelon commented Oct 29, 2018 via email

@SR-P
Copy link

SR-P commented Feb 5, 2019

Hi,

Can I get the complete code of this.

@adeelilyas
Copy link

Change Publisher and Type as @majorvin said. It worked for me. reference

$vmss = Get-AzureRmVmss -ResourceGroupName $ResourceGroupName -VMScaleSetName $vmssResource.Name $vmss = Add-AzureRMVmssExtension -VirtualMachineScaleSet $vmss
-Name "customscript" -Publisher "Microsoft.Azure.Extensions"
-Type "CustomScript" -TypeHandlerVersion 2.0
-Setting $settings -AutoUpgradeMinorVersion $true

@craigcaseyMSFT
Copy link
Contributor

It looks like this issue no longer exists, so I am closing this. Thanks!

@jstapelfeldt
Copy link

jstapelfeldt commented Oct 25, 2021

Hi, I am experiencing this behaviour again.

I've set up a linux vm scale set (using terraform) successfully with 2 extensions.

resource "azurerm_virtual_machine_scale_set_extension" "myextension" {
  count                        = length(var.regions[var.environment])
  name                         = "myextension"
  virtual_machine_scale_set_id = azurerm_linux_virtual_machine_scale_set.vmss[count.index].id
  publisher                    = "Microsoft.Azure.KeyVault"
  type                         = "KeyVaultForLinux"
  type_handler_version         = "2.0"
  auto_upgrade_minor_version   = true
  settings = jsonencode(
    {
      "secretsManagementSettings" : {
        "pollingIntervalInS" : "3600",
        "certificateStoreName" : "",
        "linkOnRenewal" : false,
        "certificateStoreLocation" : "<destination>",
        "requireInitialSync" : false,
        "observedCertificates" : ["<URL/path>"]
      }
    }
  )
}

resource "azurerm_virtual_machine_scale_set_extension" "certificate-management-extension" {
  count                        = length(var.regions[var.environment])
  name                         = "certificate-management-extension"
  virtual_machine_scale_set_id = azurerm_linux_virtual_machine_scale_set.vmss[count.index].id
  publisher                    = "Microsoft.Azure.Extensions"
  type                         = "CustomScript"
  type_handler_version         = "2.0"
  auto_upgrade_minor_version   = true
  provision_after_extensions   = [azurerm_virtual_machine_scale_set_extension.myextension[count.index].name]
  settings = jsonencode(
    {
      "script" : "${data.local_file.cert-management-script.content_base64}"
    }
  )
}

data "local_file" "cert-management-script" {
  filename = "certificate-management.sh"
}

Now to the problem: When I try to set up a third extension, very similarly to the certificate-management-extension, I run into following exception when deploying the infrastructure to Azure:

Error: creating Extension "third-extension" (Virtual Machine Scale Set "vmss" / Resource Group "rg"): compute.VirtualMachineScaleSetExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ArtifactVersionNotFound" Message="No version found in the artifact repository that satisfies the requested version '2.0' for VM extension with publisher 'Microsoft.Azure.Extensions' and type 'CustomScript'."

I have also referenced extension 1 and 2 as dependencies, so they are executed in order. The third extension does not use the script block, it uses the commandToExecute instead:

settings = jsonencode(
    {
      "commandToExecute" : "echo Hello"
    }
  )

Any ideas why this is happening?

@lulzzz
Copy link

lulzzz commented Nov 4, 2021

same issues as @jaydrue

@mikeolasz
Copy link

Same as @jaydrue and @lulzzz

@mikeolasz
Copy link

I found this in the documentation: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows#extension-schema
The second note in this section mentions that only one type of an extension can be installed during a deployment.
The error message although should be more informative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests