We can only assume you were trying to deploy an Angular app on Azure Static Web Apps, as we are unable to know for sure what is the Azure service provider, not even from a tag in your post.
With that being said, you may try adding a development config in your angular.json as suggested here.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-basic": {
...
"architect": {
"build": {
...
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
},
"development": {
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular-basic:build"
},
"configurations": {
"production": {
"browserTarget": "angular-basic:build:production"
},
"development": {
"browserTarget": "angular-basic:build:development"
}
}
},
...
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "angular-basic:serve"
},
"configurations": {
"production": {
"devServerTarget": "angular-basic:serve:production"
},
"development": {
"devServerTarget": "angular-basic:serve:development"
}
}
}
}
}
},
"defaultProject": "angular-basic"
}
...
Also use different build commands against different environments for AzureStaticWebApp@0 task.
package.json
{
"name": "angular-basic",
"version": "1.0.0",
"scripts": {
...
"build-ui-prod": "ng build --configuration production",
"build-ui-dev": "ng build --configuration development",
...
},
...
}
variables:
- ${{ if eq(parameters.target_environment, 'production') }}:
- name: env
value: prod
- ${{ else }}:
- name: env
value: dev
jobs:
- job: build_and_deploy_job
displayName: Build and Deploy Job
pool:
vmImage: ubuntu-latest
variables:
- group: VG-AzureWebAppStaticAngular
steps:
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: $(API_TOKEN)
# Repository/Build Configurations - These values can be configured to match your app requirements.
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "dist/angular-basic" # Built app content directory - optional
# End of Repository/Build Configurations
deployment_environment: ${{ parameters.target_environment }}
app_build_command: 'npm run build-ui-$(env)'

In case this is irrelevant to your current workflow, please share more details and consider adding correct tag(s) to engage insights from the experts in respective subcommunity.