Azure / Azure/azure-rest-api-specs
AppSettings string value is changed by Set-AzWebApp
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
## Description
I am using __Set-AzWebApp__ to set app settings on a web app I create dynamically (using __New-AzWebApp__). One of the settings is the web app creation time (as I did not find any other way how to get this information using Azure PowerShell). I am using the neutral round-trip format of the datetime to be able to reliably parse the string later. However, even though the string looks as expected locally, on the web app it is in a different format:
```
On the DevOps agent
2020-01-15T16:43:58.2385875Z
In the web app AppSetting
01/15/2020 16:45:06
```
## Steps to reproduce
```powershell
$AppSettings = @{
"WEBSITE_SITE_TYPE" = "live"
"CREATED_UTC" = [DateTime]::UtcNow.ToString("o", [CultureInfo]::InvariantCulture)
}
Write-Host (ConvertTo-Json $AppSettings)
Set-AzWebApp -ResourceGroupName $TargetResourceGroup -Name $TargetAppName -AppSettings $AppSettings
```
The __Write-Host__ command outputs
```
{
"WEBSITE_SITE_TYPE": "live",
"CREATED_UTC": "2020-01-15T16:43:58.0823349Z"
}
```
as expected. However, after the __Set-AzWebApp__ call, the web app shows

## Module versions
```powershell
=================
Task : Azure PowerShell
Description : Run a PowerShell script within an Azure environment
Version : 4.159.7
Author : Microsoft Corporation
Help : [Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613749)
=================
VERBOSE: Loading module from path
'C:\Modules\az_3.1.0\Az.Websites\1.5.0\Microsoft.Azure.PowerShell.Cmdlets.Websites.dll'
```
Contributor guide
Research direction
Start by reproducing the issue with Set-AzWebApp, New-AzWebApp, and the provided AppSettings example, comparing the local value with the value stored by the web app. Trace the Azure Web Apps API request used by Set-AzWebApp; done means the CREATED_UTC setting retains its invariant round-trip string rather than being reformatted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100