Azure / Azure/azure-cli

az apim api create authorization-server-id does not take effect

Open
#25,503 4 comments 0 reactions 0 assignees View on GitHub
act-observability-squad API Management Auto-Assign Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug
--authorization-server-id does not take effect when an API is created using Azure CLI
The API is created however the section for the authenticationSettings remains blank
```
"authenticationSettings": {
"oAuth2": null,
"openid": null
},
```
Should be
```
"authenticationSettings": {
"oAuth2": "",
"openid": null
}
```

Of note, this was tested using az rest it did work when running against the CreateOrUpdate endpoint:
https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/apis/create-or-update?tabs=HTTP
Where this property is set at: authenticationSettings
**Command Name**
`az apim api create`

**Errors:**
```
No error reported
```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- Create a standard tier API Management instance
- Configure the Oauth2 Provider as documented here: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-oauth2#configure-an-oauth-20-authorization-server-in-api-management
- `az apim api create --resource-group {} --service-name {} --api-id {} --path {} --authorization-server-id {oAuth2Provider} --display-name {} --protocols {} --service-url {}`

## Expected Behavior
When --authorization-server-id is set the resulting API created should have an entry like this and the authentications set properly

```
"authenticationSettings": {
"oAuth2": "",
"openid": null
}
```
## Environment Summary
```
Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31, Ubuntu 20.04.5 LTS
Python 3.10.8
Installer: DEB

azure-cli 2.44.1 *

Extensions:
application-insights 0.1.17
account 0.2.5

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.