Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while listing slot application settings #23318

Open
2 of 6 tasks
lcssanches opened this issue Sep 26, 2022 · 7 comments
Open
2 of 6 tasks

Error while listing slot application settings #23318

lcssanches opened this issue Sep 26, 2022 · 7 comments
Assignees
Labels
App Services bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.

Comments

@lcssanches
Copy link

  • Package Name: @azure/arm-appservice
  • Package Version: 13.0.0
  • Operating system: Windows
  • nodejs
    • version: 12.20.1
  • browser
    • name/version:
  • typescript
    • version: 4.8.2
  • Is the bug related to documentation in

Describe the bug

listApplicationSettingsSlot and updateApplicationSettingsSlot only work when slot is specified even though doc suggests otherwise:

@param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot.

  • When null is specified the SDK throws Error: slot cannot be null or undefined.
  • When empty is specified it throws: RestError: The Resource 'Microsoft.Web/sites/xxxxx-xxxxx/slots/config' under resource group 'xxxxxxxxx-xxxxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
  • When "production" is specified it throws: The Resource 'Microsoft.Web/sites/xxxxx-xxxxx/slots/production' under resource group 'xxxxxxxxx-xxxxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

To Reproduce
Steps to reproduce the behavior:

// index.js
const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");

async function run() {
    const appname = "xxxxx"
    const subscription_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    const resource_group = "xxxxx"
    const creds = new DefaultAzureCredential()
    const clientWebApps = new WebSiteManagementClient(creds, subscription_id);
    const res = await clientWebApps.webApps.listApplicationSettingsSlot(resource_group, appname, null)
    //const res = await clientWebApps.webApps.listApplicationSettings(resource_group, appname) // works, to prove app exists
    console.log({res})
}

run();

Expected behavior
SDK should allow listing and updating specific settings for the production slot.

Screenshots
none

Additional context
none

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 26, 2022
@azure-sdk azure-sdk added App Services Mgmt This issue is related to a management-plane library. needs-team-triage This issue needs the team to triage. labels Sep 26, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Sep 26, 2022
@xirzec xirzec removed the needs-team-triage This issue needs the team to triage. label Sep 26, 2022
@qiaozha
Copy link
Member

qiaozha commented Sep 26, 2022

@kazrael2119 Could you help take a look at this issue ? Thanks

@kazrael2119
Copy link
Contributor

kazrael2119 commented Sep 27, 2022

Hi @lcssanches ,
That's becausce in swagger:https://github.com/Azure/azure-rest-api-specs/blob/7a6ec0f1e66aac22421f9338c00cbb2d1c97547d/specification/web/resource-manager/Microsoft.Web/stable/2022-03-01/WebApps.json#L9813,the slot name is required. So it can't be null or empty.
And when you use listApplicationSettings, slot name is not required in swagger:https://github.com/Azure/azure-rest-api-specs/blob/7a6ec0f1e66aac22421f9338c00cbb2d1c97547d/specification/web/resource-manager/Microsoft.Web/stable/2022-03-01/WebApps.json#L1062 , so it works.
So you should create a slot first.
If you don't know how to create a slot, you can refer to this code
const res1=await clientWebApps.webApps.beginCreateOrUpdateSlotAndWait(resourceGroupName, appname, "slottest", { location:location, identity:{type:"SystemAssigned"} });
Or you need more detailed parameters, please refer here https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-or-update-slot#site

@kazrael2119
Copy link
Contributor

SDK and it's parameter definition is coming from swagger definition, slot Name is defined in swagger:
image

@lcssanches
Copy link
Author

Hello @kazrael2119 ,

Thank you for you message.

I should have state this before but my goal is to create multiple app settings as "Deployment slot setting" in the "production"/default slot, because I don't want them to be swapped later.

image

@navba-MSFT
Copy link

Adding Service team to look into this.

@navba-MSFT navba-MSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention labels Oct 19, 2022
@ghost
Copy link

ghost commented Oct 19, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.

Issue Details
  • Package Name: @azure/arm-appservice
  • Package Version: 13.0.0
  • Operating system: Windows
  • nodejs
    • version: 12.20.1
  • browser
    • name/version:
  • typescript
    • version: 4.8.2
  • Is the bug related to documentation in

Describe the bug

listApplicationSettingsSlot and updateApplicationSettingsSlot only work when slot is specified even though doc suggests otherwise:

@param slot Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot.

  • When null is specified the SDK throws Error: slot cannot be null or undefined.
  • When empty is specified it throws: RestError: The Resource 'Microsoft.Web/sites/xxxxx-xxxxx/slots/config' under resource group 'xxxxxxxxx-xxxxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
  • When "production" is specified it throws: The Resource 'Microsoft.Web/sites/xxxxx-xxxxx/slots/production' under resource group 'xxxxxxxxx-xxxxxxxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

To Reproduce
Steps to reproduce the behavior:

// index.js
const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");

async function run() {
    const appname = "xxxxx"
    const subscription_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    const resource_group = "xxxxx"
    const creds = new DefaultAzureCredential()
    const clientWebApps = new WebSiteManagementClient(creds, subscription_id);
    const res = await clientWebApps.webApps.listApplicationSettingsSlot(resource_group, appname, null)
    //const res = await clientWebApps.webApps.listApplicationSettings(resource_group, appname) // works, to prove app exists
    console.log({res})
}

run();

Expected behavior
SDK should allow listing and updating specific settings for the production slot.

Screenshots
none

Additional context
none

Author: lcssanches
Assignees: qiaozha
Labels:

question, customer-reported, Mgmt, App Services, Service Attention

Milestone: -

@ghost ghost added the needs-team-attention This issue needs attention from Azure service team or SDK team label Oct 19, 2022
@navba-MSFT
Copy link

@antcp, @AzureAppServiceCLI Could you please look into this issue and provide an update ?

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-js that referenced this issue Mar 29, 2023
Reverting change in name pattern regex (Azure#23318)
@xirzec xirzec added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 30, 2023
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-js that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Services bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants