Closed JaroslawParadysz closed 5 months ago
Has there been any progress, or are there any preliminary findings? Thanks in advance.
Hi @JaroslawParadysz,
There are 2 issues here that we are addressing:
Thread: https://github.com/Azure/deployment-stacks/issues/142
Describe the bug I am unable to delete deployment stacks including a Function App and an App Service Plan, although the Storage Account is deleted successfully. The Activity Log indicates a missing Resource Provider for 'sites' and 'serverfarms', despite having the Microsoft.Web resource provider registered for my subscription.
To Reproduce Steps to reproduce the behavior:
az stack sub create --name StackTest --template-file environment.test.bicep --parameters environment.test.bicepparam --description "Test Stack" --deny-settings-mode None --location eastus
az stack sub delete --delete-all true --name StackTest --verbose
Expected behavior Deployment stacks should be deleted successfully.
Screenshots
Repro Environment Host OS: Windows 10 az bicep version: 0.25.53
Server Debugging Information Correlation ID: 7863d349-4abb-4c98-823c-4516e0877ad Data Center (eg, West Central US, West Europe): eastus
Additional context Bicep script `targetScope='resourceGroup'
var rg = resourceGroup()
param storageAccountType string param functionWorkerRuntime string param storageAccountName string param hostingPlanName string param functionName string
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-05-01' = { name: storageAccountName location: rg.location sku: { name: storageAccountType } kind: 'Storage' properties: { supportsHttpsTrafficOnly: true defaultToOAuthAuthentication: true minimumTlsVersion: 'TLS1_2' } }
resource hostingPlan 'Microsoft.Web/serverfarms@2023-01-01' = { name: hostingPlanName location: rg.location kind: 'linux' sku: { name: 'B1' tier: 'Basic' size: 'B1' family: 'B' capacity: 1 } properties: { perSiteScaling: false elasticScaleEnabled: false maximumElasticWorkerCount: 1 isSpot: false reserved: true isXenon: false hyperV: false targetWorkerCount: 0 targetWorkerSizeId: 0 zoneRedundant: false } }
resource functionApp 'Microsoft.Web/sites@2023-01-01' = { name: functionName location: rg.location kind: 'functionapp,linux' identity: { type: 'SystemAssigned' } properties: { reserved: true serverFarmId: hostingPlan.id siteConfig: { linuxFxVersion: 'DOTNET|6.0' cors: { allowedOrigins: [ 'https://portal.azure.com' ] } ftpsState: 'FtpsOnly' minTlsVersion: '1.2' } httpsOnly: true } }
var currentAppSettings = list('${functionApp.id}/config/appsettings', '2021-03-01').properties
module appSettings './../appsettings.bicep' = { name: '${functionApp.name}-appsettings' scope: rg params: { webAppName: functionApp.name currentAppSettings: currentAppSettings appSettings: { FUNCTIONS_EXTENSION_VERSION: '~4' FUNCTIONS_WORKER_RUNTIME: functionWorkerRuntime AzureWebJobsStorage: 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' } } } `
az stack sub delete command output ` Are you sure you want to delete this stack and the specified resources: resource groups, resources? (y/n): y (DeploymentStackDeleteResourcesFailed) One or more resources could not be deleted. Correlation id: '7863d349-4abb-4c98-823c-4516e0877ad1'. Code: DeploymentStackDeleteResourcesFailed Message: One or more resources could not be deleted. Correlation id: '7863d349-4abb-4c98-823c-4516e0877ad1'. Exception Details: (DeploymentStackOperationFailed) Object reference not set to an instance of an object. Code: DeploymentStackOperationFailed Message: Object reference not set to an instance of an object. Command ran in 486.771 seconds (init: 0.347, invoke: 486.424) Suppress exception: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 62, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 55, in
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/decorators.py", line 79, in _wrapped_func File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/telemetry.py", line 532, in _get_secrets_warning_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 147, in getboolean ValueError: Not a boolean: None `
Message in Activity Log
No registered resource provider found for location 'eastus' and API version '2023-12-01' for type 'sites'. The supported api-versions are '2023-12-01, 2023-01-01, 2022-09-01, 2022-03-01, 2021-03-01, 2021-02-01, 2021-01-15, 2021-01-01, 2020-12-01, 2020-10-01, 2020-09-01, 2020-06-01, 2019-08-01, 2018-11-01, 2018-02-01, 2016-08-01, 2015-08-01-preview, 2016-03-01, 2015-08-01, 2015-07-01, 2015-06-01, 2015-05-01, 2015-04-01, 2015-02-01, 2014-11-01, 2014-06-01, 2014-04-01, 2014-04-01-preview, 2015-01-01, 2015-11-01, 2016-09-01, 2017-08-01, 2018-12-01-alpha'. The supported locations are 'msftwestus, msfteastus, msfteastasia, msftnortheurope, eastus2stage, centralusstage, southcentralus, southafricanorth, westus, australiaeast, brazilsouth, southeastasia, centralus, japanwest, centralindia, uksouth, canadaeast, koreacentral, francecentral, northeurope, westus2, eastus, westindia, eastus2, australiacentral, germanywestcentral, norwayeast, uaenorth, swedencentral, qatarcentral, switzerlandnorth, northcentralus, ukwest, australiasoutheast, koreasouth, canadacentral, westeurope, southindia, westcentralus, westus3, eastasia, japaneast, jioindiawest, polandcentral, italynorth, israelcentral'.