I'm trying to run a workflow file to deploy function app in Azure with new resource group and my workflow yml file fails to run the step and throws an error:
ParserError: D:\a\_temp\2ef5a91f-aee0-4906-9e6e-ab5e5233530f.ps1:3
Line |
3 | … -Name "az-xxx-xxx-rg-businessfuncappxayb" -Location "North Europe" `
| ~
| Incomplete string token.
YML script:
name: Resource Group Creation
uses: azure/powershell@v1
with:
azPSVersion: latest
inlineScript:
Select-AzSubscription -Subscription ${{ github.event.inputs.businessSubscriptionId }}| `
New-AzResourceGroup -Name "az-dna-113-rg-businessfuncappxayb" -Location "North Europe" `
failOnStandardError: $true
YML script:
name: Resource Group Creation
uses: azure/powershell@v1
with:
azPSVersion: latest
inlineScript:
Select-AzSubscription -Subscription ${{ github.event.inputs.businessSubscriptionId }}| `
New-AzResourceGroup -Name "az-dna-113-rg-businessfuncappxayb" -Location "North Europe" `
failOnStandardError: $true
The above error suggests there is a syntax issue with your YAML script. It indicates that an incomplete string token exists within your PowerShell script.
You can pass service principal's details in JSON object in a
GitHubaction and create a secret namedAZURE_CREDENTIALS, which you can use to authenticate with Azure.Here is the YAML script that utilizes
PowerShellwithin the YAML file to create an Azure resource.The deployment has been successfully completed.
After running the
GitHub action, the resource group was created successfully.Reference: Use the Azure login action with a service principal secret