Azure / Azure/static-web-apps

AzureStaticWebApp environment name errors

Open
#664 8 comments 0 reactions 0 assignees View on GitHub
azure-devops
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

The AzureStaticWebApp task has been failing since the version changed from 0.187.2 to 0.194.2. We're using it in a few pipelines, one of which errors with `The environment name provided has invalid character(s). Valid characters are 0-9, a-z, and A-Z` whereas the others error with `The environment name provided exceeds the character limit of 16.`

Reading #660 suggests this is the environment name specified in the deployment job in the pipeline, in which case our environment names do break these rules (e.g. InformationLeaflets_dev) but they are valid as far as ADO is concerned. Any advice would be appreciated.

Extract from one of the pipelines:
```
- stage: Deploy_${{ variables.env }}
pool: ${{ variables.agentPool }}
jobs:
- deployment: deploy
displayName: Deploy_${{ variables.env }}
environment: InformationLeaflets_${{ variables.env }}
strategy:
runOnce:
deploy:
steps:
// ...
- task: AzureStaticWebApp@0
displayName: Build and deploy app
inputs:
app_location: 'output'
skip_app_build: true
azure_static_web_apps_api_token: $(deployment_token)
```

Task output:
```
Starting: Build and deploy app
==============================================================================
Task : Deploy Azure Static Web App
Description : [PREVIEW] Build and deploy an Azure Static Web App
Version : 0.194.2
Author : Microsoft Corporation
Help : https://aka.ms/swadocs
==============================================================================
##[warning]Environment variable BUILD_SOURCEVERSIONMESSAGE is a multiline string and cannot be added to the build environment.
/usr/bin/bash /ado-agent/2.181.2/_work/_tasks/AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a/0.194.2/launch-docker.sh
DeploymentId: 80cfb68e-3d00-4152-b1bf-9b35891a66e3

App Directory Location: 'output' was found.
No Api directory specified. Azure Functions will not be created.
The environment name provided exceeds the character limit of 16.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.