I have my source code in Bitbucket and I'm using bitbucket pipeline to build and deploy my Web application to Azure VM.
I'm not using Azure Web Application because of constraint into the use of third parties tools.
I'm stuck on how to use a script file into my Azure cli run command.
Actual error is:
"/opt/atlassian/pipelines/agent/build/SetupSimpleSite.ps1 : The term \n'/opt/atlassian/pipelines/agent/build/SetupSimpleSite.ps1' is not recognized as the name of a cmdlet, function, script \nfile, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct \nand try again.\nAt C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.8\\Downloads\\script1.ps1:1 char:1\n+ /opt/atlassian/pipelines/agent/build/SetupSimpleSite.ps1
my pipeline code:
test-azure-cli-pipeline:
- step:
name: "Display Azure account"
deployment: staging
script:
- pipe: microsoft/azure-cli-run:1.1.0
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
#CLI_COMMAND: 'az account show'
CLI_COMMAND: 'az vm run-command invoke --command-id RunPowerShellScript --name $AZURE_VM_NAME --resource-group $AZURE_RESOURCE_GROUP_NAME --scripts $BITBUCKET_CLONE_DIR/SetupSimpleSite.ps1'
The script SetupSimpleSite.ps1 is located at the root of my Git repo, same directory than my bitbucket-pipelines.yml
Note that the Azure cli is working fine as the az account show is displaying account details as expected.
I cannot found any relevant information from the repository on how to use source code script from the azure cli, link: https://bitbucket.org/microsoft/azure-cli-run/src/master/
I would like my script Powershell to be kept into my source code.