Skip to content

[BUG]Property Name of WebSiteSlot in Azure.Provisioning.AppService defined as read-only #53508

@ShilpiRach

Description

@ShilpiRach

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

Metadata

Metadata

Assignees

Labels

App ServicesMgmtThis issue is related to a management package.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions