-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Library name and version
Azure.Provisioning.AppService 1.2.0
Describe the bug
Class WebSiteSlot in Azure.Provisioning.AppService defines Name as a read-only property. Also, there is no separate property that accepts slot name and no constructor that accepts slot name as an input.
So, the generated bicep for type Microsoft.Web/sites/slots does not have name property and the deployment fails with the following error: Error BCP035: The specified "resource" declaration is missing the following required properties: "name"
I tried adding the name property to the generated bicep template and that worked.
resource webAppSlot 'Microsoft.Web/sites/slots@2024-11-01' = {
name:'stage'
location: location
In an App Service, the Name property is a derived field (<slot name>). But the name value I specify in bicep file is regarded as slot name.
Expected behavior
There should be a writeable property in WebSiteSlot that takes the name of the slot.
Actual behavior
The property Name in WebSiteSlot is a read-only property and there is no separate property / constructor that takes slot name, making it impossible to create a WebSiteSlot using Azure provisioning SDK.
Reproduction Steps
Try to create a WebSiteSlot object using Azure.Provisioning.AppService.
Code snippet below gives compile time error:
WebSite webSite = WebSite.FromExisting("webApp");
webSite.Name = WebAppHostName;
WebSiteSlot webSiteSlot = new WebSiteSlot("webAppSlot")
{
Name = HostName, // gives error
Parent = webSite,
// Add more properties
}
Environment
.NET SDK 10.0.100-rc.2.25502.107