Closed thomas-tran closed 11 months ago
Hi @thomas-tran, I think the issue is that the URL that you are providing is not the raw content of the file, but rather the html page showing the contents of the file. Using github as an analogy, the devops URL that you are providing is (in GitGub) this one: https://github.com/Azure/appservice-landing-zone-accelerator/blob/main/scenarios/shared/scripts/win-devops-vm-extensions/post-deployment.ps1
but the raw file (in GitHub) is taken from the URL https://[raw.githubusercontent.com/Azure/appservice-landing-zone-accelerator/main/scenarios/shared/scripts/win-devops-vm-extensions/post-deployment.ps1](https://raw.githubusercontent.com/Azure/appservice-landing-zone-accelerator/main/scenarios/shared/scripts/win-devops-vm-extensions/post-deployment.ps1)
Having said that, for Azure Devops you need to use the AzDevOps REST API, check here: https://learn.microsoft.com/en-us/rest/api/azure/devops/build/source-providers/get-file-contents?view=azure-devops-rest-7.0 and here https://stackoverflow.com/questions/54137998/is-it-possible-to-have-a-link-to-raw-content-of-file-in-azure-devops
@thotheod I've cloned this repo to Azure devops repo and modify the https://github.com/Azure/appservice-landing-zone-accelerator/blob/main/scenarios/shared/bicep/compute/jumphost-win11.bicep to use the devops repo uri instead https://dev.azure.com/xxxx/xxx/_git/Infrastructure?path=main/scenarios/shared/scripts/win-devops-vm-extensions/post-deployment.ps1
However, the deployment got shown an error The term './post-deployment.ps1 .ps1' is not recognized as the name of a cmdlet, function, script file, or operable program
Note: Github and other direct blob storage is working fine however only the file came from Azure devops got this issue How to fix the issue?